Permalink
Browse files

Bug 24791: Part 2: Update references to Document instead of DOM

  • Loading branch information...
1 parent b0aea90 commit da4d3abea4623643bfc2b7f3946f14903050b543 @AutomatedTester committed Mar 13, 2014
Showing with 70 additions and 70 deletions.
  1. +2 −2 02_commands.html
  2. +2 −2 07_switching.html
  3. +6 −6 09_elements.html
  4. +6 −6 10_element_state.html
  5. +4 −4 11_ecmascript.html
  6. +4 −4 16_snapshots.html
  7. +4 −4 17_non_html_content.html
  8. +42 −42 webdriver-spec.html
View
@@ -81,7 +81,7 @@ <h3>Status Codes</h3>
</tr>
<tr>
<td><dfn id="status-invalid-element-state">invalid element state</dfn></td>
- <td>An element command could not be completed because the element is in an invalid state (e.g. attempting to click an element that is no longer attached to the DOM).</td>
+ <td>An element command could not be completed because the element is in an invalid state (e.g. attempting to click an element that is no longer attached to the Document).</td>
</tr>
<tr>
<td><dfn id="status-invalid-selector">invalid selector</dfn></td>
@@ -121,7 +121,7 @@ <h3>Status Codes</h3>
</tr>
<tr>
<td><dfn id="status-stale-element-reference">stale element reference</dfn></td>
- <td>An element command failed because the referenced element is no longer attached to the DOM.</td>
+ <td>An element command failed because the referenced element is no longer attached to the Document.</td>
</tr>
<tr>
<td><dfn id="status-success">success</dfn></td>
View
@@ -59,9 +59,9 @@ <h2>Switching Frames</h2>
<p>The "switchToFrame" command is used to select which frame within a window MUST be used as the context for handling future commands. All frame switching is taken from the current context from which commands are currently being handled. The "<code>id</code>" parameter can be a number or a <a>WebElement</a>. WebDriver implementations MUST determine which frame to select using the following algorithm:
<ol>
- <li>If the "id" is a number the current context is set to the equivalent of the JS expression "window.frames[n]" where "n" is the number and "window" is the DOM window represented by the current context.</li>
+ <li>If the "id" is a number the current context is set to the equivalent of the JS expression "window.frames[n]" where "n" is the number and "window" is the Document window represented by the current context.</li>
<li>If the "id" is null, the current context is set to the default context.</li>
- <li>If the "id" represents a <a>WebElement</a>, and the corresponding DOM element represents a FRAME or an IFRAME, and the <a>WebElement</a> is part of the current context, the "window" property of that DOM element becomes the current context.</li>
+ <li>If the "id" represents a <a>WebElement</a>, and the corresponding Document element represents a FRAME or an IFRAME, and the <a>WebElement</a> is part of the current context, the "window" property of that Document element becomes the current context.</li>
</ol>
<p>In all cases if no match is made a "<code><a href="#status-no-such-frame">no such frame</a></code>" status code MUST be returned.</p>
View
@@ -6,12 +6,12 @@ <h2>Elements</h2>
<a href="http://www.w3.org/TR/2012/WD-dom-20120105/#interface-element">Element</a> as defined in the
[[!DOM4]] specification. Because the WebDriver API is designed to allow users to interact with apps as if
they were actual users, the capabilities offered by the
- <code>WebElement</code> interface are somewhat different from those offered by the DOM Element interface.</p>
+ <code>WebElement</code> interface are somewhat different from those offered by the Document Element interface.</p>
<p>Each WebElement instance must have an ID, which is distinct from the value
- of the DOM Element's "id" property. The ID for every WebElement representing the same
- underlying DOM Element MUST be the same. The IDs used to refer to different
- underlying DOM Elements MUST be unique within the session over the entire duration of the session.</p>
+ of the Document Element's "id" property. The ID for every WebElement representing the same
+ underlying Document Element MUST be the same. The IDs used to refer to different
+ underlying Document Elements MUST be unique within the session over the entire duration of the session.</p>
<div class="note">
<p>This requirement around WebElement IDs allows for efficient equality
@@ -78,7 +78,7 @@ <h2>Element ID</h2>
valid for finding a single element or groups of elements. In the case of
finding a single WebElement, this MUST be functionally identical to a call
to "<a href="http://www.w3.org/TR/2012/WD-dom-20120105/#dom-document-getelementbyid">document.getElementById()</a>"
- from the Web DOM Core specification ([[!DOM4]]). When finding multiple
+ from the [[!DOM4]]. When finding multiple
elements, this is equivalent to an CSS query of "<code>#value</code>" where "value" is the ID being searched for with all "'" characters being properly escaped..</p>
</section>
<section>
@@ -120,7 +120,7 @@ <h2>Partial Link Text</h2>
<section>
<h2>XPath</h2>
<p>Strategy name: xpath</p>
- <p>All WebDriver implementations MUST support finding elements by XPath 1.0 [[!XPATH]] with the <a href="http://dev.w3.org/html5/spec/Overview.html#interactions-with-xpath-and-xslt">edits from section 3.3</a> of the [[!HTML51]] specification made. If no native support is present in the browser, a pure JS implementation MAY be used. When called, the returned values MUST be equivalent of calling "<a href="http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator-evaluate">evaluate</a>" function from the DOM Level 3 XPath spec [[DOM-LEVEL-3-XPATH]] with the result type set to "<a href="http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-ORDERED-NODE-SNAPSHOT-TYPE">ORDERED_NODE_SNAPSHOT_TYPE</a> (7).</p>
+ <p>All WebDriver implementations MUST support finding elements by XPath 1.0 [[!XPATH]] with the <a href="http://dev.w3.org/html5/spec/Overview.html#interactions-with-xpath-and-xslt">edits from section 3.3</a> of the [[!HTML51]] specification made. If no native support is present in the browser, a pure JS implementation MAY be used. When called, the returned values MUST be equivalent of calling "<a href="http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator-evaluate">evaluate</a>" function from [[DOM-LEVEL-3-XPATH]] with the result type set to "<a href="http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-ORDERED-NODE-SNAPSHOT-TYPE">ORDERED_NODE_SNAPSHOT_TYPE</a> (7).</p>
</section>
</section>
</section>
View
@@ -55,16 +55,16 @@ <h2>Determining Whether a WebElement Is Selected</h2>
<p>The remote end MUST determine whether a <code>WebElement</code> is selected using the following algorithm:
<ol>
<li id="is_selectable">If the item is not "<code title="selectable">selectable</code>", the WebElement is not selected. A <dfn id="selectable" title="selectable">selectable</dfn> element is either an OPTION element or an INPUT element of type "<a href="http://www.w3.org/TR/html5/forms.html#checkbox-state-(type=checkbox)">checkbox</a>" or "<a href="http://www.w3.org/TR/html5/forms.html#radio-button-state-(type=radio)">radio</a>".</li>
- <li>If the DOM node represented by the WebElement is an OPTION element, the "<a href="http://www.w3.org/TR/html5/forms.html#concept-option-selectedness">selectedness</a>" of the element, as defined in [[!HTML51]] determines whether the element is selected.</li>
- <li>Otherwise, the value of the DOM node's "<a href="http://www.w3.org/TR/html5/forms.html#attr-input-checked">checked</a>" property determines whether the element is selected. This MUST reflect the element's "<a href="http://www.w3.org/TR/html5/forms.html#concept-fe-checked">checkedness</a>" as defined in [[!HTML51]].</li>
+ <li>If the Document node represented by the WebElement is an OPTION element, the "<a href="http://www.w3.org/TR/html5/forms.html#concept-option-selectedness">selectedness</a>" of the element, as defined in [[!HTML51]] determines whether the element is selected.</li>
+ <li>Otherwise, the value of the Document node's "<a href="http://www.w3.org/TR/html5/forms.html#attr-input-checked">checked</a>" property determines whether the element is selected. This MUST reflect the element's "<a href="http://www.w3.org/TR/html5/forms.html#concept-fe-checked">checkedness</a>" as defined in [[!HTML51]].</li>
</ol>
<dl class='idl' title='partial interface WebElement'>
<dt>boolean isSelected()</dt>
<dd><p>The remote end MUST determine whether a <code>WebElement</code> is selected using the following algorithm:
<ol>
<li id="is_selectable">If the item is not "<code title="selectable">selectable</code>", the WebElement is not selected. A <dfn id="selectable" title="selectable">selectable</dfn> element is either an OPTION element or an INPUT element of type "<a href="http://www.w3.org/TR/html5/forms.html#checkbox-state-(type=checkbox)">checkbox</a>" or "<a href="http://www.w3.org/TR/html5/forms.html#radio-button-state-(type=radio)">radio</a>".</li>
- <li>If the DOM node represented by the WebElement is an OPTION element, the "<a href="http://www.w3.org/TR/html5/forms.html#concept-option-selectedness">selectedness</a>" of the element, as defined in [[!HTML51]] determines whether the element is selected.</li>
- <li>Otherwise, the value of the DOM node's "<a href="http://www.w3.org/TR/html5/forms.html#attr-input-checked">checked</a>" property determines whether the element is selected. This MUST reflect the element's "<a href="http://www.w3.org/TR/html5/forms.html#concept-fe-checked">checkedness</a>" as defined in [[!HTML51]].</li>
+ <li>If the Document node represented by the WebElement is an OPTION element, the "<a href="http://www.w3.org/TR/html5/forms.html#concept-option-selectedness">selectedness</a>" of the element, as defined in [[!HTML51]] determines whether the element is selected.</li>
+ <li>Otherwise, the value of the Document node's "<a href="http://www.w3.org/TR/html5/forms.html#attr-input-checked">checked</a>" property determines whether the element is selected. This MUST reflect the element's "<a href="http://www.w3.org/TR/html5/forms.html#concept-fe-checked">checkedness</a>" as defined in [[!HTML51]].</li>
</ol>
<dl class='parameters'>
<dt>DOMString id</dt>
@@ -78,7 +78,7 @@ <h2>Determining Whether a WebElement Is Selected</h2>
<section>
<h2 name="attributes-and-properties">Reading Attributes and Properties</h2>
- <p>Although the [[!HTML51]] spec is very clear about the difference between the properties and attributes of a DOM element, users are frequently confused between the two. Because of this, the WebDriver API offers a single command ("getElementAttribute") which covers the case of returning either of the value of a DOM element's property or attribute. If a user wishes to refer specifically to an attribute or a property, they should evaluate Javascript in order to be unambiguous.</p>
+ <p>Although the [[!HTML51]] spec is very clear about the difference between the properties and attributes of a Document element, users are frequently confused between the two. Because of this, the WebDriver API offers a single command ("getElementAttribute") which covers the case of returning either of the value of a Document element's property or attribute. If a user wishes to refer specifically to an attribute or a property, they should evaluate Javascript in order to be unambiguous.</p>
<dl class='idl' title='interface WebElement'>
<dt>DOMString getElementAttribute()</dt>
<dd>
@@ -181,7 +181,7 @@ <h2>Rendering Text</h2>
<dd>Horizontal whitespace characters are defined by the ECMAScript regular expression <code>[\x20\t\u2028\u2029]</code>.</dd>
</dl>
-<p>The expected return value is roughly what a text-only browser would display. This means that on browsers that support the Shadow DOM, this algorithm MUST operate on the section of the rendered DOM underneath the DOM node represented by this WebElement. The algorithm for determining this text is as follows:</p>
+<p>The expected return value is roughly what a text-only browser would display. The algorithm for determining this text is as follows:</p>
<p>Let <code>lines</code> equal an empty array. Then:
<ol>
View
@@ -33,8 +33,8 @@ <h2>Javascript Command Parameters</h2>
<li>a dictionary, then recursively apply this algorithm to each value in <code>args[index]</code> and assign the result to <code>args[index]</code>.</li>
<li>a <a href="#elements">WebElement</a>, then:
<ol>
- <li>If the element's ID does not represent a DOMElement, or it represents a DOMElement that is no longer attached to the document's tree, then the WebDriver implementation MUST immediately abort the command and return a <code title="stale-element-reference"><a href="#status-stale-element-reference">stale element reference</a></code> error.</li>
- <li>Otherwise, let <code>args[index]</code> be the underlying DOMElement.</li>
+ <li>If the element's ID does not represent a Document Element, or it represents a Document Element that is no longer attached to the document's tree, then the WebDriver implementation MUST immediately abort the command and return a <code title="stale-element-reference"><a href="#status-stale-element-reference">stale element reference</a></code> error.</li>
+ <li>Otherwise, let <code>args[index]</code> be the underlying Document Element.</li>
</ol>
</li>
<li>Otherwise WebDriver implementations MAY throw an <code><a href="#status-unknown-error">unknown error</a></code> indicating the index of the unhandled parameter but SHOULD attempt to convert the value into a dictionary.</li>
@@ -75,7 +75,7 @@ <h2>Synchronous Javascript Execution</h2>
<ol>
<li><code>undefined</code> or <code>null</code>, return <code> null</code>.
<li>a number, boolean, or DOMString, return <code>result</code>.
- <li>a DOMElement, then return the corresponding WebElement for that DOMElement.
+ <li>a Document Element, then return the corresponding WebElement for that Document Element.
<!-- Should there be a recursion limit? -->
<li>a <code>Sequence &lt;Node&gt; nodes</code>, then return the result of recursively applying this algorithm to <code>result</code>.
<!-- Should there be a limit? -->
@@ -135,7 +135,7 @@ <h2>Asynchronous Javascript Execution</h2>
<ol>
<li><code>undefined</code> or <code>null</code>, return <code> null</code>.</li>
<li>a number, boolean, or DOMString, return <code>result</code>.</li>
- <li>a DOMElement, then return the corresponding WebElement for that DOMElement.</li>
+ <li>a Document Element, then return the corresponding WebElement for that Document Element.</li>
<!-- Should there be a recursion limit? -->
<li>a <code>Sequence &lt;Node> Nodes</code>, then return the result by recursively applying this algorithm to <code>result</code>. WebDriver implementations SHOULD limit the recursion depth.</li>
<!-- Should there be a limit? -->
View
@@ -29,15 +29,15 @@ <h2>Current Window</h2>
<p>If this capability is supported, local end MUST add the <code>TakesScreenshot</code> interface to the <code>WebDriver</code> interface.</p>
- <p>This command will take a screenshot of the current window. Implementations of the remote end SHOULD capture the entire DOM, even if this would require a user to scroll the browser window. That is, the returned PNG SHOULD have the same width and height as returned by a call to <code>getSize</code> of the BODY element and MUST contain all visible content on the page, and this SHOULD be done without resizing the browser window. If the remote end is unable to capture the entire DOM, then the part of the DOM currently displayed in UI of the browser MUST be captured without additional chrome such as scrollbars and browser chrome.</p>
+ <p>This command will take a screenshot of the current window. Implementations of the remote end SHOULD capture the entire Document, even if this would require a user to scroll the browser window. That is, the returned PNG SHOULD have the same width and height as returned by a call to <code>getSize</code> of the BODY element and MUST contain all visible content on the page, and this SHOULD be done without resizing the browser window. If the remote end is unable to capture the entire Document, then the part of the Document currently displayed in UI of the browser MUST be captured without additional chrome such as scrollbars and browser chrome.</p>
<div class="note">
- <p>One way to think of capturing the entire DOM is that the user has an infinitely large monitor and has resized the window to allow all content to be visible. One of those monitors would be very cool.</p>
+ <p>One way to think of capturing the entire Document is that the user has an infinitely large monitor and has resized the window to allow all content to be visible. One of those monitors would be very cool.</p>
</div>
<p>Nested frames MUST be sized as if the user has resized the window to the dimensions of the PNG being returned. This often means that not all potentially visible content within the nested frames is captured.</p>
- <p>Remote ends MUST NOT attempt to track changes in window size as the screenshot is being taken. In particular this means that in the case of a page that makes use of "infinite scrolling" (where an AJAX call is used to populate additional content as the user scrolls down) or in some other way resizes content as the window size is changed only the content that was originally contained in the DOM when the command is executed will be captured.</p>
+ <p>Remote ends MUST NOT attempt to track changes in window size as the screenshot is being taken. In particular this means that in the case of a page that makes use of "infinite scrolling" (where an AJAX call is used to populate additional content as the user scrolls down) or in some other way resizes content as the window size is changed only the content that was originally contained in the Document when the command is executed will be captured.</p>
</section>
<section>
<h2>Element</h2>
@@ -47,7 +47,7 @@ <h2>Element</h2>
</table>
<p>If this capability is supported, local end MUST add the <code>TakesScreenshot</code> interface to the <code>WebElement</code> interface.</p>
- <p>Remote ends SHOULD take a screenshot of the area bounded by the clientBoundingRect of the DOM element represented by the <code>WebElement</code>, returning it as a Base64 encoded, lossless PNG. Local ends MUST make the PNG available directly to the user as at least one of a binary blob or a file. If the remote end cannot capture the entire clientBoundingRect, they MUST scroll as much of the element into the current browser viewport as possible and capture the maximum visible area without additional browser chrome.</p>
+ <p>Remote ends SHOULD take a screenshot of the area bounded by the clientBoundingRect of the Document element represented by the <code>WebElement</code>, returning it as a Base64 encoded, lossless PNG. Local ends MUST make the PNG available directly to the user as at least one of a binary blob or a file. If the remote end cannot capture the entire clientBoundingRect, they MUST scroll as much of the element into the current browser viewport as possible and capture the maximum visible area without additional browser chrome.</p>
<p>If the <code>WebElement</code> represents a FRAME or IFRAME element, this is equivalent of taking a screenshot of the frame's BODY element.</p>
</section>
</section>
Oops, something went wrong.

0 comments on commit da4d3ab

Please sign in to comment.