Skip to content

Commit

Permalink
Bug 1935687 [wpt PR 49568] - Expose attributionsrc support on <area> …
Browse files Browse the repository at this point in the history
…through IDL, a=testonly

Automatic update from web-platform-tests
Expose attributionsrc support on <area> through IDL

This was already unintentionally supported due to the handling of the
attributionsrc attribute on HTMLAnchorBaseElement, and is reasonable to
support anyway, as <area> is a first-class navigation surface, just like
the already supported <a> and window.open.

WICG/attribution-reporting-api#1465

I2S: https://groups.google.com/a/chromium.org/d/msgid/blink-dev/673f72a6.2b0a0220.3bb1d2.02f2.GAE%40google.com

Bug: 369219144, 379275911
Change-Id: I7230229de087c752af7a5be2f7663fff999d66e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6022268
Reviewed-by: Nate Chapin <japhetchromium.org>
Reviewed-by: Domenic Denicola <domenicchromium.org>
Commit-Queue: Andrew Paseltiner <apaseltinerchromium.org>
Reviewed-by: John Delaney <johnidelchromium.org>
Cr-Commit-Position: refs/heads/main{#1392912}

--

wpt-commits: 9535d4d010f2b40dc7f406d2c0ca53b8bda84e2c
wpt-pr: 49568

UltraBlame original commit: a14e525cf3faf4ce08f70c3a8210d6ac8ff17a67
  • Loading branch information
marco-c committed Dec 13, 2024
1 parent b473273 commit 1131817
Show file tree
Hide file tree
Showing 2 changed files with 225 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,28 @@
?
method
=
area
&
expected
-
eligible
=
navigation
-
source
"
>
<
meta
name
=
variant
content
=
"
?
method
=
img
&
expected
Expand Down
241 changes: 203 additions & 38 deletions testing/web-platform/tests/attribution-reporting/resources/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,96 @@ true
)
;
}
function
prepareAnchorOrArea
(
tag
referrerPolicy
eligible
url
)
{
const
el
=
document
.
createElement
(
tag
)
;
el
.
referrerPolicy
=
referrerPolicy
;
el
.
target
=
'
_blank
'
;
el
.
textContent
=
'
link
'
;
if
(
eligible
=
=
=
null
)
{
el
.
attributionSrc
=
url
;
el
.
href
=
blankURL
(
)
;
}
else
{
el
.
attributionSrc
=
'
'
;
el
.
href
=
url
;
}
return
el
;
}
let
nextMapId
=
0
;
/
*
*
Expand Down Expand Up @@ -1200,6 +1290,7 @@ case
img
'
:
{
const
img
=
Expand Down Expand Up @@ -1255,6 +1346,7 @@ return
event
'
;
}
case
'
script
Expand Down Expand Up @@ -1332,98 +1424,171 @@ a
const
a
=
document
.
createElement
prepareAnchorOrArea
(
'
a
'
referrerPolicy
eligible
url
)
;
a
document
.
referrerPolicy
=
referrerPolicy
;
body
.
appendChild
(
a
)
;
test_driver
.
target
=
click
(
a
)
;
return
'
_blank
navigation
'
;
a
.
textContent
=
case
'
link
area
'
;
if
:
{
const
area
=
prepareAnchorOrArea
(
'
area
'
referrerPolicy
eligible
url
)
;
const
size
=
100
;
area
.
coords
=
=
null
)
0
0
{
a
size
}
{
size
}
;
area
.
attributionSrc
shape
=
url
'
rect
'
;
a
.
href
const
map
=
blankURL
document
.
createElement
(
'
map
'
)
;
}
else
map
.
name
=
map
-
{
a
nextMapId
+
+
}
;
map
.
attributionSrc
append
(
area
)
;
const
img
=
document
.
createElement
(
'
img
'
)
;
a
img
.
href
width
=
url
size
;
img
.
height
=
size
;
img
.
useMap
=
#
{
map
.
name
}
;
document
.
body
.
appendChild
append
(
a
map
img
)
;
test_driver
.
click
(
a
area
)
;
return
'
navigation
'
;
}
case
'
open
Expand Down

0 comments on commit 1131817

Please sign in to comment.