Closed
Bug 344258
Opened 19 years ago
Closed 17 years ago
Make <svg:use> live to id changes in document
Categories
(Core :: SVG, defect)
Core
SVG
Tracking
()
RESOLVED
FIXED
People
(Reporter: tor, Assigned: roc)
References
Details
Attachments
(5 files)
81.78 KB,
patch
|
jst
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
58.27 KB,
patch
|
jst
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
42.98 KB,
patch
|
jst
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
18.47 KB,
patch
|
longsonr
:
review+
MatsPalmgren_bugz
:
superreview+
|
Details | Diff | Splinter Review |
28.36 KB,
patch
|
Details | Diff | Splinter Review |
See bug 343900 comment 5.
Specifically the last paragraph:
"The way we could implement an observer mechanism is to add an array to the
IdAndNameMapEntry class that contains all observers that are interested in
knowing whenever the mapping for this id changes. Should be very performant."
We would first have to move the id-hash from nsHTMLDocument up to nsDocument of course.
*** Bug 311715 has been marked as a duplicate of this bug. ***
Comment 3•19 years ago
|
||
I'd love to push the ID hash up!
Assignee | ||
Comment 4•17 years ago
|
||
I have a fix for this in my tree. Part of the fix is to push up the ID table.
Assignee: general → roc
Assignee | ||
Comment 5•17 years ago
|
||
-- Move ID table up to nsDocument
-- Moves implement of GetElementById up to nsDocument
-- Make it use nsTHashtable
-- Avoids direct access to nsIdentifierMapEntry fields by encapsulating stuff in methods
-- removes nsXMLDocument::GetElementById since it's no longer needed
Attachment #325895 -
Flags: superreview?(jst)
Attachment #325895 -
Flags: review?(jst)
Assignee | ||
Comment 6•17 years ago
|
||
Gets rid of XUL's own ID table mess to use the new shared stuff.
This is a bit complicated since XUL stores both 'id' and 'ref'-named elements in its table. So I create a seperate ref-to-element map for XUL. This actually could change behaviour in situations where we have elements with both id="foo" and ref="foo" --- now we'll always prefer the id-element when you call getElementById. I think that should be OK.
I also fixed the tests to reflect the fact that this makes XUL more sane.
Attachment #325897 -
Flags: superreview?(jst)
Attachment #325897 -
Flags: review?(jst)
Assignee | ||
Comment 7•17 years ago
|
||
Creates change-observer hooks accessible through nsIDocument. These fire at risky times and are not all that convenient to use.
Creates nsReferencedElement which is the preferred way to watch for ID-mapping changes. Much more convenient to use and uses nsContentUtils::AddScriptRunner to ensure that its notifications only happen at safe times.
Attachment #325900 -
Flags: superreview?(jst)
Attachment #325900 -
Flags: review?(jst)
Assignee | ||
Comment 8•17 years ago
|
||
Not requesting reviews on this part yet since it depends parts 3 and 1 in a major way. But it shows how nsReferencedElement can be used, and it includes tests that exercise the functionality of parts 1 and 3.
Assignee | ||
Comment 9•17 years ago
|
||
Again, not going for reviews yet. In fact it might make more sense to roll this up into some of my other filter work for review. Just putting it here because I have the patch around.
Updated•17 years ago
|
Attachment #325900 -
Attachment is patch: true
Attachment #325900 -
Attachment mime type: application/text → text/plain
Comment 10•17 years ago
|
||
Comment on attachment 325895 [details] [diff] [review]
part 1: move ID table to nsDocument from nsHTMLDocument
Looks good, but these two changes look unrelated (and incorrect):
nsresult
-nsHTMLDocument::SetEditingState(EditingState aState)
-{
- mEditingState = aState;
- return NS_OK;
-}
-
-nsresult
nsHTMLDocument::EditingStateChanged()
{
- if (mRemovedFromDocShell) {
- return NS_OK;
- }
-
Attachment #325895 -
Flags: superreview?(jst)
Attachment #325895 -
Flags: superreview+
Attachment #325895 -
Flags: review?(jst)
Attachment #325895 -
Flags: review+
Updated•17 years ago
|
Attachment #325897 -
Flags: superreview?(jst)
Attachment #325897 -
Flags: superreview+
Attachment #325897 -
Flags: review?(jst)
Attachment #325897 -
Flags: review+
Updated•17 years ago
|
Attachment #325900 -
Flags: superreview?(jst)
Attachment #325900 -
Flags: superreview+
Attachment #325900 -
Flags: review?(jst)
Attachment #325900 -
Flags: review+
Assignee | ||
Comment 11•17 years ago
|
||
Hrm. I'll do some archaeology to find out how those changes got into the patches. Thanks!
Assignee | ||
Comment 12•17 years ago
|
||
Checked in patch 1.
Assignee | ||
Comment 13•17 years ago
|
||
Comment on attachment 325903 [details] [diff] [review]
part 4: Use nsReferencedElement to track ID-map changes for <use>
Ok, since jst approved the nsReferencedElement API let's go for review on the real patch now.
Attachment #325903 -
Flags: superreview?(mats.palmgren)
Attachment #325903 -
Flags: review?(longsonr)
Assignee | ||
Comment 14•17 years ago
|
||
Checked in part 2.
Comment 15•17 years ago
|
||
Comment on attachment 325903 [details] [diff] [review]
part 4: Use nsReferencedElement to track ID-map changes for <use>
Looks good to me. sr=mats
> content/svg/content/src/nsSVGUseElement.h
We need to bump the UUID for nsSVGUseElement, right?
+ SourceReference mSource; // observed element
One more space before the // and the comments would line up.
Attachment #325903 -
Flags: superreview?(mats.palmgren) → superreview+
Assignee | ||
Comment 16•17 years ago
|
||
Yeah, I suppose I should bump that UUID.
Updated•17 years ago
|
Attachment #325903 -
Flags: review?(longsonr) → review+
Assignee | ||
Comment 17•17 years ago
|
||
Checked in part 3.
Assignee | ||
Comment 18•17 years ago
|
||
checked in part 4. Thanks all.
Status: NEW → RESOLVED
Closed: 17 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Comment 19•17 years ago
|
||
Will patch 5 be reviewed in another bug?
Assignee | ||
Comment 20•17 years ago
|
||
Maybe. There are other changes to that code in my tree and I have to figure out whether it's easier to review individual patches or combined patches.
Comment 21•16 years ago
|
||
Comment on attachment 325900 [details] [diff] [review]
part 3: Infrastructure for tracking ID-map changes
>+ return NS_PTR_TO_INT32(aKey->mCallback) >> 2 +
>+ NS_PTR_TO_INT32(aKey->mData);
I'm getting a compiler warning about operator precedence here. Did you really mean mCallback >> (2 + mData)? If yes, then please fix the confusing formatting and put some parentheses around it.
Comment 22•16 years ago
|
||
No, that warning is catching a bug. I pushed changeset eaa47afa4c3a to fix that.
You need to log in
before you can comment on or make changes to this bug.
Description
•