Closed
Bug 1154525
Opened 10 years ago
Closed 10 years ago
Make HTMLElement.size and HTMLElement.location to use marionette.rect internally
Categories
(Testing :: Marionette Client and Harness, defect)
Testing
Marionette Client and Harness
Tracking
(firefox40 fixed)
RESOLVED
FIXED
mozilla40
Tracking | Status | |
---|---|---|
firefox40 | --- | fixed |
People
(Reporter: automatedtester, Assigned: ato)
References
Details
(Keywords: pi-marionette-client)
Attachments
(1 file, 1 obsolete file)
size and location have been deprecated and are due for removal. We need to update the python tests to use HTMLElement.rect instead
Assignee | ||
Updated•10 years ago
|
Assignee | ||
Comment 1•10 years ago
|
||
/r/7207 - Bug 1154525: Make HTMLElement#location and #size use #rect internally
Pull down this commit:
hg pull -r d0f18163b3bcf7e3a9d5698953e244b718013258 https://reviewboard-hg.mozilla.org/gecko/
Attachment #8594010 -
Flags: review?(dburns)
Assignee | ||
Updated•10 years ago
|
Component: Gaia::UI Tests → Marionette
Product: Firefox OS → Testing
Summary: Update all usage of HTMLElement.size and HTMLElement.location to use marionette.rect → Make HTMLElement.size and HTMLElement.location to use marionette.rect internally
Assignee | ||
Comment 2•10 years ago
|
||
dburns: I'm sorry I misread this bug as making them use rect internally, but I only realised after I'd pushed my patch. Refiled your original bug as bug 1155746.
Assignee | ||
Updated•10 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•10 years ago
|
||
Comment on attachment 8594010 [details]
MozReview Request: bz://1154525/ato
/r/7207 - Bug 1154525: Make HTMLElement#location and #size use #rect internally
Pull down this commit:
hg pull -r d0f18163b3bcf7e3a9d5698953e244b718013258 https://reviewboard-hg.mozilla.org/gecko/
Attachment #8594010 -
Flags: review?(cmanchester)
Comment 4•10 years ago
|
||
Comment on attachment 8594010 [details]
MozReview Request: bz://1154525/ato
https://reviewboard.mozilla.org/r/7205/#review6145
::: testing/marionette/driver/marionette_driver/marionette.py:153
(Diff revision 1)
> + return {"x": rect.x, "y": rect.y}
In the listener's getElementLocation I see:
let el = elementManager.getKnownElement(msg.json.id, curFrame);
let rect = el.getBoundingClientRect();
let location = {};
location.x = rect.left;
location.y = rect.top;
but getElementRect has:
let el = elementManager.getKnownElement(id, curFrame);
let clientRect = el.getBoundingClientRect();
return {
x: clientRect.x + curFrame.pageXOffset,
y: clientRect.y + curFrame.pageYOffset,
width: clientRect.width,
height: clientRect.height
};
from documentation of getBoundingClientRect, this means location used to be relative to the viewport but is now relative to the document. Is that intended?
Attachment #8594010 -
Flags: review?(cmanchester)
Assignee | ||
Comment 5•10 years ago
|
||
https://reviewboard.mozilla.org/r/7205/#review6195
> In the listener's getElementLocation I see:
>
> let el = elementManager.getKnownElement(msg.json.id, curFrame);
> let rect = el.getBoundingClientRect();
>
> let location = {};
> location.x = rect.left;
> location.y = rect.top;
>
> but getElementRect has:
>
> let el = elementManager.getKnownElement(id, curFrame);
> let clientRect = el.getBoundingClientRect();
> return {
> x: clientRect.x + curFrame.pageXOffset,
> y: clientRect.y + curFrame.pageYOffset,
> width: clientRect.width,
> height: clientRect.height
> };
>
> from documentation of getBoundingClientRect, this means location used to be relative to the viewport but is now relative to the document. Is that intended?
Well spotted, sir! I didn't catch this.
Although the [specification isn't entirely clear on this](https://w3c.github.io/webdriver/webdriver-spec.html#elementrect-getelementrect) I think `getElementLocation` has been wrong all along. An element's position should be relative to the document, and not the viewport.
I also think this is what Selenium does, but that's also not quite clear from the API documentation.
The question then is if we have test code which relies on this for calculations. I'll do a full try run to verify.
Thanks again for the thorough review!
Assignee | ||
Comment 6•10 years ago
|
||
Assignee | ||
Updated•10 years ago
|
Attachment #8594010 -
Flags: review?(dburns)
Assignee | ||
Updated•10 years ago
|
Attachment #8594010 -
Flags: review?(cmanchester)
Comment 7•10 years ago
|
||
Comment on attachment 8594010 [details]
MozReview Request: bz://1154525/ato
https://reviewboard.mozilla.org/r/7205/#review6217
::: testing/marionette/driver/marionette_driver/marionette.py:158
(Diff revision 1)
> +
Whitespace added.
Attachment #8594010 -
Flags: review?(cmanchester)
Comment 8•10 years ago
|
||
Comment on attachment 8594010 [details]
MozReview Request: bz://1154525/ato
https://reviewboard.mozilla.org/r/7205/#review6219
Ship It!
Attachment #8594010 -
Flags: review+
Assignee | ||
Comment 9•10 years ago
|
||
Comment 10•10 years ago
|
||
Comment 11•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox40:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
Assignee | ||
Comment 12•10 years ago
|
||
Attachment #8594010 -
Attachment is obsolete: true
Attachment #8620045 -
Flags: review+
Assignee | ||
Comment 13•10 years ago
|
||
Updated•2 years ago
|
Product: Testing → Remote Protocol
Comment 14•2 years ago
|
||
Moving bugs for Marionette client due to component changes.
Component: Marionette → Marionette Client and Harness
Product: Remote Protocol → Testing
You need to log in
before you can comment on or make changes to this bug.
Description
•