Changeset 206404 in webkit
- Timestamp:
- Sep 26, 2016, 4:51:17 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r206403 r206404 1 2016-09-26 Antti Koivisto <antti@apple.com> 2 3 Setter on style element's textContent or cssText doesn't trigger style recalc 4 https://bugs.webkit.org/show_bug.cgi?id=160331 5 <rdar://problem/27609715> 6 7 Reviewed by Ryosuke Niwa and Daniel Bates. 8 9 * fast/shadow-dom/shadow-style-text-mutation-expected.html: Added. 10 * fast/shadow-dom/shadow-style-text-mutation.html: Added. 11 1 12 2016-09-26 Antti Koivisto <antti@apple.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r206403 r206404 1 2016-09-26 Antti Koivisto <antti@apple.com> 2 3 Setter on style element's textContent or cssText doesn't trigger style recalc 4 https://bugs.webkit.org/show_bug.cgi?id=160331 5 <rdar://problem/27609715> 6 7 Reviewed by Ryosuke Niwa and Daniel Bates. 8 9 We would not notify the parent when text node content changed in a shadow tree. 10 11 Test: fast/shadow-dom/shadow-style-text-mutation.html 12 13 * dom/AuthorStyleSheets.cpp: 14 (WebCore::AuthorStyleSheets::updateActiveStyleSheets): 15 16 Invalidate shadow root children instead of the root itself when doing full invalidation. 17 The invalidity bits have no meaning for non-element, non-texts. 18 19 * dom/CharacterData.cpp: 20 (WebCore::CharacterData::parserAppendData): 21 (WebCore::CharacterData::setDataAndUpdate): 22 (WebCore::CharacterData::notifyParentAfterChange): 23 24 Add a helper and call it also in shadow trees. 25 26 (WebCore::CharacterData::dispatchModifiedEvent): 27 * dom/CharacterData.h: 28 1 29 2016-09-26 Antti Koivisto <antti@apple.com> 2 30 -
trunk/Source/WebCore/dom/AuthorStyleSheets.cpp
r206361 r206404 31 31 #include "CSSStyleSheet.h" 32 32 #include "Element.h" 33 #include "ElementChildIterator.h" 33 34 #include "ExtensionStyleSheets.h" 34 35 #include "HTMLIFrameElement.h" … … 337 338 338 339 if (requiresFullStyleRecalc) { 339 if (m_shadowRoot) 340 m_shadowRoot->setNeedsStyleRecalc(); 341 else 340 if (m_shadowRoot) { 341 for (auto& shadowChild : childrenOfType<Element>(*m_shadowRoot)) 342 shadowChild.setNeedsStyleRecalc(); 343 } else 342 344 m_document.scheduleForcedStyleRecalc(); 343 345 } -
trunk/Source/WebCore/dom/CharacterData.cpp
r204316 r206404 104 104 downcast<Text>(*this).updateRendererAfterContentChange(oldLength, 0); 105 105 106 document().incDOMTreeVersion(); 107 // We don't call dispatchModifiedEvent here because we don't want the 108 // parser to dispatch DOM mutation events. 109 if (parentNode()) { 110 ContainerNode::ChildChange change = { 111 ContainerNode::TextChanged, 112 ElementTraversal::previousSibling(*this), 113 ElementTraversal::nextSibling(*this), 114 ContainerNode::ChildChangeSourceParser 115 }; 116 parentNode()->childrenChanged(change); 117 } 106 notifyParentAfterChange(ContainerNode::ChildChangeSourceParser); 118 107 119 108 return characterLengthLimit; … … 209 198 document().frame()->selection().textWasReplaced(this, offsetOfReplacedData, oldLength, newLength); 210 199 200 notifyParentAfterChange(ContainerNode::ChildChangeSourceAPI); 201 202 dispatchModifiedEvent(oldData); 203 } 204 205 void CharacterData::notifyParentAfterChange(ContainerNode::ChildChangeSource source) 206 { 211 207 document().incDOMTreeVersion(); 212 dispatchModifiedEvent(oldData); 208 209 if (!parentNode()) 210 return; 211 212 ContainerNode::ChildChange change = { 213 ContainerNode::TextChanged, 214 ElementTraversal::previousSibling(*this), 215 ElementTraversal::nextSibling(*this), 216 source 217 }; 218 parentNode()->childrenChanged(change); 213 219 } 214 220 … … 219 225 220 226 if (!isInShadowTree()) { 221 if (parentNode()) {222 ContainerNode::ChildChange change = {223 ContainerNode::TextChanged,224 ElementTraversal::previousSibling(*this),225 ElementTraversal::nextSibling(*this),226 ContainerNode::ChildChangeSourceAPI227 };228 parentNode()->childrenChanged(change);229 }230 227 if (document().hasListenerType(Document::DOMCHARACTERDATAMODIFIED_LISTENER)) 231 228 dispatchScopedEvent(MutationEvent::create(eventNames().DOMCharacterDataModifiedEvent, true, nullptr, oldData, m_data)); -
trunk/Source/WebCore/dom/CharacterData.h
r204717 r206404 23 23 #pragma once 24 24 25 #include " Node.h"25 #include "ContainerNode.h" 26 26 #include <wtf/text/WTFString.h> 27 27 … … 70 70 void setDataAndUpdate(const String&, unsigned offsetOfReplacedData, unsigned oldLength, unsigned newLength); 71 71 void checkCharDataOperation(unsigned offset, ExceptionCode&); 72 void notifyParentAfterChange(ContainerNode::ChildChangeSource); 72 73 73 74 String m_data;
Note:
See TracChangeset
for help on using the changeset viewer.