Closed
Bug 602231
Opened 14 years ago
Closed 14 years ago
copying text on cbc.ca (and newyorker.com, other sites using tynt) is broken
Categories
(Core :: DOM: Serializers, defect)
Core
DOM: Serializers
Tracking
()
RESOLVED
FIXED
mozilla2.0b7
Tracking | Status | |
---|---|---|
blocking2.0 | --- | final+ |
People
(Reporter: deb, Assigned: MatsPalmgren_bugz)
References
()
Details
(Keywords: regression)
Attachments
(2 files, 3 obsolete files)
(deleted),
text/plain
|
Details | |
(deleted),
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
If you go to cbc.ca with today's nightly, select, and try to copy text, it ...doesn't. Works ok in 3.6, although cbc uses one of those insanely annoying scripts that appends additional content to whatever you're copying.
Turning off javascript.options.tracejit.content and javascript.options.methodjit.content didn't fix it (beltzner's suggestion).
Specific URL I was trying to copy from:
http://www.cbc.ca/technology/story/2010/10/06/tech-hidden-language.html?ref=rss
Comment 1•14 years ago
|
||
Deb, any idea what the regression range is?
Keywords: regression,
regressionwindow-wanted
Reporter | ||
Comment 2•14 years ago
|
||
I tested /pub/mozilla.org/firefox/nightly/2010-09-05-03-mozilla-central mac64 and it was happening there then, too...robcee suggests it might be UA string related.
Comment 3•14 years ago
|
||
I can confirm this bug as well on other sites that use Tynt (newyorker.com, smithsonian.com, sportsillustrated.com). I didn't notice this earlier because I forgot I was actively blocking that script. :/
Comment 5•14 years ago
|
||
Here's the direct URL to the script we're calling off of the CBC site:
http://tcr.tynt.com/javascripts/Tracer.js?user=cT9yCKGeer3PWlab7jrHtB&s=62
Comment 6•14 years ago
|
||
(In reply to comment #2)
> robcee suggests it might be UA string related.
Just changed my UA string to match 3.6.9 by manually overriding it via about:config, and that had no effect. Seems to actually be a JS or perhaps a clipboard bug?
Comment 7•14 years ago
|
||
Regression range would help. I cc'd Jeff because it smelled a bit like an ES5 compat issue to me.
Comment 8•14 years ago
|
||
This is actually a rather old regression. I started bisecting tracemonkey, but the result of that just included a mozilla-central merge, so then I bisected that:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=da9e50cb4091&tochange=ffbc3baf03ae
https://hg.mozilla.org/tracemonkey/pushloghtml?fromchange=b3e27c1ee35e&tochange=4bed87d68dab
Bug 39098 is in both of those, and I think it's more likely to be the cause than a JS engine bug.
Assignee: general → nobody
Component: JavaScript Engine → General
Keywords: regressionwindow-wanted
QA Contact: general → general
Comment 9•14 years ago
|
||
I confirmed that this was caused by bug 39098.
Summary: copy on cbc.ca is broken in nightlies → copying text on cbc.ca (and newyorker.com, other sites using tynt) is broken
Assignee | ||
Comment 10•14 years ago
|
||
Assignee | ||
Comment 11•14 years ago
|
||
Tracer.js does something like this:
line 436: create a DIV (d)
line 451-459: append the current selection to it (along with some other stuff)
line 478: create another DIV (e)
line 479: append that to BODY (k)
line 480: append (d) to (e)
line 481: create a range (a)
line 482: add (d) to it
line 483: remove the current selection
line 484: select the range (a)
line 485: setup a timer that will restore the original selection range
This all happens in an event handler (oncopy I think), and when our
internal copy-to-clipboard command runs it sees the "fake" selection
with the (a) range.
The inserted DIV (e) does not have a frame when doing the copy,
so it's invisible and results in an empty string.
The node has a NODE_NEEDS_FRAME flag though, so we could
either check that (on any ancestor) or we could do a flush
(creating frames) before starting the copy somehow.
Assignee | ||
Comment 12•14 years ago
|
||
Flushing seems more correct, I'll try that first...
Assignee: nobody → matspal
Component: General → Serializers
OS: Mac OS X → All
QA Contact: general → dom-to-text
Hardware: x86 → All
Updated•14 years ago
|
blocking2.0: ? → final+
Assignee | ||
Updated•14 years ago
|
Attachment #481417 -
Attachment is obsolete: true
Assignee | ||
Updated•14 years ago
|
Assignee | ||
Comment 13•14 years ago
|
||
Attachment #481752 -
Flags: review?(bzbarsky)
Comment 14•14 years ago
|
||
Comment on attachment 481752 [details] [diff] [review]
Patch rev. 1
Do you need to worry if the flush destroys the presshell? r=me if not; otherwise you need another IsDestroying check.
Attachment #481752 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 15•14 years ago
|
||
Good point, I think that it can happen.
Attachment #481752 -
Attachment is obsolete: true
Attachment #481987 -
Flags: review?(bzbarsky)
Comment 16•14 years ago
|
||
Comment on attachment 481987 [details] [diff] [review]
Patch rev. 2
Hmm, one more thing. Do you need a layout flush or a frame flush? That is, does clipboard care about geometry, or just the styles?
Assignee | ||
Comment 17•14 years ago
|
||
It doesn't use geometry, it's determined from the presence of a frame and
its visibility style. So, as you suggest, a more limited flush should
be enough. Flush_Frames is the right choice?
Attachment #481996 -
Flags: review?(bzbarsky)
Assignee | ||
Updated•14 years ago
|
Attachment #481987 -
Attachment is obsolete: true
Attachment #481987 -
Flags: review?(bzbarsky)
Comment 18•14 years ago
|
||
Comment on attachment 481996 [details] [diff] [review]
Patch rev. 3
Yep, if you check for frame presence Flush_Frames is good.
Attachment #481996 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 19•14 years ago
|
||
Status: NEW → RESOLVED
Closed: 14 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b8
Updated•14 years ago
|
Target Milestone: mozilla2.0b8 → mozilla2.0b7
You need to log in
before you can comment on or make changes to this bug.
Description
•