From 5e1cc307868ded8429ba0a6c18b34568200a6a18 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Thu, 8 Dec 2016 17:48:35 -0800 Subject: [PATCH] Remove anchored positioning of s This was mentioned briefly in the discussion in #1929. only has one implementation currently, and that implementation is not planning to implement the anchoring feature, per https://bugs.chromium.org/p/chromium/issues/detail?id=410346. --- source | 298 +++------------------------------------------------------ 1 file changed, 11 insertions(+), 287 deletions(-) diff --git a/source b/source index c81c32b4d4a..1de3d6134f9 100644 --- a/source +++ b/source @@ -56613,8 +56613,8 @@ dictionary RelatedEventInit : EventInit { interface HTMLDialogElement : HTMLElement { [CEReactions] attribute boolean open; attribute DOMString returnValue; - [CEReactions] void show(optional (MouseEvent or Element) anchor); - [CEReactions] void showModal(optional (MouseEvent or Element) anchor); + [CEReactions] void show(); + [CEReactions] void showModal(); [CEReactions] void close(optional DOMString returnValue); }; @@ -56644,24 +56644,20 @@ interface HTMLDialogElement : HTMLElement {
-
dialog . show( [ anchor ] )
+
dialog . show()

Displays the dialog element.

-

The argument, if provided, provides an anchor point to which the element will be fixed.

-
-
dialog . showModal( [ anchor ] )
+
dialog . showModal()

Displays the dialog element and makes it the top-most modal dialog.

-

The argument, if provided, provides an anchor point to which the element will be fixed.

-

This method honors the autofocus attribute.

