Bug 915079 - Composition text should be underlined on Firefox OS devices. r=masayuki
authorYuan Xulei <xyuan@mozilla.com>
Sun, 22 Sep 2013 17:44:26 +0800
changeset 148276 7f46781f97a1bb2478d1e4ad274e01687f5e30a6
parent 148275 5ec7b5e4876462abc2d23f134623ab63004b5d09
child 148277 b0770caee5e50e23fa722b4beede3890acda0777
push id25334
push userryanvm@gmail.com
push dateMon, 23 Sep 2013 20:58:03 +0000
treeherdermozilla-central@577cf2dd7e01 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs915079
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 915079 - Composition text should be underlined on Firefox OS devices. r=masayuki
widget/gonk/nsLookAndFeel.cpp
widget/gonk/nsLookAndFeel.h
--- a/widget/gonk/nsLookAndFeel.cpp
+++ b/widget/gonk/nsLookAndFeel.cpp
@@ -80,17 +80,17 @@ nsLookAndFeel::NativeGetColor(ColorID aI
         break;
     case eColorID_Widget3DShadow:
         aColor = NS_RGB(0x40,0x40,0x40);
         break;
     case eColorID_TextBackground:
         // not used?
         aColor = BASE_NORMAL_COLOR;
         break;
-    case eColorID_TextForeground: 
+    case eColorID_TextForeground:
         // not used?
         aColor = TEXT_NORMAL_COLOR;
         break;
     case eColorID_TextSelectBackground:
     case eColorID_IMESelectedRawTextBackground:
     case eColorID_IMESelectedConvertedTextBackground:
         // still used
         aColor = BASE_SELECTED_COLOR;
@@ -241,17 +241,17 @@ nsLookAndFeel::NativeGetColor(ColorID aI
     case eColorID__moz_dialog:
         aColor = BG_NORMAL_COLOR;
         break;
     case eColorID__moz_dialogtext:
         aColor = FG_NORMAL_COLOR;
         break;
     case eColorID__moz_dragtargetzone:
         aColor = BG_SELECTED_COLOR;
-        break; 
+        break;
     case eColorID__moz_buttondefault:
         // default button border color
         aColor = NS_RGB(0,0,0);
         break;
     case eColorID__moz_buttonhoverface:
         aColor = BG_PRELIGHT_COLOR;
         break;
     case eColorID__moz_buttonhovertext:
@@ -354,16 +354,26 @@ nsLookAndFeel::GetIntImpl(IntID aID, int
 
         case eIntID_WindowsDefaultTheme:
         case eIntID_WindowsThemeIdentifier:
         case eIntID_OperatingSystemVersionIdentifier:
             aResult = 0;
             rv = NS_ERROR_NOT_IMPLEMENTED;
             break;
 
+        case eIntID_IMERawInputUnderlineStyle:
+        case eIntID_IMEConvertedTextUnderlineStyle:
+            aResult = NS_STYLE_TEXT_DECORATION_STYLE_SOLID;
+            break;
+
+        case eIntID_IMESelectedRawTextUnderlineStyle:
+        case eIntID_IMESelectedConvertedTextUnderline:
+            aResult = NS_STYLE_TEXT_DECORATION_STYLE_NONE;
+            break;
+
         case eIntID_SpellCheckerUnderlineStyle:
             aResult = NS_STYLE_TEXT_DECORATION_STYLE_WAVY;
             break;
 
         case eIntID_ScrollbarButtonAutoRepeatBehavior:
             aResult = 0;
             break;
 
@@ -377,16 +387,38 @@ nsLookAndFeel::GetIntImpl(IntID aID, int
         default:
             aResult = 0;
             rv = NS_ERROR_FAILURE;
     }
 
     return rv;
 }
 
+nsresult
+nsLookAndFeel::GetFloatImpl(FloatID aID, float &aResult)
+{
+  nsresult res = nsXPLookAndFeel::GetFloatImpl(aID, aResult);
+  if (NS_SUCCEEDED(res))
+    return res;
+  res = NS_OK;
+
+  switch (aID) {
+    case eFloatID_IMEUnderlineRelativeSize:
+        aResult = 1.0f;
+        break;
+    case eFloatID_SpellCheckerUnderlineRelativeSize:
+        aResult = 1.0f;
+        break;
+    default:
+        aResult = -1.0;
+        res = NS_ERROR_FAILURE;
+    }
+  return res;
+}
+
 /*virtual*/
 bool
 nsLookAndFeel::GetFontImpl(FontID aID, nsString& aFontName,
                            gfxFontStyle& aFontStyle,
                            float aDevPixPerCSSPixel)
 {
     aFontName.AssignLiteral("\"Fira Sans\"");
     aFontStyle.style = NS_FONT_STYLE_NORMAL;
--- a/widget/gonk/nsLookAndFeel.h
+++ b/widget/gonk/nsLookAndFeel.h
@@ -23,16 +23,17 @@ class nsLookAndFeel : public nsXPLookAnd
 {
 public:
     nsLookAndFeel();
     virtual ~nsLookAndFeel();
 
     virtual bool GetFontImpl(FontID aID, nsString& aName, gfxFontStyle& aStyle,
                              float aDevPixPerCSSPixel);
     virtual nsresult GetIntImpl(IntID aID, int32_t &aResult);
+    virtual nsresult GetFloatImpl(FloatID aID, float &aResult);
     virtual bool GetEchoPasswordImpl();
     virtual uint32_t GetPasswordMaskDelayImpl();
     virtual PRUnichar GetPasswordCharacterImpl();
 
 protected:
     virtual nsresult NativeGetColor(ColorID aID, nscolor &aColor);
 };