REGRESSION(r146025): WebKit applications can't apply underline or strike through
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Apr 2013 18:25:38 +0000 (18:25 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Apr 2013 18:25:38 +0000 (18:25 +0000)
https://bugs.webkit.org/show_bug.cgi?id=114662

Reviewed by Enrica Casucci.

Use -webkit- prefixes to apply underline. There should be no further compatibility issues
since -khtml- was used only internally to pass the information down to WebCore.

Unfortunately, we can't test this code like any other font panel bug.

In the long run, we need to add some abstraction layer around font panel to make this testable
or else we'll keep regressing this feature.

* WebView/WebHTMLView.mm:
(-[WebHTMLView _styleFromFontAttributes:]):
(-[WebHTMLView _styleForAttributeChange:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@148525 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebHTMLView.mm

index 62fe94d8cc12ef7e460de011f6c42e43525a4edf..ac4dd71e8f4792df36b2d9ca86abdded0884783c 100644 (file)
@@ -1,3 +1,22 @@
+2013-04-15  Ryosuke Niwa  <rniwa@webkit.org>
+
+        REGRESSION(r146025): WebKit applications can't apply underline or strike through
+        https://bugs.webkit.org/show_bug.cgi?id=114662
+
+        Reviewed by Enrica Casucci.
+
+        Use -webkit- prefixes to apply underline. There should be no further compatibility issues
+        since -khtml- was used only internally to pass the information down to WebCore.
+
+        Unfortunately, we can't test this code like any other font panel bug.
+
+        In the long run, we need to add some abstraction layer around font panel to make this testable
+        or else we'll keep regressing this feature.
+
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView _styleFromFontAttributes:]):
+        (-[WebHTMLView _styleForAttributeChange:]):
+
 2013-04-15  Anders Carlsson  <andersca@apple.com>
 
         plugins/get-url-beforeunload-destroys-plugin.html crashes in WebKit1
 2013-04-15  Anders Carlsson  <andersca@apple.com>
 
         plugins/get-url-beforeunload-destroys-plugin.html crashes in WebKit1
index 551872ddb45a986e11f9b7d34e7bfa80408493eb..454807490979b931e2143a792bbf1e3819bfa9c5 100644 (file)
@@ -4336,11 +4336,11 @@ static PassRefPtr<KeyboardEvent> currentKeyboardEvent(Frame* coreFrame)
     int underlineInt = [[dictionary objectForKey:NSUnderlineStyleAttributeName] intValue];
     // FIXME: Underline wins here if we have both (see bug 3790443).
     if (strikethroughInt == NSUnderlineStyleNone && underlineInt == NSUnderlineStyleNone)
     int underlineInt = [[dictionary objectForKey:NSUnderlineStyleAttributeName] intValue];
     // FIXME: Underline wins here if we have both (see bug 3790443).
     if (strikethroughInt == NSUnderlineStyleNone && underlineInt == NSUnderlineStyleNone)
-        [style setProperty:@"-khtml-text-decorations-in-effect" value:@"none" priority:@""];
+        [style setProperty:@"-webkit-text-decorations-in-effect" value:@"none" priority:@""];
     else if (underlineInt == NSUnderlineStyleNone)
     else if (underlineInt == NSUnderlineStyleNone)
-        [style setProperty:@"-khtml-text-decorations-in-effect" value:@"line-through" priority:@""];
+        [style setProperty:@"-webkit-text-decorations-in-effect" value:@"line-through" priority:@""];
     else
     else
-        [style setProperty:@"-khtml-text-decorations-in-effect" value:@"underline" priority:@""];
+        [style setProperty:@"-webkit-text-decorations-in-effect" value:@"underline" priority:@""];
 
     return style;
 }
 
     return style;
 }
@@ -4588,10 +4588,10 @@ static PassRefPtr<KeyboardEvent> currentKeyboardEvent(Frame* coreFrame)
     int sb = [[b objectForKey:NSStrikethroughStyleAttributeName] intValue];
     if (sa == sb) {
         if (sa == NSUnderlineStyleNone)
     int sb = [[b objectForKey:NSStrikethroughStyleAttributeName] intValue];
     if (sa == sb) {
         if (sa == NSUnderlineStyleNone)
-            [style setProperty:@"-khtml-text-decorations-in-effect" value:@"none" priority:@""]; 
+            [style setProperty:@"-webkit-text-decorations-in-effect" value:@"none" priority:@""];
             // we really mean "no line-through" rather than "none"
         else
             // we really mean "no line-through" rather than "none"
         else
-            [style setProperty:@"-khtml-text-decorations-in-effect" value:@"line-through" priority:@""];
+            [style setProperty:@"-webkit-text-decorations-in-effect" value:@"line-through" priority:@""];
             // we really mean "add line-through" rather than "line-through"
     }
 
             // we really mean "add line-through" rather than "line-through"
     }
 
@@ -4610,10 +4610,10 @@ static PassRefPtr<KeyboardEvent> currentKeyboardEvent(Frame* coreFrame)
     int ub = [[b objectForKey:NSUnderlineStyleAttributeName] intValue];
     if (ua == ub) {
         if (ua == NSUnderlineStyleNone)
     int ub = [[b objectForKey:NSUnderlineStyleAttributeName] intValue];
     if (ua == ub) {
         if (ua == NSUnderlineStyleNone)
-            [style setProperty:@"-khtml-text-decorations-in-effect" value:@"none" priority:@""];
+            [style setProperty:@"-webkit-text-decorations-in-effect" value:@"none" priority:@""];
             // we really mean "no underline" rather than "none"
         else
             // we really mean "no underline" rather than "none"
         else
-            [style setProperty:@"-khtml-text-decorations-in-effect" value:@"underline" priority:@""];
+            [style setProperty:@"-webkit-text-decorations-in-effect" value:@"underline" priority:@""];
             // we really mean "add underline" rather than "underline"
     }
 
             // we really mean "add underline" rather than "underline"
     }