From 8274539f7e16a07c147f660334ecc73d2856b2d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 11 Apr 2020 21:34:06 +0200 Subject: [PATCH] [cssom] CSSStyleDeclaration.cssText should return the empty string for computed style. Closes #1033 --- cssom-1/Overview.bs | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/cssom-1/Overview.bs b/cssom-1/Overview.bs index d753f9023bb..eab2f770e39 100644 --- a/cssom-1/Overview.bs +++ b/cssom-1/Overview.bs @@ -1808,7 +1808,7 @@ On setting the {{CSSStyleRule/selectorText}} attribute these steps must be run: The style attribute must return a CSSStyleDeclaration object for the style rule, with the following properties:
-
readonly flag +
computed flag
Unset.
declarations
The declared declarations in the rule, in specified order. @@ -1908,7 +1908,7 @@ On setting the {{CSSPageRule/selectorText}} attribute these steps must be run: The style attribute must return a CSSStyleDeclaration object for the @page at-rule, with the following properties:
-
readonly flag +
computed flag
Unset.
declarations
The declared declarations in the rule, in specified order. @@ -1938,7 +1938,7 @@ included in the name. [[!CSS3SYN]] The style attribute must return a CSSStyleDeclaration object for the margin at-rule, with the following properties:
-
readonly flag +
computed flag
Unset.
declarations
The declared declarations in the rule, in specified order. @@ -1996,9 +1996,9 @@ the DOM a CSS declaration block is a CSS declaration block has the following associated properties:
-
readonly flag -
Unset if the object can be manipulated. Set if it can not be - manipulated. Unless otherwise stated it is unset. +
computed flag +
Set if the object is a computed style declaration, rather than a specified + style. Unless otherwise stated it is unset.
declarations
The CSS declarations associated with the object. @@ -2099,7 +2099,7 @@ A CSS declaration block has these attribute change steps for its < with localName, value, and namespace:
    -
  1. If the readonly flag is set, then return. +
  2. If the computed flag is set, then return.
  3. If the updating flag is set, then return.
  4. If localName is not "style", or namespace is not null, then return.
  5. If value is null, empty the declarations. @@ -2111,7 +2111,7 @@ When a CSS declaration block object is created, then:
    1. Let owner node be the owner node. -
    2. If owner node is null, or the readonly flag is set, then return. +
    3. If owner node is null, or the computed flag is set, then return.
    4. Let value be the result of getting an attribute given null, "style", and owner node.
    5. If value is not null, let the declarations be the result of @@ -2121,7 +2121,7 @@ When a CSS declaration block object is created, then: To update style attribute for declaration block means to run the steps below:
        -
      1. Assert: declaration block's readonly flag is unset. +
      2. Assert: declaration block's computed flag is unset.
      3. Let owner node be declaration block's owner node.
      4. If owner node is null, then return.
      5. Set declaration block's updating flag. @@ -2164,11 +2164,14 @@ The object's supported property indices are the numbers in the range zero CSS declarations in the declarations. If there are no such CSS declarations, then there are no supported property indices. -The cssText attribute must return the result of -serializing the declarations. +Getting the cssText attribute must run these steps: + +1. If the computed flag is set, then return the empty string. +2. Return the result of serializing the declarations. + Setting the {{CSSStyleDeclaration/cssText}} attribute must run these steps:
          -
        1. If the readonly flag is set, +
        2. If the computed flag is set, then throw a {{NoModificationAllowedError}} exception.
        3. Empty the declarations.
        4. Parse the given value and, if the return value is not the empty list, insert the items in the list @@ -2234,7 +2237,7 @@ value would be "important". The setProperty(property, value, priority) method must run these steps:
            -
          1. If the readonly flag is set, +
          2. If the computed flag is set, then throw a {{NoModificationAllowedError}} exception.
          3. If property is not a custom property, follow these substeps:
              @@ -2349,7 +2352,7 @@ use different algorithms as long as the constraints above hold. The removeProperty(property) method must run these steps:
                -
              1. If the readonly flag is set, +
              2. If the computed flag is set, then throw a {{NoModificationAllowedError}} exception.
              3. If property is not a custom property, let property be property converted to ASCII lowercase. @@ -2801,7 +2804,7 @@ interface mixin ElementCSSInlineStyle { The style attribute must return a CSS declaration block object whose -readonly flag is unset, whose parent CSS rule is null, and +computed flag is unset, whose parent CSS rule is null, and whose owner node is the context object. If the user agent supports HTML, the following IDL applies: [[HTML]] @@ -2859,7 +2862,7 @@ steps:
              4. Return a live CSS declaration block with the following properties:
                -
                readonly flag +
                computed flag
                Set.
                declarations
                decls.