Title: [249212] trunk
Revision
249212
Author
[email protected]
Date
2019-08-28 12:34:43 -0700 (Wed, 28 Aug 2019)

Log Message

Implement HTMLOrForeignElement
https://bugs.webkit.org/show_bug.cgi?id=201219

Patch by Rob Buis <[email protected]> on 2019-08-28
Reviewed by Ryosuke Niwa.

Source/WebCore:

Add the HTMLOrForeignElement [1] interface to share properties
and methods between HTML, SVG and MathML.

[1] https://github.com/mathml-refresh/mathml/issues/83

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/StaticRange.h:
* html/HTMLElement.idl:
* html/HTMLOrForeignElement.idl: Added.
* svg/SVGElement.idl:

LayoutTests:

Adjust test expectations to new HTMLOrForeignElement interface.

* js/dom/dom-static-property-for-in-iteration-expected.txt:
* platform/mac-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt:
* platform/mac/inspector/model/remote-object-dom-expected.txt:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (249211 => 249212)


--- trunk/LayoutTests/ChangeLog	2019-08-28 19:19:41 UTC (rev 249211)
+++ trunk/LayoutTests/ChangeLog	2019-08-28 19:34:43 UTC (rev 249212)
@@ -1,3 +1,16 @@
+2019-08-28  Rob Buis  <[email protected]>
+
+        Implement HTMLOrForeignElement
+        https://bugs.webkit.org/show_bug.cgi?id=201219
+
+        Reviewed by Ryosuke Niwa.
+
+        Adjust test expectations to new HTMLOrForeignElement interface.
+
+        * js/dom/dom-static-property-for-in-iteration-expected.txt:
+        * platform/mac-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt:
+        * platform/mac/inspector/model/remote-object-dom-expected.txt:
+
 2019-08-28  Chris Dumez  <[email protected]>
 
         geolocation.watchPosition() / getCurrentPosition() should return PERMISSION_DENIED when context is not secure

Modified: trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt (249211 => 249212)


--- trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt	2019-08-28 19:19:41 UTC (rev 249211)
+++ trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt	2019-08-28 19:34:43 UTC (rev 249212)
@@ -35,9 +35,7 @@
 PASS a["lang"] is 
 PASS a["translate"] is true
 PASS a["dir"] is 
-PASS a["dataset"] is [object DOMStringMap]
 PASS a["hidden"] is false
-PASS a["tabIndex"] is 0
 PASS a["accessKey"] is 
 PASS a["draggable"] is true
 PASS a["spellcheck"] is true
@@ -45,7 +43,7 @@
 PASS a["contentEditable"] is inherit
 PASS a["isContentEditable"] is false
 PASS a["offsetParent"] is [object HTMLBodyElement]
-PASS a["offsetTop"] is 714
+PASS a["offsetTop"] is 684
 PASS a["offsetLeft"] is 8
 PASS a["offsetWidth"] is 40
 PASS a["offsetHeight"] is 18
@@ -129,6 +127,8 @@
 PASS a["onpointerout"] is null
 PASS a["onpointerenter"] is null
 PASS a["onpointerleave"] is null
+PASS a["dataset"] is [object DOMStringMap]
+PASS a["tabIndex"] is 0
 PASS a["namespaceURI"] is http://www.w3.org/1999/xhtml
 PASS a["prefix"] is null
 PASS a["localName"] is a

Modified: trunk/LayoutTests/platform/mac/inspector/model/remote-object-dom-expected.txt (249211 => 249212)


--- trunk/LayoutTests/platform/mac/inspector/model/remote-object-dom-expected.txt	2019-08-28 19:19:41 UTC (rev 249211)
+++ trunk/LayoutTests/platform/mac/inspector/model/remote-object-dom-expected.txt	2019-08-28 19:34:43 UTC (rev 249212)
@@ -166,9 +166,9 @@
         "_value": ""
       },
       {
-        "_name": "dataset",
-        "_type": "object",
-        "_value": "DOMStringMap"
+        "_name": "hidden",
+        "_type": "boolean",
+        "_value": "false"
       }
     ],
     "_entries": null

Modified: trunk/LayoutTests/platform/mac-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt (249211 => 249212)


--- trunk/LayoutTests/platform/mac-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt	2019-08-28 19:19:41 UTC (rev 249211)
+++ trunk/LayoutTests/platform/mac-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt	2019-08-28 19:34:43 UTC (rev 249212)
@@ -37,9 +37,7 @@
 PASS a["lang"] is 
 PASS a["translate"] is true
 PASS a["dir"] is 
-PASS a["dataset"] is [object DOMStringMap]
 PASS a["hidden"] is false
-PASS a["tabIndex"] is 0
 PASS a["accessKey"] is 
 PASS a["draggable"] is true
 PASS a["spellcheck"] is true
@@ -47,7 +45,7 @@
 PASS a["contentEditable"] is inherit
 PASS a["isContentEditable"] is false
 PASS a["offsetParent"] is [object HTMLBodyElement]
-PASS a["offsetTop"] is 744
+PASS a["offsetTop"] is 714
 PASS a["offsetLeft"] is 8
 PASS a["offsetWidth"] is 40
 PASS a["offsetHeight"] is 18
@@ -132,6 +130,8 @@
 PASS a["onpointerout"] is null
 PASS a["onpointerenter"] is null
 PASS a["onpointerleave"] is null
+PASS a["dataset"] is [object DOMStringMap]
+PASS a["tabIndex"] is 0
 PASS a["namespaceURI"] is http://www.w3.org/1999/xhtml
 PASS a["prefix"] is null
 PASS a["localName"] is a

Modified: trunk/Source/WebCore/CMakeLists.txt (249211 => 249212)


--- trunk/Source/WebCore/CMakeLists.txt	2019-08-28 19:19:41 UTC (rev 249211)
+++ trunk/Source/WebCore/CMakeLists.txt	2019-08-28 19:34:43 UTC (rev 249212)
@@ -824,6 +824,7 @@
     html/HTMLOptGroupElement.idl
     html/HTMLOptionElement.idl
     html/HTMLOptionsCollection.idl
+    html/HTMLOrForeignElement.idl
     html/HTMLOutputElement.idl
     html/HTMLParagraphElement.idl
     html/HTMLParamElement.idl

Modified: trunk/Source/WebCore/ChangeLog (249211 => 249212)


--- trunk/Source/WebCore/ChangeLog	2019-08-28 19:19:41 UTC (rev 249211)
+++ trunk/Source/WebCore/ChangeLog	2019-08-28 19:34:43 UTC (rev 249212)
@@ -1,3 +1,26 @@
+2019-08-28  Rob Buis  <[email protected]>
+
+        Implement HTMLOrForeignElement
+        https://bugs.webkit.org/show_bug.cgi?id=201219
+
+        Reviewed by Ryosuke Niwa.
+
+        Add the HTMLOrForeignElement [1] interface to share properties
+        and methods between HTML, SVG and MathML.
+
+        [1] https://github.com/mathml-refresh/mathml/issues/83
+
+        * CMakeLists.txt:
+        * DerivedSources-input.xcfilelist:
+        * DerivedSources-output.xcfilelist:
+        * DerivedSources.make:
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/StaticRange.h:
+        * html/HTMLElement.idl:
+        * html/HTMLOrForeignElement.idl: Added.
+        * svg/SVGElement.idl:
+
 2019-08-28  Sam Weinig  <[email protected]>
 
         [WHLSL] Inline typedef'd types during Metal code generation to simplify generated code while also making it easier to read

Modified: trunk/Source/WebCore/DerivedSources-input.xcfilelist (249211 => 249212)


--- trunk/Source/WebCore/DerivedSources-input.xcfilelist	2019-08-28 19:19:41 UTC (rev 249211)
+++ trunk/Source/WebCore/DerivedSources-input.xcfilelist	2019-08-28 19:34:43 UTC (rev 249212)
@@ -712,6 +712,7 @@
 $(PROJECT_DIR)/html/HTMLOptGroupElement.idl
 $(PROJECT_DIR)/html/HTMLOptionElement.idl
 $(PROJECT_DIR)/html/HTMLOptionsCollection.idl
+$(PROJECT_DIR)/html/HTMLOrForeignElement.idl
 $(PROJECT_DIR)/html/HTMLOutputElement.idl
 $(PROJECT_DIR)/html/HTMLParagraphElement.idl
 $(PROJECT_DIR)/html/HTMLParamElement.idl

Modified: trunk/Source/WebCore/DerivedSources-output.xcfilelist (249211 => 249212)


--- trunk/Source/WebCore/DerivedSources-output.xcfilelist	2019-08-28 19:19:41 UTC (rev 249211)
+++ trunk/Source/WebCore/DerivedSources-output.xcfilelist	2019-08-28 19:34:43 UTC (rev 249212)
@@ -775,6 +775,8 @@
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSHTMLMeterElement.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSHTMLModElement.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSHTMLModElement.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSHTMLOrForeignElement.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSHTMLOrForeignElement.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSHTMLOListElement.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSHTMLOListElement.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSHTMLObjectElement.cpp

