You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Elements and <a>viewports</a> have an associated <dfn>scrolling box</dfn> if has a scrolling mechanism<!--XXX xref--> or it overflows
116
118
its content area<!--XXX xref--> and the used value of the 'overflow-x' or 'overflow-y' property is ''overflow/hidden''. [[!CSS3-BOX]]
117
119
120
+
An element is <dfn>potentially scrollable</dfn> if all of the following conditions are true:
121
+
122
+
* The element has an associated <a>CSS layout box</a>.
123
+
* The element is not <a>the HTML <code>body</code> element</a>, or it is and
124
+
the root element's used value of the 'overflow-x' or 'overflow-y' properties is not ''overflow/visible''.
125
+
* The element's used value of the 'overflow-x' or 'overflow-y' properties is not ''overflow/visible''.
126
+
127
+
Note: An element that is <a>potentially scrollable</a> might not have a <a>scrolling box</a>.
128
+
For instance, it could have 'overflow' set to ''overflow/auto'' but not have its content overflowing its content area.
129
+
118
130
A <a>scrolling box</a> of a <a>viewport</a> or element has two <dfn>overflow directions</dfn>, depending on the <a>viewport’s</a> or
119
131
element's <a>block flow direction</a> and <a>inline base direction</a>, as follows:
120
132
@@ -922,7 +934,7 @@ revision of CSS or HTML.
922
934
<p class=atrisk>The <dfn attribute for=Document>scrollingElement</dfn> attribute, on getting, must run these steps:
923
935
924
936
1. If the {{Document}} is in <a>quirks mode</a>, follow these substeps:
925
-
1. If <a>the HTML <code>body</code> element</a> exists, and it does not have an associated <a>scrolling box</a>, return <a>the HTML <code>body</code> element</a> and abort these steps.
937
+
1. If <a>the HTML <code>body</code> element</a> exists, and it is not <a>potentially scrollable</a>, return <a>the HTML <code>body</code> element</a> and abort these steps.
926
938
1. Return null and abort these steps.
927
939
1. If there is a root element, return the root element and abort these steps.
928
940
1. Return null.
@@ -1062,7 +1074,7 @@ The <dfn method for=Element lt="scroll(options)|scroll(x, y)">scroll()</dfn> met
1062
1074
and terminate these steps.
1063
1075
1. If the element is <a>the HTML <code>body</code> element</a>,
1064
1076
the {{Document}} is in <a>quirks mode</a>,
1065
-
and the element does not have an associated <a>scrolling box</a>,
1077
+
and the element is not <a>potentially scrollable</a>,
1066
1078
invoke {{Window/scroll()}} with <var>options</var> as the only argument,
1067
1079
and terminate these steps.
1068
1080
1. If the element does not have any associated <a>CSS layout box</a>,
@@ -1095,7 +1107,7 @@ The <dfn attribute for=Element>scrollTop</dfn> attribute, on getting, must retur
1095
1107
1096
1108
1. If the element is the root element and the {{Document}} is in <a>quirks mode</a>, return zero and terminate these steps.
1097
1109
1. If the element is the root element return the value of {{Window/scrollY}}.
1098
-
1. If the element is <a>the HTML <code>body</code> element</a>, the {{Document}} is in <a>quirks mode</a>, and the element does not have an associated <a>scrolling box</a>, return the value of {{Window/scrollY}}.
1110
+
1. If the element is <a>the HTML <code>body</code> element</a>, the {{Document}} is in <a>quirks mode</a>, and the element is not <a>potentially scrollable</a>, return the value of {{Window/scrollY}}.
1099
1111
1. If the element does not have any associated <a>CSS layout box</a>, return zero and terminate these steps.
1100
1112
1. Return the y-coordinate of the <a>scrolling area</a> at the alignment point with the top of the <a>padding edge</a> of the element.
1101
1113
@@ -1105,15 +1117,15 @@ When setting the {{Element/scrollTop}} attribute these steps must be run:
1105
1117
1. <a>Normalize non-finite values</a> for <var>y</var>.
1106
1118
1. If the element is the root element and the {{Document}} is in <a>quirks mode</a>, terminate these steps.
1107
1119
1. If the element is the root element invoke {{Window/scroll()}} with {{Window/scrollX}} as first argument and <var>y</var> as second argument, and terminate these steps.
1108
-
1. If the element is <a>the HTML <code>body</code> element</a>, the {{Document}} is in <a>quirks mode</a>, and the element does not have an associated <a>scrolling box</a>, invoke {{Window/scroll()}} with {{Window/scrollX}} as first argument and <var>y</var> as second argument, and terminate these steps.
1120
+
1. If the element is <a>the HTML <code>body</code> element</a>, the {{Document}} is in <a>quirks mode</a>, and the element is not <a>potentially scrollable</a>, invoke {{Window/scroll()}} with {{Window/scrollX}} as first argument and <var>y</var> as second argument, and terminate these steps.
1109
1121
1. If the element does not have any associated <a>CSS layout box</a>, the element has no associated <a>scrolling box</a>, or the element has no overflow, terminate these steps.
1110
1122
1. <a lt='scroll an element'>Scroll the element</a> to {{Element/scrollLeft}},<var>y</var>, with the scroll behavior being <code>"auto"</code>.
1111
1123
1112
1124
The <dfn attribute for=Element>scrollLeft</dfn> attribute, on getting, must return the result of running these steps:
1113
1125
1114
1126
1. If the element is the root element and the {{Document}} is in <a>quirks mode</a>, return zero and terminate these steps.
1115
1127
1. If the element is the root element return the value of {{Window/scrollX}}.
1116
-
1. If the element is <a>the HTML <code>body</code> element</a>, the {{Document}} is in <a>quirks mode</a>, and the element does not have an associated <a>scrolling box</a>, return the value of {{Window/scrollX}}.
1128
+
1. If the element is <a>the HTML <code>body</code> element</a>, the {{Document}} is in <a>quirks mode</a>, and the element is not <a>potentially scrollable</a>, return the value of {{Window/scrollX}}.
1117
1129
1. If the element does not have any associated <a>CSS layout box</a>, return zero and terminate these steps.
1118
1130
1. Return the x-coordinate of the <a>scrolling area</a> at the alignment point with the left of the <a>padding edge</a> of the element.
1119
1131
@@ -1123,23 +1135,23 @@ When setting the {{Element/scrollLeft}} attribute these steps must be run:
1123
1135
1. <a>Normalize non-finite values</a> for <var>x</var>.
1124
1136
1. If the element is the root element and the {{Document}} is in <a>quirks mode</a>, terminate these steps.
1125
1137
1. If the element is the root element invoke {{Window/scroll()}} with <var>x</var> as first argument and {{Window/scrollY}} as second argument, and terminate these steps.
1126
-
1. If the element is <a>the HTML <code>body</code> element</a>, the {{Document}} is in <a>quirks mode</a>, and the element does not have an associated <a>scrolling box</a>, invoke {{Window/scroll()}} with <var>x</var> as first argument and {{Window/scrollY}} as second argument, and terminate these steps.
1138
+
1. If the element is <a>the HTML <code>body</code> element</a>, the {{Document}} is in <a>quirks mode</a>, and the element is not <a>potentially scrollable</a>, invoke {{Window/scroll()}} with <var>x</var> as first argument and {{Window/scrollY}} as second argument, and terminate these steps.
1127
1139
1. If the element does not have any associated <a>CSS layout box</a>, the element has no associated <a>scrolling box</a>, or the element has no overflow, terminate these steps.
1128
1140
1. <a lt='scroll an element'>Scroll the element</a> to <var>x</var>,{{Element/scrollTop}}, with the scroll behavior being <code>"auto"</code>.
1129
1141
1130
1142
The <dfn attribute for=Element>scrollWidth</dfn> attribute must return the result of running these steps:
1131
1143
1132
1144
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>.
1133
1145
1. If the element is the root element and the {{Document}} is not in <a>quirks mode</a> return max(<a>viewport</a><a>scrolling area</a> width, <var>viewport width</var>).
1134
-
1. If the element is <a>the HTML <code>body</code> element</a>, the {{Document}} is in <a>quirks mode</a> and the element has no associated <a>scrolling box</a>, return max(<a>viewport</a><a>scrolling area</a> width, <var>viewport width</var>).
1146
+
1. If the element is <a>the HTML <code>body</code> element</a>, the {{Document}} 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>).
1135
1147
1. If the element does not have any associated <a>CSS layout box</a> return zero and terminate these steps.
1136
1148
1. Return the width of the element's <a>scrolling area</a>.
1137
1149
1138
1150
The <dfn attribute for=Element>scrollHeight</dfn> attribute must return the result of running these steps:
1139
1151
1140
1152
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>.
1141
1153
1. If the element is the root element and the {{Document}} is not in <a>quirks mode</a> return max(<a>viewport</a><a>scrolling area</a> height, <var>viewport height</var>).
1142
-
1. If the element is <a>the HTML <code>body</code> element</a>, the {{Document}} is in <a>quirks mode</a> and the element has no associated <a>scrolling box</a>, return max(<a>viewport</a><a>scrolling area</a> height, <var>viewport height</var>).
1154
+
1. If the element is <a>the HTML <code>body</code> element</a>, the {{Document}} 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>).
1143
1155
1. If the element does not have any associated <a>CSS layout box</a> return zero and terminate these steps.
1144
1156
1. Return the height of the element's <a>scrolling area</a>.
0 commit comments