Changeset 244269 in webkit
- Timestamp:
- Apr 15, 2019 10:27:40 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r244267 r244269 1 2019-04-15 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: DOMDebugger: "Attribute Modified" breakpoints pause after the modification occurs for the style attribute 4 https://bugs.webkit.org/show_bug.cgi?id=196556 5 <rdar://problem/49570681> 6 7 Reviewed by Timothy Hatcher. 8 9 * inspector/dom-debugger/attribute-modified-style.html: Added. 10 * inspector/dom-debugger/attribute-modified-style-expected.txt: Added. 11 1 12 2019-04-15 Devin Rousso <drousso@apple.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r244267 r244269 1 2019-04-15 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: DOMDebugger: "Attribute Modified" breakpoints pause after the modification occurs for the style attribute 4 https://bugs.webkit.org/show_bug.cgi?id=196556 5 <rdar://problem/49570681> 6 7 Reviewed by Timothy Hatcher. 8 9 Test: inspector/dom-debugger/attribute-modified-style.html 10 11 * css/PropertySetCSSStyleDeclaration.h: 12 * css/PropertySetCSSStyleDeclaration.cpp: 13 (WebCore::StyleAttributeMutationScope::~StyleAttributeMutationScope): 14 (WebCore::InlineCSSStyleDeclaration::willMutate): Added. 15 16 * dom/StyledElement.cpp: 17 (WebCore::StyledElement::styleAttributeChanged): 18 (WebCore::StyledElement::inlineStyleChanged): 19 20 * inspector/InspectorInstrumentation.h: 21 (WebCore::InspectorInstrumentation::willInvalidateStyleAttr): Added. 22 (WebCore::InspectorInstrumentation::didInvalidateStyleAttr): 23 * inspector/InspectorInstrumentation.cpp: 24 (WebCore::InspectorInstrumentation::willInvalidateStyleAttrImpl): Added. 25 (WebCore::InspectorInstrumentation::didInvalidateStyleAttrImpl): 26 27 * inspector/agents/InspectorDOMAgent.h: 28 * inspector/agents/InspectorDOMAgent.cpp: 29 (WebCore::InspectorDOMAgent::didInvalidateStyleAttr): 30 31 * inspector/agents/InspectorDOMDebuggerAgent.h: 32 * inspector/agents/InspectorDOMDebuggerAgent.cpp: 33 (WebCore::InspectorDOMDebuggerAgent::willInvalidateStyleAttr): Added. 34 (WebCore::InspectorDOMDebuggerAgent::didInvalidateStyleAttr): Deleted. 35 1 36 2019-04-15 Devin Rousso <drousso@apple.com> 2 37 -
trunk/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp
r243887 r244269 105 105 s_currentDecl = nullptr; 106 106 s_shouldNotifyInspector = false; 107 if (localCopyStyleDecl->parentElement()) 108 InspectorInstrumentation::didInvalidateStyleAttr(localCopyStyleDecl->parentElement()->document(), *localCopyStyleDecl->parentElement()); 107 108 if (auto* parentElement = localCopyStyleDecl->parentElement()) 109 InspectorInstrumentation::didInvalidateStyleAttr(*parentElement); 109 110 } 110 111 … … 422 423 } 423 424 425 bool InlineCSSStyleDeclaration::willMutate() 426 { 427 if (m_parentElement) 428 InspectorInstrumentation::willInvalidateStyleAttr(*m_parentElement); 429 return true; 430 } 431 424 432 void InlineCSSStyleDeclaration::didMutate(MutationType type) 425 433 { -
trunk/Source/WebCore/css/PropertySetCSSStyleDeclaration.h
r243887 r244269 135 135 void clearParentElement() final { m_parentElement = nullptr; } 136 136 137 bool willMutate() final WARN_UNUSED_RETURN; 137 138 void didMutate(MutationType) final; 138 139 CSSParserContext cssParserContext() const final; -
trunk/Source/WebCore/dom/StyledElement.cpp
r243239 r244269 207 207 208 208 invalidateStyle(); 209 InspectorInstrumentation::didInvalidateStyleAttr( document(),*this);209 InspectorInstrumentation::didInvalidateStyleAttr(*this); 210 210 } 211 211 … … 232 232 { 233 233 invalidateStyleAttribute(); 234 InspectorInstrumentation::didInvalidateStyleAttr( document(),*this);234 InspectorInstrumentation::didInvalidateStyleAttr(*this); 235 235 } 236 236 -
trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp
r243663 r244269 189 189 } 190 190 191 void InspectorInstrumentation::didInvalidateStyleAttrImpl(InstrumentingAgents& instrumentingAgents, Node& node) 192 { 193 if (InspectorDOMAgent* domAgent = instrumentingAgents.inspectorDOMAgent()) 194 domAgent->didInvalidateStyleAttr(node); 195 if (InspectorDOMDebuggerAgent* domDebuggerAgent = instrumentingAgents.inspectorDOMDebuggerAgent()) 196 domDebuggerAgent->didInvalidateStyleAttr(node); 191 void InspectorInstrumentation::willInvalidateStyleAttrImpl(InstrumentingAgents& instrumentingAgents, Element& element) 192 { 193 if (auto* domDebuggerAgent = instrumentingAgents.inspectorDOMDebuggerAgent()) 194 domDebuggerAgent->willInvalidateStyleAttr(element); 195 } 196 197 void InspectorInstrumentation::didInvalidateStyleAttrImpl(InstrumentingAgents& instrumentingAgents, Element& element) 198 { 199 if (auto* domAgent = instrumentingAgents.inspectorDOMAgent()) 200 domAgent->didInvalidateStyleAttr(element); 197 201 } 198 202 -
trunk/Source/WebCore/inspector/InspectorInstrumentation.h
r243663 r244269 116 116 static void didRemoveDOMAttr(Document&, Element&, const AtomicString& name); 117 117 static void characterDataModified(Document&, CharacterData&); 118 static void didInvalidateStyleAttr(Document&, Node&); 118 static void willInvalidateStyleAttr(Element&); 119 static void didInvalidateStyleAttr(Element&); 119 120 static void documentDetached(Document&); 120 121 static void frameWindowDiscarded(Frame&, DOMWindow*); … … 309 310 static void didRemoveDOMAttrImpl(InstrumentingAgents&, Element&, const AtomicString& name); 310 311 static void characterDataModifiedImpl(InstrumentingAgents&, CharacterData&); 311 static void didInvalidateStyleAttrImpl(InstrumentingAgents&, Node&); 312 static void willInvalidateStyleAttrImpl(InstrumentingAgents&, Element&); 313 static void didInvalidateStyleAttrImpl(InstrumentingAgents&, Element&); 312 314 static void documentDetachedImpl(InstrumentingAgents&, Document&); 313 315 static void frameWindowDiscardedImpl(InstrumentingAgents&, DOMWindow*); … … 553 555 } 554 556 555 inline void InspectorInstrumentation::didInvalidateStyleAttr(Document& document, Node& node) 556 { 557 FAST_RETURN_IF_NO_FRONTENDS(void()); 558 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document)) 559 didInvalidateStyleAttrImpl(*instrumentingAgents, node); 557 inline void InspectorInstrumentation::willInvalidateStyleAttr(Element& element) 558 { 559 FAST_RETURN_IF_NO_FRONTENDS(void()); 560 if (auto* instrumentingAgents = instrumentingAgentsForDocument(element.document())) 561 willInvalidateStyleAttrImpl(*instrumentingAgents, element); 562 } 563 564 inline void InspectorInstrumentation::didInvalidateStyleAttr(Element& element) 565 { 566 FAST_RETURN_IF_NO_FRONTENDS(void()); 567 if (auto* instrumentingAgents = instrumentingAgentsForDocument(element.document())) 568 didInvalidateStyleAttrImpl(*instrumentingAgents, element); 560 569 } 561 570 -
trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp
r244267 r244269 2312 2312 } 2313 2313 2314 void InspectorDOMAgent::didInvalidateStyleAttr( Node& node)2315 { 2316 int id = m_documentNodeToIdMap.get(& node);2314 void InspectorDOMAgent::didInvalidateStyleAttr(Element& element) 2315 { 2316 int id = m_documentNodeToIdMap.get(&element); 2317 2317 if (!id) 2318 2318 return; … … 2320 2320 if (!m_revalidateStyleAttrTask) 2321 2321 m_revalidateStyleAttrTask = std::make_unique<RevalidateStyleAttributeTask>(this); 2322 m_revalidateStyleAttrTask->scheduleFor( downcast<Element>(&node));2322 m_revalidateStyleAttrTask->scheduleFor(&element); 2323 2323 } 2324 2324 -
trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.h
r244267 r244269 147 147 void didRemoveDOMAttr(Element&, const AtomicString& name); 148 148 void characterDataModified(CharacterData&); 149 void didInvalidateStyleAttr( Node&);149 void didInvalidateStyleAttr(Element&); 150 150 void didPushShadowRoot(Element& host, ShadowRoot&); 151 151 void willPopShadowRoot(Element& host, ShadowRoot&); -
trunk/Source/WebCore/inspector/agents/InspectorDOMDebuggerAgent.cpp
r243719 r244269 171 171 } 172 172 173 void InspectorDOMDebuggerAgent:: didInvalidateStyleAttr(Node& node)174 { 175 if (!m_debuggerAgent->breakpointsActive()) 176 return; 177 178 if (hasBreakpoint(& node, AttributeModified)) {173 void InspectorDOMDebuggerAgent::willInvalidateStyleAttr(Element& element) 174 { 175 if (!m_debuggerAgent->breakpointsActive()) 176 return; 177 178 if (hasBreakpoint(&element, AttributeModified)) { 179 179 Ref<JSON::Object> eventData = JSON::Object::create(); 180 descriptionForDOMEvent( node, AttributeModified, false, eventData.get());180 descriptionForDOMEvent(element, AttributeModified, false, eventData.get()); 181 181 m_debuggerAgent->breakProgram(Inspector::DebuggerFrontendDispatcher::Reason::DOM, WTFMove(eventData)); 182 182 } -
trunk/Source/WebCore/inspector/agents/InspectorDOMDebuggerAgent.h
r243273 r244269 70 70 // InspectorInstrumentation 71 71 void willInsertDOMNode(Node& parent); 72 void didInvalidateStyleAttr(Node&);72 void willInvalidateStyleAttr(Element&); 73 73 void didInsertDOMNode(Node&); 74 74 void willRemoveDOMNode(Node&);
Note: See TracChangeset
for help on using the changeset viewer.