Commit 0b2ef2a8 authored by evan@chromium.org's avatar evan@chromium.org

2011-03-28 Evan Martin <evan@chromium.org>

        Reviewed by Ryosuke Niwa.

        Refactor duplicate code in HTMLTextElement
        https://bugs.webkit.org/show_bug.cgi?id=57215

        * html/HTMLTitleElement.cpp:
        (WebCore::HTMLTitleElement::childrenChanged):
        This method did an equivalent loop to the text() method on
        the same object.

git-svn-id: svn://svn.chromium.org/blink/trunk@82090 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 8d964ac2
2011-03-28 Evan Martin <evan@chromium.org>
Reviewed by Ryosuke Niwa.
Refactor duplicate code in HTMLTextElement
https://bugs.webkit.org/show_bug.cgi?id=57215
* html/HTMLTitleElement.cpp:
(WebCore::HTMLTitleElement::childrenChanged):
This method did an equivalent loop to the text() method on
the same object.
2011-03-27 Fumitoshi Ukai <ukai@chromium.org> 2011-03-27 Fumitoshi Ukai <ukai@chromium.org>
Reviewed by Alexey Proskuryakov. Reviewed by Alexey Proskuryakov.
...@@ -57,10 +57,7 @@ void HTMLTitleElement::removedFromDocument() ...@@ -57,10 +57,7 @@ void HTMLTitleElement::removedFromDocument()
void HTMLTitleElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) void HTMLTitleElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
{ {
m_title = ""; m_title = text();
for (Node* c = firstChild(); c != 0; c = c->nextSibling())
if (c->nodeType() == TEXT_NODE || c->nodeType() == CDATA_SECTION_NODE)
m_title += c->nodeValue();
if (inDocument()) if (inDocument())
document()->setTitle(m_title, this); document()->setTitle(m_title, this);
HTMLElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); HTMLElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment