diff options
author | Ben Murdoch <benm@google.com> | 2011-05-13 16:23:25 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-05-16 11:35:02 +0100 |
commit | 65f03d4f644ce73618e5f4f50dd694b26f55ae12 (patch) | |
tree | f478babb801e720de7bfaee23443ffe029f58731 /Source/WebCore/dom/StyleElement.cpp | |
parent | 47de4a2fb7262c7ebdb9cd133ad2c54c187454d0 (diff) | |
download | external_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.zip external_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.tar.gz external_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.tar.bz2 |
Merge WebKit at r75993: Initial merge by git.
Change-Id: I602bbdc3974787a3b0450456a30a7868286921c3
Diffstat (limited to 'Source/WebCore/dom/StyleElement.cpp')
-rw-r--r-- | Source/WebCore/dom/StyleElement.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/Source/WebCore/dom/StyleElement.cpp b/Source/WebCore/dom/StyleElement.cpp index e9878a6..8f37275 100644 --- a/Source/WebCore/dom/StyleElement.cpp +++ b/Source/WebCore/dom/StyleElement.cpp @@ -30,6 +30,13 @@ namespace WebCore { +static bool isValidStyleChild(Node* node) +{ + ASSERT(node); + Node::NodeType nodeType = node->nodeType(); + return nodeType == Node::TEXT_NODE || nodeType == Node::CDATA_SECTION_NODE; +} + StyleElement::StyleElement(Document* document, bool createdByParser) : m_createdByParser(createdByParser) , m_loading(false) @@ -94,6 +101,7 @@ void StyleElement::process(Element* e) unsigned resultLength = 0; for (Node* c = e->firstChild(); c; c = c->nextSibling()) { +<<<<<<< HEAD Node::NodeType nodeType = c->nodeType(); if (nodeType == Node::TEXT_NODE || nodeType == Node::CDATA_SECTION_NODE || nodeType == Node::COMMENT_NODE) { unsigned length = c->nodeValue().length(); @@ -101,14 +109,17 @@ void StyleElement::process(Element* e) CRASH(); resultLength += length; } +======= + if (isValidStyleChild(c)) + resultLength += c->nodeValue().length(); +>>>>>>> WebKit.org @ r75993 } UChar* text; String sheetText = String::createUninitialized(resultLength, text); UChar* p = text; for (Node* c = e->firstChild(); c; c = c->nextSibling()) { - Node::NodeType nodeType = c->nodeType(); - if (nodeType == Node::TEXT_NODE || nodeType == Node::CDATA_SECTION_NODE || nodeType == Node::COMMENT_NODE) { + if (isValidStyleChild(c)) { String nodeValue = c->nodeValue(); unsigned nodeLength = nodeValue.length(); memcpy(p, nodeValue.characters(), nodeLength * sizeof(UChar)); |