OLD | NEW |
---|---|
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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
127 replaceChildrenWithFragment(this, fragment, exceptionState); | 127 replaceChildrenWithFragment(this, fragment, exceptionState); |
128 } | 128 } |
129 | 129 |
130 void ShadowRoot::recalcStyle(StyleRecalcChange change) | 130 void ShadowRoot::recalcStyle(StyleRecalcChange change) |
131 { | 131 { |
132 // ShadowRoot doesn't support custom callbacks. | 132 // ShadowRoot doesn't support custom callbacks. |
133 DCHECK(!hasCustomStyleCallbacks()); | 133 DCHECK(!hasCustomStyleCallbacks()); |
134 | 134 |
135 StyleSharingDepthScope sharingScope(*this); | 135 StyleSharingDepthScope sharingScope(*this); |
136 | 136 |
137 if (getStyleChangeType() >= SubtreeStyleChange) | 137 if (getStyleChangeType() >= SubtreeStyleChange) { |
138 change = Force; | 138 change = Force; |
139 } else if (change == IndependentInherit) { | |
140 // Independent inheritance can't continue through shadow roots, since we | |
141 // assume inheritance from the parent element which isn't the case here. | |
142 change = Inherit; | |
sashab
2016/08/18 04:47:15
Fix for shadow roots problem - crbug.com/633859. I
rune
2016/08/18 08:06:49
I think I know what's happening. We traverse the f
sashab
2016/08/19 05:35:25
Thanks for the excellent summary Rune! You were ab
| |
143 } | |
139 | 144 |
140 // There's no style to update so just calling recalcStyle means we're update d. | 145 // There's no style to update so just calling recalcStyle means we're update d. |
141 clearNeedsStyleRecalc(); | 146 clearNeedsStyleRecalc(); |
142 | 147 |
143 recalcDescendantStyles(change); | 148 recalcDescendantStyles(change); |
144 clearChildNeedsStyleRecalc(); | 149 clearChildNeedsStyleRecalc(); |
145 } | 150 } |
146 | 151 |
147 void ShadowRoot::attachLayoutTree(const AttachContext& context) | 152 void ShadowRoot::attachLayoutTree(const AttachContext& context) |
148 { | 153 { |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
335 ostream << "ShadowRootType::Open"; | 340 ostream << "ShadowRootType::Open"; |
336 break; | 341 break; |
337 case ShadowRootType::Closed: | 342 case ShadowRootType::Closed: |
338 ostream << "ShadowRootType::Closed"; | 343 ostream << "ShadowRootType::Closed"; |
339 break; | 344 break; |
340 } | 345 } |
341 return ostream; | 346 return ostream; |
342 } | 347 } |
343 | 348 |
344 } // namespace blink | 349 } // namespace blink |
OLD | NEW |