Bug 28057

Summary: deprecatedCopyInheritableProperties must be replaced by two different functions
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: HTML EditingAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: eric, justin.garcia
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 20348    
Attachments:
Description Flags
adds new functions to ApplyStyleCommand.* and removes deprecatedCopyInheritableProperties justin.garcia: review+

Description Ryosuke Niwa 2009-08-06 15:35:38 PDT
As a follow up to https://bugs.webkit.org/show_bug.cgi?id=27325, deprecatedCopyInheritableProperties must be replaced by two separate functions:

1. Preparing style to apply - Delete CSS properties that are already present at the specified position from a mutable style.
2. Typing styles - Retrieve mutable style merged with the typing style
Comment 1 Ryosuke Niwa 2009-08-06 17:07:56 PDT
Created attachment 34235 [details]
adds new functions to ApplyStyleCommand.* and removes deprecatedCopyInheritableProperties
Comment 2 Eric Seidel (no email) 2009-08-06 17:12:22 PDT
Comment on attachment 34235 [details]
adds new functions to ApplyStyleCommand.* and removes deprecatedCopyInheritableProperties

I don't believe you that this doens't change behavior.

A bunch of the editingStyleAtPosition calls now use IncludeTypingStyle which didn't before.
Comment 3 Ryosuke Niwa 2009-08-06 17:47:50 PDT
This patch follows the rules below:

1. styleAtPosition merges the computed style at the position and the typing style. So every instance of styleAtPosition MUST be replaced by editingStyleAtPosition(selection.start(), IncludeTypingStyle);

2. computedStyle(<node>)->deprecatedCopyInheritableProperties()->diff(<style>) or any two-line codes that does a similar thing MUST be replaced by prepareEditingStyleToApplyAt(<style>, Position(<node>, 0)).  Note that prepareEditingStyleToApplyAt uses IgnoreTypingStyle implicitly.

3. All other instances of computedStyle(<node>)->deprecatedCopyInheritableProperties must be replaced by editingStyleAtPosition(positionBeforeTabSpan(Position(<node>,0));
Comment 4 Ryosuke Niwa 2009-08-07 14:46:22 PDT
Landed in http://trac.webkit.org/changeset/46914.
Comment 5 Eric Seidel (no email) 2009-09-08 08:59:17 PDT
This is believed to have caused http://code.google.com/p/chromium/issues/detail?id=21203.  I'm not sure if that has a WebKit bug yet, it certainly needs one.
Comment 6 Ryosuke Niwa 2009-09-08 09:08:39 PDT
(In reply to comment #5)
> This is believed to have caused
> http://code.google.com/p/chromium/issues/detail?id=21203.  I'm not sure if that
> has a WebKit bug yet, it certainly needs one.

https://bugs.webkit.org/show_bug.cgi?id=28710 is the corresponding WebKit bug.