Closed
Bug 153998
Opened 22 years ago
Closed 19 years ago
COtherDTD should go; composer should handle containment checking itself
Categories
(Core :: DOM: HTML Parser, defect, P3)
Core
DOM: HTML Parser
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha1
People
(Reporter: bzbarsky, Assigned: peterv)
References
Details
Attachments
(2 files)
24.16 KB,
patch
|
mrbkap
:
review+
jst
:
superreview+
asa
:
approval1.8b4-
|
Details | Diff | Splinter Review |
140.40 KB,
patch
|
Details | Diff | Splinter Review |
COtherDTD only exists because composer wants containment checking. It's a way too heavyweight solution for that... we should do the containment checking in composer itself and remove COtherDTD.
See also bug 130439. (The last patch there hasn't been checked in.)
Updated•19 years ago
|
Assignee: harishd → peterv
Assignee | ||
Comment 2•19 years ago
|
||
Attachment #187959 -
Flags: review?(mrbkap)
Assignee | ||
Comment 3•19 years ago
|
||
Comment 4•19 years ago
|
||
Comment on attachment 187959 [details] [diff] [review] v1 >Index: editor/libeditor/html/nsHTMLEditUtils.cpp >=================================================================== >+ >+ >+#define GROUP_NONE 0 Nit: Extra newline (though a comment explaining what these #defines are for would probably not hurt). Note: I'm assuming that you basically just translated the containment lists and the groups from the original code. From a quick check, everything looks OK, though. >+PRBool >+nsHTMLEditUtils::CanContain(PRInt32 aParent, PRInt32 aChild) >+{ >+#ifdef DEBUG >+ PRInt32 i; >+ for (i = 1; i <= eHTMLTag_userdefined; ++i) { >+ NS_ASSERTION(kElements[i - 1].mTag == i, >+ "You need to update kElements (missing tags)."); >+ } >+#endif Does this check need to happen every time someone calls ::CanContain in a debug build? Why not have something like: static PRBool checked = PR_FALSE; if (!checked) { checked = PR_TRUE; // check... } >+ return (parent.mCanContainGroups & child.mGroup) ? PR_TRUE : PR_FALSE; Nit: that could be "(parent.mCanContainGroups & child.mGroups) != 0", but that's a question of style. Other than those nits, r=me
Attachment #187959 -
Flags: review?(mrbkap) → review+
Assignee | ||
Updated•19 years ago
|
Attachment #187959 -
Flags: superreview?(jst)
Comment 5•19 years ago
|
||
Comment on attachment 187959 [details] [diff] [review] v1 Nice! sr=jst
Attachment #187959 -
Flags: superreview?(jst) → superreview+
Assignee | ||
Comment 6•19 years ago
|
||
Comment on attachment 187959 [details] [diff] [review] v1 This should give a bit of codesize reduction. I've verified that the new code returns the same result for all combinations of input as the old code by feeding all possible input values to both.
Attachment #187959 -
Flags: approval1.8b4?
Comment 7•19 years ago
|
||
My inclination is not to approve this for 1.8, since touching editor always tends to blow up and gets much less QA anyway: is there a good reason why we need this?
Assignee | ||
Comment 8•19 years ago
|
||
Well, I'm not going to spend much time on getting this approval. I felt confident enough about the code to ask for it, and from a quick measurement this gives about 20k codesize reduction on Windows.
Updated•19 years ago
|
QA Contact: moied → ian
Comment 9•19 years ago
|
||
Comment on attachment 187959 [details] [diff] [review] v1 Let's get this in on the trunk after we branch.
Attachment #187959 -
Flags: approval1.8b4? → approval1.8b4-
Assignee | ||
Comment 10•19 years ago
|
||
Finally checked this in. From brad: mZdiff:-36448.
Status: NEW → RESOLVED
Closed: 19 years ago
Priority: -- → P3
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.8beta4
Reporter | ||
Comment 11•19 years ago
|
||
So this just landed on the trunk, right? Not sure how to interpret the target milestone here...
Assignee | ||
Updated•19 years ago
|
Target Milestone: mozilla1.8beta4 → mozilla1.9alpha
Comment 12•19 years ago
|
||
*** Bug 63116 has been marked as a duplicate of this bug. ***
Comment 13•19 years ago
|
||
Comment on attachment 187959 [details] [diff] [review] v1 Unfortunately it seems as if this patch is also required to fix bug 299343 so I'm requesting the same approvals although less hopefully.
Attachment #187959 -
Flags: approval1.8.1?
Attachment #187959 -
Flags: approval1.8.0.1?
Assignee | ||
Comment 14•19 years ago
|
||
Comment on attachment 187959 [details] [diff] [review] v1 I see no need to put this on the branch, the patch for bug 299343 should be ported to the branch and that's unrelated to this patch.
Attachment #187959 -
Flags: approval1.8.1?
Attachment #187959 -
Flags: approval1.8.0.1?
You need to log in
before you can comment on or make changes to this bug.
Description
•