script: Create CSSStyleOwner::Null for getComputedStyle (#36272)

This new `CSSStyleOwner` variant is used when the pseudo-element
argument fails to parse properly or is for some unknown or unsupported
pseudo-element.

Testing: There are tests for this change. Various tests start to pass
and some start to
fail. New failures are due to partial or fully missing support for
pseudo-elements such
as:
 - `::selection`
 - `::first-letter` and `::first-line`
 - `::marker`

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Martin Robinson 2025-04-02 15:54:42 +02:00 committed by GitHub
parent 1f13e8b596
commit 2ce306f450
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 171 additions and 219 deletions

View file

@ -16,3 +16,21 @@
[U span::selections own text-decoration-thickness respects U spans font-size]
expected: FAIL
[M::selections font-size is the same as in M]
expected: FAIL
[M span::selections font-size is the same as in M span]
expected: FAIL
[W::selections line-height is the same as in W]
expected: FAIL
[W span::selections line-height is the same as in W span]
expected: FAIL
[U::selections font-size is the same as in U]
expected: FAIL
[U span::selections font-size is the same as in U span]
expected: FAIL

View file

@ -1,6 +0,0 @@
[highlight-cascade-009.html]
[body ::selection does not use its own custom property]
expected: FAIL
[div::selection does not use its own custom property]
expected: FAIL

View file

@ -1,3 +0,0 @@
[highlight-cascade-011.html]
[div::selection does not inherit custom properties from the highlight parent]
expected: FAIL

View file

@ -0,0 +1,36 @@
[highlight-currentcolor-computed-visited.html]
[getComputedStyle() for ::selection at #target1]
expected: FAIL
[getComputedStyle() for ::selection at #target2]
expected: FAIL
[getComputedStyle() for ::target-text at #target1]
expected: FAIL
[getComputedStyle() for ::target-text at #target2]
expected: FAIL
[getComputedStyle() for ::search-text at #target1]
expected: FAIL
[getComputedStyle() for ::search-text at #target2]
expected: FAIL
[getComputedStyle() for ::spelling-error at #target1]
expected: FAIL
[getComputedStyle() for ::spelling-error at #target2]
expected: FAIL
[getComputedStyle() for ::grammar-error at #target1]
expected: FAIL
[getComputedStyle() for ::grammar-error at #target2]
expected: FAIL
[getComputedStyle() for ::highlight(foo) at #target1]
expected: FAIL
[getComputedStyle() for ::highlight(foo) at #target2]
expected: FAIL

View file

@ -1,10 +1,4 @@
[highlight-currentcolor-computed.html]
[getComputedStyle() for ::selection at #target1]
expected: FAIL
[getComputedStyle() for ::selection at #target2]
expected: FAIL
[getComputedStyle() for ::target-text at #target1]
expected: FAIL

View file

@ -1,24 +1,3 @@
[highlight-pseudos-computed-search-text.tentative.html]
[getComputedStyle() for ::search-text]
expected: FAIL
[getComputedStyle() for ::search-text: should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::search-text) should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::search-text( should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::search-text(foo) should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::search-text() should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for :::search-text should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::search-text. should return an empty CSSStyleDeclaration]
expected: FAIL

View file

@ -1,123 +1,15 @@
[highlight-pseudos-computed.html]
[getComputedStyle() for ::selection]
expected: FAIL
[getComputedStyle() for ::selection: should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::selection) should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::selection( should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::selection(foo) should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::selection() should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for :::selection should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::selection. should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::target-text]
expected: FAIL
[getComputedStyle() for ::target-text: should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::target-text) should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::target-text( should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::target-text(foo) should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::target-text() should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for :::target-text should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::target-text. should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::spelling-error]
expected: FAIL
[getComputedStyle() for ::spelling-error: should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::spelling-error) should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::spelling-error( should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::spelling-error(foo) should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::spelling-error() should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for :::spelling-error should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::spelling-error. should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::grammar-error]
expected: FAIL
[getComputedStyle() for ::grammar-error: should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::grammar-error) should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::grammar-error( should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::grammar-error(foo) should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::grammar-error() should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for :::grammar-error should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::grammar-error. should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::highlight(foo)]
expected: FAIL
[getComputedStyle() for ::highlight(foo): should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::highlight(foo)) should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::highlight(foo)( should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::highlight(foo)(foo) should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::highlight(foo)() should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for :::highlight(foo) should return an empty CSSStyleDeclaration]
expected: FAIL
[getComputedStyle() for ::highlight(foo). should return an empty CSSStyleDeclaration]
expected: FAIL
[Different getComputedStyle() for ::highlight(bar) and same element]
expected: FAIL

View file

@ -1,10 +1,4 @@
[highlight-pseudos-visited-computed-001.html]
[getComputedStyle() for ::selection at #target1]
expected: FAIL
[getComputedStyle() for ::selection at #target2]
expected: FAIL
[getComputedStyle() for ::target-text at #target1]
expected: FAIL

View file

@ -16,3 +16,15 @@
[Computed 'content' for non-list-item ::marker, variant none]
expected: FAIL
[Computed 'content' for list-item ::marker, variant default]
expected: FAIL
[Computed 'content' for list-item ::marker, variant normal]
expected: FAIL
[Computed 'content' for non-list-item ::marker, variant default]
expected: FAIL
[Computed 'content' for non-list-item ::marker, variant normal]
expected: FAIL

View file

@ -70,3 +70,27 @@
[Computed value of 'text-indent' for inside marker]
expected: FAIL
[Computed value of 'unicode-bidi' for outside symbol]
expected: FAIL
[Computed value of 'unicode-bidi' for outside decimal]
expected: FAIL
[Computed value of 'unicode-bidi' for outside string]
expected: FAIL
[Computed value of 'unicode-bidi' for outside marker]
expected: FAIL
[Computed value of 'unicode-bidi' for inside symbol]
expected: FAIL
[Computed value of 'unicode-bidi' for inside decimal]
expected: FAIL
[Computed value of 'unicode-bidi' for inside string]
expected: FAIL
[Computed value of 'unicode-bidi' for inside marker]
expected: FAIL

View file

@ -1,3 +0,0 @@
[selection-universal-shadow-dom.html]
[getComputedStyle() for #target ::selection]
expected: FAIL

View file

@ -11,3 +11,8 @@
[nested color]
expected: FAIL
[position]
expected: FAIL
[abspos]
expected: FAIL

View file

@ -11,3 +11,8 @@
[nested color]
expected: FAIL
[position]
expected: FAIL
[abspos]
expected: FAIL

View file

@ -1,6 +1,3 @@
[getComputedStyle-pseudo-checkmark.html]
[Resolution of width is correct when pseudo-element argument is ignored (due to single-colon)]
expected: FAIL
[Resolution of width is correct for pseudo-element (due to double-colon)]
expected: FAIL

View file

@ -2,8 +2,5 @@
[Resolution of width is correct when pseudo-element argument is ignored (due to no colon)]
expected: FAIL
[Resolution of width is correct when pseudo-element argument is ignored (due to single-colon)]
expected: FAIL
[Resolution of width is correct for pseudo-element (due to double-colon)]
expected: FAIL

View file

@ -13,54 +13,3 @@
[This pseudo-element should parse: ::highlight( n\\61me )]
expected: FAIL
[This pseudo-element should not parse: ::before(test)]
expected: FAIL
[This pseudo-element should not parse: ::highlight]
expected: FAIL
[This pseudo-element should not parse: ::highlight(]
expected: FAIL
[This pseudo-element should not parse: ::highlight()]
expected: FAIL
[This pseudo-element should not parse: ::highlight(1)]
expected: FAIL
[This pseudo-element should not parse: ::highlight($)]
expected: FAIL
[This pseudo-element should not parse: ::highlight (name)]
expected: FAIL
[This pseudo-element should not parse: ::highlight(name)a]
expected: FAIL
[This pseudo-element should not parse: ::view-transition-group(*)]
expected: FAIL
[This pseudo-element should not parse: :highlight(name)]
expected: FAIL
[This pseudo-element should not parse: ::view-transition-image-pair(*)]
expected: FAIL
[This pseudo-element should not parse: ::view-transition-old(*)]
expected: FAIL
[This pseudo-element should not parse: ::view-transition-new(*)]
expected: FAIL
[This pseudo-element should not parse: :view-transition-group(name)]
expected: FAIL
[This pseudo-element should not parse: :view-transition-image-pair(name)]
expected: FAIL
[This pseudo-element should not parse: :view-transition-old(name)]
expected: FAIL
[This pseudo-element should not parse: :view-transition-new(name)]
expected: FAIL

View file

@ -8,9 +8,6 @@
[Unknown pseudo-elements throw]
expected: FAIL
[Unknown pseudo-elements]
expected: FAIL
[Unknown pseudo-element with a known string (ex: marker)]
expected: FAIL
@ -52,6 +49,3 @@
[Unknown pseudo-element with a known identifier: view-transition-new(name)]
expected: PRECONDITION_FAILED
[Resolution of width is correct when pseudo-element argument is invalid (due to a trailing token)]
expected: FAIL

View file

@ -0,0 +1,3 @@
[placeholder-opacity-default.tentative.html]
[Default opacity value is '1']
expected: FAIL