Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(867)

Side by Side Diff: Source/core/html/HTMLTitleElement.cpp

Issue 365673002: Pass a struct to ContainerNode::childrenChanged() instead of separate arguments (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove dead code Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2010 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2010 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 return InsertionDone; 54 return InsertionDone;
55 } 55 }
56 56
57 void HTMLTitleElement::removedFrom(ContainerNode* insertionPoint) 57 void HTMLTitleElement::removedFrom(ContainerNode* insertionPoint)
58 { 58 {
59 HTMLElement::removedFrom(insertionPoint); 59 HTMLElement::removedFrom(insertionPoint);
60 if (insertionPoint->inDocument() && !insertionPoint->isInShadowTree()) 60 if (insertionPoint->inDocument() && !insertionPoint->isInShadowTree())
61 document().removeTitle(this); 61 document().removeTitle(this);
62 } 62 }
63 63
64 void HTMLTitleElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) 64 void HTMLTitleElement::childrenChanged(const ChildrenChange& change)
65 { 65 {
66 HTMLElement::childrenChanged(changedByParser, beforeChange, afterChange, chi ldCountDelta); 66 HTMLElement::childrenChanged(change);
67 if (inDocument() && !isInShadowTree() && !m_ignoreTitleUpdatesWhenChildrenCh ange) 67 if (inDocument() && !isInShadowTree() && !m_ignoreTitleUpdatesWhenChildrenCh ange)
68 document().setTitleElement(text(), this); 68 document().setTitleElement(text(), this);
69 } 69 }
70 70
71 String HTMLTitleElement::text() const 71 String HTMLTitleElement::text() const
72 { 72 {
73 StringBuilder result; 73 StringBuilder result;
74 74
75 for (Node *n = firstChild(); n; n = n->nextSibling()) { 75 for (Node *n = firstChild(); n; n = n->nextSibling()) {
76 if (n->isTextNode()) 76 if (n->isTextNode())
(...skipping 11 matching lines...) Expand all
88 // Avoid calling Document::setTitleElement() during intermediate steps. 88 // Avoid calling Document::setTitleElement() during intermediate steps.
89 m_ignoreTitleUpdatesWhenChildrenChange = !value.isEmpty(); 89 m_ignoreTitleUpdatesWhenChildrenChange = !value.isEmpty();
90 removeChildren(); 90 removeChildren();
91 m_ignoreTitleUpdatesWhenChildrenChange = false; 91 m_ignoreTitleUpdatesWhenChildrenChange = false;
92 92
93 if (!value.isEmpty()) 93 if (!value.isEmpty())
94 appendChild(document().createTextNode(value.impl()), IGNORE_EXCEPTION); 94 appendChild(document().createTextNode(value.impl()), IGNORE_EXCEPTION);
95 } 95 }
96 96
97 } 97 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698