Modified: trunk/Source/WebCore/DerivedSources.make (249211 => 249212)


--- trunk/Source/WebCore/DerivedSources.make	2019-08-28 19:19:41 UTC (rev 249211)
+++ trunk/Source/WebCore/DerivedSources.make	2019-08-28 19:34:43 UTC (rev 249212)
@@ -716,6 +716,7 @@
     $(WebCore)/html/HTMLOptGroupElement.idl \
     $(WebCore)/html/HTMLOptionElement.idl \
     $(WebCore)/html/HTMLOptionsCollection.idl \
+    $(WebCore)/html/HTMLOrForeignElement.idl \
     $(WebCore)/html/HTMLOutputElement.idl \
     $(WebCore)/html/HTMLParagraphElement.idl \
     $(WebCore)/html/HTMLParamElement.idl \

Modified: trunk/Source/WebCore/Sources.txt (249211 => 249212)


--- trunk/Source/WebCore/Sources.txt	2019-08-28 19:19:41 UTC (rev 249211)
+++ trunk/Source/WebCore/Sources.txt	2019-08-28 19:34:43 UTC (rev 249212)
@@ -2560,8 +2560,8 @@
 UserAgentStyleSheetsData.cpp
 WebCoreJSBuiltinInternals.cpp
 WebCoreJSBuiltins.cpp
+JSHTMLElementWrapperFactory.cpp
 JSSVGElementWrapperFactory.cpp
-JSHTMLElementWrapperFactory.cpp
 
 // IDL bindings
 // FIXME: We should probably move these into ${DerivedSources}/bindings/js/ so they get bundled with the custom bindings.
@@ -2889,6 +2889,7 @@
 JSHTMLMetaElement.cpp
 JSHTMLMeterElement.cpp
 JSHTMLModElement.cpp
+JSHTMLOrForeignElement.cpp
 JSHTMLOListElement.cpp
 JSHTMLObjectElement.cpp
 JSHTMLOptGroupElement.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (249211 => 249212)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2019-08-28 19:19:41 UTC (rev 249211)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2019-08-28 19:34:43 UTC (rev 249212)
@@ -11990,6 +11990,9 @@
 		AAA728F316D1D8BC00D3BBC6 /* AXObjectCacheIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AXObjectCacheIOS.mm; sourceTree = "<group>"; };
 		AAC08CF015F941FC00F1E188 /* AccessibilitySVGRoot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilitySVGRoot.cpp; sourceTree = "<group>"; };
 		AAC08CF115F941FC00F1E188 /* AccessibilitySVGRoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilitySVGRoot.h; sourceTree = "<group>"; };
+		AACC83D62316569E00EB6BF5 /* HTMLOrForeignElement.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = HTMLOrForeignElement.idl; sourceTree = "<group>"; };
+		AACC83D72316576A00EB6BF5 /* JSHTMLOrForeignElement.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSHTMLOrForeignElement.h; sourceTree = "<group>"; };
+		AACC83D82316576B00EB6BF5 /* JSHTMLOrForeignElement.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLOrForeignElement.cpp; sourceTree = "<group>"; };
 		AAE27B7416CBFC0D00623043 /* PlatformSpeechSynthesizerMock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformSpeechSynthesizerMock.cpp; sourceTree = "<group>"; };
 		AAE27B7516CBFC0D00623043 /* PlatformSpeechSynthesizerMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformSpeechSynthesizerMock.h; sourceTree = "<group>"; };
 		AAE3755D17429BCC006200C2 /* PlatformSpeechSynthesizerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformSpeechSynthesizerIOS.mm; sourceTree = "<group>"; };
@@ -21525,6 +21528,7 @@
 				9327A94109968D1A0068A546 /* HTMLOptionsCollection.cpp */,
 				A81369BE097374F500D74463 /* HTMLOptionsCollection.h */,
 				85DF2F920AA3C9B600AD64C5 /* HTMLOptionsCollection.idl */,
+				AACC83D62316569E00EB6BF5 /* HTMLOrForeignElement.idl */,
 				4AD01005127E642A0015035F /* HTMLOutputElement.cpp */,
 				4AD01006127E642A0015035F /* HTMLOutputElement.h */,
 				4AD01007127E642A0015035F /* HTMLOutputElement.idl */,
