Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Issue 17654008: Implement the ::backdrop pseudo-element for modal <dialog>. (Closed)

Created:
7 years, 6 months ago by falken
Modified:
7 years, 5 months ago
CC:
blink-reviews, eae+blinkwatch, leviw+renderwatch, dglazkov+blink, apavlov+blink_chromium.org, adamk+blink_chromium.org, jchaffraix+rendering, darktears
Visibility:
Public.

Description

Implement the ::backdrop pseudo-element for modal <dialog>. The Fullscreen spec defines ::backdrop, a pseudo-element rendered immediately beneath top layer elements. This enables the grayed-out screen effect, for example. This commit implements ::backdrop for modal dialogs, which are the currently the only residents of the top layer. The plan is for fullscreen elements to also use the top layer, so they will use ::backdrop as well. BUG=253909 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=153612

Patch Set 1 #

Patch Set 2 : fix failing tests #

Total comments: 8

Patch Set 3 : rebase #

Patch Set 4 : review comments #

Total comments: 2

Patch Set 5 : sync #

Patch Set 6 : add helper function and descendant selector test #

Total comments: 8

Patch Set 7 : rebase #

Patch Set 8 : put backdrop in DOM-side top layer #

Total comments: 11

Patch Set 9 : review comments #

Total comments: 2

Patch Set 10 : rebase #

Patch Set 11 : use element directly #

Unified diffs Side-by-side diffs Delta from patch set Stats (+584 lines, -15 lines) Patch
A LayoutTests/dialog/backdrop-descendant-selector.html View 1 2 3 4 5 1 chunk +52 lines, -0 lines 0 comments Download
A LayoutTests/dialog/backdrop-descendant-selector-expected.html View 1 2 3 4 5 1 chunk +18 lines, -0 lines 0 comments Download
A LayoutTests/dialog/backdrop-does-not-inherit.html View 1 chunk +27 lines, -0 lines 0 comments Download
A LayoutTests/dialog/backdrop-does-not-inherit-expected.html View 1 chunk +16 lines, -0 lines 0 comments Download
A LayoutTests/dialog/backdrop-in-flow.html View 1 chunk +36 lines, -0 lines 0 comments Download
A LayoutTests/dialog/backdrop-in-flow-expected.html View 1 chunk +16 lines, -0 lines 0 comments Download
A LayoutTests/dialog/backdrop-stacking-order.html View 1 chunk +78 lines, -0 lines 0 comments Download
A LayoutTests/dialog/backdrop-stacking-order-expected.html View 1 chunk +65 lines, -0 lines 0 comments Download
A LayoutTests/dialog/dialogs-with-no-backdrop.html View 1 2 3 1 chunk +38 lines, -0 lines 0 comments Download
A LayoutTests/dialog/dialogs-with-no-backdrop-expected.html View 1 chunk +5 lines, -0 lines 0 comments Download
A LayoutTests/dialog/modal-dialog-backdrop.html View 1 chunk +30 lines, -0 lines 0 comments Download
A LayoutTests/dialog/modal-dialog-backdrop-expected.html View 1 chunk +38 lines, -0 lines 0 comments Download
A LayoutTests/dialog/modal-dialog-generated-content.html View 1 chunk +56 lines, -0 lines 0 comments Download
A LayoutTests/dialog/modal-dialog-generated-content-expected.html View 1 chunk +42 lines, -0 lines 0 comments Download
M Source/core/css/CSSSelector.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/css/CSSSelector.cpp View 1 2 4 chunks +5 lines, -0 lines 0 comments Download
M Source/core/css/PseudoStyleRequest.h View 1 2 3 4 5 6 7 1 chunk +6 lines, -0 lines 0 comments Download
M Source/core/css/resolver/StyleResolver.cpp View 1 2 3 4 5 6 7 8 9 4 chunks +11 lines, -4 lines 0 comments Download
M Source/core/dom/Document.h View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Document.cpp View 1 2 3 4 5 6 7 1 chunk +9 lines, -2 lines 0 comments Download
M Source/core/dom/Element.cpp View 1 2 3 4 5 6 7 8 9 10 6 chunks +13 lines, -1 line 0 comments Download
M Source/core/dom/ElementRareData.h View 1 2 3 4 5 6 7 8 5 chunks +9 lines, -0 lines 0 comments Download
M Source/core/dom/ElementRareData.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/PseudoElement.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/PseudoElement.cpp View 1 2 3 4 5 6 7 1 chunk +5 lines, -2 lines 0 comments Download
M Source/core/rendering/RenderTheme.cpp View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/rendering/style/RenderStyle.h View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/rendering/style/RenderStyleConstants.h View 1 2 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 16 (0 generated)
falken
Hi Julien and Elliott Would you be able to review this? I'm not totally sure ...
7 years, 6 months ago (2013-06-25 14:23:50 UTC) #1
Julien - ping for review
> I'm not totally sure about this approach. This patch makes ::backdrop a child > ...
7 years, 5 months ago (2013-06-27 22:49:00 UTC) #2
falken
Thanks for the review! > Talking with Elliott, this is by design of pseudo-elements. It ...
7 years, 5 months ago (2013-06-28 08:06:52 UTC) #3
falken
Anne has clarified the spec. ::backdrop is a first-class citizen in the top layer, so ...
7 years, 5 months ago (2013-06-28 10:54:20 UTC) #4
Julien - ping for review
You have addressed my comments and I am happy with the code change (didn't look ...
7 years, 5 months ago (2013-07-03 01:48:05 UTC) #5
falken
Julien, thanks for the review. I also added a test for ::backdrop in a descendant ...
7 years, 5 months ago (2013-07-03 06:14:48 UTC) #6
esprehn
It would be nicer if the ::backdrop was isInTopLayer() too, could we change isInTopLayer() to ...
7 years, 5 months ago (2013-07-03 23:44:29 UTC) #7
falken
Elliott, thanks for the review. I changed the patch to make ::backdrop in the top ...
7 years, 5 months ago (2013-07-04 08:20:11 UTC) #8
esprehn
https://codereview.chromium.org/17654008/diff/61001/Source/core/css/resolver/StyleResolver.cpp File Source/core/css/resolver/StyleResolver.cpp (right): https://codereview.chromium.org/17654008/diff/61001/Source/core/css/resolver/StyleResolver.cpp#newcode1460 Source/core/css/resolver/StyleResolver.cpp:1460: return (element && element->isInTopLayer()) || (style && style->styleType() == ...
7 years, 5 months ago (2013-07-04 08:34:07 UTC) #9
falken
Thanks for the speedy review! https://codereview.chromium.org/17654008/diff/61001/Source/core/css/resolver/StyleResolver.cpp File Source/core/css/resolver/StyleResolver.cpp (right): https://codereview.chromium.org/17654008/diff/61001/Source/core/css/resolver/StyleResolver.cpp#newcode1460 Source/core/css/resolver/StyleResolver.cpp:1460: return (element && element->isInTopLayer()) ...
7 years, 5 months ago (2013-07-04 09:06:35 UTC) #10
falken
https://codereview.chromium.org/17654008/diff/61001/Source/core/css/resolver/StyleResolver.cpp File Source/core/css/resolver/StyleResolver.cpp (right): https://codereview.chromium.org/17654008/diff/61001/Source/core/css/resolver/StyleResolver.cpp#newcode1460 Source/core/css/resolver/StyleResolver.cpp:1460: return (element && element->isInTopLayer()) || (style && style->styleType() == ...
7 years, 5 months ago (2013-07-04 12:18:00 UTC) #11
esprehn
LGTM
7 years, 5 months ago (2013-07-04 16:06:05 UTC) #12
esprehn
https://codereview.chromium.org/17654008/diff/71001/Source/core/dom/Element.cpp File Source/core/dom/Element.cpp (right): https://codereview.chromium.org/17654008/diff/71001/Source/core/dom/Element.cpp#newcode2450 Source/core/dom/Element.cpp:2450: document()->addToTopLayer(pseudoElement(BACKDROP), this); btw, you don't need to call pseudoElement(BACKDROP) ...
7 years, 5 months ago (2013-07-04 20:17:49 UTC) #13
falken
Thanks for the reviews! https://codereview.chromium.org/17654008/diff/71001/Source/core/dom/Element.cpp File Source/core/dom/Element.cpp (right): https://codereview.chromium.org/17654008/diff/71001/Source/core/dom/Element.cpp#newcode2450 Source/core/dom/Element.cpp:2450: document()->addToTopLayer(pseudoElement(BACKDROP), this); On 2013/07/04 20:17:50, ...
7 years, 5 months ago (2013-07-05 02:16:14 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/falken@chromium.org/17654008/80003
7 years, 5 months ago (2013-07-05 02:16:40 UTC) #15
commit-bot: I haz the power
7 years, 5 months ago (2013-07-05 05:32:02 UTC) #16
Message was sent while issue was closed.
Change committed as 153612

Powered by Google App Engine
This is Rietveld 408576698