Closed Bug 1292278 Opened 8 years ago Closed 8 years ago

Stylo Assertion failure: aNameSpaceID > 0 && (int64_t) aNameSpaceID <= (int64_t) mURIArray.Length() at dom/base/nsNameSpaceManager.h

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla51
Tracking Status
firefox51 --- fixed

People

(Reporter: cpeterson, Assigned: bholley)

References

Details

(Keywords: assertion, Whiteboard: [stylo:m2])

Attachments

(1 file)

To reproduce, run `./mach reftest --disable-e10s <filename>` or replace <filename> with `layout/reftest/reftest.list`.

TEST-UNEXPECTED-FAIL | file:///home/shinglyu/workspace/stylo/gecko-dev/layout/reftests/margin-collapsing/block-xhtml-root-1a.xhtml | application terminated with exit code 11
REFTEST PROCESS-CRASH | file:///home/shinglyu/workspace/stylo/gecko-dev/layout/reftests/margin-collapsing/block-xhtml-root-1a.xhtml | application crashed [None]

Assertion failure: aNameSpaceID > 0 && (int64_t) aNameSpaceID <= (int64_t) mURIArray.Length(), at /files/mozilla/stylo/bb/gecko/dom/base/nsNameSpaceManager.h:43
ç      \#01: nsNameSpaceManager::NameSpaceURIAtom(int) (nsNameSpaceManager.h:43, in XUL)
#02: Gecko_Namespace (ServoBindings.cpp:158, in XUL)
#03: _$LT$wrapper..GeckoElement$LT$$u27$le$GT$$u20$as$u20$selectors..Element$GT$::get_namespace::h7a2f0ddcbd2acca7 (wrapper.rs:468, in XUL)
Assignee: nobody → bobbyholley
The current setup here tries to "save" an entry in the list by checking
for the "None" namespace everywhere and special-casing it. We can simplify
this a lot by just adding the empty atom to the beginning of the array,
which is the value that servo uses to represent "namespace none" anyway.
Attachment #8778465 - Flags: review?(bzbarsky)
Comment on attachment 8778465 [details] [diff] [review]
Zero-index the namespace manager URIs. v1

So this has two behavior changes:

1)  GetNameSpaceURI will now happily hand out "" for kNameSpaceID_None.  But calling GetNameSpaceURI for kNameSpaceID_None is arguably an error, and was treated as such by the old code.  Please preserve the old behavior here.

2)  NameSpaceURIAtom will now happily hand out "".  This is the intentional part of this change.  Please document this behavior, and document that this function should really be called only from servo code, where using "" to represent "no namespace" actually makes sense.  If we can assert somehow that it's only called by servo code, that would be even better, but I can't see a way to do that.  :(  Maybe it should be renamed to indicate what it's expected to do?

r=me with both of those things done.
Attachment #8778465 - Flags: review?(bzbarsky) → review+
Pushed by bholley@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/2629e4786dd8
Zero-index the namespace manager URIs. r=bz
https://hg.mozilla.org/mozilla-central/rev/2629e4786dd8
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: