diff --git a/components/script/dom/htmlanchorelement.rs b/components/script/dom/htmlanchorelement.rs index 37daa0ef6e0a..95d03872ac54 100644 --- a/components/script/dom/htmlanchorelement.rs +++ b/components/script/dom/htmlanchorelement.rs @@ -139,6 +139,12 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { // https://html.spec.whatwg.org/multipage/#dom-a-shape make_setter!(SetShape, "shape"); + // https://html.spec.whatwg.org/multipage/#attr-hyperlink-target + make_getter!(Target, "target"); + + // https://html.spec.whatwg.org/multipage/#attr-hyperlink-target + make_setter!(SetTarget, "target"); + // https://html.spec.whatwg.org/multipage/#dom-hyperlink-hash fn Hash(&self) -> USVString { // Step 1. diff --git a/components/script/dom/webidls/HTMLAnchorElement.webidl b/components/script/dom/webidls/HTMLAnchorElement.webidl index daf739ac0b56..ddfc155cc1fc 100644 --- a/components/script/dom/webidls/HTMLAnchorElement.webidl +++ b/components/script/dom/webidls/HTMLAnchorElement.webidl @@ -12,7 +12,7 @@ // https://html.spec.whatwg.org/multipage/#htmlanchorelement interface HTMLAnchorElement : HTMLElement { - // attribute DOMString target; + attribute DOMString target; // attribute DOMString download; //[PutForwards=value] attribute DOMSettableTokenList ping; // attribute DOMString rel; diff --git a/tests/wpt/metadata/html/dom/interfaces.html.ini b/tests/wpt/metadata/html/dom/interfaces.html.ini index 83d3c5a9cb3c..d9a8f51e1a30 100644 --- a/tests/wpt/metadata/html/dom/interfaces.html.ini +++ b/tests/wpt/metadata/html/dom/interfaces.html.ini @@ -1602,9 +1602,6 @@ [HTMLDListElement interface: attribute compact] expected: FAIL - [HTMLAnchorElement interface: attribute target] - expected: FAIL - [HTMLAnchorElement interface: attribute download] expected: FAIL @@ -1623,9 +1620,6 @@ [HTMLAnchorElement interface: attribute charset] expected: FAIL - [HTMLAnchorElement interface: document.createElement("a") must inherit property "target" with the proper type (0)] - expected: FAIL - [HTMLAnchorElement interface: document.createElement("a") must inherit property "download" with the proper type (1)] expected: FAIL diff --git a/tests/wpt/metadata/html/dom/reflection-text.html.ini b/tests/wpt/metadata/html/dom/reflection-text.html.ini index b74e8b961586..7d13d5b78d51 100644 --- a/tests/wpt/metadata/html/dom/reflection-text.html.ini +++ b/tests/wpt/metadata/html/dom/reflection-text.html.ini @@ -444,135 +444,6 @@ [a.tabIndex: IDL set to -2147483648 followed by getAttribute()] expected: FAIL - [a.target: typeof IDL attribute] - expected: FAIL - - [a.target: IDL get with DOM attribute unset] - expected: FAIL - - [a.target: setAttribute() to "" followed by IDL get] - expected: FAIL - - [a.target: setAttribute() to " \\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07 \\b\\t\\n\\v\\f\\r\\x0e\\x0f \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17 \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f foo " followed by IDL get] - expected: FAIL - - [a.target: setAttribute() to undefined followed by IDL get] - expected: FAIL - - [a.target: setAttribute() to 7 followed by IDL get] - expected: FAIL - - [a.target: setAttribute() to 1.5 followed by IDL get] - expected: FAIL - - [a.target: setAttribute() to true followed by IDL get] - expected: FAIL - - [a.target: setAttribute() to false followed by IDL get] - expected: FAIL - - [a.target: setAttribute() to object "[object Object\]" followed by IDL get] - expected: FAIL - - [a.target: setAttribute() to NaN followed by IDL get] - expected: FAIL - - [a.target: setAttribute() to Infinity followed by IDL get] - expected: FAIL - - [a.target: setAttribute() to -Infinity followed by IDL get] - expected: FAIL - - [a.target: setAttribute() to "\\0" followed by IDL get] - expected: FAIL - - [a.target: setAttribute() to null followed by IDL get] - expected: FAIL - - [a.target: setAttribute() to object "test-toString" followed by IDL get] - expected: FAIL - - [a.target: setAttribute() to object "test-valueOf" followed by IDL get] - expected: FAIL - - [a.target: IDL set to "" followed by getAttribute()] - expected: FAIL - - [a.target: IDL set to " \\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07 \\b\\t\\n\\v\\f\\r\\x0e\\x0f \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17 \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f foo " followed by getAttribute()] - expected: FAIL - - [a.target: IDL set to undefined followed by getAttribute()] - expected: FAIL - - [a.target: IDL set to undefined followed by IDL get] - expected: FAIL - - [a.target: IDL set to 7 followed by getAttribute()] - expected: FAIL - - [a.target: IDL set to 7 followed by IDL get] - expected: FAIL - - [a.target: IDL set to 1.5 followed by getAttribute()] - expected: FAIL - - [a.target: IDL set to 1.5 followed by IDL get] - expected: FAIL - - [a.target: IDL set to true followed by getAttribute()] - expected: FAIL - - [a.target: IDL set to true followed by IDL get] - expected: FAIL - - [a.target: IDL set to false followed by getAttribute()] - expected: FAIL - - [a.target: IDL set to false followed by IDL get] - expected: FAIL - - [a.target: IDL set to object "[object Object\]" followed by getAttribute()] - expected: FAIL - - [a.target: IDL set to object "[object Object\]" followed by IDL get] - expected: FAIL - - [a.target: IDL set to NaN followed by getAttribute()] - expected: FAIL - - [a.target: IDL set to NaN followed by IDL get] - expected: FAIL - - [a.target: IDL set to Infinity followed by getAttribute()] - expected: FAIL - - [a.target: IDL set to Infinity followed by IDL get] - expected: FAIL - - [a.target: IDL set to -Infinity followed by getAttribute()] - expected: FAIL - - [a.target: IDL set to -Infinity followed by IDL get] - expected: FAIL - - [a.target: IDL set to "\\0" followed by getAttribute()] - expected: FAIL - - [a.target: IDL set to null followed by getAttribute()] - expected: FAIL - - [a.target: IDL set to null followed by IDL get] - expected: FAIL - - [a.target: IDL set to object "test-toString" followed by getAttribute()] - expected: FAIL - - [a.target: IDL set to object "test-toString" followed by IDL get] - expected: FAIL - - [a.target: IDL set to object "test-valueOf" followed by IDL get] - expected: FAIL - [a.download: typeof IDL attribute] expected: FAIL