summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/rendering/RenderTreeAsText.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-11-04 05:50:05 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-11-04 05:50:05 (GMT)
commit9cfd793625e6582d2fe3eaff7d5dfac3a3fcdff6 (patch)
tree8f44e4adbf0de9308669820b80697e7ed372608d /src/3rdparty/webkit/WebCore/rendering/RenderTreeAsText.cpp
parent48ea5a5c74620f9811debc6bf1e49bf095d30722 (diff)
parent0ced984d3e2cb2a7a1a219ae7a9b09ff4e15a55c (diff)
downloadQt-9cfd793625e6582d2fe3eaff7d5dfac3a3fcdff6.zip
Qt-9cfd793625e6582d2fe3eaff7d5dfac3a3fcdff6.tar.gz
Qt-9cfd793625e6582d2fe3eaff7d5dfac3a3fcdff6.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/3rdparty/webkit/WebCore/rendering/RenderTreeAsText.cpp')
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderTreeAsText.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderTreeAsText.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderTreeAsText.cpp
index 5c6e738..b7ab191 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderTreeAsText.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderTreeAsText.cpp
@@ -28,6 +28,7 @@
#include "CSSMutableStyleDeclaration.h"
#include "CharacterNames.h"
+#include "CString.h"
#include "Document.h"
#include "Frame.h"
#include "FrameView.h"
@@ -553,4 +554,31 @@ String externalRepresentation(RenderObject* o)
return ts.release();
}
+static void writeCounterValuesFromChildren(TextStream& stream, RenderObject* parent)
+{
+ for (RenderObject* child = parent->firstChild(); child; child = child->nextSibling()) {
+ if (child->isCounter()) {
+ String str(toRenderText(child)->text());
+ stream << str;
+ }
+ }
+}
+
+String counterValueForElement(Element* element)
+{
+ // Make sure the element is not freed during the layout.
+ RefPtr<Element> elementRef(element);
+ element->document()->updateLayout();
+ TextStream stream;
+ // The counter renderers should be children of anonymous children
+ // (i.e., :before or :after pseudo-elements).
+ if (RenderObject* renderer = element->renderer()) {
+ for (RenderObject* child = renderer->firstChild(); child; child = child->nextSibling()) {
+ if (child->isAnonymous())
+ writeCounterValuesFromChildren(stream, child);
+ }
+ }
+ return stream.release();
+}
+
} // namespace WebCore