Closed
Bug 370416
Opened 18 years ago
Closed 18 years ago
textPath not updating properly when path changes
Categories
(Core :: SVG, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: tor, Assigned: tor)
References
()
Details
Attachments
(3 files, 1 obsolete file)
|
8.34 KB,
patch
|
longsonr
:
review+
|
Details | Diff | Splinter Review |
|
8.17 KB,
patch
|
longsonr
:
review+
sicking
:
superreview+
|
Details | Diff | Splinter Review |
|
7.97 KB,
patch
|
Details | Diff | Splinter Review |
textPath currently puts an observer on the nsSVGPathSegList, but a change I made last year to create the seglist lazily means that it ends up watching an orphaned list as soon as the path data is changed.
Won't properly update after deletion of the path element, but the current code is no better, and we're currently talking about how this could be best accomplished.
Attachment #255128 -
Flags: review?(jonas)
Comment 2•18 years ago
|
||
(In reply to comment #1)
> Created an attachment (id=255128) [details]
> use nsIMutationObserver on the path element itself
>
> Won't properly update after deletion of the path element, but the current code
> is no better, and we're currently talking about how this could be best
> accomplished.
>
How about hoisting UpdateGraphic to nsSVGTextContainerFrame.
It could then be used in nsSVGTSpanFrame::AttributeChanged although that's probably a follow up kind of thing.
Comment 5•18 years ago
|
||
(In reply to comment #3)
> Yes, I can address that in a follow-up.
>
UpdateGraphic changes checked in under bug 372689.
Comment on attachment 255128 [details] [diff] [review]
use nsIMutationObserver on the path element itself
>Index: layout/svg/base/src/nsSVGTextPathFrame.cpp
>+nsSVGPathListener::AttributeChanged(nsIDocument *aDocument,
>+ nsIContent *aContent,
>+ PRInt32 aNameSpaceID,
>+ nsIAtom *aAttribute,
>+ PRInt32 aModType)
>+{
>+ mTextPathFrame->UpdateGraphic();
>+}
How can you be sure that mTextPathFrame hasn't been deleted at this point? I guess the frame is the only thing keeping the listener alive, but it feels scary since at least nsNodeUtils will also at least temporarily hold a strong reference to the listener.
I'm fine with "fixing" this using just assertions if there really is no way this could be a problem.
I'd rather sr this since I don't fully understand the functional changes.
Attachment #255128 -
Flags: review?(jonas) → superreview+
Attachment #255128 -
Attachment is obsolete: true
Attachment #260841 -
Flags: review?(longsonr)
Comment 8•18 years ago
|
||
Comment on attachment 260841 [details] [diff] [review]
update to tip, don't store frame pointer
You could hsve stored a pointer to the textpath frame rather than the element in the listener.
You would not have to have a ref counted pointer to the frame, nor would you have to look it up in nsSVGPathListener::AttributeChanged which would be a tad faster.
When the frame dies, its listener dies so we would not have any lifetime problems.
There's nothing functionally wrong with doing it this way though. r=longsonr either way.
Attachment #260841 -
Flags: review?(longsonr) → review+
Attachment #261051 -
Flags: review?
Attachment #261051 -
Flags: review? → review?(longsonr)
Updated•18 years ago
|
Attachment #261051 -
Flags: review?(longsonr) → review+
Attachment #261051 -
Flags: superreview?(jonas)
Comment on attachment 261051 [details] [diff] [review]
back to frameptr
Use NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED in the nsSVGPathListener.
sr=me with that
Attachment #261051 -
Flags: superreview?(jonas) → superreview+
| Assignee | ||
Comment 11•18 years ago
|
||
| Assignee | ||
Comment 12•18 years ago
|
||
Checked in.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Updated•18 years ago
|
Flags: in-testsuite?
Updated•4 months ago
|
Flags: in-testsuite? → in-testsuite+
You need to log in
before you can comment on or make changes to this bug.
Description
•