New issue
Advanced search Search tips

Issue 755956 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 657748



Sign in to add a comment

Support display:contents on ::before/::after

Reported by r...@opera.com, Aug 16 2017

Issue description

This code should create a block box for the div, no box for the pseudo element, but text boxes for the generated content:

<style>
div::before {
  display:contents;
  content:"PASS";
}
</style>
<div></div>

 
Labels: Update-Quarterly
Project Member

Comment 2 by sheriffbot@chromium.org, Oct 19 2017

Labels: Hotlist-Recharge-BouncingOwner
Owner: ----
Status: Untriaged (was: Started)
The assigned owner "rune@opera.com" is not able to receive e-mails, please re-triage.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 3 by nainar@chromium.org, Oct 19 2017

Labels: Hotlist-Reassign-In-Nov
Owner: nainar@chromium.org
Status: Assigned (was: Untriaged)

Comment 4 by nainar@chromium.org, Oct 30 2017

Labels: Hotlist-Interop
Labels: -Hotlist-Recharge-BouncingOwner -Hotlist-Reassign-In-Nov
Owner: futhark@chromium.org
Project Member

Comment 6 by bugdroid1@chromium.org, Nov 20 2017

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

commit 34d4fb086793b586a9b1ce18f83a234b3b40cd71
Author: Rune Lillesveen <futhark@chromium.org>
Date: Mon Nov 20 20:56:00 2017

Added tests for flex items inside display:contents.

Test that a flex container with generated text content for ::before and
::after elements with display:contents end up in the same flex item.

Works as expected in WebKit, not in Gecko nor Blink.

Bug:  755956 
Change-Id: I1db2769be8704f2a6ef540b115e99fe2929dc02f
Reviewed-on: https://chromium-review.googlesource.com/776659
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Christian Biesinger <cbiesinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517921}
[modify] https://crrev.com/34d4fb086793b586a9b1ce18f83a234b3b40cd71/third_party/WebKit/LayoutTests/TestExpectations
[add] https://crrev.com/34d4fb086793b586a9b1ce18f83a234b3b40cd71/third_party/WebKit/LayoutTests/external/wpt/css/css-display/display-contents-before-after-003.html

Status: Started (was: Assigned)
Project Member

Comment 8 by bugdroid1@chromium.org, Nov 22 2017

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

commit f64ab7d95f9ab111613d17cfca40c46e750ae87e
Author: Rune Lillesveen <futhark@chromium.org>
Date: Wed Nov 22 05:47:25 2017

Support display:contents on ::before/::after pseudo elements.

These pseudo elements should behave like normal elements for
display:contents and not generate a box. However, the generated content
is rendered using anonymous LayoutObjects which are not connected to
the pseudo element or the real DOM element by any means. Therefore, we
generate a  inline box for the pseudo element instead to be able to
detach the correct LayoutObjects when the generated content goes away.

In order to return the correct ComputedStyle for getComputedStyle for
the pseudo elements, we store a NonLayoutObjectComputedStyle for the
real computed style in addition to the ComputedStyle on the fictional
inline box. The assumption here is that the fact that we generate an
inline box for the pseudo element here should not be observable.

FWIW, this is also the way WebKit support display:contents on ::before
and ::after elements.

Bug:  755956 
Change-Id: I60d79d463fb25def0ee96fc4231a8615cae049b0
Reviewed-on: https://chromium-review.googlesource.com/781863
Reviewed-by: nainar <nainar@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518546}
[modify] https://crrev.com/f64ab7d95f9ab111613d17cfca40c46e750ae87e/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/f64ab7d95f9ab111613d17cfca40c46e750ae87e/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/f64ab7d95f9ab111613d17cfca40c46e750ae87e/third_party/WebKit/Source/core/dom/PseudoElement.cpp
[modify] https://crrev.com/f64ab7d95f9ab111613d17cfca40c46e750ae87e/third_party/WebKit/Source/core/dom/PseudoElement.h

Status: Fixed (was: Started)

Sign in to add a comment