New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 590835 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
NOT IN USE
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 590818



Sign in to add a comment

don't inherit styles from the document node

Project Member Reported by skobes@chromium.org, Feb 29 2016

Issue description

Currently, setting a style on the <html> element to "inherit" gives it a computed value inherited from its DOM ancestor, the document node.

The computed style of the document is determined by StyleResolver::styleForDocument but not directly exposed to CSS (no selector matches the document and you cannot pass it to getComputedStyle).

Allowing styles to inherit from the document node leads to bugs like  http://crbug.com/586759  and  http://crbug.com/590818 .

In the review thread of http://crrev.com/1734273002 it is suggested that the <html> element inherit styles from the default values as produced by StyleResolver::initialStyleForElement(), instead of inheriting them from the document node.
 
Components: Blink>CSS
Labels: Hotlist-CodeHealth

Comment 3 by nainar@chromium.org, Feb 13 2017

Labels: Update-Quarterly

Comment 4 by meade@chromium.org, Feb 13 2017

Blocking: 590818

Comment 5 by r...@opera.com, Jun 20 2017

Cc: -r...@opera.com
Owner: r...@opera.com
Status: Started (was: Available)
Project Member

Comment 6 by bugdroid1@chromium.org, Jun 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/334b4846828ceb697785b466619a1f1b96592a3b

commit 334b4846828ceb697785b466619a1f1b96592a3b
Author: Rune Lillesveen <rune@opera.com>
Date: Wed Jun 28 12:08:58 2017

Separate initial style and viewport/ICB style.

We store the initial containing block/viewport style on the Document
node. This style includes properties propagated from body/html like
writing-mode and overflow. It also sets things like z-index to a non-
auto value to establish a stacking context.

The problem was that this ComputedStyle was used for inheriting values
down to the root element as well, which is incorrect. The root element
should inherit initial values.

Instead, split StyleForDocument into InitialStyleForElement and a
StyleForViewport which applies viewport specific properties on top of
the initial values. Then use InitialStyleForElement as the style to
inherit from for the root element.

A bunch of writing-mode tests are modified to apply writing-mode on the
html element instead of body. The code change aligns with the spec and
how Gecko behaves by not propagating the writing-mode on body to the
html element. The intention of the modified tests was to have the effect
of setting the same writing-mode on the html element.

Bug:  732349 , 541529 , 590818 , 590835 , 731022 
Change-Id: I4ff9c076c54483245db931ede6a2293ef5279cd2
Reviewed-on: https://chromium-review.googlesource.com/548379
Commit-Queue: Rune Lillesveen <rune@opera.com>
Reviewed-by: meade_UTC10 <meade@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#482950}
[delete] https://crrev.com/93846275952fa28f83a4ea318e56c4f494bf7005/third_party/WebKit/LayoutTests/editing/selection/select-delete-in-event-handler-expected.txt
[delete] https://crrev.com/93846275952fa28f83a4ea318e56c4f494bf7005/third_party/WebKit/LayoutTests/editing/selection/select-delete-in-event-handler.html
[add] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/external/wpt/css-cascade/inherit-initial.html
[add] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes-3/wm-propagation-body-computed-root.html
[add] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/backgrounds/root-background-propagation3-expected.html
[add] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/backgrounds/root-background-propagation3.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/block/float/overhanging-float-crashes-when-sibling-becomes-formatting-context.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/block/positioning/vertical-lr/001.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/block/positioning/vertical-rl/001.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/borders/inline-mask-overlay-image-outset-vertical-rl.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/multicol/vertical-lr/float-big-line-expected.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/multicol/vertical-lr/float-big-line.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/multicol/vertical-lr/float-paginate-expected.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/multicol/vertical-lr/float-paginate.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/multicol/vertical-lr/unsplittable-inline-block-expected.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/multicol/vertical-lr/unsplittable-inline-block.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/multicol/vertical-rl/float-big-line-expected.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/multicol/vertical-rl/float-big-line.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/multicol/vertical-rl/float-paginate-expected.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/multicol/vertical-rl/float-paginate.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/multicol/vertical-rl/unsplittable-inline-block-expected.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/multicol/vertical-rl/unsplittable-inline-block.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/replaced/vertical-lr/absolute-position-with-auto-height-and-top-and-bottom.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/replaced/vertical-lr/absolute-position-with-auto-width-and-left-and-right.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/replaced/vertical-rl/absolute-position-with-auto-height-and-top-and-bottom.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/replaced/vertical-rl/absolute-position-with-auto-width-and-left-and-right.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/table/035-vertical.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/table/border-collapsing/003-vertical.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/text/decorations-with-text-combine.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/text/international/text-combine-image-test.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/writing-mode/Kusa-Makura-background-canvas.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/writing-mode/border-image-vertical-lr.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/writing-mode/border-image-vertical-rl.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/writing-mode/border-radius-clipping-vertical-lr.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/writing-mode/border-styles-vertical-lr.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/writing-mode/border-styles-vertical-rl.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/writing-mode/floats-in-block-layout.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/writing-mode/self-collapsing-block.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fonts/mongolian-glyphs.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/paint/invalidation/inline-vertical-lr-overflow-expected.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/paint/invalidation/inline-vertical-lr-overflow.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/paint/invalidation/inline-vertical-rl-overflow-expected.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/paint/invalidation/inline-vertical-rl-overflow.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/paint/invalidation/window-resize-vertical-writing-mode.html
[delete] https://crrev.com/93846275952fa28f83a4ea318e56c4f494bf7005/third_party/WebKit/LayoutTests/platform/linux/editing/selection/select-delete-in-event-handler-expected.txt
[delete] https://crrev.com/93846275952fa28f83a4ea318e56c4f494bf7005/third_party/WebKit/LayoutTests/platform/win/editing/selection/select-delete-in-event-handler-expected.txt
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/Source/core/css/resolver/ElementResolveContext.h
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/Source/core/css/resolver/StyleResolver.h
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/Source/web/tests/data/rtl-iframe-inner.html

