From 0d3bb7ac83badb52d69b268996cc58974f7fa290 Mon Sep 17 00:00:00 2001 From: "cdumez@apple.com" Date: Wed, 9 Mar 2016 20:55:28 +0000 Subject: [PATCH] focus() / blur() should be on HTMLElement / SVGElement, not Element https://bugs.webkit.org/show_bug.cgi?id=155216 Reviewed by Darin Adler. LayoutTests/imported/w3c: Rebaseline now that more checks are passing. * web-platform-tests/html/dom/interfaces-expected.txt: Source/WebCore: focus() / blur() should be on HTMLElement / SVGElement, not Element: - https://html.spec.whatwg.org/multipage/dom.html#htmlelement - https://www.w3.org/TR/SVG2/types.html#InterfaceSVGElement Chrome and Firefox match the specification. Note that after this change, focus() / blur() is no longer exposed on MathMLElement. This matches the MathML specification and is consistent with Firefox and Chrome. * dom/Element.idl: * html/HTMLElement.idl: * svg/SVGElement.idl: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197875 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/imported/w3c/ChangeLog | 11 +++++++++++ .../html/dom/interfaces-expected.txt | 4 ++-- .../html/dom/interfaces-expected.txt | 4 ++-- Source/WebCore/ChangeLog | 21 +++++++++++++++++++++ Source/WebCore/dom/Element.idl | 5 ++++- Source/WebCore/html/HTMLElement.idl | 5 +++++ Source/WebCore/svg/SVGElement.idl | 5 +++++ 7 files changed, 50 insertions(+), 5 deletions(-) diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog index efe858f..ede0e19 100644 --- a/LayoutTests/imported/w3c/ChangeLog +++ b/LayoutTests/imported/w3c/ChangeLog @@ -1,5 +1,16 @@ 2016-03-09 Chris Dumez + focus() / blur() should be on HTMLElement / SVGElement, not Element + https://bugs.webkit.org/show_bug.cgi?id=155216 + + Reviewed by Darin Adler. + + Rebaseline now that more checks are passing. + + * web-platform-tests/html/dom/interfaces-expected.txt: + +2016-03-09 Chris Dumez + Move attributes to the instance for most interfaces that have "Error" in their name https://bugs.webkit.org/show_bug.cgi?id=155231 diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt index 3d91b48..5ce7958 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt @@ -869,8 +869,8 @@ FAIL HTMLElement interface: attribute itemValue assert_true: The prototype objec PASS HTMLElement interface: attribute hidden PASS HTMLElement interface: operation click() PASS HTMLElement interface: attribute tabIndex -FAIL HTMLElement interface: operation focus() assert_own_property: interface prototype object missing non-static operation expected property "focus" missing -FAIL HTMLElement interface: operation blur() assert_own_property: interface prototype object missing non-static operation expected property "blur" missing +PASS HTMLElement interface: operation focus() +PASS HTMLElement interface: operation blur() PASS HTMLElement interface: attribute accessKey FAIL HTMLElement interface: attribute accessKeyLabel assert_true: The prototype object must have a property "accessKeyLabel" expected true got false PASS HTMLElement interface: attribute draggable diff --git a/LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt b/LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt index 2adfadf..ecd202f 100644 --- a/LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt +++ b/LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt @@ -869,8 +869,8 @@ FAIL HTMLElement interface: attribute itemValue assert_true: The prototype objec PASS HTMLElement interface: attribute hidden PASS HTMLElement interface: operation click() PASS HTMLElement interface: attribute tabIndex -FAIL HTMLElement interface: operation focus() assert_own_property: interface prototype object missing non-static operation expected property "focus" missing -FAIL HTMLElement interface: operation blur() assert_own_property: interface prototype object missing non-static operation expected property "blur" missing +PASS HTMLElement interface: operation focus() +PASS HTMLElement interface: operation blur() PASS HTMLElement interface: attribute accessKey FAIL HTMLElement interface: attribute accessKeyLabel assert_true: The prototype object must have a property "accessKeyLabel" expected true got false PASS HTMLElement interface: attribute draggable diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index fc2504a..08edff0 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,5 +1,26 @@ 2016-03-09 Chris Dumez + focus() / blur() should be on HTMLElement / SVGElement, not Element + https://bugs.webkit.org/show_bug.cgi?id=155216 + + Reviewed by Darin Adler. + + focus() / blur() should be on HTMLElement / SVGElement, not Element: + - https://html.spec.whatwg.org/multipage/dom.html#htmlelement + - https://www.w3.org/TR/SVG2/types.html#InterfaceSVGElement + + Chrome and Firefox match the specification. + + Note that after this change, focus() / blur() is no longer exposed + on MathMLElement. This matches the MathML specification and is + consistent with Firefox and Chrome. + + * dom/Element.idl: + * html/HTMLElement.idl: + * svg/SVGElement.idl: + +2016-03-09 Chris Dumez + Move attributes to the instance for most interfaces that have "Error" in their name https://bugs.webkit.org/show_bug.cgi?id=155231 diff --git a/Source/WebCore/dom/Element.idl b/Source/WebCore/dom/Element.idl index 99ce3da..8a63900 100644 --- a/Source/WebCore/dom/Element.idl +++ b/Source/WebCore/dom/Element.idl @@ -105,8 +105,11 @@ [ImplementedAs=bindingsOffsetParent] readonly attribute Element offsetParent; +#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C || defined(LANGUAGE_GOBJECT) && LANGUAGE_GOBJECT void focus(); void blur(); +#endif + void scrollIntoView(optional boolean alignWithTop); // WebKit extensions @@ -123,7 +126,7 @@ #endif [TreatNullAs=EmptyString, SetterRaisesException] attribute DOMString innerHTML; [TreatNullAs=EmptyString, SetterRaisesException] attribute DOMString outerHTML; - + [Reflect=class] attribute DOMString className; [PutForwards=value] readonly attribute DOMTokenList classList; diff --git a/Source/WebCore/html/HTMLElement.idl b/Source/WebCore/html/HTMLElement.idl index 62d0caa..fa374c7 100644 --- a/Source/WebCore/html/HTMLElement.idl +++ b/Source/WebCore/html/HTMLElement.idl @@ -69,5 +69,10 @@ #endif void click(); + +#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT + void focus(); + void blur(); +#endif }; diff --git a/Source/WebCore/svg/SVGElement.idl b/Source/WebCore/svg/SVGElement.idl index ca8df37..2546746 100644 --- a/Source/WebCore/svg/SVGElement.idl +++ b/Source/WebCore/svg/SVGElement.idl @@ -39,5 +39,10 @@ attribute long tabIndex; CSSValue getPresentationAttribute([Default=Undefined] optional DOMString name); + +#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT + void focus(); + void blur(); +#endif }; -- 1.8.3.1