Changeset 288492 in webkit
- Timestamp:
- Jan 24, 2022, 5:11:15 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/inspector/css/nodeLayoutContextTypeChanged-expected.txt (modified) (1 diff)
-
LayoutTests/inspector/css/nodeLayoutContextTypeChanged.html (modified) (3 diffs)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/inspector/protocol/CSS.json (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/inspector/agents/InspectorCSSAgent.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderFlexibleBox.cpp (modified) (3 diffs)
-
Source/WebInspectorUI/ChangeLog (modified) (1 diff)
-
Source/WebInspectorUI/UserInterface/Models/DOMNode.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r288466 r288492 1 2022-01-24 Patrick Angle <pangle@apple.com> 2 3 Web Inspector: [Flexbox] Add instrumentation/protocol bits for flex layout containers 4 https://bugs.webkit.org/show_bug.cgi?id=235454 5 6 Reviewed by Devin Rousso. 7 8 * inspector/css/nodeLayoutContextTypeChanged-expected.txt: 9 * inspector/css/nodeLayoutContextTypeChanged.html: 10 1 11 2022-01-24 Eric Carlson <eric.carlson@apple.com> 2 12 -
trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged-expected.txt
r272670 r288492 11 11 PASS: Layout context should now be `grid`. 12 12 13 -- Running test case: CSS.nodeLayoutContextTypeChanged.FlexToNonFlex 14 PASS: Layout context should be `flex`. 15 PASS: Layout context should now be `null`. 16 17 -- Running test case: CSS.nodeLayoutContextTypeChanged.NonFlexToFlex 18 PASS: Layout context should be `null`. 19 PASS: Layout context should now be `flex`. 20 21 -- Running test case: CSS.nodeLayoutContextTypeChanged.GridToFlex 22 PASS: Layout context should now be `grid`. 23 PASS: Layout context should now be `flex`. 24 -
trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged.html
r272670 r288492 66 66 }); 67 67 68 addTestCase({ 69 name: "CSS.nodeLayoutContextTypeChanged.FlexToNonFlex", 70 description: "Change a flex container to a non-flex container.", 71 selector: "#flexToNonFlex", 72 async domNodeHandler(domNode) { 73 InspectorTest.expectEqual(domNode.layoutContextType, WI.DOMNode.LayoutContextType.Flex, "Layout context should be `flex`."); 74 75 await Promise.all([ 76 domNode.awaitEvent(WI.DOMNode.Event.LayoutContextTypeChanged), 77 changeElementDisplayValue("flexToNonFlex", "block"), 78 ]); 79 80 InspectorTest.expectEqual(domNode.layoutContextType, null, "Layout context should now be `null`."); 81 } 82 }); 83 84 addTestCase({ 85 name: "CSS.nodeLayoutContextTypeChanged.NonFlexToFlex", 86 description: "Change a non-flex container to a flex container.", 87 selector: "#nonFlexToFlex", 88 async domNodeHandler(domNode) { 89 InspectorTest.expectEqual(domNode.layoutContextType, null, "Layout context should be `null`."); 90 91 await Promise.all([ 92 domNode.awaitEvent(WI.DOMNode.Event.LayoutContextTypeChanged), 93 changeElementDisplayValue("nonFlexToFlex", "flex"), 94 ]); 95 96 InspectorTest.expectEqual(domNode.layoutContextType, WI.DOMNode.LayoutContextType.Flex, "Layout context should now be `flex`."); 97 } 98 }); 99 100 addTestCase({ 101 name: "CSS.nodeLayoutContextTypeChanged.GridToFlex", 102 description: "Change a non-flex container to a flex container.", 103 selector: "#gridToFlex", 104 async domNodeHandler(domNode) { 105 InspectorTest.expectEqual(domNode.layoutContextType, WI.DOMNode.LayoutContextType.Grid, "Layout context should now be `grid`."); 106 107 await Promise.all([ 108 domNode.awaitEvent(WI.DOMNode.Event.LayoutContextTypeChanged), 109 changeElementDisplayValue("gridToFlex", "flex"), 110 ]); 111 112 InspectorTest.expectEqual(domNode.layoutContextType, WI.DOMNode.LayoutContextType.Flex, "Layout context should now be `flex`."); 113 } 114 }); 115 68 116 WI.domManager.requestDocument().then((doc) => { 69 117 documentNode = doc; … … 75 123 .grid-container { 76 124 display: grid; 125 } 126 127 .flex-container { 128 display: flex; 77 129 } 78 130 </style> … … 89 141 <div></div> 90 142 </div> 143 144 <div id="flexToNonFlex" class="flex-container"> 145 <div></div> 146 <div></div> 147 </div> 148 149 <div id="nonFlexToFlex"> 150 <div></div> 151 <div></div> 152 </div> 153 154 <div id="gridToFlex" class="grid-container"> 155 <div></div> 156 <div></div> 157 </div> 91 158 </body> 92 159 </html> -
trunk/Source/JavaScriptCore/ChangeLog
r288476 r288492 1 2022-01-24 Patrick Angle <pangle@apple.com> 2 3 Web Inspector: [Flexbox] Add instrumentation/protocol bits for flex layout containers 4 https://bugs.webkit.org/show_bug.cgi?id=235454 5 6 Reviewed by Devin Rousso. 7 8 * inspector/protocol/CSS.json: 9 1 10 2022-01-24 Mikhail R. Gadelha <mikhail@igalia.com> 2 11 -
trunk/Source/JavaScriptCore/inspector/protocol/CSS.json
r286558 r288492 258 258 "id": "LayoutContextType", 259 259 "type": "string", 260 "enum": [" grid"],260 "enum": ["flex", "grid"], 261 261 "description": "The layout context type of a node." 262 262 }, -
trunk/Source/WebCore/ChangeLog
r288489 r288492 1 2022-01-24 Patrick Angle <pangle@apple.com> 2 3 Web Inspector: [Flexbox] Add instrumentation/protocol bits for flex layout containers 4 https://bugs.webkit.org/show_bug.cgi?id=235454 5 6 Reviewed by Devin Rousso. 7 8 Added tests in inspector/css/nodeLayoutContextTypeChanged.html. 9 10 Add instrumentation to RenderFlexibleBox to observe elements becoming/ceasing to be flex containers. We only 11 instrument RenderFlexibleBox created with an Element, not a Document, since all anonymous nodes will have their 12 document passed, which means we would attempt to track multiple different nodes against the same document, 13 resulting in unexpected results. Conversely, we only instrument in the destructor for non-anonymous nodes. 14 15 * inspector/agents/InspectorCSSAgent.cpp: 16 (WebCore::InspectorCSSAgent::layoutContextTypeForRenderer): 17 * rendering/RenderFlexibleBox.cpp: 18 (WebCore::RenderFlexibleBox::RenderFlexibleBox): 19 (WebCore::RenderFlexibleBox::~RenderFlexibleBox): 20 1 21 2022-01-24 Per Arne Vollan <pvollan@apple.com> 2 22 -
trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp
r286625 r288492 57 57 #include "NodeList.h" 58 58 #include "PseudoElement.h" 59 #include "RenderFlexibleBox.h" 59 60 #include "RenderGrid.h" 60 61 #include "RenderStyleConstants.h" … … 939 940 std::optional<Protocol::CSS::LayoutContextType> InspectorCSSAgent::layoutContextTypeForRenderer(RenderObject* renderer) 940 941 { 942 if (is<RenderFlexibleBox>(renderer)) 943 return Protocol::CSS::LayoutContextType::Flex; 941 944 if (is<RenderGrid>(renderer)) 942 945 return Protocol::CSS::LayoutContextType::Grid; -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r288113 r288492 34 34 #include "FlexibleBoxAlgorithm.h" 35 35 #include "HitTestResult.h" 36 #include "InspectorInstrumentation.h" 36 37 #include "LayoutRepainter.h" 37 38 #include "RenderChildIterator.h" … … 73 74 { 74 75 setChildrenInline(false); // All of our children must be block-level. 76 77 InspectorInstrumentation::nodeLayoutContextChanged(element, this); 75 78 } 76 79 … … 81 84 } 82 85 83 RenderFlexibleBox::~RenderFlexibleBox() = default; 86 RenderFlexibleBox::~RenderFlexibleBox() 87 { 88 if (!isAnonymous()) 89 InspectorInstrumentation::nodeLayoutContextChanged(nodeForNonAnonymous(), nullptr); 90 } 84 91 85 92 const char* RenderFlexibleBox::renderName() const -
trunk/Source/WebInspectorUI/ChangeLog
r288470 r288492 1 2022-01-24 Patrick Angle <pangle@apple.com> 2 3 Web Inspector: [Flexbox] Add instrumentation/protocol bits for flex layout containers 4 https://bugs.webkit.org/show_bug.cgi?id=235454 5 6 Reviewed by Devin Rousso. 7 8 * UserInterface/Models/DOMNode.js: 9 1 10 2022-01-24 Devin Rousso <drousso@apple.com> 2 11 -
trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js
r274229 r288492 1139 1139 // Corresponds to `CSS.LayoutContextType`. 1140 1140 WI.DOMNode.LayoutContextType = { 1141 Flex: "flex", 1141 1142 Grid: "grid", 1142 1143 };
Note:
See TracChangeset
for help on using the changeset viewer.