Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (203760 => 203761)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2016-07-27 04:12:11 UTC (rev 203760)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2016-07-27 04:27:12 UTC (rev 203761)
@@ -1,5 +1,16 @@
2016-07-26 Chris Dumez <cdu...@apple.com>
+ Move 'dir' attribute from HTMLDocument to Document
+ https://bugs.webkit.org/show_bug.cgi?id=160231
+
+ Reviewed by Sam Weinig.
+
+ Rebaseline W3C test now that more checks are passing.
+
+ * web-platform-tests/html/dom/interfaces-expected.txt:
+
+2016-07-26 Chris Dumez <cdu...@apple.com>
+
Second parameter to History.pushState() / replaceState() should be mandatory
https://bugs.webkit.org/show_bug.cgi?id=160230
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt (203760 => 203761)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt 2016-07-27 04:12:11 UTC (rev 203760)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt 2016-07-27 04:27:12 UTC (rev 203761)
@@ -19,7 +19,7 @@
PASS Document interface: attribute lastModified
PASS Document interface: attribute readyState
PASS Document interface: attribute title
-FAIL Document interface: attribute dir assert_true: The prototype object must have a property "dir" expected true got false
+PASS Document interface: attribute dir
PASS Document interface: attribute body
PASS Document interface: attribute head
PASS Document interface: attribute images
@@ -444,7 +444,7 @@
PASS Document interface: new Document() must inherit property "lastModified" with the proper type (38)
PASS Document interface: new Document() must inherit property "readyState" with the proper type (39)
PASS Document interface: new Document() must inherit property "title" with the proper type (41)
-FAIL Document interface: new Document() must inherit property "dir" with the proper type (42) assert_inherits: property "dir" not found in prototype chain
+PASS Document interface: new Document() must inherit property "dir" with the proper type (42)
PASS Document interface: new Document() must inherit property "body" with the proper type (43)
PASS Document interface: new Document() must inherit property "head" with the proper type (44)
PASS Document interface: new Document() must inherit property "images" with the proper type (45)
@@ -711,7 +711,7 @@
PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "lastModified" with the proper type (38)
PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "readyState" with the proper type (39)
PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "title" with the proper type (41)
-FAIL Document interface: document.implementation.createDocument(null, "", null) must inherit property "dir" with the proper type (42) assert_inherits: property "dir" not found in prototype chain
+PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "dir" with the proper type (42)
PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "body" with the proper type (43)
PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "head" with the proper type (44)
PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "images" with the proper type (45)
Modified: trunk/Source/WebCore/ChangeLog (203760 => 203761)
--- trunk/Source/WebCore/ChangeLog 2016-07-27 04:12:11 UTC (rev 203760)
+++ trunk/Source/WebCore/ChangeLog 2016-07-27 04:27:12 UTC (rev 203761)
@@ -1,5 +1,31 @@
2016-07-26 Chris Dumez <cdu...@apple.com>
+ Move 'dir' attribute from HTMLDocument to Document
+ https://bugs.webkit.org/show_bug.cgi?id=160231
+
+ Reviewed by Sam Weinig.
+
+ Move 'dir' attribute from HTMLDocument to Document to match the
+ specification:
+ - https://html.spec.whatwg.org/multipage/dom.html#document
+
+ Both Firefox and Chrome have 'dir' on Document already.
+
+ No new tests, rebaselined existing test.
+
+ * dom/Document.cpp:
+ (WebCore::Document::dir):
+ (WebCore::Document::setDir):
+ * dom/Document.h:
+ * dom/Document.idl:
+ * html/HTMLDocument.cpp:
+ (WebCore::HTMLDocument::dir): Deleted.
+ (WebCore::HTMLDocument::setDir): Deleted.
+ * html/HTMLDocument.h:
+ * html/HTMLDocument.idl:
+
+2016-07-26 Chris Dumez <cdu...@apple.com>
+
Second parameter to History.pushState() / replaceState() should be mandatory
https://bugs.webkit.org/show_bug.cgi?id=160230
Modified: trunk/Source/WebCore/dom/Document.cpp (203760 => 203761)
--- trunk/Source/WebCore/dom/Document.cpp 2016-07-27 04:12:11 UTC (rev 203760)
+++ trunk/Source/WebCore/dom/Document.cpp 2016-07-27 04:27:12 UTC (rev 203761)
@@ -7085,4 +7085,19 @@
m_viewportDependentPictures.remove(&picture);
}
+const AtomicString& Document::dir() const
+{
+ auto* documentElement = this->documentElement();
+ if (!is<HTMLHtmlElement>(documentElement))
+ return nullAtom;
+ return downcast<HTMLHtmlElement>(*documentElement).dir();
+}
+
+void Document::setDir(const AtomicString& value)
+{
+ auto* documentElement = this->documentElement();
+ if (is<HTMLHtmlElement>(documentElement))
+ downcast<HTMLHtmlElement>(*documentElement).setDir(value);
+}
+
} // namespace WebCore
Modified: trunk/Source/WebCore/dom/Document.h (203760 => 203761)
--- trunk/Source/WebCore/dom/Document.h 2016-07-27 04:12:11 UTC (rev 203760)
+++ trunk/Source/WebCore/dom/Document.h 2016-07-27 04:27:12 UTC (rev 203761)
@@ -865,6 +865,9 @@
String title() const { return m_title.string(); }
void setTitle(const String&, ExceptionCode&);
+ const AtomicString& dir() const;
+ void setDir(const AtomicString&);
+
void titleElementAdded(Element& titleElement);
void titleElementRemoved(Element& titleElement);
void titleElementTextChanged(Element& titleElement);
Modified: trunk/Source/WebCore/dom/Document.idl (203760 => 203761)
--- trunk/Source/WebCore/dom/Document.idl 2016-07-27 04:12:11 UTC (rev 203760)
+++ trunk/Source/WebCore/dom/Document.idl 2016-07-27 04:27:12 UTC (rev 203761)
@@ -162,6 +162,7 @@
// Moved down from HTMLDocument
[SetterRaisesException] attribute DOMString title;
+ attribute DOMString dir;
readonly attribute DOMString referrer;
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
Modified: trunk/Source/WebCore/html/HTMLDocument.cpp (203760 => 203761)
--- trunk/Source/WebCore/html/HTMLDocument.cpp 2016-07-27 04:12:11 UTC (rev 203760)
+++ trunk/Source/WebCore/html/HTMLDocument.cpp 2016-07-27 04:27:12 UTC (rev 203761)
@@ -107,21 +107,6 @@
return frameView ? frameView->contentsHeight() : 0;
}
-const AtomicString& HTMLDocument::dir() const
-{
- auto* documentElement = this->documentElement();
- if (!is<HTMLHtmlElement>(documentElement))
- return nullAtom;
- return downcast<HTMLHtmlElement>(*documentElement).dir();
-}
-
-void HTMLDocument::setDir(const AtomicString& value)
-{
- auto* documentElement = this->documentElement();
- if (is<HTMLHtmlElement>(documentElement))
- downcast<HTMLHtmlElement>(*documentElement).setDir(value);
-}
-
String HTMLDocument::designMode() const
{
return inDesignMode() ? ASCIILiteral("on") : ASCIILiteral("off");
Modified: trunk/Source/WebCore/html/HTMLDocument.h (203760 => 203761)
--- trunk/Source/WebCore/html/HTMLDocument.h 2016-07-27 04:12:11 UTC (rev 203760)
+++ trunk/Source/WebCore/html/HTMLDocument.h 2016-07-27 04:27:12 UTC (rev 203761)
@@ -45,9 +45,6 @@
int width();
int height();
- const AtomicString& dir() const;
- void setDir(const AtomicString&);
-
String designMode() const;
void setDesignMode(const String&);
Modified: trunk/Source/WebCore/html/HTMLDocument.idl (203760 => 203761)
--- trunk/Source/WebCore/html/HTMLDocument.idl 2016-07-27 04:12:11 UTC (rev 203760)
+++ trunk/Source/WebCore/html/HTMLDocument.idl 2016-07-27 04:27:12 UTC (rev 203761)
@@ -49,10 +49,9 @@
#if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT
readonly attribute long width;
readonly attribute long height;
+ attribute DOMString dir;
#endif
- attribute DOMString dir;
-
attribute DOMString designMode;
readonly attribute DOMString compatMode;