Closed
Bug 1226293
Opened 9 years ago
Closed 9 years ago
Greyhound website won't search schedules
Categories
(Core :: General, defect)
Core
General
Tracking
()
VERIFIED
FIXED
mozilla45
Tracking | Status | |
---|---|---|
firefox45 | --- | verified |
People
(Reporter: jdm, Assigned: roc)
References
()
Details
(Keywords: regression, site-compat, testcase)
Attachments
(2 files)
STR:
1. Visit https://greyhound.ca/default.aspx
2. Choose "Toronto, ON" for Leaving From, and "Guelph, ON" for Going To
3. Press "Search schedules"
Expected:
Overlay explaining that a search is in progress, followed by navigating to search results.
Actual:
JS error: "TypeError: $find(...).get_selectedItem(...) is null"
I can reproduce this in the 11/18 nightly but not Developer Edition or Chrome.
Updated•9 years ago
|
Comment 1•9 years ago
|
||
So the basic problem is that on this RadComboBox object get_value returns "". Then findItemByValue returns null because "" is falsy, etc.
get_value() just returns this._value, so something went wrong earlier... Really need that regression range. Josh, are you working on that?
Flags: needinfo?(josh)
Reporter | ||
Comment 3•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=798c82c8a96d1099cf712434d9c9036fc48d8297&tochange=9160f08660b8290559e427fd80d617edd86fe2a6
My guess of the HTMLElement.innerText change was right on the money.
Blocks: innertext
Keywords: regressionwindow-wanted
Comment 4•9 years ago
|
||
[Tracking Requested - why for this release]: Website bustage.
tracking-firefox45:
--- → ?
Comment 5•9 years ago
|
||
I think we're bombing out somewhere related to the "Discount Type:" select (Telerik RadComboBox control widget thingy). If you pick something no value is displayed.
$find('ctl00_body_search_discounts').get_selectedItem()._text in "Companion Fare" in Chrome, but "" in Nightly.
Comment 6•9 years ago
|
||
(uhhh, it seems like someone is working on this site... this line was commented out between refreshes and now the search works for me (w/ some additional console errors):
// var discount = $find(SearchReferences.ListDiscounts).get_value();
Comment 7•9 years ago
|
||
Ugh. We should have saved as "web page, complete" up front. :(
Comment 8•9 years ago
|
||
Now it's back to not working. Sorry for the noise. Looking into how the RadComboBox expects to get its _text property.
Comment 9•9 years ago
|
||
Apparently Firefox returns "" for innerText if the element is hidden. Testcase coming.
Comment 10•9 years ago
|
||
(In reply to Kohei Yoshino [:kohei] from comment #9)
> Apparently Firefox returns "" for innerText if the element is hidden.
> Testcase coming.
If that's the case, then that explains RadComboBoxItem.prototype.get_text returning "":
get_text: function() {
if (this._text !== null) {
return this._removeEmTags(this._text);
}
if ((this._text = this._properties.getValue('text', null)) != null) {
return this._removeEmTags(this._text);
}
if (!this.get_element()) {
return '';
}
var c = this.get_textElement();
if (!c) {
return '';
}
if (typeof(c.innerText) != 'undefined') {
this._text = c.innerText;
} else {
this._text = c.textContent;
}
if ($telerik.isSafari2) {
this._text = c.innerHTML;
}
return this._removeEmTags(this._text);
},
Comment 11•9 years ago
|
||
The console should say "Mozilla Firefox developers" but the actual output is "Mozilla Firefox".
Comment 12•9 years ago
|
||
Yeah, so GetInnerText will fall back on GetTextContent in the no-frame case but only if we have no style context or are styled display:none or are not in the document.
Should we just always fall back?
Flags: needinfo?(roc)
Assignee | ||
Comment 13•9 years ago
|
||
Oops, yes! The spec and the implementation (and the tests) should check whether we're in a display:none subtree instead of just display:none.
Flags: needinfo?(roc)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → roc
Updated•9 years ago
|
Keywords: site-compat,
testcase
Comment 14•9 years ago
|
||
Does it have to be a display:none subtree? For example, could it be some random block inside SVG but not inside foreignObject, which doesn't get rendered as a result?
Assignee | ||
Comment 15•9 years ago
|
||
(In reply to Boris Zbarsky [:bz] from comment #14)
> Does it have to be a display:none subtree? For example, could it be some
> random block inside SVG but not inside foreignObject, which doesn't get
> rendered as a result?
As discussed on IRC, that would be hard to spec properly.
I've updated the spec to say that we fall back to textContent if the element *or any ancestor* is display:none and I'm about to attach my patch.
Assignee | ||
Comment 16•9 years ago
|
||
Bug 1226293. innerText for non-display:none elements with display:none ancestors should use textContent. r=bz
Attachment #8689902 -
Flags: review?(bzbarsky)
Comment 17•9 years ago
|
||
Comment on attachment 8689902 [details]
MozReview Request: Bug 1226293. innerText for non-display:none elements with display:none ancestors should use textContent. r=bz
https://reviewboard.mozilla.org/r/25743/#review23219
::: dom/html/nsGenericHTMLElement.cpp:3337
(Diff revision 1)
> - nsComputedDOMStyle::GetStyleContextForElementNoFlush(this, nullptr, nullptr);
> + if (!presShell || !IsInComposedDoc() ||
if !IsInComposedDoc(), then nsComputedDOMStyle::GetPresShellForContent will return null, no? So I don't think you need the check.
Speccing the !presShell condition will be hard, by the way. Not much we can do about that, though.
::: testing/web-platform/tests/innerText/getter-tests.js:76
(Diff revision 1)
>
It would be good to have tests for the <div> in <svg> case, both with and without display:none on the div (and possibly with an extra level of nesting, with the display:none on the inner thing, too, as a separate test), just to ensure that part works correctly.
r=me
Attachment #8689902 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 18•9 years ago
|
||
Assignee | ||
Comment 19•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/ef653e3a6b0d21190af39dab7cc0716974dbf0f8
Bug 1226293. innerText for non-display:none elements with display:none ancestors should use textContent. r=bz
Assignee | ||
Comment 20•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/a97d937370729c70bb4e55893e05aec556568e45
Bug 1226293. Followup: add SVG tests. r=bz
Comment 21•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/ef653e3a6b0d
https://hg.mozilla.org/mozilla-central/rev/a97d93737072
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Comment 22•9 years ago
|
||
Verified fixed in today's Nightly.
You need to log in
before you can comment on or make changes to this bug.
Description
•