WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
52686
Setting outerHTML should merge text nodes
https://bugs.webkit.org/show_bug.cgi?id=52686
Summary
Setting outerHTML should merge text nodes
Emil A Eklund
Reported
2011-01-18 17:00:15 PST
When setting outerHTML adjacent text nodes should be merged. Setting outerText already has this behavior as does the IE implementation of setting outerHTML.
Attachments
Patch
(6.88 KB, patch)
2011-01-18 17:14 PST
,
Emil A Eklund
no flags
Details
Formatted Diff
Diff
Patch
(7.01 KB, patch)
2011-01-19 19:57 PST
,
Emil A Eklund
no flags
Details
Formatted Diff
Diff
Patch for landing
(7.01 KB, patch)
2011-04-29 16:37 PDT
,
Emil A Eklund
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Emil A Eklund
Comment 1
2011-01-18 17:14:40 PST
Created
attachment 79359
[details]
Patch
Alexey Proskuryakov
Comment 2
2011-01-19 00:43:10 PST
> This matches the behavior of outerText and the IE implementation of outerHTML.
Does HTML5 specify such behavior?
Emil A Eklund
Comment 3
2011-01-19 12:33:01 PST
> Does HTML5 specify such behavior?
No, HTML5 doesn't specify how text nodes should be handled when setting outerHTML and doesn't cover outerText at all.
Adam Barth
Comment 4
2011-01-19 18:59:43 PST
Comment on
attachment 79359
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=79359&action=review
> Source/WebCore/html/HTMLElement.cpp:386 > HTMLElement* parent = static_cast<HTMLElement*>(p);
We don't need to hold a reference to parent here? It's strange that we re-check parentNode for null below but don't hold a ref here.
Emil A Eklund
Comment 5
2011-01-19 19:25:33 PST
Comment on
attachment 79359
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=79359&action=review
>> Source/WebCore/html/HTMLElement.cpp:386
> > We don't need to hold a reference to parent here? It's strange that we re-check parentNode for null below but don't hold a ref here.
Good point, I'll change it to hold a reference to the parent node instead.
Emil A Eklund
Comment 6
2011-01-19 19:57:33 PST
Created
attachment 79543
[details]
Patch
Emil A Eklund
Comment 7
2011-01-26 10:49:27 PST
Ping?
Tony Chang
Comment 8
2011-04-26 15:26:19 PDT
Comment on
attachment 79543
[details]
Patch Seems fine.
Tony Chang
Comment 9
2011-04-26 15:27:12 PDT
Oh, are we worried that we don't collapse chains of text nodes or should we not get into that state because we collapse at every change? What does IE do in this case?
Emil A Eklund
Comment 10
2011-04-26 15:46:07 PDT
We shouldn't be able to get into that state. If you can think of any case where we could I'd love to hear about it! IE always collapses adjacent text nodes.
Emil A Eklund
Comment 11
2011-04-29 16:37:24 PDT
Created
attachment 91765
[details]
Patch for landing
WebKit Commit Bot
Comment 12
2011-04-29 17:23:12 PDT
Comment on
attachment 91765
[details]
Patch for landing Clearing flags on attachment: 91765 Committed
r85374
: <
http://trac.webkit.org/changeset/85374
>
WebKit Commit Bot
Comment 13
2011-04-29 17:23:18 PDT
All reviewed patches have been landed. Closing bug.
Aryeh Gregor
Comment 14
2011-05-02 15:42:58 PDT
Could you please file bugs against HTML5 when you find problems with it, instead of just changing behavior and letting the spec remain incorrect? You don't have to make an account or anything. Just go to
http://whatwg.org/html5/
, find the right part of the spec, and file a comment in the little box at the bottom. I just filed a bug:
http://www.w3.org/Bugs/Public/show_bug.cgi?id=12584
Emil A Eklund
Comment 15
2011-05-03 13:47:37 PDT
Certainly. Thanks for the pointer.
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