Should chrome.declarativeContent API match display:contents elements |
|||||
Issue descriptionNeed to decide if display:contents elements should be included as matching CSS rules as described in [1], or ignored like display:none elements. Most likely they should be included. [1] https://developer.chrome.com/extensions/declarativeContent
,
Nov 21 2017
,
Nov 22 2017
Just to make it clear, children of display:contents elements which are rendered should clearly be included. The question was if the display:contents elements themselves should be included. This is currently what the code does. I've implemented a unit test: https://chromium-review.googlesource.com/c/chromium/src/+/784930
,
Nov 22 2017
I omitted display:none elements and their children so that extensions wouldn't take action based on stuff that wasn't visible to the user. display:contents doesn't seem like that case, so my instinct would be to include it, as you've done.
,
Nov 22 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/910a824266ff9c6e912ee664cfd93c2754ec1b61 commit 910a824266ff9c6e912ee664cfd93c2754ec1b61 Author: Rune Lillesveen <futhark@chromium.org> Date: Wed Nov 22 22:42:07 2017 Unit tests for WatchCSSSelectors and display:contents. Include elements which are display:contents and their rendered descendants when matching selectors for the chrome.declarativeContent API. Bug: 787337 Change-Id: I16bc7604dea573555fd5071e96c8194bdb0054b2 Reviewed-on: https://chromium-review.googlesource.com/784930 Commit-Queue: Rune Lillesveen <futhark@chromium.org> Reviewed-by: Devlin <rdevlin.cronin@chromium.org> Cr-Commit-Position: refs/heads/master@{#518777} [modify] https://crrev.com/910a824266ff9c6e912ee664cfd93c2754ec1b61/third_party/WebKit/Source/core/exported/WebFrameTest.cpp
,
Nov 22 2017
rdevlin@ said in review: "Ideally, we'd also add a brief end-to-end test exercising this with the declarativeContent API, but that's definitely something we can save for a later CL." I tried codesearch to see if there were any tests testing declarativeContent with actual page content, but couldn't find any examples.
,
Nov 23 2017
,
Dec 1 2017
Closing as the Blink work's done. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by rdevlin....@chromium.org
, Nov 21 2017