Project Member

Comment 7 by bugdroid1@chromium.org, Jun 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/334b4846828ceb697785b466619a1f1b96592a3b

commit 334b4846828ceb697785b466619a1f1b96592a3b
Author: Rune Lillesveen <rune@opera.com>
Date: Wed Jun 28 12:08:58 2017

Separate initial style and viewport/ICB style.

We store the initial containing block/viewport style on the Document
node. This style includes properties propagated from body/html like
writing-mode and overflow. It also sets things like z-index to a non-
auto value to establish a stacking context.

The problem was that this ComputedStyle was used for inheriting values
down to the root element as well, which is incorrect. The root element
should inherit initial values.

Instead, split StyleForDocument into InitialStyleForElement and a
StyleForViewport which applies viewport specific properties on top of
the initial values. Then use InitialStyleForElement as the style to
inherit from for the root element.

A bunch of writing-mode tests are modified to apply writing-mode on the
html element instead of body. The code change aligns with the spec and
how Gecko behaves by not propagating the writing-mode on body to the
html element. The intention of the modified tests was to have the effect
of setting the same writing-mode on the html element.

Bug:  732349 , 541529 , 590818 , 590835 , 731022 
Change-Id: I4ff9c076c54483245db931ede6a2293ef5279cd2
Reviewed-on: https://chromium-review.googlesource.com/548379
Commit-Queue: Rune Lillesveen <rune@opera.com>
Reviewed-by: meade_UTC10 <meade@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#482950}
[delete] https://crrev.com/93846275952fa28f83a4ea318e56c4f494bf7005/third_party/WebKit/LayoutTests/editing/selection/select-delete-in-event-handler-expected.txt
[delete] https://crrev.com/93846275952fa28f83a4ea318e56c4f494bf7005/third_party/WebKit/LayoutTests/editing/selection/select-delete-in-event-handler.html
[add] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/external/wpt/css-cascade/inherit-initial.html
[add] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes-3/wm-propagation-body-computed-root.html
[add] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/backgrounds/root-background-propagation3-expected.html
[add] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/backgrounds/root-background-propagation3.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/block/float/overhanging-float-crashes-when-sibling-becomes-formatting-context.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/block/positioning/vertical-lr/001.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/block/positioning/vertical-rl/001.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/borders/inline-mask-overlay-image-outset-vertical-rl.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/multicol/vertical-lr/float-big-line-expected.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/multicol/vertical-lr/float-big-line.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/multicol/vertical-lr/float-paginate-expected.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/multicol/vertical-lr/float-paginate.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/multicol/vertical-lr/unsplittable-inline-block-expected.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/multicol/vertical-lr/unsplittable-inline-block.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/multicol/vertical-rl/float-big-line-expected.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/multicol/vertical-rl/float-big-line.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/multicol/vertical-rl/float-paginate-expected.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/multicol/vertical-rl/float-paginate.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/multicol/vertical-rl/unsplittable-inline-block-expected.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/multicol/vertical-rl/unsplittable-inline-block.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/replaced/vertical-lr/absolute-position-with-auto-height-and-top-and-bottom.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/replaced/vertical-lr/absolute-position-with-auto-width-and-left-and-right.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/replaced/vertical-rl/absolute-position-with-auto-height-and-top-and-bottom.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/replaced/vertical-rl/absolute-position-with-auto-width-and-left-and-right.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/table/035-vertical.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/table/border-collapsing/003-vertical.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/text/decorations-with-text-combine.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/text/international/text-combine-image-test.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/writing-mode/Kusa-Makura-background-canvas.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/writing-mode/border-image-vertical-lr.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/writing-mode/border-image-vertical-rl.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/writing-mode/border-radius-clipping-vertical-lr.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/writing-mode/border-styles-vertical-lr.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/writing-mode/border-styles-vertical-rl.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/writing-mode/floats-in-block-layout.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fast/writing-mode/self-collapsing-block.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/fonts/mongolian-glyphs.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/paint/invalidation/inline-vertical-lr-overflow-expected.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/paint/invalidation/inline-vertical-lr-overflow.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/paint/invalidation/inline-vertical-rl-overflow-expected.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/paint/invalidation/inline-vertical-rl-overflow.html
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/LayoutTests/paint/invalidation/window-resize-vertical-writing-mode.html
[delete] https://crrev.com/93846275952fa28f83a4ea318e56c4f494bf7005/third_party/WebKit/LayoutTests/platform/linux/editing/selection/select-delete-in-event-handler-expected.txt
[delete] https://crrev.com/93846275952fa28f83a4ea318e56c4f494bf7005/third_party/WebKit/LayoutTests/platform/win/editing/selection/select-delete-in-event-handler-expected.txt
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/Source/core/css/resolver/ElementResolveContext.h
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/Source/core/css/resolver/StyleResolver.h
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/334b4846828ceb697785b466619a1f1b96592a3b/third_party/WebKit/Source/web/tests/data/rtl-iframe-inner.html

Comment 8 by r...@opera.com, Jun 28 2017

Status: Fixed (was: Started)

Sign in to add a comment