Closed
Bug 1274806
Opened 8 years ago
Closed 8 years ago
got NS_ERROR_UNEXPECTED error when I call range.extractContents() for DOM element with iframe
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla50
Tracking | Status | |
---|---|---|
firefox50 | --- | fixed |
People
(Reporter: deadem, Assigned: smaug)
References
Details
(Whiteboard: btpp-followup-2016-07-05)
Attachments
(4 files, 1 obsolete file)
(deleted),
text/html
|
Details | |
(deleted),
patch
|
MatsPalmgren_bugz
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36
Steps to reproduce:
I've try to grab content from page by range operations, and when I call ange.extractContents() for DOM element with iframe I got NS_ERROR_UNEXPECTED error.
If i remove iframe from that element all works fine.
Small example in attached file
Actual results:
NS_ERROR_UNEXPECTED error in browser console
Expected results:
cut DOM contents and return data
Updated•8 years ago
|
Whiteboard: btpp-followup-2016-07-05
Assignee | ||
Comment 2•8 years ago
|
||
So MutationGuard doesn't quite work here because of unload event being dispatched and iframe doing its mutations. And ValidateCurrentNode is overly strict here when dealing with character data.
Assignee: nobody → bugs
Assignee | ||
Comment 3•8 years ago
|
||
mats, perhaps you could review this (bz and sicking are both on vacation)?
I need to still write a testcase for this.
Flags: needinfo?(bugs)
Attachment #8765201 -
Flags: review?(mats)
Assignee | ||
Comment 4•8 years ago
|
||
Attachment #8765201 -
Attachment is obsolete: true
Attachment #8765201 -
Flags: review?(mats)
Attachment #8765203 -
Flags: review?(mats)
Assignee | ||
Updated•8 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 5•8 years ago
|
||
Comment on attachment 8765203 [details] [diff] [review]
range_validate.diff
LGTM, although I think this might actually be too conservative.
I think that if 'node' is either the start/end container is
proof that it hasn't been removed, so I think you could just
"return true" in both these if-statements.
You might want to write some tests to figure out what makes
most sense for the cut operation though.
One nit: 'before'/'after' might be undefined if NS_FAILED(res),
so I think you should do an early return in that case
(and remove the NS_SUCCEEDED test at the end).
Attachment #8765203 -
Flags: review?(mats) → review+
Assignee | ||
Comment 6•8 years ago
|
||
Good catch that uninitialized variables.
(a reason to always initialize variables to some value).
I'd prefer to be conservative here.
Assignee | ||
Comment 7•8 years ago
|
||
Assignee | ||
Comment 8•8 years ago
|
||
Pushed by opettay@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/07073e0e98e3
got NS_ERROR_UNEXPECTED error when I call range.extractContents() for DOM element with iframe , r=mats
Comment 10•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox50:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•