Skip to content

Commit 5235256

Browse files
committed
[cssom-view] Bail if document is not the active document. Fixes https://www.w3.org/Bugs/Public/show_bug.cgi?id=28488
1 parent 9e3b8ac commit 5235256

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

cssom-view/Overview.bs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,6 +1071,7 @@ The <dfn method for=Element lt="scroll(options)|scroll(x, y)">scroll()</dfn> met
10711071
1. Let the {{ScrollToOptions/left}} dictionary member of <var>options</var> have the value <var>x</var>.
10721072
1. Let the {{ScrollToOptions/top}} dictionary member of <var>options</var> have the value <var>y</var>.
10731073
1. Let <var>document</var> be the element's <a>node document</a>.
1074+
1. If <var>document</var> is not the <a>active document</a>, terminate these steps.
10741075
1. Let <var>window</var> be the value of <var>document</var>'s {{Document/defaultView}} attribute.
10751076
1. If <var>window</var> is null, terminate these steps.
10761077
1. If the element is the root element and <var>document</var> is in <a>quirks mode</a>, terminate these steps.
@@ -1110,6 +1111,7 @@ user agent must run these steps:
11101111
The <dfn attribute for=Element>scrollTop</dfn> attribute, on getting, must return the result of running these steps:
11111112

11121113
1. Let <var>document</var> be the element's <a>node document</a>.
1114+
1. If <var>document</var> is not the <a>active document</a>, return zero and terminate these steps.
11131115
1. Let <var>window</var> be the value of <var>document</var>'s {{Document/defaultView}} attribute.
11141116
1. If <var>window</var> is null, return zero and terminate these steps.
11151117
1. If the element is the root element and <var>document</var> is in <a>quirks mode</a>, return zero and terminate these steps.
@@ -1123,6 +1125,7 @@ When setting the {{Element/scrollTop}} attribute these steps must be run:
11231125
1. Let <var>y</var> be the given value.
11241126
1. <a>Normalize non-finite values</a> for <var>y</var>.
11251127
1. Let <var>document</var> be the element's <a>node document</a>.
1128+
1. If <var>document</var> is not the <a>active document</a>, terminate these steps.
11261129
1. Let <var>window</var> be the value of <var>document</var>'s {{Document/defaultView}} attribute.
11271130
1. If <var>window</var> is null, terminate these steps.
11281131
1. If the element is the root element and <var>document</var> is in <a>quirks mode</a>, terminate these steps.
@@ -1134,6 +1137,7 @@ When setting the {{Element/scrollTop}} attribute these steps must be run:
11341137
The <dfn attribute for=Element>scrollLeft</dfn> attribute, on getting, must return the result of running these steps:
11351138

11361139
1. Let <var>document</var> be the element's <a>node document</a>.
1140+
1. If <var>document</var> is not the <a>active document</a>, return zero and terminate these steps.
11371141
1. Let <var>window</var> be the value of <var>document</var>'s {{Document/defaultView}} attribute.
11381142
1. If <var>window</var> is null, return zero and terminate these steps.
11391143
1. If the element is the root element and <var>document</var> is in <a>quirks mode</a>, return zero and terminate these steps.
@@ -1147,6 +1151,7 @@ When setting the {{Element/scrollLeft}} attribute these steps must be run:
11471151
1. Let <var>x</var> be the given value.
11481152
1. <a>Normalize non-finite values</a> for <var>x</var>.
11491153
1. Let <var>document</var> be the element's <a>node document</a>.
1154+
1. If <var>document</var> is not the <a>active document</a>, terminate these steps.
11501155
1. Let <var>window</var> be the value of <var>document</var>'s {{Document/defaultView}} attribute.
11511156
1. If <var>window</var> is null, terminate these steps.
11521157
1. If the element is the root element and <var>document</var> is in <a>quirks mode</a>, terminate these steps.
@@ -1158,6 +1163,7 @@ When setting the {{Element/scrollLeft}} attribute these steps must be run:
11581163
The <dfn attribute for=Element>scrollWidth</dfn> attribute must return the result of running these steps:
11591164

11601165
1. Let <var>document</var> be the element's <a>node document</a>.
1166+
1. If <var>document</var> is not the <a>active document</a>, return zero and terminate these steps.
11611167
1. Let <var>viewport width</var> be the width of the <a>viewport</a> excluding the width of the scroll bar, if any, or zero if there is no <a>viewport</a>.
11621168
1. If the element is the root element and <var>document</var> is not in <a>quirks mode</a> return max(<a>viewport</a> <a>scrolling area</a> width, <var>viewport width</var>).
11631169
1. If the element is <a>the HTML <code>body</code> element</a>, <var>document</var> is in <a>quirks mode</a> and the element is not <a>potentially scrollable</a>, return max(<a>viewport</a> <a>scrolling area</a> width, <var>viewport width</var>).
@@ -1167,6 +1173,7 @@ The <dfn attribute for=Element>scrollWidth</dfn> attribute must return the resul
11671173
The <dfn attribute for=Element>scrollHeight</dfn> attribute must return the result of running these steps:
11681174

11691175
1. Let <var>document</var> be the element's <a>node document</a>.
1176+
1. If <var>document</var> is not the <a>active document</a>, return zero and terminate these steps.
11701177
1. Let <var>viewport height</var> be the height of the <a>viewport</a> excluding the height of the scroll bar, if any, or zero if there is no <a>viewport</a>.
11711178
1. If the element is the root element and <var>document</var> is not in <a>quirks mode</a> return max(<a>viewport</a> <a>scrolling area</a> height, <var>viewport height</var>).
11721179
1. If the element is <a>the HTML <code>body</code> element</a>, <var>document</var> is in <a>quirks mode</a> and the element is not <a>potentially scrollable</a>, return max(<a>viewport</a> <a>scrolling area</a> height, <var>viewport height</var>).

0 commit comments

Comments
 (0)