Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[LBSE] Assure <foreignObject> HTML descendants create a new formattin…
…g context https://bugs.webkit.org/show_bug.cgi?id=245908 Reviewed by Simon Fraser. Fix mistake in svg/hixie/mixed/009.xml and its copies. A style sheet applied a certain 'margin' value to all <div> elements, including the one inside the <foreignObject>, which was unintentional. Now the testcase behaves as expected in Firefox/Chrome, but is broken in Safari. With LBSE the test works correctly: 'margin' is respected as intended on block-level children that are direct children of <foreignObject>. -> <foreignObject> needs to create a new formatting context for its descendants. This finally fixes margin handling for block-children of <foreignObject> which was broken since forever (at least 15 years) in WebKit. Some further fixes are necessary to correctly compute clip rects for <foreignObject>. <fO> should behaves like an absolutely positioned object -- but we failed to honor that SVG2 requirement, when comuting clip rects in RenderLayer - fix that. Enable some tests that were skipped because of bugs in the testcases themselves, such as missing width/height attributes on <foreignObject> elements. Covered by existing tests, and a specific new test that enforce LBSE usage so we get coverage for this in EWS layout test runs, where LBSE is not explicitely turned out (similar to the tests in svg/z-index, svg/compositing). * LayoutTests/platform/glib/TestExpectations: * LayoutTests/platform/mac-ventura-wk2-lbse-text/TestExpectations: * LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/hixie/mixed/009-expected.txt: * LayoutTests/platform/win/TestExpectations: * LayoutTests/svg/custom/display-table-caption-foreignObject.svg: * LayoutTests/svg/custom/display-table-caption-inherit-foreignObject.xhtml: * LayoutTests/svg/custom/use-on-use-with-child.svg: * LayoutTests/svg/dom/SVGScriptElement/script-async-attr.svg: * LayoutTests/svg/dom/SVGScriptElement/script-load-and-error-events.svg: * LayoutTests/svg/dom/SVGScriptElement/script-onerror-bubbling.svg: * LayoutTests/svg/dom/SVGScriptElement/script-reexecution.svg: * LayoutTests/svg/dom/SVGScriptElement/script-type-attribute.svg: * LayoutTests/svg/dom/smil-methods.svg: * LayoutTests/svg/foreignObject/respect-block-margin-expected.html: Added. * LayoutTests/svg/foreignObject/respect-block-margin.html: Added. * LayoutTests/svg/hittest/svg-standalone-tooltip.svg: * LayoutTests/svg/hixie/mixed/009.xml: * Source/WebCore/rendering/RenderElement.cpp: (WebCore::RenderElement::createsNewFormattingContext const): * Source/WebCore/rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateAncestorDependentState): (WebCore::RenderLayer::calculateClipRects const): * Source/WebCore/rendering/RenderObject.h: (WebCore::RenderObject::shouldUsePositionedClipping const): Canonical link: https://commits.webkit.org/256960@main
- Loading branch information
1 parent
8b10813
commit 7fd975ae74272051463b1f88a67cffdf7c5dfcc4
Showing
20 changed files
with
54 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<body style="margin: 0"> | ||
<div style="width: 400px; height: 120px;"> | ||
<div style="margin: 100px 0">Margin should be respected</div> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html><!-- webkit-test-runner [ LayerBasedSVGEngineEnabled=true ] --> | ||
<html> | ||
<head> | ||
<body style="margin: 0"> | ||
<svg xmlns="http://www.w3.org/2000/svg" width="400" height="120"> | ||
<foreignObject width="400" height="120" overflow="visible"> | ||
<div style="margin: 100px 0">Margin should be respected</div> | ||
</foreignObject> | ||
</svg> | ||
</body> | ||
</html> |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters