Bug 27858

Summary: selectionHasStyle doesn't handle text-specific properties properly
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: HTML EditingAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: eric, justin.garcia, tonikitoo
Priority: P3    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Bug Depends on: 27865, 28055    
Bug Blocks: 23892    
Attachments:
Description Flags
fixes the bug, large because converts a pixel test to a dumpastext.
none
fixed per comment on IRC
none
fixes the bug
none
resubmission after split
eric: review+
reverts the behavioral change in Mac
none
fixes the bug and changes the WebKit behavior on all platforms except mac justin.garcia: review+

Description Ryosuke Niwa 2009-07-30 15:20:42 PDT
selectionHasStyle does not return TrueTriState when asked if <b><span style="text-decoration: underline;">hello</span><span style="text-decoration: underline;">world</span></b> is has underline.  Because b does not have underline style, it returns MixedTriState. It also does not take care of -webkit-text-decorations; i.e. text decorations added by u, s, and strike.
Comment 1 Ryosuke Niwa 2009-07-30 17:41:59 PDT
Created attachment 33849 [details]
fixes the bug, large because converts a pixel test to a dumpastext.
Comment 2 Ryosuke Niwa 2009-07-30 18:38:21 PDT
Created attachment 33852 [details]
fixed per comment on IRC
Comment 3 Ryosuke Niwa 2009-07-30 18:39:44 PDT
Will fix
// CSS properties that only has a visual difference when applied to text.
to
// CSS properties that have a visual difference only if applied to text.
Comment 4 Ryosuke Niwa 2009-07-30 18:42:11 PDT
Comment on attachment 33852 [details]
fixed per comment on IRC

will split into two patches.
Comment 5 Ryosuke Niwa 2009-08-04 18:17:49 PDT
Created attachment 34107 [details]
fixes the bug
Comment 6 Eric Seidel (no email) 2009-08-06 11:53:57 PDT
Comment on attachment 34107 [details]
fixes the bug

Converting the tests in one patch and then changing them in a second would be clearer.
Comment 7 Ryosuke Niwa 2009-08-06 14:15:06 PDT
The test conversion bug is filed as https://bugs.webkit.org/show_bug.cgi?id=28055 and the corresponding patch has been submitted.
Comment 8 Ryosuke Niwa 2009-08-06 17:38:36 PDT
Created attachment 34236 [details]
resubmission after split
Comment 9 Eric Seidel (no email) 2009-08-06 19:15:07 PDT
Comment on attachment 34236 [details]
resubmission after split

Looks OK.
Comment 10 Justin Garcia 2009-08-06 22:44:48 PDT
Comment on attachment 34236 [details]
resubmission after split

+        WebKit now applies the text styles (bold, italic, etc) if the specified style was not present on
+        at least one text node, rather than at the beginning of selection. This change is tested in toggle-compound-styles.

Sorry I didn't notice this until now but we behaved this way to match Mac OS X editing behavior (TextEdit).  Perhaps we should preserve the old behavior for Mac-only.
Comment 11 Ryosuke Niwa 2009-08-07 13:49:33 PDT
Created attachment 34325 [details]
reverts the behavioral change in Mac
Comment 12 Ryosuke Niwa 2009-08-07 14:21:31 PDT
Created attachment 34329 [details]
fixes the bug and changes the WebKit behavior on all platforms except mac
Comment 13 Ryosuke Niwa 2009-08-07 14:25:17 PDT
mn... I don't know why it has svn property change.  that doesn't seem right. 
should i delete that property change before I commit?
Comment 14 Ryosuke Niwa 2009-08-07 16:06:43 PDT
Landed in http://trac.webkit.org/changeset/46920.