Changeset 293565 in webkit
- Timestamp:
- Apr 27, 2022 10:32:05 PM (3 months ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/inspector/css/nodeLayoutContextTypeChanged-expected.txt (modified) (2 diffs)
-
LayoutTests/inspector/css/nodeLayoutContextTypeChanged.html (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/inspector/agents/InspectorCSSAgent.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r293560 r293565 1 2022-04-27 Patrick Angle <pangle@apple.com> 2 3 Web Inspector: [Flexbox] `<button>` and `<select>` elements are appearing in list of Flex containers 4 https://bugs.webkit.org/show_bug.cgi?id=239425 5 6 Reviewed by Devin Rousso. 7 8 * inspector/css/nodeLayoutContextTypeChanged-expected.txt: 9 * inspector/css/nodeLayoutContextTypeChanged.html: 10 1 11 2022-04-27 Karl Rackler <rackler@apple.com> 2 12 -
trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged-expected.txt
r288492 r293565 1 1 Tests for the CSS.nodeLayoutContextTypeChanged event. 2 2 3 3 4 … … 23 24 PASS: Layout context should now be `flex`. 24 25 26 -- Running test case: CSS.nodeLayoutContextTypeChanged.NotFlex.SubmitInput 27 PASS: Layout context should be `null`. 28 29 -- Running test case: CSS.nodeLayoutContextTypeChanged.NotFlex.Select 30 PASS: Layout context should be `null`. 31 32 -- Running test case: CSS.nodeLayoutContextTypeChanged.NotFlex.Button 33 PASS: Layout context should be `null`. 34 -
trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged.html
r288492 r293565 114 114 }); 115 115 116 function addEnsureLayoutContextTypeTestCase({name, description, selector, expectedLayoutContextType}) 117 { 118 addTestCase({name, description, selector, async domNodeHandler(domNode) { 119 InspectorTest.expectEqual(domNode.layoutContextType, expectedLayoutContextType, `Layout context should be \`${expectedLayoutContextType}\`.`); 120 } 121 }); 122 } 123 124 addEnsureLayoutContextTypeTestCase({ 125 name: "CSS.nodeLayoutContextTypeChanged.NotFlex.SubmitInput", 126 description: "Make sure an `input` element of type `submit` is not considered a flex container.", 127 selector: "#flexSubmitInput", 128 expectedLayoutContextType: null, 129 }); 130 131 addEnsureLayoutContextTypeTestCase({ 132 name: "CSS.nodeLayoutContextTypeChanged.NotFlex.Select", 133 description: "Make sure a `select` element is not considered a flex container.", 134 selector: "#flexSelect", 135 expectedLayoutContextType: null, 136 }); 137 138 addEnsureLayoutContextTypeTestCase({ 139 name: "CSS.nodeLayoutContextTypeChanged.NotFlex.Button", 140 description: "Make sure a `button` is not considered a flex container.", 141 selector: "#flexButton", 142 expectedLayoutContextType: null, 143 }); 144 116 145 WI.domManager.requestDocument().then((doc) => { 117 146 documentNode = doc; … … 156 185 <div></div> 157 186 </div> 187 188 <input type="submit" id="flexSubmitInput" /> 189 <select id="flexSelect"></select> 190 <button id="flexButton"></button> 158 191 </body> 159 192 </html> -
trunk/Source/WebCore/ChangeLog
r293550 r293565 1 2022-04-27 Patrick Angle <pangle@apple.com> 2 3 Web Inspector: [Flexbox] `<button>` and `<select>` elements are appearing in list of Flex containers 4 https://bugs.webkit.org/show_bug.cgi?id=239425 5 6 Reviewed by Devin Rousso. 7 8 Added test cases to inspector/css/nodeLayoutContextTypeChanged.html. 9 10 * inspector/agents/InspectorCSSAgent.cpp: 11 (WebCore::InspectorCSSAgent::layoutContextTypeForRenderer): 12 1 13 2022-04-27 Sihui Liu <sihui_liu@apple.com> 2 14 -
trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp
r293285 r293565 941 941 std::optional<Protocol::CSS::LayoutContextType> InspectorCSSAgent::layoutContextTypeForRenderer(RenderObject* renderer) 942 942 { 943 if (is<RenderFlexibleBox>(renderer)) 943 if (auto* renderFlexibleBox = dynamicDowncast<RenderFlexibleBox>(renderer)) { 944 // Subclasses of RenderFlexibleBox (buttons, selection inputs, etc.) should not be considered flex containers, 945 // as it is an internal implementation detail. 946 if (renderFlexibleBox->isFlexibleBoxImpl()) 947 return std::nullopt; 944 948 return Protocol::CSS::LayoutContextType::Flex; 949 } 945 950 if (is<RenderGrid>(renderer)) 946 951 return Protocol::CSS::LayoutContextType::Grid;
Note: See TracChangeset
for help on using the changeset viewer.