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

Side by Side Diff: sky/engine/core/dom/shadow/ShadowRoot.cpp

Issue 867963006: Add the <t> element and ignore whitespace outside it. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Do it for a whole subtree. Created 5 years, 11 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
« no previous file with comments | « sky/engine/core/dom/Text.cpp ('k') | sky/engine/core/html/HTMLTElement.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 } 97 }
98 98
99 void ShadowRoot::recalcStyle(StyleRecalcChange change) 99 void ShadowRoot::recalcStyle(StyleRecalcChange change)
100 { 100 {
101 if (styleChangeType() >= SubtreeStyleChange) 101 if (styleChangeType() >= SubtreeStyleChange)
102 change = Force; 102 change = Force;
103 103
104 // There's no style to update so just calling recalcStyle means we're update d. 104 // There's no style to update so just calling recalcStyle means we're update d.
105 clearNeedsStyleRecalc(); 105 clearNeedsStyleRecalc();
106 106
107 // FIXME: This doesn't handle :hover + div properly like Element::recalcStyl e does.
108 Text* lastTextNode = 0;
109 for (Node* child = lastChild(); child; child = child->previousSibling()) { 107 for (Node* child = lastChild(); child; child = child->previousSibling()) {
110 if (child->isTextNode()) { 108 if (child->isTextNode()) {
111 toText(child)->recalcTextStyle(change, lastTextNode); 109 toText(child)->recalcTextStyle(change);
112 lastTextNode = toText(child);
113 } else if (child->isElementNode()) { 110 } else if (child->isElementNode()) {
114 if (child->shouldCallRecalcStyle(change)) 111 if (child->shouldCallRecalcStyle(change))
115 toElement(child)->recalcStyle(change, lastTextNode); 112 toElement(child)->recalcStyle(change);
116 if (child->renderer())
117 lastTextNode = 0;
118 } 113 }
119 } 114 }
120 115
121 clearChildNeedsStyleRecalc(); 116 clearChildNeedsStyleRecalc();
122 } 117 }
123 118
124 void ShadowRoot::insertedInto(ContainerNode* insertionPoint) 119 void ShadowRoot::insertedInto(ContainerNode* insertionPoint)
125 { 120 {
126 DocumentFragment::insertedInto(insertionPoint); 121 DocumentFragment::insertedInto(insertionPoint);
127 122
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 Vector<RefPtr<InsertionPoint> > insertionPoints; 195 Vector<RefPtr<InsertionPoint> > insertionPoints;
201 for (InsertionPoint* insertionPoint = Traversal<InsertionPoint>::firstWithin (*this); insertionPoint; insertionPoint = Traversal<InsertionPoint>::next(*inser tionPoint, this)) 196 for (InsertionPoint* insertionPoint = Traversal<InsertionPoint>::firstWithin (*this); insertionPoint; insertionPoint = Traversal<InsertionPoint>::next(*inser tionPoint, this))
202 insertionPoints.append(insertionPoint); 197 insertionPoints.append(insertionPoint);
203 198
204 m_descendantInsertionPoints.swap(insertionPoints); 199 m_descendantInsertionPoints.swap(insertionPoints);
205 200
206 return m_descendantInsertionPoints; 201 return m_descendantInsertionPoints;
207 } 202 }
208 203
209 } 204 }
OLDNEW
« no previous file with comments | « sky/engine/core/dom/Text.cpp ('k') | sky/engine/core/html/HTMLTElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698