Closed Bug 346373 Opened 18 years ago Closed 18 years ago

Changing spellcheck attribute on parent element doesn't resync children

Categories

(Core :: Spelling checker, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.8.1

People

(Reporter: pkasting, Assigned: pkasting)

References

Details

(Keywords: fixed1.8.1)

Attachments

(2 files, 1 obsolete file)

From bug 339127 comment 55, when the spellcheck attribute on a node changes, all the node's children should resync, not just the node itself.  Otherwise dynamic changes to attributes won't affect inheriting editors "on the fly".
No longer blocks: 339127
Attached file Testcase
This testcase demonstrates the issue.
Attached patch patch v1 (obsolete) — Splinter Review
This patch fixes my testcase.

The only tricky bit here is that we should traverse past non-HTML elements to their children during the subtree notification.  This patch should get that right, but I don't have a testcase demonstrating it.
Attachment #234856 - Flags: superreview?(bugmail)
Attachment #234856 - Flags: review?(bzbarsky)
Requesting blocking since we need to actually implement the spellcheck attribute spec correctly in Fx2.
Blocks: 339127
Flags: blocking1.8.1?
Target Milestone: --- → mozilla1.8.1
Comment on attachment 234856 [details] [diff] [review]
patch v1

>Index: content/html/content/src/nsGenericHTMLElement.cpp
>+    nsIContent* childContent = content->GetChildAt(i);
>+    if (childContent) {

No need for that check if we're sure the child list cannot mutate.

r=bzbarsky with that
Attachment #234856 - Flags: review?(bzbarsky) → review+
Flags: blocking1.8.1? → blocking1.8.1+
Comment on attachment 234856 [details] [diff] [review]
patch v1

sr=me with bz's comment. But if you're not 100% sure that the DOM can't mutate just keep the extra check. Better safe then sorry...
Attachment #234856 - Flags: superreview?(bugmail) → superreview+
Checked in on trunk:

/mozilla/content/html/content/src/nsGenericHTMLElement.cpp 1.668
/mozilla/content/html/content/src/nsGenericHTMLElement.h 1.246

I don't think the DOM can mutate, but I'd rather be defensive.  So I left the check in, but added an assertion that the childContent pointer is non-NULL right before it.

Leaving open until this makes it onto branch.
Whiteboard: [baking]
Here's what I actually committed.
Attachment #234856 - Attachment is obsolete: true
Attachment #235333 - Flags: approval1.8.1?
Comment on attachment 235333 [details] [diff] [review]
patch (as committed)

a=schrep for drivers
Attachment #235333 - Flags: approval1.8.1? → approval1.8.1+
Checked in on branch.

/mozilla/content/html/content/src/nsGenericHTMLElement.cpp 1.596.2.14
/mozilla/content/html/content/src/nsGenericHTMLElement.h 1.221.6.4
Status: NEW → RESOLVED
Closed: 18 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
Whiteboard: [baking]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: