From a03a914b36981f83b7f1c183ff63b01ffd1af40d Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Sat, 8 Apr 2017 00:44:51 +0900 Subject: [PATCH] Use logical positioning for centering a dialog Fixes #2185. Tests: https://github.com/w3c/web-platform-tests/pull/4605 --- source | 59 +++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/source b/source index c75609f44f5..d64af74afac 100644 --- a/source +++ b/source @@ -3320,6 +3320,10 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute 'padding-bottom', 'padding-left', and 'padding-right' properties +
  • The 'top', + 'bottom', + 'left', and + 'right' properties
  • The 'float' property
  • The 'clear' property
  • The 'width' property
  • @@ -3434,14 +3438,16 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

    The 'overflow' property - is defined in the CSS Overflow specification.

    + and its 'hidden' value + are defined in the CSS Overflow specification.

    The following features are defined in the CSS Positioned Layout specification:

    The

  • The 'direction' property
  • The 'unicode-bidi' property
  • -
  • The block size, +
  • The block flow direction, + block size, inline size, block-start, block-end, @@ -57414,32 +57421,42 @@ interface HTMLDialogElement : HTMLElement { element. The centered alignment mode is only used for dialog elements that are in the top layer.

    -

    When an element subject is placed in centered alignment mode, - and when it is in that mode and has new rendering boxes created, the user agent must set up the - element such that its top static position, for the purposes of calculating the - used value of the 'top' property, is the value that would place the - element's top margin edge as far from the top of the viewport as the - element's bottom margin edge from the bottom of the viewport, if the - element's height is less than the height of the viewport, and otherwise is the value - that would place the element's top margin edge at the top of the +

    When an element subject is placed in centered alignment mode, and when + it is in that mode and has new rendering boxes created, the user agent must set up the element + such that its static position of the edge that corresponds to subject's parent's + block-start edge, for the purposes of calculating the used value of the + appropriate box offset property ('top', 'right', 'bottom', + or 'left'), is the value that would place the element's margin edge on + the side that corresponds to subject's parent's block-start side as far + from the same-side edge of the viewport as the element's opposing side margin + edge from that same-side edge of the viewport, if the element's dimension + ('width' or 'height') in subject's parent's block flow + direction is less than the same-axis dimension of the viewport, and otherwise + is the value that would place the element's margin edge on the side that corresponds + to subject's parent's block-start side at the same-side edge of the viewport.

    If there is a dialog element with centered alignment and that is being rendered when its browsing context changes viewport - width (as measured in CSS pixels), then the user agent must recreate - the element's boxes, recalculating its top static position as in the previous paragraph.

    + dimensions (as measured in CSS pixels), or when this + dialog element's parent changes block flow direction, then the user + agent must recreate the element's boxes, recalculating its edge that corresponds to this + dialog element's parent's block-start edge as in the previous + paragraph.

    -

    This top static position of a dialog element with centered alignment - must remain the element's top static position until its boxes are recreated. (The element's static - position is only used in calculating the used value of the 'top' - property in certain situations; it's not used, for instance, to position the element if its - 'position' property is set to 'static'.)

    +

    This static position of a dialog element's edge with centered + alignment must remain the element's static position of that edge until its boxes are + recreated. (The element's static position is only used in calculating the used value + of the appropriate box offset property ('top', 'right', + 'bottom', or 'left') in certain situations; it's not used, for instance, + to position the element if its 'position' property is set to + 'static'.)

    User agents in visual interactive media should allow the user to pan the viewport to access all parts of a dialog element's border box, even if the element is larger than the viewport and the viewport would otherwise not have a scroll mechanism (e.g. because the viewport's 'overflow' property - is set to 'hidden').

    + is set to 'hidden').


    @@ -109942,7 +109959,7 @@ listing, plaintext, pre, xmp { dialog:not([open]) { display: none; } dialog { position: absolute; - left: 0; right: 0; + offset-inline-start: 0; offset-inline-end: 0; width: fit-content; height: fit-content; margin: auto;