Bug 191286 - Add a pseudoclass that matches img elements that are backed by an attachment
Summary: Add a pseudoclass that matches img elements that are backed by an attachment
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-11-05 15:36 PST by mitz
Modified: 2018-11-07 11:34 PST (History)
7 users (show)

See Also:


Attachments
WIP (4.01 KB, patch)
2018-11-05 17:53 PST, mitz
no flags Details | Formatted Diff | Diff
WIP (8.97 KB, patch)
2018-11-06 14:53 PST, mitz
no flags Details | Formatted Diff | Diff
Introduce :has-attachment (12.44 KB, patch)
2018-11-06 16:23 PST, mitz
dino: review+
ews: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews201 for win-future (12.78 MB, application/zip)
2018-11-06 19:51 PST, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2018-11-05 15:36:13 PST
It would be useful to have a way to select img elements that are using an attachment as their data source.
Comment 1 mitz 2018-11-05 15:38:01 PST
<rdar://problem/45823554>
Comment 2 mitz 2018-11-05 17:53:34 PST
Created attachment 353935 [details]
WIP
Comment 3 mitz 2018-11-06 14:53:48 PST
Created attachment 354012 [details]
WIP
Comment 4 mitz 2018-11-06 16:23:37 PST
Created attachment 354024 [details]
Introduce :has-attachment

Some things that need review here:
- the name of the pseudoclass
- the way it’s made to not parse at runtime if the attachment element isn’t enabled
- the lack of an explicit mechanism to force style resolution when an img gains an attachment, because currently the DOM tree mutation just makes it work
Comment 5 Build Bot 2018-11-06 19:51:06 PST
Comment on attachment 354024 [details]
Introduce :has-attachment

Attachment 354024 [details] did not pass win-ews (win):
Output: https://webkit-queues.webkit.org/results/9887671

New failing tests:
fast/css/has-attachment.html
Comment 6 Build Bot 2018-11-06 19:51:17 PST
Created attachment 354053 [details]
Archive of layout-test-results from ews201 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews201  Port: win-future  Platform: CYGWIN_NT-6.1-2.10.0-0.325-5-3-x86_64-64bit
Comment 7 Simon Fraser (smfr) 2018-11-07 11:13:02 PST
If this is apple-internal only, should it have a -apple- prefix?
Comment 8 mitz 2018-11-07 11:34:13 PST
Committed <https://trac.webkit.org/r237932>.