Closed
Bug 339807
Opened 19 years ago
Closed 19 years ago
SVG layout changes should be flushed before DOM calls
Categories
(Core :: SVG, defect)
Core
SVG
Tracking
()
RESOLVED
FIXED
People
(Reporter: longsonr, Assigned: longsonr)
References
()
Details
Attachments
(1 file, 1 obsolete file)
|
8.90 KB,
patch
|
tor
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
If the layout is updated and DOM functions are called the functions will return data appropriate to the old rather than the updated layout.
| Assignee | ||
Comment 1•19 years ago
|
||
As discussed in mozilla.tech.dev.svg group
Bug .getBBox() and .getCharNumAtPosition() after modifiying text-anchor attribute
Comment 2•19 years ago
|
||
> + NS_ERROR("no document");
Er... NO. Do NOT do that. Having no current doc is a perfectly reasonable state of things for a DOM node. Having a DOM API called on such node is also perfectly reasonable. Asserting when this happens is NOT acceptable. Furthermore, does the SVG spec really not define a better error code than NS_ERROR_FAILURE for this case?
> + NS_ERROR("no presshell");
Again, this is NOT something you can assert.
I see that nsSVGPathElement, nsSVGTextElement, nsSVGTextPathElement, and nsSVGTSpanElement already have such bogus asserts. Please remove them.
| Assignee | ||
Comment 3•19 years ago
|
||
Attachment #223918 -
Attachment is obsolete: true
Attachment #223933 -
Flags: review?(tor)
Attachment #223918 -
Flags: review?(tor)
| Assignee | ||
Comment 4•19 years ago
|
||
As far as I can tell the SVG spec does not define any failure codes except invalid argument values for it's own functions. Things like what happens if the element is display:none and you call a DOM function on it are not mentioned.
Attachment #223933 -
Flags: review?(tor) → review+
| Assignee | ||
Updated•19 years ago
|
Attachment #223933 -
Flags: superreview?(bzbarsky)
Comment 5•19 years ago
|
||
Comment on attachment 223933 [details] [diff] [review]
address bz's comments
sr=bzbarsky, though this looks like it should perhaps be a GetPresShell method on some common superclass instead of copy/pasting the same code a bunch of times.
Attachment #223933 -
Flags: superreview?(bzbarsky) → superreview+
| Assignee | ||
Comment 6•19 years ago
|
||
Checked in.
Checking in nsSVGGraphicElement.cpp;
/cvsroot/mozilla/content/svg/content/src/nsSVGGraphicElement.cpp,v <-- nsSVGGraphicElement.cpp
new revision: 1.32; previous revision: 1.31
done
Checking in nsSVGPathElement.cpp;
/cvsroot/mozilla/content/svg/content/src/nsSVGPathElement.cpp,v <-- nsSVGPathElement.cpp
new revision: 1.18; previous revision: 1.17
done
Checking in nsSVGSVGElement.cpp;
/cvsroot/mozilla/content/svg/content/src/nsSVGSVGElement.cpp,v <-- nsSVGSVGElement.cpp
new revision: 1.69; previous revision: 1.68
done
Checking in nsSVGTSpanElement.cpp;
/cvsroot/mozilla/content/svg/content/src/nsSVGTSpanElement.cpp,v <-- nsSVGTSpanElement.cpp
new revision: 1.22; previous revision: 1.21
done
Checking in nsSVGTextElement.cpp;
/cvsroot/mozilla/content/svg/content/src/nsSVGTextElement.cpp,v <-- nsSVGTextElement.cpp
new revision: 1.25; previous revision: 1.24
done
Checking in nsSVGTextPathElement.cpp;
/cvsroot/mozilla/content/svg/content/src/nsSVGTextPathElement.cpp,v <-- nsSVGTextPathElement.cpp
new revision: 1.6; previous revision: 1.5
done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•