Closed
Bug 959955
Opened 11 years ago
Closed 11 years ago
Goggles element selector can point to the wrong or non-existent element
Categories
(Webmaker Graveyard :: X-Ray Goggles, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: dumitru, Assigned: jon)
References
Details
Attachments
(1 file)
STR:
Go to www.cnn.com or www.nytimes.com and activate X-Ray Goggles.
Select any element and click to edit it.
Expected result:
The text appears in the editor and can be changed.
Actual result:
The HTML source code window opens, but there's nothing in it. See screenshots:
https://app.box.com/s/ogd5u0a6vrjcv1px6cx8
https://app.box.com/s/8ubeyqld23m29iqd196g
Notes:
This report came from one of my students, and I was able to reproduce it on two of my laptops. All updates are installed and running Firefox stable. Was able to reproduce it in Safari too.
On other pages, Wikipedia for example, editing works.
this is goggles running on https, and CNN.com running on http. We need to put goggles up on both http and https so that we can load the library appropriately. CCing jbuck/jp to find out whether we can tell AWS to host the content through both protocols or whether we can pick only one.
| Assignee | ||
Comment 2•11 years ago
|
||
Goggles does not function correctly on http sites
You can't edit your page, but you can publish it
Errors loading page CSS which causes no display, but there are console errors that we don't understand
Looks like they're caused by not being able to select the element within the preview doc?
http://flickr.com and https://flickr.com both don't work for the same reason
the nth-of-type() selector seems suspect
If you change the flickr-generated selector to the following it'll work correctly:
previewDoc[0].documentElement.querySelectorAll("body > div#main.clearfix.wide.soup:nth-of-type(4) > div#fl-mayday:nth-of-type(1) > ul#flickr-frames.frame-list.justified-inner-content:nth-of-type(1) > li#home.frame.parallax-item.accelerated:nth-of-type(2) > div#home-body.bd:nth-of-type(2) > div:nth-of-type(1) > p:nth-of-type(1) > a.neon-cta.sign-up-pixel-trigger.rapidnofollow:nth-of-type(1)")
It's an off by nth error, seemingly caused by having html elements that should be in the body, inside html or head instead. When doing document.write, it'll put the div into the body instead! And then our generated CSS selector doesn't work anymore
Pomax and I will
Assignee: nobody → pomax
Status: NEW → ASSIGNED
| Assignee | ||
Comment 3•11 years ago
|
||
Here's an example that demonstrates this behaviour:
<!doctype html>
<html>
<head>
<title>Test page</title>
</head>
<body>
<div id="d1">d1</div>
<script>
var div = document.createElement("div");
div.id = "d4";
document.head.appendChild(div);
</script>
</body>
</html>
| Assignee | ||
Updated•11 years ago
|
Assignee: pomax → jon
Summary: Unable to edit elements → Goggles element selector can point to the wrong or non-existent element
| Assignee | ||
Comment 4•11 years ago
|
||
Attachment #8360608 -
Flags: review?(pomax)
Comment on attachment 8360608 [details] [review]
https://github.com/mozilla/goggles.webmaker.org/pull/86
r+ with technical nits on windows: works on OSX, works in firefox (vanilla) on windows, does not work in Chrome (32.x) on windows
Attachment #8360608 -
Flags: review?(pomax) → review+
let's stick this on staging and see what happens. Worst case, we fixed it for [everything - (win7/chrome)]
Comment 7•11 years ago
|
||
Commit pushed to master at https://github.com/mozilla/goggles.webmaker.org
https://github.com/mozilla/goggles.webmaker.org/commit/a206caa10d8d9309679bc6f000a0246d796d77cb
Fix bug 959955 - Use a single class to find focused element
Updated•11 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•