@@ -56703,9 +56699,7 @@ interface HTMLDialogElement : HTMLElement {
  • Add an open attribute to the dialog element, whose value is the empty string.

  • -
  • If the show() method was invoked with an argument, - set up the position of the dialog element, using that argument as the - anchor. Otherwise, set the dialog to the normal alignment mode.

  • +
  • Set the dialog to the normal alignment mode.

  • Run the dialog focusing steps for the dialog element.

  • @@ -56740,10 +56734,7 @@ interface HTMLDialogElement : HTMLElement {
  • Add an open attribute to subject, whose value is the empty string.

  • -
  • If the showModal() method was invoked with an - argument, set up the position of subject, using that argument - as the anchor. Otherwise, set the dialog to the centered alignment - mode.

  • +
  • Set the dialog to the centered alignment mode.

  • Let subject's node document be blocked by the modal dialog subject.

  • @@ -56872,11 +56863,11 @@ interface HTMLDialogElement : HTMLElement {
    -

    All dialog elements are always in one of three modes: normal alignment, - centered alignment, and magic alignment. When a dialog element - is created, it must be placed in the normal alignment mode. In this mode, normal CSS - requirements apply to the element. The centered alignment mode is only used for - dialog elements that are in the top layer.

    +

    A dialog element is in one of two modes: normal alignment or + centered alignment. When a dialog element is created, it must be placed in + the normal alignment mode. In this mode, normal CSS requirements apply to the + 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 @@ -56899,221 +56890,6 @@ interface HTMLDialogElement : HTMLElement { property in certain situations; it's not used, for instance, to position the element if its 'position' property is set to 'static'.)

    -

    When a user agent is to set up the position of an element subject using an anchor anchor, it must run the following - steps:

    - -
      - -
    1. - -

      If anchor is a MouseEvent object, then run these - substeps:

      - -
        - -
      1. If anchor's target element does not have a rendered box, or is in a - different document than subject, then let subject be - in the centered alignment mode, and abort the set up the position - steps.

      2. - -
      3. Let anchor element be an anonymous element rendered as a box with - zero height and width (so its margin box and border box both just - form a point), positioned so that its top and left are at the coordinate identified by the - event, and whose properties all compute to their initial values.

      4. - -
      - -

      Otherwise, let anchor element be anchor.

      - -
    2. - -
    3. Put subject in the magic alignment mode, aligned to anchor element.

    4. - -
    - -

    While an element A has magic alignment, aligned to an element - B, the following requirements apply:

    - -
      - -
    • - -

      If at any time either A or B cease having rendered - boxes, A and B cease being in the same - Document, or B ceases being earlier than A in tree order, then, if subject is in the - pending dialog stack, let subject's mode become centered - alignment, otherwise, let subject's mode become normal - alignment.

      - -
    • - -
    • - -

      A's 'position' property must compute to the keyword 'absolute-anchored' rather than whatever it would - otherwise compute to (i.e. the 'position' property's specified value - is ignored).

      - -

      The 'absolute-anchored' - keyword's requirements are described below.

      - -
    • - -
    • - -

      The anchor points for A and B are defined as per the - appropriate entry in the following list:

      - -
      - -
      If the computed value of 'anchor-point' is 'none' on both - A and B - -
      -

      The anchor points of A and B are the center points - of their respective first boxes' border boxes. - - -

      If the computed value of 'anchor-point' is 'none' on A - and a specific point on B - -
      -

      The anchor point of B is the point given by its 'anchor-point' - property. - -

      If the anchor point of B is the center point of B's - first box's border box, then A's anchor point is the center point of - its first box's margin box. - -

      Otherwise, A's anchor point is on one of its margin edges. Consider four hypothetical half-infinite lines - L1, L2, L3, and L4 that each start in the center of B's first box's - border box, and that extend respectively through the - top left corner, top right corner, bottom right corner, and bottom left corner of - B's first box's border box. A's anchor point is determined - by the location of B's anchor point relative to these four hypothetical lines, as - follows: - -

      If the anchor point of B lies on L1 or L2, or inside the area bounded by L1 and - L2 that also contains the points above B's first box's border box, - then let A's anchor point be the horizontal center of A's bottom - margin edge.

      - -

      Otherwise, if the anchor point of B lies on L3 or L4, or inside the - area bounded by L3 and L4 that also contains the points below B's first - box's border box, then let A's anchor point be the horizontal center - of A's top margin edge.

      - -

      Otherwise, if the anchor point of B lies inside the area bounded by L4 and L1 - that also contains the points to the left of B's first box's border - box, then let A's anchor point be the vertical center of A's - right margin edge.

      - -

      Otherwise, the anchor point of B lies inside the area bounded by L2 and L3 that - also contains the points to the right of B's first box's border box; - let A's anchor point be the vertical center of A's left margin - edge.

      - - -
      If the computed value of 'anchor-point' is a specific point on - A and 'none' on B - -
      -

      The anchor point of A is the point given by its 'anchor-point' - property. - -

      If the anchor point of A is the center point of A's - first box's margin box, then B's anchor point is the center point of - its first box's border box. - -

      Otherwise, B's anchor point is on one of its border edges. Consider four hypothetical half-infinite lines - L1, L2, L3, and L4 that each start in the center of A's first box's - margin box, and that extend respectively through the - top left corner, top right corner, bottom right corner, and bottom left corner of - A's first box's margin box. B's anchor point is determined - by the location of A's anchor point relative to these four hypothetical lines, as - follows: - -

      If the anchor point of A lies on L1 or L2, or inside the area bounded by L1 and - L2 that also contains the points above A's first box's margin box, - then let B's anchor point be the horizontal center of B's bottom - border edge.

      - -

      Otherwise, if the anchor point of A lies on L3 or L4, or inside the - area bounded by L4 and L4 that also contains the points below A's first - box's margin box, then let B's anchor point be the horizontal center - of B's top border edge.

      - -

      Otherwise, if the anchor point of A lies inside the area bounded by L4 and L1 - that also contains the points to the left of A's first box's margin - box, then let B's anchor point be the vertical center of B's - right border edge.

      - -

      Otherwise, the anchor point of A lies inside the area bounded by L2 and L3 that - also contains the points to the right of A's first box's margin box; - let B's anchor point be the vertical center of B's left border - edge.

      - - -
      If the computed value of 'anchor-point' is a specific point on - both A and B - -
      -

      The anchor points of A and B are the points given - by their respective 'anchor-point' properties. - -

      - -

      The rules above generally use A's margin box, but - B's border box. This is because while A always - has a margin box, and using the margin box allows for the dialog to be - positioned offset from the box it is annotating, B sometimes does not have a - margin box (e.g. if it is a 'table-cell'), or has a margin - box whose position may be not entirely clear (e.g. in the face of margin collapsing and 'clear' handling of - in-flow blocks).

      - -

      In cases where B does not have a border box but its - border box is used by the algorithm above, user agents must use its first box's - content area instead. (This is in particular an issue with boxes in tables that - have 'border-collapse' set to 'collapse'.)

      - -
    • - -
    • - -

      When an element's 'position' property computes to 'absolute-anchored', the 'float' - property does not apply and must compute to 'none', the 'display' property must - compute to a value as described by the table in the section of the CSS - specification describing the relationships between 'display', 'position', and - 'float', and the element's box must be positioned using the rules for absolute - positioning but with its static position set such that if the box is positioned in its static - position, its anchor point is exactly aligned over the anchor point of the element to which it - is magically aligned. Elements aligned in this way are - absolutely positioned. For the purposes of determining the containing block - of other elements, the 'absolute-anchored' - keyword must be treated like the 'absolute' keyword.

      - -
    • - -
    - -

    The trivial example of an element that does not have a rendered box is one whose - 'display' property computes to 'none'. However, there are many other cases; e.g. - table columns do not have boxes (their properties merely affect other boxes).

    - -

    If an element to which another element is anchored changes rendering, the anchored - element will be repositioned accordingly. (In other words, the requirements above are live, - they are not just calculated once per anchored element.)

    - -

    The 'absolute-anchored' - keyword is not a keyword that can be specified in CSS; the 'position' property can - only compute to this value if the dialog element is positioned via the APIs described - above.

    -

    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 @@ -57149,58 +56925,6 @@ interface HTMLDialogElement : HTMLElement { -

    Anchor points
    - -

    This section will eventually be moved to a CSS specification; it is specified - here only on an interim basis until an editor can be found to own this.

    - - - - - - - - - - - - -
    'anchor-point'
    Value: - none | <position> -
    Initial: - none -
    Applies to: - all elements -
    Inherited: - no -
    Percentages: - refer to width or height of box; see prose -
    Media: - visual -
    Computed value: - The specified value, but with any lengths replaced by their corresponding absolute length -
    Animatable: - no -
    Canonical order: - per grammar -
    - -

    The 'anchor-point' property specifies a point to which dialog boxes are to be - aligned.

    - -

    If the value is a <position>, the anchor point is the point given by the value, - which must be interpreted relative to the element's first rendered box's margin box. - Percentages must be calculated relative to the element's first rendered box's margin - box (specifically, its width for the horizontal position and its height for the vertical - position).

    - -

    If the value is the keyword 'none', then no explicit anchor point is defined. The user agent - will pick an anchor point automatically if necessary (as described in the definition of the - open() method above).

    - - - -

    Scripting