Summary: | Deploy EditingStyle in applyBlockStyle and applyInlineStyle | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> | ||||
Component: | HTML Editing | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Enhancement | CC: | darin, enrica, eric, ojan, tony | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 49956 | ||||||
Attachments: |
|
Description
Ryosuke Niwa
2011-02-07 01:33:04 PST
Created attachment 81464 [details]
Patch
Could someone review this patch? Comment on attachment 81464 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=81464&action=review > Source/WebCore/ChangeLog:21 > + (WebCore::ApplyStyleCommand::removeInlineStyleFromElement): Allows style to be null; exit early instead. Is this because of the changes to removeInlineStyle() at ApplyStyleCommand.cpp:917,921? > Source/WebCore/editing/ApplyStyleCommand.cpp:895 > + style->textDirection(textDirection); Nit: Do you need to check the return value here? Comment on attachment 81464 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=81464&action=review Thanks for the review, Tony. >> Source/WebCore/ChangeLog:21 >> + (WebCore::ApplyStyleCommand::removeInlineStyleFromElement): Allows style to be null; exit early instead. > > Is this because of the changes to removeInlineStyle() at ApplyStyleCommand.cpp:917,921? Not really. The reason is that EditingStyle::style() can return a null-pointer, and these functions previously assumed that the style is always not null. >> Source/WebCore/editing/ApplyStyleCommand.cpp:895 >> + style->textDirection(textDirection); > > Nit: Do you need to check the return value here? Oops, I must have done: ASSERT(style->textDirection(textDirection)); (In reply to comment #4) > > Is this because of the changes to removeInlineStyle() at ApplyStyleCommand.cpp:917,921? > > Not really. The reason is that EditingStyle::style() can return a null-pointer, and these functions previously assumed that the style is always not null. I think the change is fine, but it would be nice if you had a test case that showed this possibility. (In reply to comment #5) > (In reply to comment #4) > > > Is this because of the changes to removeInlineStyle() at ApplyStyleCommand.cpp:917,921? > > > > Not really. The reason is that EditingStyle::style() can return a null-pointer, and these functions previously assumed that the style is always not null. > > I think the change is fine, but it would be nice if you had a test case that showed this possibility. Oh, indeed some existing tests crash without this change because any test that inserts anchor element has null style pointer. Committed r78417: <http://trac.webkit.org/changeset/78417> |