WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
41921
Coalesce text nodes when foster parenting
https://bugs.webkit.org/show_bug.cgi?id=41921
Summary
Coalesce text nodes when foster parenting
Adam Barth
Reported
2010-07-08 17:36:19 PDT
Coalesce text nodes when foster parenting
Attachments
Patch
(11.00 KB, patch)
2010-07-08 17:41 PDT
,
Adam Barth
eric
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Adam Barth
Comment 1
2010-07-08 17:41:46 PDT
Created
attachment 60989
[details]
Patch
Eric Seidel (no email)
Comment 2
2010-07-08 19:12:12 PDT
This feels wrong. Why is the if inside attach at site instead of Just having two separate methods?
Adam Barth
Comment 3
2010-07-08 19:18:50 PDT
Yeah, there's something wrong in the layering. I'm inclined to land this patch and then think the whole class through in another patch once we see the foreign content part. The class isn't that complicated.
Darin Adler
Comment 4
2010-07-08 23:37:52 PDT
Comment on
attachment 60989
[details]
Patch Drive-by comments:
> + // FIXME: We need an insertElement which does not send mutation events.
One way to deal with this is to create a function that promises it won't send mutation events, even if it can't yet deliver on that promise. Then you only need the FIXME in one place. Generally speaking we should probably have parents in the HTML parser be Element* instead of Node*. We should change things around to make that happen because Element has more efficient versions of some of the functions that you can call on Node in a less efficient fashion. I might get a chance to review this later, although I assume Eric will beat me to it.
Adam Barth
Comment 5
2010-07-08 23:41:58 PDT
> One way to deal with this is to create a function that promises it won't send mutation events, even if it can't yet deliver on that promise. Then you only need the FIXME in one place.
That's a good idea.
> Generally speaking we should probably have parents in the HTML parser be Element* instead of Node*. We should change things around to make that happen because Element has more efficient versions of some of the functions that you can call on Node in a less efficient fashion.
We can work towards that. We need to use nodes sometimes because we need to attach things to the document occasionally.
> I might get a chance to review this later, although I assume Eric will beat me to it.
You're welcome to review it, but this patch is ugly. We're learning more about what this class needs to do, and it's internal structure hasn't quite caught up yet. I'll try to make the class beautiful before we're done.
Eric Seidel (no email)
Comment 6
2010-07-09 02:49:33 PDT
Comment on
attachment 60989
[details]
Patch Sigh. We need to fix this. But I agree, it is clearer to land it first and then work from the fixed version towards a saner wholistic design.
Adam Barth
Comment 7
2010-07-09 02:58:11 PDT
Committed
r62924
: <
http://trac.webkit.org/changeset/62924
>
Darin Adler
Comment 8
2010-07-09 08:16:46 PDT
(In reply to
comment #5
)
> > Generally speaking we should probably have parents in the HTML parser be Element* instead of Node*. We should change things around to make that happen because Element has more efficient versions of some of the functions that you can call on Node in a less efficient fashion. > > We can work towards that. We need to use nodes sometimes because we need to attach things to the document occasionally.
If it can be a document, then we can still at least use ContainerNode*.
Daniel Bates
Comment 9
2010-07-23 22:24:11 PDT
Comment on
attachment 60989
[details]
Patch Clearing commit-queue flag to get this out of the commit-queue.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug