Last Comment Bug 682651 - "ASSERTION: Element without owner document" with createDocumentType
: "ASSERTION: Element without owner document" with createDocumentType
Status: RESOLVED FIXED
: assertion, testcase
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: x86 Mac OS X
: -- normal (vote)
: ---
Assigned To: Olli Pettay [:smaug]
:
:
Mentors:
Depends on: 675166
Blocks: 326633
  Show dependency treegraph
 
Reported: 2011-08-27 23:00 PDT by Jesse Ruderman
Modified: 2011-09-18 09:42 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
testcase (106 bytes, text/html)
2011-08-27 23:00 PDT, Jesse Ruderman
no flags Details
patch (942 bytes, patch)
2011-08-28 05:31 PDT, Olli Pettay [:smaug]
no flags Details | Diff | Splinter Review

Description Jesse Ruderman 2011-08-27 23:00:29 PDT
Created attachment 556361 [details]
testcase

###!!! ASSERTION: Element without owner document: 'Error', file content/base/src/nsGenericElement.cpp, line 1372
Comment 1 Olli Pettay [:smaug] 2011-08-28 05:31:45 PDT
Created attachment 556386 [details] [diff] [review]
patch

The NS_ERROR is just wrong, but to get right behavior after bug 675166 is fixed,
we should use GetOwnerDocument.
Comment 2 Jonas Sicking (:sicking) No longer reading bugmail consistently 2011-08-29 19:17:15 PDT
Comment on attachment 556386 [details] [diff] [review]
patch

Review of attachment 556386 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/base/src/nsGenericElement.cpp
@@ +1364,5 @@
>  
>  already_AddRefed<nsIURI>
>  nsIContent::GetBaseURI() const
>  {
> +  nsIDocument* doc = GetOwnerDocument();

Why this change? This is slightly slower. Not that it matters perf wise, but doesn't seem like a win either.
Comment 3 Olli Pettay [:smaug] 2011-08-30 01:47:40 PDT
Because after bug 675166 GetOwnerDoc() will actually return something in this case, 
and we don't actually want that something but null.
Comment 4 Olli Pettay [:smaug] 2011-08-30 01:52:03 PDT
But ok, if DOM Core has changed, this patch is wrong.
Comment 5 Olli Pettay [:smaug] 2011-08-30 02:39:28 PDT
Comment on attachment 556386 [details] [diff] [review]
patch

So, the spec has changed and this will be fixed in the bug which makes
GetOwnerDoc to return always a valid value.
Comment 6 Olli Pettay [:smaug] 2011-09-18 09:42:11 PDT
Fixed in bug 675166

Note You need to log in before you can comment on or make changes to this bug.