@@ -22795,6 +22799,8 @@
 				A80E7E8F0A1A83E3007FB8C5 /* JSHTMLOptionElement.h */,
 				448A29BE0A46D9CB0030759F /* JSHTMLOptionsCollection.cpp */,
 				448A29BD0A46D9CB0030759F /* JSHTMLOptionsCollection.h */,
+				AACC83D82316576B00EB6BF5 /* JSHTMLOrForeignElement.cpp */,
+				AACC83D72316576A00EB6BF5 /* JSHTMLOrForeignElement.h */,
 				4AD0173A127E82860015035F /* JSHTMLOutputElement.cpp */,
 				4AD0173B127E82860015035F /* JSHTMLOutputElement.h */,
 				1AE2AB9E0A1CE90500B42B25 /* JSHTMLParagraphElement.cpp */,

Modified: trunk/Source/WebCore/dom/StaticRange.h (249211 => 249212)


--- trunk/Source/WebCore/dom/StaticRange.h	2019-08-28 19:19:41 UTC (rev 249211)
+++ trunk/Source/WebCore/dom/StaticRange.h	2019-08-28 19:34:43 UTC (rev 249212)
@@ -25,6 +25,7 @@
 
 #pragma once
 
+#include "ExceptionOr.h"
 #include <wtf/Ref.h>
 #include <wtf/RefCounted.h>
 

Modified: trunk/Source/WebCore/html/HTMLElement.idl (249211 => 249212)


--- trunk/Source/WebCore/html/HTMLElement.idl	2019-08-28 19:19:41 UTC (rev 249211)
+++ trunk/Source/WebCore/html/HTMLElement.idl	2019-08-28 19:34:43 UTC (rev 249212)
@@ -29,14 +29,10 @@
     [CEReactions, Reflect] attribute DOMString lang;
     [CEReactions] attribute boolean translate;
     [CEReactions] attribute DOMString dir;
-    readonly attribute DOMStringMap dataset; // FIXME: Should be [SameObject].
 
     // User interaction.
     [CEReactions, Reflect] attribute boolean hidden;
     void click();
-    [CEReactions, ImplementedAs=tabIndexForBindings] attribute long tabIndex;
-    void focus();
-    void blur();
     [CEReactions, Reflect] attribute DOMString accessKey;
     // readonly attribute DOMString accessKeyLabel; // FIXME: Not supported.
     [CEReactions] attribute boolean draggable;
@@ -73,3 +69,4 @@
 
 HTMLElement implements ElementCSSInlineStyle;
 HTMLElement implements GlobalEventHandlers;
+HTMLElement implements HTMLOrForeignElement;

Added: trunk/Source/WebCore/html/HTMLOrForeignElement.idl (0 => 249212)


--- trunk/Source/WebCore/html/HTMLOrForeignElement.idl	                        (rev 0)
+++ trunk/Source/WebCore/html/HTMLOrForeignElement.idl	2019-08-28 19:34:43 UTC (rev 249212)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2019 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// https://html.spec.whatwg.org/multipage/dom.html#htmlorsvgelement
+// https://github.com/whatwg/html/issues/4702
+[
+    NoInterfaceObject,
+] interface HTMLOrForeignElement {
+    readonly attribute DOMStringMap dataset; // FIXME: Should be [SameObject].
+    [CEReactions, ImplementedAs=tabIndexForBindings] attribute long tabIndex;
+    void focus();
+    void blur();
+};

Modified: trunk/Source/WebCore/svg/SVGElement.idl (249211 => 249212)


--- trunk/Source/WebCore/svg/SVGElement.idl	2019-08-28 19:19:41 UTC (rev 249211)
+++ trunk/Source/WebCore/svg/SVGElement.idl	2019-08-28 19:34:43 UTC (rev 249212)
@@ -31,17 +31,11 @@
 
     readonly attribute SVGAnimatedString className;
 
-    [CEReactions=NotNeeded, ImplementedAs=tabIndexForBindings] attribute long tabIndex;
-
     // FIXME: Using "undefined" as default parameter value is wrong.
     // This method is deprecated, and we'd like to remove it someday.
     DeprecatedCSSOMValue getPresentationAttribute(optional DOMString name = "undefined");
-
-    void focus();
-    void blur();
-
-    readonly attribute DOMStringMap dataset;
 };
 
 SVGElement implements ElementCSSInlineStyle;
 SVGElement implements GlobalEventHandlers;
+SVGElement implements HTMLOrForeignElement;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to