svg:svg element inside foreignObject is not considered to be an svg root, which makes StyleAdjuster incorrectly reset position property for it.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b20c89c7d032fb4c4289f09b92e5ba6181a7c91b commit b20c89c7d032fb4c4289f09b92e5ba6181a7c91b Author: Rune Lillesveen <futhark@chromium.org> Date: Mon Dec 18 12:39:32 2017 Tests and implementation of display:contents in SVG. Adjusted how display:contents affect various SVG elements as specified in https://drafts.csswg.org/css-display/#unbox-svg By using IsOutermostSVGSVGElement() for svg root testing , this change also fixes 795685. Bug: 794498 , 795685 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Change-Id: I6b45f1ad65cfe9b29378d9ea9f2c4f9d855da231 Reviewed-on: https://chromium-review.googlesource.com/829633 Commit-Queue: Rune Lillesveen <futhark@chromium.org> Reviewed-by: Fredrik Söderquist <fs@opera.com> Cr-Commit-Position: refs/heads/master@{#524687} [add] https://crrev.com/b20c89c7d032fb4c4289f09b92e5ba6181a7c91b/third_party/WebKit/LayoutTests/external/wpt/css/css-display/display-contents-svg-elements-ref.html [add] https://crrev.com/b20c89c7d032fb4c4289f09b92e5ba6181a7c91b/third_party/WebKit/LayoutTests/external/wpt/css/css-display/display-contents-svg-elements.html [add] https://crrev.com/b20c89c7d032fb4c4289f09b92e5ba6181a7c91b/third_party/WebKit/LayoutTests/external/wpt/svg/foreignobject/position-svg-root-in-foreign-object-ref.html [add] https://crrev.com/b20c89c7d032fb4c4289f09b92e5ba6181a7c91b/third_party/WebKit/LayoutTests/external/wpt/svg/foreignobject/position-svg-root-in-foreign-object.html [modify] https://crrev.com/b20c89c7d032fb4c4289f09b92e5ba6181a7c91b/third_party/WebKit/LayoutTests/svg/css/display-computed.html [modify] https://crrev.com/b20c89c7d032fb4c4289f09b92e5ba6181a7c91b/third_party/WebKit/LayoutTests/svg/css/display-expected.html [modify] https://crrev.com/b20c89c7d032fb4c4289f09b92e5ba6181a7c91b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp [modify] https://crrev.com/b20c89c7d032fb4c4289f09b92e5ba6181a7c91b/third_party/WebKit/Source/core/svg/SVGGElement.cpp [modify] https://crrev.com/b20c89c7d032fb4c4289f09b92e5ba6181a7c91b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
Comment 1 by futhark@chromium.org
, Dec 18 2017