Closed
Bug 233643
Opened 21 years ago
Closed 17 years ago
XUL needs to clone inline-style rule before modifying it
Categories
(Core :: XUL, defect)
Core
XUL
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha5
People
(Reporter: sicking, Assigned: Gavin)
References
(Blocks 1 open bug)
Details
Attachments
(2 files, 1 obsolete file)
2.63 KB,
application/vnd.mozilla.xul+xml
|
Details | |
7.94 KB,
patch
|
Details | Diff | Splinter Review |
Currently the prototype and contentnode share stylerule. When that stylerule is changed through .style we need to clone the rule before modifying it's declaration. Otherwise we end up modifying the declaration used by the prototype.
Comment 1•21 years ago
|
||
sicking, any chance you could just do this?
Reporter | ||
Comment 2•21 years ago
|
||
This might be another case where doing the RightThing might be too costly. I'm not sure if we should clone the rule just because nsXULElement::GetStyle is called, but anything later then that will be too late. One solution is to let the stylerule clone the declaration if it notices that it has more then one reference to it. Or some such...
Comment 3•20 years ago
|
||
Do we need to make a lighter-weight thing to clone? Or is the style rule as light as it can get for the needs of a fix for this bug? /be
Comment 4•20 years ago
|
||
Frankly, we should just clone in GetStyle. If someone does that to a XUL element, they're up to no good anyway and deserve the perf hit.
Updated•19 years ago
|
Flags: blocking1.8b3?
Updated•19 years ago
|
Flags: blocking1.8b4?
Flags: blocking1.8b3?
Flags: blocking1.8b3-
Updated•19 years ago
|
Whiteboard: [no l10n impact]
Updated•19 years ago
|
Flags: blocking1.8b4? → blocking1.8b4-
Assignee | ||
Comment 5•17 years ago
|
||
Assignee: hyatt → gavin.sharp
Status: NEW → ASSIGNED
Assignee | ||
Updated•17 years ago
|
QA Contact: shrir → xptoolkit.xul
Whiteboard: [no l10n impact]
Target Milestone: --- → mozilla1.9alpha4
Assignee | ||
Comment 6•17 years ago
|
||
This fixes the testcase in this bug, but I'm not sure that I've done everything correctly. The MakeHeavyweight change is an unrelated correctness fix that Boris requested over IRC (though I'm not sure that this is what he meant). Cloning the CSSStyleRuleValue on any given element's first GetStyle() seems rather expensive (unless there's some simpler way that I'm unaware of). People calling GetStyle on a XUL element may be "up to no good", but the fact is we seem to do it quite a bit in Firefox/Toolkit chrome (see e.g. http://lxr.mozilla.org/seamonkey/search?string=.style. ), though maybe none of those are in any critical paths.
Comment 7•17 years ago
|
||
That patch looks like about what I was thinking... As for it being expensive... yes. It is. The problem is that after that point we can't easily detect attempts to set. If that change actually causes a noticeable Txul/Ts/memory-use hit, we can worry about it then. I rather doubt it will.
Assignee | ||
Updated•17 years ago
|
Attachment #260310 -
Flags: superreview?(jonas)
Attachment #260310 -
Flags: review?(jonas)
Reporter | ||
Comment 8•17 years ago
|
||
Comment on attachment 260310 [details] [diff] [review] patch Looks good. I assume that you tested that this test fails on trunk, but passes with this test?
Attachment #260310 -
Flags: superreview?(jonas)
Attachment #260310 -
Flags: superreview+
Attachment #260310 -
Flags: review?(jonas)
Attachment #260310 -
Flags: review+
Assignee | ||
Comment 9•17 years ago
|
||
(In reply to comment #8) > (From update of attachment 260310 [details] [diff] [review]) > Looks good. I assume that you tested that this test fails on trunk, but passes > with this test? I did, but I'll test again before landing.
Whiteboard: [checkin needed]
Assignee | ||
Comment 10•17 years ago
|
||
This is the same patch, with the test updated to deal with the test issue found in bug 377295.
Attachment #260310 -
Attachment is obsolete: true
Comment on attachment 263175 [details] [diff] [review] updated patch > _TEST_FILES = test_bug330705-2.xul \ >+ test_bug233643.xul \ > $(NULL) Something's wrong with the indentation here.
Assignee | ||
Comment 12•17 years ago
|
||
(In reply to comment #11) > Something's wrong with the indentation here. Thanks, I noticed that too but forgot to fix it before uploading the patch. I've fixed this locally.
Assignee | ||
Comment 13•17 years ago
|
||
For some reason the "r+sr=sicking" part of my commit message got cut off, but I've landed this on the trunk. mozilla/content/xul/content/src/nsXULElement.cpp 1.696 mozilla/content/xul/content/test/Makefile.in 1.2 mozilla/content/xul/content/test/test_bug233643.xul 1.1
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Target Milestone: mozilla1.9alpha4 → mozilla1.9alpha5
Updated•17 years ago
|
Flags: in-testsuite+
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.xul → xptoolkit.widgets
You need to log in
before you can comment on or make changes to this bug.
Description
•