Title: [204449] trunk
Revision
204449
Author
[email protected]
Date
2016-08-13 15:36:20 -0700 (Sat, 13 Aug 2016)

Log Message

Move designMode attribute from HTMLDocument to Document
https://bugs.webkit.org/show_bug.cgi?id=160838

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Rebaseline W3C test now that more checks are passing.

* web-platform-tests/html/dom/interfaces-expected.txt:

Source/WebCore:

Move designMode attribute from HTMLDocument to Document to match the
latest HTML specification:
- https://html.spec.whatwg.org/multipage/interaction.html#designMode

This also matches Chrome.

No new tests, rebaselined existing test.

* dom/Document.cpp:
(WebCore::Document::designMode):
(WebCore::Document::setDesignMode):
* dom/Document.h:
* dom/Document.idl:
* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::bgColor): Deleted.
(WebCore::HTMLDocument::setBgColor): Deleted.
(WebCore::HTMLDocument::fgColor): Deleted.
* html/HTMLDocument.h:
* html/HTMLDocument.idl:

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (204448 => 204449)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2016-08-13 20:30:50 UTC (rev 204448)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2016-08-13 22:36:20 UTC (rev 204449)
@@ -1,3 +1,14 @@
+2016-08-13  Chris Dumez  <[email protected]>
+
+        Move designMode attribute from HTMLDocument to Document
+        https://bugs.webkit.org/show_bug.cgi?id=160838
+
+        Reviewed by Sam Weinig.
+
+        Rebaseline W3C test now that more checks are passing.
+
+        * web-platform-tests/html/dom/interfaces-expected.txt:
+
 2016-08-12  Chris Dumez  <[email protected]>
 
         getElementsByTagName() should take a qualifiedName in parameter

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt (204448 => 204449)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt	2016-08-13 20:30:50 UTC (rev 204448)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt	2016-08-13 22:36:20 UTC (rev 204449)
@@ -39,7 +39,7 @@
 PASS Document interface: attribute defaultView 
 PASS Document interface: attribute activeElement 
 PASS Document interface: operation hasFocus() 
-FAIL Document interface: attribute designMode assert_true: The prototype object must have a property "designMode" expected true got false
+PASS Document interface: attribute designMode 
 PASS Document interface: operation execCommand(DOMString,boolean,DOMString) 
 PASS Document interface: operation queryCommandEnabled(DOMString) 
 PASS Document interface: operation queryCommandIndeterm(DOMString) 
@@ -457,7 +457,7 @@
 PASS Document interface: new Document() must inherit property "defaultView" with the proper type (59) 
 PASS Document interface: new Document() must inherit property "activeElement" with the proper type (60) 
 PASS Document interface: new Document() must inherit property "hasFocus" with the proper type (61) 
-FAIL Document interface: new Document() must inherit property "designMode" with the proper type (62) assert_inherits: property "designMode" not found in prototype chain
+PASS Document interface: new Document() must inherit property "designMode" with the proper type (62) 
 PASS Document interface: new Document() must inherit property "execCommand" with the proper type (63) 
 PASS Document interface: calling execCommand(DOMString,boolean,DOMString) on new Document() with too few arguments must throw TypeError 
 PASS Document interface: new Document() must inherit property "queryCommandEnabled" with the proper type (64) 
@@ -712,7 +712,7 @@
 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "defaultView" with the proper type (59) 
 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "activeElement" with the proper type (60) 
 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "hasFocus" with the proper type (61) 
-FAIL Document interface: document.implementation.createDocument(null, "", null) must inherit property "designMode" with the proper type (62) assert_inherits: property "designMode" not found in prototype chain
+PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "designMode" with the proper type (62) 
 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "execCommand" with the proper type (63) 
 PASS Document interface: calling execCommand(DOMString,boolean,DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError 
 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "queryCommandEnabled" with the proper type (64) 

Modified: trunk/Source/WebCore/ChangeLog (204448 => 204449)


--- trunk/Source/WebCore/ChangeLog	2016-08-13 20:30:50 UTC (rev 204448)
+++ trunk/Source/WebCore/ChangeLog	2016-08-13 22:36:20 UTC (rev 204449)
@@ -1,3 +1,30 @@
+2016-08-13  Chris Dumez  <[email protected]>
+
+        Move designMode attribute from HTMLDocument to Document
+        https://bugs.webkit.org/show_bug.cgi?id=160838
+
+        Reviewed by Sam Weinig.
+
+        Move designMode attribute from HTMLDocument to Document to match the
+        latest HTML specification:
+        - https://html.spec.whatwg.org/multipage/interaction.html#designMode
+
+        This also matches Chrome.
+
+        No new tests, rebaselined existing test.
+
+        * dom/Document.cpp:
+        (WebCore::Document::designMode):
+        (WebCore::Document::setDesignMode):
+        * dom/Document.h:
+        * dom/Document.idl:
+        * html/HTMLDocument.cpp:
+        (WebCore::HTMLDocument::bgColor): Deleted.
+        (WebCore::HTMLDocument::setBgColor): Deleted.
+        (WebCore::HTMLDocument::fgColor): Deleted.
+        * html/HTMLDocument.h:
+        * html/HTMLDocument.idl:
+
 2016-08-12  Chris Dumez  <[email protected]>
 
         getElementsByTagName() should take a qualifiedName in parameter

Modified: trunk/Source/WebCore/dom/Document.cpp (204448 => 204449)


--- trunk/Source/WebCore/dom/Document.cpp	2016-08-13 20:30:50 UTC (rev 204448)
+++ trunk/Source/WebCore/dom/Document.cpp	2016-08-13 22:36:20 UTC (rev 204449)
@@ -5031,8 +5031,25 @@
         frame->document()->scheduleForcedStyleRecalc();
 }
 
