New issue
Advanced search Search tips

Issue 868380 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

::first-letter incorrectly applied to button with grid display

Project Member Reported by futhark@chromium.org, Jul 27

Issue description

<!DOCTYPE html>
<style>
  button { display: grid }
  button::first-letter { color: red }
</style>
<button>
  <span>First letter should not be red</span>
</button>

 
Project Member

Comment 1 by bugdroid1@chromium.org, Jul 30

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

commit 62649b86ee5c9165c05e06f121b61eee33c45e16
Author: Rune Lillesveen <futhark@chromium.org>
Date: Mon Jul 30 07:54:45 2018

Find LayoutText containing the first letter before attaching pseudo.

We assert that we find the same text node before creating the element as
we find when attaching the first letter LayoutText. We used to attach
the ::first-letter pseudo element before finding the LayoutText from
which we get the first letter text.

We did crash in a clusterfuzz test because FirstLetterTextLayoutObject()
was confused by a combination of a grid, button, anonymous
wrappers and continuations. Instead of trying to fix all bugs in
FirstLetterTextLayoutObject(), find the LayoutText before attaching the
::first-letter to make sure we are consistent instead of chasing
clusterfuzz issues.

Reported the incorrectness for button, grid, and ::first-letter in
868380.

Bug:  859285 , 868380
Change-Id: I335a32b466ab31858fb05ea5f650cf12ab674040
Reviewed-on: https://chromium-review.googlesource.com/1152982
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578993}
[modify] https://crrev.com/62649b86ee5c9165c05e06f121b61eee33c45e16/third_party/WebKit/LayoutTests/TestExpectations
[add] https://crrev.com/62649b86ee5c9165c05e06f121b61eee33c45e16/third_party/WebKit/LayoutTests/external/wpt/css/css-grid/grid-model/grid-container-ignores-first-letter-002-ref.html
[add] https://crrev.com/62649b86ee5c9165c05e06f121b61eee33c45e16/third_party/WebKit/LayoutTests/external/wpt/css/css-grid/grid-model/grid-container-ignores-first-letter-002.html
[modify] https://crrev.com/62649b86ee5c9165c05e06f121b61eee33c45e16/third_party/blink/renderer/core/dom/first_letter_pseudo_element.cc
[modify] https://crrev.com/62649b86ee5c9165c05e06f121b61eee33c45e16/third_party/blink/renderer/core/dom/first_letter_pseudo_element.h

Sign in to add a comment