-Document::InheritedBool Document::getDesignMode() const
+String Document::designMode() const
 {
+    return inDesignMode() ? ASCIILiteral("on") : ASCIILiteral("off");
+}
+
+void Document::setDesignMode(const String& value)
+{
+    InheritedBool mode;
+    if (equalLettersIgnoringASCIICase(value, "on"))
+        mode = on;
+    else if (equalLettersIgnoringASCIICase(value, "off"))
+        mode = off;
+    else
+        mode = inherit;
+    setDesignMode(mode);
+}
+
+auto Document::getDesignMode() const -> InheritedBool
+{
     return m_designMode;
 }
 

Modified: trunk/Source/WebCore/dom/Document.h (204448 => 204449)


--- trunk/Source/WebCore/dom/Document.h	2016-08-13 20:30:50 UTC (rev 204448)
+++ trunk/Source/WebCore/dom/Document.h	2016-08-13 22:36:20 UTC (rev 204449)
@@ -941,6 +941,8 @@
     void setDesignMode(InheritedBool value);
     InheritedBool getDesignMode() const;
     bool inDesignMode() const;
+    String designMode() const;
+    void setDesignMode(const String&);
 
     Document* parentDocument() const;
     Document& topDocument() const;

Modified: trunk/Source/WebCore/dom/Document.idl (204448 => 204449)


--- trunk/Source/WebCore/dom/Document.idl	2016-08-13 20:30:50 UTC (rev 204448)
+++ trunk/Source/WebCore/dom/Document.idl	2016-08-13 22:36:20 UTC (rev 204449)
@@ -141,6 +141,7 @@
 
     [SetterRaisesException] attribute DOMString title;
     attribute DOMString dir;
+    attribute DOMString designMode;
 
     readonly attribute USVString referrer;
 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT

Modified: trunk/Source/WebCore/html/HTMLDocument.cpp (204448 => 204449)


--- trunk/Source/WebCore/html/HTMLDocument.cpp	2016-08-13 20:30:50 UTC (rev 204448)
+++ trunk/Source/WebCore/html/HTMLDocument.cpp	2016-08-13 22:36:20 UTC (rev 204449)
@@ -107,23 +107,6 @@
     return frameView ? frameView->contentsHeight() : 0;
 }
 
-String HTMLDocument::designMode() const
-{
-    return inDesignMode() ? ASCIILiteral("on") : ASCIILiteral("off");
-}
-
-void HTMLDocument::setDesignMode(const String& value)
-{
-    InheritedBool mode;
-    if (equalLettersIgnoringASCIICase(value, "on"))
-        mode = on;
-    else if (equalLettersIgnoringASCIICase(value, "off"))
-        mode = off;
-    else
-        mode = inherit;
-    Document::setDesignMode(mode);
-}
-
 const AtomicString& HTMLDocument::bgColor() const
 {
     auto* bodyElement = body();

Modified: trunk/Source/WebCore/html/HTMLDocument.h (204448 => 204449)


--- trunk/Source/WebCore/html/HTMLDocument.h	2016-08-13 20:30:50 UTC (rev 204448)
+++ trunk/Source/WebCore/html/HTMLDocument.h	2016-08-13 22:36:20 UTC (rev 204449)
@@ -45,9 +45,6 @@
     int width();
     int height();
 
-    String designMode() const;
-    void setDesignMode(const String&);
-
     const AtomicString& bgColor() const;
     void setBgColor(const String&);
     const AtomicString& fgColor() const;

Modified: trunk/Source/WebCore/html/HTMLDocument.idl (204448 => 204449)


--- trunk/Source/WebCore/html/HTMLDocument.idl	2016-08-13 20:30:50 UTC (rev 204448)
+++ trunk/Source/WebCore/html/HTMLDocument.idl	2016-08-13 22:36:20 UTC (rev 204449)
@@ -52,7 +52,6 @@
     attribute DOMString dir;
 #endif
 
-    attribute DOMString designMode;
     readonly attribute DOMString compatMode;
 
     // Deprecated attributes.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to