Changeset 76379 in webkit


Ignore:
Timestamp:
Jan 21, 2011 12:26:01 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-01-21 Xiyuan Xia <xiyuan@chromium.org>

Reviewed by Tony Chang.

Update chromium/linux baselines after drawing code moved into
WebThemeEngine.
https://bugs.webkit.org/show_bug.cgi?id=52826

  • platform/chromium-linux/css1/box_properties/acid_test-expected.checksum:
  • platform/chromium-linux/css1/box_properties/acid_test-expected.png:
  • platform/chromium-linux/css2.1/t09-c5526c-display-00-e-expected.checksum:
  • platform/chromium-linux/css2.1/t09-c5526c-display-00-e-expected.png:
  • platform/chromium-linux/fast/block/basic/011-expected.checksum:
  • platform/chromium-linux/fast/block/basic/011-expected.png:
  • platform/chromium-linux/fast/block/margin-collapse/103-expected.checksum:
  • platform/chromium-linux/fast/block/margin-collapse/103-expected.png:
  • platform/chromium-linux/fast/css/non-standard-checkbox-size-expected.checksum:
  • platform/chromium-linux/fast/css/non-standard-checkbox-size-expected.png:
  • platform/chromium-linux/fast/dom/HTMLProgressElement/progress-element-expected.checksum:
  • platform/chromium-linux/fast/dom/HTMLProgressElement/progress-element-expected.png:
  • platform/chromium-linux/fast/forms/basic-inputs-expected.checksum:
  • platform/chromium-linux/fast/forms/basic-inputs-expected.png:
  • platform/chromium-linux/fast/forms/basic-selects-expected.checksum:
  • platform/chromium-linux/fast/forms/basic-selects-expected.png:
  • platform/chromium-linux/fast/forms/box-shadow-override-expected.checksum:
  • platform/chromium-linux/fast/forms/box-shadow-override-expected.png:
  • platform/chromium-linux/fast/forms/checkbox-radio-onchange-expected.checksum:
  • platform/chromium-linux/fast/forms/checkbox-radio-onchange-expected.png:
  • platform/chromium-linux/fast/forms/file-input-disabled-expected.checksum:
  • platform/chromium-linux/fast/forms/file-input-disabled-expected.png:
  • platform/chromium-linux/fast/forms/form-element-geometry-expected.checksum:
  • platform/chromium-linux/fast/forms/form-element-geometry-expected.png:
  • platform/chromium-linux/fast/forms/formmove-expected.checksum:
  • platform/chromium-linux/fast/forms/formmove-expected.png:
  • platform/chromium-linux/fast/forms/formmove2-expected.checksum:
  • platform/chromium-linux/fast/forms/formmove2-expected.png:
  • platform/chromium-linux/fast/forms/indeterminate-expected.checksum:
  • platform/chromium-linux/fast/forms/indeterminate-expected.png:
  • platform/chromium-linux/fast/forms/input-appearance-height-expected.checksum:
  • platform/chromium-linux/fast/forms/input-appearance-height-expected.png:
  • platform/chromium-linux/fast/forms/input-value-expected.checksum:
  • platform/chromium-linux/fast/forms/input-value-expected.png:
  • platform/chromium-linux/fast/forms/menulist-restrict-line-height-expected.checksum:
  • platform/chromium-linux/fast/forms/menulist-restrict-line-height-expected.png:
  • platform/chromium-linux/fast/forms/menulist-style-color-expected.checksum:
  • platform/chromium-linux/fast/forms/menulist-style-color-expected.png:
  • platform/chromium-linux/fast/forms/placeholder-position-expected.checksum:
  • platform/chromium-linux/fast/forms/placeholder-position-expected.png: Added property svn:mime-type.
  • platform/chromium-linux/fast/forms/radio-attr-order-expected.checksum:
  • platform/chromium-linux/fast/forms/radio-attr-order-expected.png:
  • platform/chromium-linux/fast/forms/radio-nested-labels-expected.checksum:
  • platform/chromium-linux/fast/forms/radio-nested-labels-expected.png:
  • platform/chromium-linux/fast/forms/radio_checked-expected.checksum:
  • platform/chromium-linux/fast/forms/radio_checked-expected.png:
  • platform/chromium-linux/fast/forms/radio_checked_dynamic-expected.checksum:
  • platform/chromium-linux/fast/forms/radio_checked_dynamic-expected.png:
  • platform/chromium-linux/fast/forms/select-baseline-expected.checksum:
  • platform/chromium-linux/fast/forms/select-baseline-expected.png:
  • platform/chromium-linux/fast/inline/positionedLifetime-expected.checksum:
  • platform/chromium-linux/fast/inline/positionedLifetime-expected.png:
  • platform/chromium-linux/fast/parser/bad-xml-slash-expected.checksum:
  • platform/chromium-linux/fast/parser/bad-xml-slash-expected.png:
  • platform/chromium-linux/fast/replaced/replaced-breaking-expected.checksum:
  • platform/chromium-linux/fast/replaced/replaced-breaking-expected.png:
  • platform/chromium-linux/fast/replaced/width100percent-checkbox-expected.checksum:
  • platform/chromium-linux/fast/replaced/width100percent-checkbox-expected.png:
  • platform/chromium-linux/fast/text/textIteratorNilRenderer-expected.checksum:
  • platform/chromium-linux/fast/text/textIteratorNilRenderer-expected.png:
  • platform/chromium-linux/fast/text/whitespace/normal-after-nowrap-breaking-expected.checksum:
  • platform/chromium-linux/fast/text/whitespace/normal-after-nowrap-breaking-expected.png:
  • platform/chromium-linux/tables/mozilla/bugs/bug1318-expected.checksum:
  • platform/chromium-linux/tables/mozilla/bugs/bug1318-expected.png:
  • platform/chromium-linux/tables/mozilla/bugs/bug4527-expected.checksum:
  • platform/chromium-linux/tables/mozilla/bugs/bug4527-expected.png: Added property svn:mime-type.
  • platform/chromium-linux/tables/mozilla_expected_failures/core/captions1-expected.checksum:
  • platform/chromium-linux/tables/mozilla_expected_failures/core/captions1-expected.png:
  • platform/chromium-linux/tables/mozilla_expected_failures/core/captions2-expected.checksum:
  • platform/chromium-linux/tables/mozilla_expected_failures/core/captions2-expected.png:

2011-01-21 Xiyuan Xia <xiyuan@chromium.org>

Reviewed by Tony Chang.

Use WebThemeEngine for relevant RenderTheme parts for chromium/linux.
https://bugs.webkit.org/show_bug.cgi?id=52826

  • platform/chromium/ChromiumBridge.h:
  • rendering/RenderThemeChromiumLinux.cpp: (WebCore::getWebThemeState): (WebCore::RenderThemeChromiumLinux::adjustSliderThumbSize): (WebCore::RenderThemeChromiumLinux::paintCheckbox): (WebCore::RenderThemeChromiumLinux::setCheckboxSize): (WebCore::RenderThemeChromiumLinux::paintRadio): (WebCore::RenderThemeChromiumLinux::setRadioSize): (WebCore::RenderThemeChromiumLinux::paintButton): (WebCore::RenderThemeChromiumLinux::paintTextField): (WebCore::RenderThemeChromiumLinux::paintMenuList): (WebCore::RenderThemeChromiumLinux::paintSliderTrack): (WebCore::RenderThemeChromiumLinux::paintSliderThumb): (WebCore::RenderThemeChromiumLinux::adjustInnerSpinButtonStyle): (WebCore::RenderThemeChromiumLinux::paintInnerSpinButton): (WebCore::RenderThemeChromiumLinux::paintProgressBar):
  • rendering/RenderThemeChromiumLinux.h:
  • rendering/RenderThemeChromiumSkia.cpp: (WebCore::RenderThemeChromiumSkia::setCheckboxSize): (WebCore::RenderThemeChromiumSkia::setSizeIfAuto): (WebCore::RenderThemeChromiumSkia::indeterminateProgressValueRectFor):
  • rendering/RenderThemeChromiumSkia.h:

2011-01-21 Xiyuan Xia <xiyuan@chromium.org>

Reviewed by Tony Chang.

Use WebThemeEngine for relevant RenderTheme parts for chromium/linux.
https://bugs.webkit.org/show_bug.cgi?id=52826

  • WebKit.gyp:
  • src/ChromiumBridge.cpp: (WebCore::WebThemePart): (WebCore::GetWebThemeExtraParams):
Location:
trunk
Files:
80 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r76373 r76379  
     12011-01-21  Xiyuan Xia  <xiyuan@chromium.org>
     2
     3        Reviewed by Tony Chang.
     4
     5        Update chromium/linux baselines after drawing code moved into
     6        WebThemeEngine.
     7        https://bugs.webkit.org/show_bug.cgi?id=52826
     8
     9        * platform/chromium-linux/css1/box_properties/acid_test-expected.checksum:
     10        * platform/chromium-linux/css1/box_properties/acid_test-expected.png:
     11        * platform/chromium-linux/css2.1/t09-c5526c-display-00-e-expected.checksum:
     12        * platform/chromium-linux/css2.1/t09-c5526c-display-00-e-expected.png:
     13        * platform/chromium-linux/fast/block/basic/011-expected.checksum:
     14        * platform/chromium-linux/fast/block/basic/011-expected.png:
     15        * platform/chromium-linux/fast/block/margin-collapse/103-expected.checksum:
     16        * platform/chromium-linux/fast/block/margin-collapse/103-expected.png:
     17        * platform/chromium-linux/fast/css/non-standard-checkbox-size-expected.checksum:
     18        * platform/chromium-linux/fast/css/non-standard-checkbox-size-expected.png:
     19        * platform/chromium-linux/fast/dom/HTMLProgressElement/progress-element-expected.checksum:
     20        * platform/chromium-linux/fast/dom/HTMLProgressElement/progress-element-expected.png:
     21        * platform/chromium-linux/fast/forms/basic-inputs-expected.checksum:
     22        * platform/chromium-linux/fast/forms/basic-inputs-expected.png:
     23        * platform/chromium-linux/fast/forms/basic-selects-expected.checksum:
     24        * platform/chromium-linux/fast/forms/basic-selects-expected.png:
     25        * platform/chromium-linux/fast/forms/box-shadow-override-expected.checksum:
     26        * platform/chromium-linux/fast/forms/box-shadow-override-expected.png:
     27        * platform/chromium-linux/fast/forms/checkbox-radio-onchange-expected.checksum:
     28        * platform/chromium-linux/fast/forms/checkbox-radio-onchange-expected.png:
     29        * platform/chromium-linux/fast/forms/file-input-disabled-expected.checksum:
     30        * platform/chromium-linux/fast/forms/file-input-disabled-expected.png:
     31        * platform/chromium-linux/fast/forms/form-element-geometry-expected.checksum:
     32        * platform/chromium-linux/fast/forms/form-element-geometry-expected.png:
     33        * platform/chromium-linux/fast/forms/formmove-expected.checksum:
     34        * platform/chromium-linux/fast/forms/formmove-expected.png:
     35        * platform/chromium-linux/fast/forms/formmove2-expected.checksum:
     36        * platform/chromium-linux/fast/forms/formmove2-expected.png:
     37        * platform/chromium-linux/fast/forms/indeterminate-expected.checksum:
     38        * platform/chromium-linux/fast/forms/indeterminate-expected.png:
     39        * platform/chromium-linux/fast/forms/input-appearance-height-expected.checksum:
     40        * platform/chromium-linux/fast/forms/input-appearance-height-expected.png:
     41        * platform/chromium-linux/fast/forms/input-value-expected.checksum:
     42        * platform/chromium-linux/fast/forms/input-value-expected.png:
     43        * platform/chromium-linux/fast/forms/menulist-restrict-line-height-expected.checksum:
     44        * platform/chromium-linux/fast/forms/menulist-restrict-line-height-expected.png:
     45        * platform/chromium-linux/fast/forms/menulist-style-color-expected.checksum:
     46        * platform/chromium-linux/fast/forms/menulist-style-color-expected.png:
     47        * platform/chromium-linux/fast/forms/placeholder-position-expected.checksum:
     48        * platform/chromium-linux/fast/forms/placeholder-position-expected.png: Added property svn:mime-type.
     49        * platform/chromium-linux/fast/forms/radio-attr-order-expected.checksum:
     50        * platform/chromium-linux/fast/forms/radio-attr-order-expected.png:
     51        * platform/chromium-linux/fast/forms/radio-nested-labels-expected.checksum:
     52        * platform/chromium-linux/fast/forms/radio-nested-labels-expected.png:
     53        * platform/chromium-linux/fast/forms/radio_checked-expected.checksum:
     54        * platform/chromium-linux/fast/forms/radio_checked-expected.png:
     55        * platform/chromium-linux/fast/forms/radio_checked_dynamic-expected.checksum:
     56        * platform/chromium-linux/fast/forms/radio_checked_dynamic-expected.png:
     57        * platform/chromium-linux/fast/forms/select-baseline-expected.checksum:
     58        * platform/chromium-linux/fast/forms/select-baseline-expected.png:
     59        * platform/chromium-linux/fast/inline/positionedLifetime-expected.checksum:
     60        * platform/chromium-linux/fast/inline/positionedLifetime-expected.png:
     61        * platform/chromium-linux/fast/parser/bad-xml-slash-expected.checksum:
     62        * platform/chromium-linux/fast/parser/bad-xml-slash-expected.png:
     63        * platform/chromium-linux/fast/replaced/replaced-breaking-expected.checksum:
     64        * platform/chromium-linux/fast/replaced/replaced-breaking-expected.png:
     65        * platform/chromium-linux/fast/replaced/width100percent-checkbox-expected.checksum:
     66        * platform/chromium-linux/fast/replaced/width100percent-checkbox-expected.png:
     67        * platform/chromium-linux/fast/text/textIteratorNilRenderer-expected.checksum:
     68        * platform/chromium-linux/fast/text/textIteratorNilRenderer-expected.png:
     69        * platform/chromium-linux/fast/text/whitespace/normal-after-nowrap-breaking-expected.checksum:
     70        * platform/chromium-linux/fast/text/whitespace/normal-after-nowrap-breaking-expected.png:
     71        * platform/chromium-linux/tables/mozilla/bugs/bug1318-expected.checksum:
     72        * platform/chromium-linux/tables/mozilla/bugs/bug1318-expected.png:
     73        * platform/chromium-linux/tables/mozilla/bugs/bug4527-expected.checksum:
     74        * platform/chromium-linux/tables/mozilla/bugs/bug4527-expected.png: Added property svn:mime-type.
     75        * platform/chromium-linux/tables/mozilla_expected_failures/core/captions1-expected.checksum:
     76        * platform/chromium-linux/tables/mozilla_expected_failures/core/captions1-expected.png:
     77        * platform/chromium-linux/tables/mozilla_expected_failures/core/captions2-expected.checksum:
     78        * platform/chromium-linux/tables/mozilla_expected_failures/core/captions2-expected.png:
     79
    1802011-01-21  Anton Muhin  <antonm@chromium.org>
    281
  • trunk/LayoutTests/platform/chromium-linux/css1/box_properties/acid_test-expected.checksum

    r56272 r76379  
    1 f353ed60c217c35a9a331a3c0773fd10
     1e2b7a88f11dae9aeb36f3cce169928c8
  • trunk/LayoutTests/platform/chromium-linux/css2.1/t09-c5526c-display-00-e-expected.checksum

    r70278 r76379  
    1 2fcd76111a537a8bc402afaf764042d4
     1857651d0098974b32ff32e6a41963329
  • trunk/LayoutTests/platform/chromium-linux/fast/block/basic/011-expected.checksum

    r56277 r76379  
    1 f353ed60c217c35a9a331a3c0773fd10
     1e2b7a88f11dae9aeb36f3cce169928c8
  • trunk/LayoutTests/platform/chromium-linux/fast/block/margin-collapse/103-expected.checksum

    r75311 r76379  
    1 5a5c6549929cc3fa39916f22943c2770
     10410b6c9859bd433a41bad7aa64ea036
  • trunk/LayoutTests/platform/chromium-linux/fast/css/non-standard-checkbox-size-expected.checksum

    r56277 r76379  
    1 3561d28f3c41f52aeeed2e2f622547b9
     152b0e66b3d0eff7a6d46e2ef32281587
  • trunk/LayoutTests/platform/chromium-linux/fast/dom/HTMLProgressElement/progress-element-expected.checksum

    r61479 r76379  
    1 e5e7132bec9d33f172110c570d6b71e5
     1cfed1222b4f902ccb8e72d842f3fadda
  • trunk/LayoutTests/platform/chromium-linux/fast/forms/basic-inputs-expected.checksum

    r67091 r76379  
    1 c7b6401c6e7079364f5919e58fb92db9
     11d5fada71c2e5b1cd49c5c1a958c8584
  • trunk/LayoutTests/platform/chromium-linux/fast/forms/basic-selects-expected.checksum

    r75311 r76379  
    1 2b77541a31cf118c3c8eaa920088f29f
     1ce204fb3c19b6446ff77adc183742f99
  • trunk/LayoutTests/platform/chromium-linux/fast/forms/box-shadow-override-expected.checksum

    r75311 r76379  
    1 9fc3b723b0cd8b29e2c8ebfb04c387cb
     1362963478a1efd5ca5f5405160862234
  • trunk/LayoutTests/platform/chromium-linux/fast/forms/checkbox-radio-onchange-expected.checksum

    r56277 r76379  
    1 f752be0eadb0fa59942240e722638156
     13839bfb094e16628512a3af82b4c68aa
  • trunk/LayoutTests/platform/chromium-linux/fast/forms/file-input-disabled-expected.checksum

    r75311 r76379  
    1 557a5a3f4aec985594f35b8ba2d70057
     102fe74d68fb55a2fcd55b19a64c24b19
  • trunk/LayoutTests/platform/chromium-linux/fast/forms/form-element-geometry-expected.checksum

    r75311 r76379  
    1 0d69908f5ab8763f0f963aae021ac024
     1b1e3541f696cd7f5f50fce1f0f99ae6e
  • trunk/LayoutTests/platform/chromium-linux/fast/forms/formmove-expected.checksum

    r56277 r76379  
    1 359f5833ce5b3c2905d45c96a0ca5ed9
     1570b7e77a0bf6835f3f2544b1e346552
  • trunk/LayoutTests/platform/chromium-linux/fast/forms/formmove2-expected.checksum

    r56277 r76379  
    1 418715c09c2aeae02cdcef085c1b287a
     140831efa561b3f0944340035b8493cd2
  • trunk/LayoutTests/platform/chromium-linux/fast/forms/indeterminate-expected.checksum

    r62622 r76379  
    1 9c47ef09dfc0c8a302fb4bae3dbd4d64
     150b0c5b7834eb76d03388e15441f1c75
  • trunk/LayoutTests/platform/chromium-linux/fast/forms/input-appearance-height-expected.checksum

    r75311 r76379  
    1 f25d50637130b97a04f9e12fade883b8
     115095e1d75fbcaf5f537730cb68d5b55
  • trunk/LayoutTests/platform/chromium-linux/fast/forms/input-value-expected.checksum

    r75311 r76379  
    1 e0a2213afe993b7bf86bd0af0bfa00c6
     11f413e36b6dbe6e5894de39a58d498a5
  • trunk/LayoutTests/platform/chromium-linux/fast/forms/menulist-restrict-line-height-expected.checksum

    r75311 r76379  
    1 74df9a5740e5718a8908df6aa288921b
     1274fa379b74af982fa12e009f00d4503
  • trunk/LayoutTests/platform/chromium-linux/fast/forms/menulist-style-color-expected.checksum

    r75311 r76379  
    1 5f0da1e321c89006a2289df4944d23ca
     1665a9dfb63403df20deb6c7bf8a4eebb
  • trunk/LayoutTests/platform/chromium-linux/fast/forms/placeholder-position-expected.checksum

    r75311 r76379  
    1 138aa1ba63d923cdd5856467663dc5ef
     1b7fc7220f4ebdd7dafc197781fff395d
  • trunk/LayoutTests/platform/chromium-linux/fast/forms/radio-attr-order-expected.checksum

    r56277 r76379  
    1 87cc186fe6e8ba9b768ba8a647b74768
     1eff7fbbd6c76ac0db2adc94c34b018c9
  • trunk/LayoutTests/platform/chromium-linux/fast/forms/radio-nested-labels-expected.checksum

    r56277 r76379  
    1 24273da0f86748b51f877da38ab0ed24
     1867dbe0a5e9e6d23a7c0692f0aae80c7
  • trunk/LayoutTests/platform/chromium-linux/fast/forms/radio_checked-expected.checksum

    r56277 r76379  
    1 3e749a763e9bc3e076248297be2a5789
     15cb65911f1790b06a3297fce62b68483
  • trunk/LayoutTests/platform/chromium-linux/fast/forms/radio_checked_dynamic-expected.checksum

    r56277 r76379  
    1 5036944b029094bf34e2c442108a37aa
     1777f47028bcb9353783784fb53359c58
  • trunk/LayoutTests/platform/chromium-linux/fast/forms/select-baseline-expected.checksum

    r75311 r76379  
    1 6a546f8f3bfc3a99cbc588aa365c2234
     18c052baa6fc4ac34a4734a43aec827d9
  • trunk/LayoutTests/platform/chromium-linux/fast/inline/positionedLifetime-expected.checksum

    r56278 r76379  
    1 3db6199505319fd5fe3bb41457f04ec1
     1a82cf56bb3d7010e23789b869af3b70e
  • trunk/LayoutTests/platform/chromium-linux/fast/parser/bad-xml-slash-expected.checksum

    r56278 r76379  
    1 ce8ed31873b1ea6f8526e30802f38152
     1b8f56a9b331ae182bb935ca5554e615c
  • trunk/LayoutTests/platform/chromium-linux/fast/replaced/replaced-breaking-expected.checksum

    r75311 r76379  
    1 9ed3840ae18149dff9148e885ce948f3
     17376d12828febb043bcf2927cd6b8406
  • trunk/LayoutTests/platform/chromium-linux/fast/replaced/width100percent-checkbox-expected.checksum

    r56278 r76379  
    1 e7c1fdc1853425d70905da9497d90fd3
     175a3ba8f9403784fd7e7ec5a056fe647
  • trunk/LayoutTests/platform/chromium-linux/fast/text/textIteratorNilRenderer-expected.checksum

    r75311 r76379  
    1 3341f820db3c325c6b5bf82f6795d455
     1a7453705b11a9df4a7d3ac8ddfceb9e8
  • trunk/LayoutTests/platform/chromium-linux/fast/text/whitespace/normal-after-nowrap-breaking-expected.checksum

    r67091 r76379  
    1 0cc1ec175ab05d0f26dd3749ee33263f
     1bff1c102f50ffc3a501499137714d950
  • trunk/LayoutTests/platform/chromium-linux/tables/mozilla/bugs/bug1318-expected.checksum

    r75311 r76379  
    1 2e5821c5792313f381653a3bd176553d
     177fc9663503d46d0f6b16df1b8b4515f
  • trunk/LayoutTests/platform/chromium-linux/tables/mozilla/bugs/bug4527-expected.checksum

    r67091 r76379  
    1 917fd36e5fec9e89956f6bcefb061268
     1b75cf106d081e9c9515f8ead4d29a556
  • trunk/LayoutTests/platform/chromium-linux/tables/mozilla_expected_failures/core/captions1-expected.checksum

    r67961 r76379  
    1 7eea62dbd4f182701b5e72ec76d35868
     1d8159b0237ea43a869ad210b3b1ede15
  • trunk/LayoutTests/platform/chromium-linux/tables/mozilla_expected_failures/core/captions2-expected.checksum

    r67091 r76379  
    1 a90fceb21dc3db04c8ac38a2c1adfbc1
     156f2ab2eb09b07f3ffcb8148aa4daff4
  • trunk/Source/WebCore/ChangeLog

    r76378 r76379  
     12011-01-21  Xiyuan Xia  <xiyuan@chromium.org>
     2
     3        Reviewed by Tony Chang.
     4
     5        Use WebThemeEngine for relevant RenderTheme parts for chromium/linux.
     6        https://bugs.webkit.org/show_bug.cgi?id=52826
     7
     8        * platform/chromium/ChromiumBridge.h:
     9        * rendering/RenderThemeChromiumLinux.cpp:
     10        (WebCore::getWebThemeState):
     11        (WebCore::RenderThemeChromiumLinux::adjustSliderThumbSize):
     12        (WebCore::RenderThemeChromiumLinux::paintCheckbox):
     13        (WebCore::RenderThemeChromiumLinux::setCheckboxSize):
     14        (WebCore::RenderThemeChromiumLinux::paintRadio):
     15        (WebCore::RenderThemeChromiumLinux::setRadioSize):
     16        (WebCore::RenderThemeChromiumLinux::paintButton):
     17        (WebCore::RenderThemeChromiumLinux::paintTextField):
     18        (WebCore::RenderThemeChromiumLinux::paintMenuList):
     19        (WebCore::RenderThemeChromiumLinux::paintSliderTrack):
     20        (WebCore::RenderThemeChromiumLinux::paintSliderThumb):
     21        (WebCore::RenderThemeChromiumLinux::adjustInnerSpinButtonStyle):
     22        (WebCore::RenderThemeChromiumLinux::paintInnerSpinButton):
     23        (WebCore::RenderThemeChromiumLinux::paintProgressBar):
     24        * rendering/RenderThemeChromiumLinux.h:
     25        * rendering/RenderThemeChromiumSkia.cpp:
     26        (WebCore::RenderThemeChromiumSkia::setCheckboxSize):
     27        (WebCore::RenderThemeChromiumSkia::setSizeIfAuto):
     28        (WebCore::RenderThemeChromiumSkia::indeterminateProgressValueRectFor):
     29        * rendering/RenderThemeChromiumSkia.h:
     30
    1312011-01-21  Sam Weinig  <sam@webkit.org>
    232
  • trunk/Source/WebCore/platform/chromium/PlatformBridge.h

    r76340 r76379  
    268268    // The UI part which is being accessed.
    269269    enum ThemePart {
     270        // ScrollbarTheme parts
    270271        PartScrollbarDownArrow,
    271272        PartScrollbarLeftArrow,
     
    276277        PartScrollbarHorizontalTrack,
    277278        PartScrollbarVerticalTrack,
     279
     280        // RenderTheme parts
     281        PartCheckbox,
     282        PartRadio,
     283        PartButton,
     284        PartTextField,
     285        PartMenuList,
     286        PartSliderTrack,
     287        PartSliderThumb,
     288        PartInnerSpinButton,
     289        PartProgressBar
    278290    };
    279291
     
    283295        StateHover,
    284296        StateNormal,
    285         StatePressed,
     297        StatePressed
    286298    };
    287299
     
    294306    };
    295307
     308    struct ButtonExtraParams {
     309        bool checked;
     310        bool indeterminate; // Whether the button state is indeterminate.
     311        bool isDefault; // Whether the button is default button.
     312        unsigned backgroundColor;
     313    };
     314
     315    struct TextFieldExtraParams {
     316        bool isTextArea;
     317        bool isListbox;
     318        unsigned backgroundColor;
     319    };
     320
     321    struct MenuListExtraParams {
     322        int arrowX;
     323        int arrowY;
     324        unsigned backgroundColor;
     325    };
     326
     327    struct SliderExtraParams {
     328        bool vertical;
     329        bool inDrag;
     330    };
     331
     332    struct InnerSpinButtonExtraParams {
     333        bool spinUp;
     334        bool readOnly;
     335    };
     336
     337    struct ProgressBarExtraParams {
     338        bool determinate;
     339        int valueRectX;
     340        int valueRectY;
     341        int valueRectWidth;
     342        int valueRectHeight;
     343    };
     344
    296345    union ThemePaintExtraParams {
    297346        ScrollbarTrackExtraParams scrollbarTrack;
     347        ButtonExtraParams button;
     348        TextFieldExtraParams textField;
     349        MenuListExtraParams menuList;
     350        SliderExtraParams slider;
     351        InnerSpinButtonExtraParams innerSpin;
     352        ProgressBarExtraParams progressBar;
    298353    };
    299354
  • trunk/Source/WebCore/rendering/RenderThemeChromiumLinux.cpp

    r75837 r76379  
    2929#include "Color.h"
    3030#include "PaintInfo.h"
    31 #include "PlatformThemeChromiumGtk.h"
     31#include "PlatformBridge.h"
    3232#include "RenderObject.h"
     33#include "RenderProgress.h"
     34#include "RenderSlider.h"
    3335#include "ScrollbarTheme.h"
    3436#include "UserAgentStyleSheets.h"
     
    4749double RenderThemeChromiumLinux::m_caretBlinkInterval;
    4850
     51static const unsigned defaultButtonBackgroundColor = 0xffdddddd;
     52
     53static PlatformBridge::ThemePaintState getWebThemeState(const RenderTheme* theme, const RenderObject* o)
     54{
     55    if (!theme->isEnabled(o))
     56        return PlatformBridge::StateDisabled;
     57    if (theme->isPressed(o))
     58        return PlatformBridge::StatePressed;
     59    if (theme->isHovered(o))
     60        return PlatformBridge::StateHover;
     61
     62    return PlatformBridge::StateNormal;
     63}
     64
     65
    4966PassRefPtr<RenderTheme> RenderThemeChromiumLinux::create()
    5067{
     
    129146void RenderThemeChromiumLinux::adjustSliderThumbSize(RenderObject* o) const
    130147{
    131     // These sizes match the sizes in Chromium Win.
    132     const int sliderThumbAlongAxis = 11;
    133     const int sliderThumbAcrossAxis = 21;
     148    IntSize size = PlatformBridge::getThemePartSize(PlatformBridge::PartSliderThumb);
     149
    134150    if (o->style()->appearance() == SliderThumbHorizontalPart) {
    135         o->style()->setWidth(Length(sliderThumbAlongAxis, Fixed));
    136         o->style()->setHeight(Length(sliderThumbAcrossAxis, Fixed));
     151        o->style()->setWidth(Length(size.width(), Fixed));
     152        o->style()->setHeight(Length(size.height(), Fixed));
    137153    } else if (o->style()->appearance() == SliderThumbVerticalPart) {
    138         o->style()->setWidth(Length(sliderThumbAcrossAxis, Fixed));
    139         o->style()->setHeight(Length(sliderThumbAlongAxis, Fixed));
     154        o->style()->setWidth(Length(size.height(), Fixed));
     155        o->style()->setHeight(Length(size.width(), Fixed));
    140156    } else
    141157        RenderThemeChromiumSkia::adjustSliderThumbSize(o);
     
    169185}
    170186
     187bool RenderThemeChromiumLinux::paintCheckbox(RenderObject* o, const PaintInfo& i, const IntRect& rect)
     188{
     189    PlatformBridge::ThemePaintExtraParams extraParams;
     190    extraParams.button.checked = isChecked(o);
     191    extraParams.button.indeterminate = isIndeterminate(o);
     192
     193    PlatformBridge::paintThemePart(i.context, PlatformBridge::PartCheckbox, getWebThemeState(this, o), rect, &extraParams);
     194    return false;
     195}
     196
     197void RenderThemeChromiumLinux::setCheckboxSize(RenderStyle* style) const
     198{
     199    // If the width and height are both specified, then we have nothing to do.
     200    if (!style->width().isIntrinsicOrAuto() && !style->height().isAuto())
     201        return;
     202
     203    IntSize size = PlatformBridge::getThemePartSize(PlatformBridge::PartCheckbox);
     204    setSizeIfAuto(style, size);
     205}
     206
     207bool RenderThemeChromiumLinux::paintRadio(RenderObject* o, const PaintInfo& i, const IntRect& rect)
     208{
     209    PlatformBridge::ThemePaintExtraParams extraParams;
     210    extraParams.button.checked = isChecked(o);
     211
     212    PlatformBridge::paintThemePart(i.context, PlatformBridge::PartRadio, getWebThemeState(this, o), rect, &extraParams);
     213    return false;
     214}
     215
     216void RenderThemeChromiumLinux::setRadioSize(RenderStyle* style) const
     217{
     218    // If the width and height are both specified, then we have nothing to do.
     219    if (!style->width().isIntrinsicOrAuto() && !style->height().isAuto())
     220        return;
     221
     222    IntSize size = PlatformBridge::getThemePartSize(PlatformBridge::PartRadio);
     223    setSizeIfAuto(style, size);
     224}
     225
     226bool RenderThemeChromiumLinux::paintButton(RenderObject* o, const PaintInfo& i, const IntRect& rect)
     227{
     228    PlatformBridge::ThemePaintExtraParams extraParams;
     229    extraParams.button.isDefault = isDefault(o);
     230    extraParams.button.backgroundColor = defaultButtonBackgroundColor;
     231    if (o->hasBackground())
     232        extraParams.button.backgroundColor = o->style()->visitedDependentColor(CSSPropertyBackgroundColor).rgb();
     233
     234    PlatformBridge::paintThemePart(i.context, PlatformBridge::PartButton, getWebThemeState(this, o), rect, &extraParams);
     235    return false;
     236}
     237
     238bool RenderThemeChromiumLinux::paintTextField(RenderObject* o, const PaintInfo& i, const IntRect& rect)
     239{
     240    // WebThemeEngine does not handle border rounded corner and background image
     241    // so return true to draw CSS border and background.
     242    if (o->style()->hasBorderRadius() || o->style()->hasBackgroundImage())
     243        return true;
     244
     245    ControlPart part = o->style()->appearance();
     246
     247    PlatformBridge::ThemePaintExtraParams extraParams;
     248    extraParams.textField.isTextArea = part == TextAreaPart;
     249    extraParams.textField.isListbox = part == ListboxPart;
     250
     251    // Fallback to white if the specified color object is invalid.
     252    Color backgroundColor(Color::white);
     253    if (o->style()->visitedDependentColor(CSSPropertyBackgroundColor).isValid())
     254        backgroundColor = o->style()->visitedDependentColor(CSSPropertyBackgroundColor);
     255    extraParams.textField.backgroundColor = backgroundColor.rgb();
     256
     257    PlatformBridge::paintThemePart(i.context, PlatformBridge::PartTextField, getWebThemeState(this, o), rect, &extraParams);
     258    return false;
     259}
     260
     261bool RenderThemeChromiumLinux::paintMenuList(RenderObject* o, const PaintInfo& i, const IntRect& rect)
     262{
     263    const int right = rect.x() + rect.width();
     264    const int middle = rect.y() + rect.height() / 2;
     265
     266    PlatformBridge::ThemePaintExtraParams extraParams;
     267    extraParams.menuList.arrowX = (o->style()->direction() == RTL) ? rect.x() + 7 : right - 13;
     268    extraParams.menuList.arrowY = middle;
     269    extraParams.menuList.backgroundColor = SkColorSetRGB(0xdd, 0xdd, 0xdd);
     270    if (o->hasBackground())
     271        extraParams.menuList.backgroundColor = o->style()->visitedDependentColor(CSSPropertyBackgroundColor).rgb();
     272
     273    PlatformBridge::paintThemePart(i.context, PlatformBridge::PartMenuList, getWebThemeState(this, o), rect, &extraParams);
     274    return false;
     275}
     276
     277bool RenderThemeChromiumLinux::paintSliderTrack(RenderObject* o, const PaintInfo& i, const IntRect& rect)
     278{
     279    PlatformBridge::ThemePaintExtraParams extraParams;
     280    extraParams.slider.vertical = o->style()->appearance() == SliderVerticalPart;
     281
     282    PlatformBridge::paintThemePart(i.context, PlatformBridge::PartSliderTrack, getWebThemeState(this, o), rect, &extraParams);
     283    return false;
     284}
     285
     286bool RenderThemeChromiumLinux::paintSliderThumb(RenderObject* o, const PaintInfo& i, const IntRect& rect)
     287{
     288    PlatformBridge::ThemePaintExtraParams extraParams;
     289    extraParams.slider.vertical = o->style()->appearance() == SliderThumbVerticalPart;
     290    extraParams.slider.inDrag = toRenderSlider(o->parent())->inDragMode();
     291
     292    PlatformBridge::paintThemePart(i.context, PlatformBridge::PartSliderThumb, getWebThemeState(this, o), rect, &extraParams);
     293    return false;
     294}
     295
    171296void RenderThemeChromiumLinux::adjustInnerSpinButtonStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
    172297{
    173     int width = ScrollbarTheme::nativeTheme()->scrollbarThickness();
    174     style->setWidth(Length(width, Fixed));
    175     style->setMinWidth(Length(width, Fixed));
    176 }
    177 
    178 bool RenderThemeChromiumLinux::paintInnerSpinButton(RenderObject* object, const PaintInfo& info, const IntRect& rect)
    179 {
    180     ControlStates northStates = controlStatesForRenderer(object);
    181     ControlStates southStates = northStates;
    182     if (northStates & SpinUpState)
    183         southStates &= ~(HoverState | PressedState);
    184     else
    185         northStates &= ~(HoverState | PressedState);
    186 
    187     IntRect half = rect;
    188     half.setHeight(rect.height() / 2);
    189     PlatformThemeChromiumGtk::paintArrowButton(info.context, half, PlatformThemeChromiumGtk::North, northStates);
    190 
    191     half.setY(rect.y() + rect.height() / 2);
    192     PlatformThemeChromiumGtk::paintArrowButton(info.context, half, PlatformThemeChromiumGtk::South, southStates);
    193     return false;
    194 }
     298    IntSize size = PlatformBridge::getThemePartSize(PlatformBridge::PartInnerSpinButton);
     299
     300    style->setWidth(Length(size.width(), Fixed));
     301    style->setMinWidth(Length(size.width(), Fixed));
     302}
     303
     304bool RenderThemeChromiumLinux::paintInnerSpinButton(RenderObject* o, const PaintInfo& i, const IntRect& rect)
     305{
     306    PlatformBridge::ThemePaintExtraParams extraParams;
     307    extraParams.innerSpin.spinUp = (controlStatesForRenderer(o) & SpinUpState);
     308    extraParams.innerSpin.readOnly = isReadOnlyControl(o);
     309
     310    PlatformBridge::paintThemePart(i.context, PlatformBridge::PartInnerSpinButton, getWebThemeState(this, o), rect, &extraParams);
     311    return false;
     312}
     313
     314#if ENABLE(PROGRESS_TAG)
     315
     316bool RenderThemeChromiumLinux::paintProgressBar(RenderObject* o, const PaintInfo& i, const IntRect& rect)
     317{
     318    if (!o->isProgress())
     319        return true;
     320
     321    RenderProgress* renderProgress = toRenderProgress(o);
     322    IntRect valueRect = progressValueRectFor(renderProgress, rect);
     323
     324    PlatformBridge::ThemePaintExtraParams extraParams;
     325    extraParams.progressBar.determinate = renderProgress->isDeterminate();
     326    extraParams.progressBar.valueRectX = valueRect.x();
     327    extraParams.progressBar.valueRectY = valueRect.y();
     328    extraParams.progressBar.valueRectWidth = valueRect.width();
     329    extraParams.progressBar.valueRectHeight = valueRect.height();
     330
     331    PlatformBridge::paintThemePart(i.context, PlatformBridge::PartProgressBar, getWebThemeState(this, o), rect, &extraParams);
     332    return false;
     333}
     334
     335#endif
    195336
    196337} // namespace WebCore
  • trunk/Source/WebCore/rendering/RenderThemeChromiumLinux.h

    r63280 r76379  
    6060        virtual double caretBlinkIntervalInternal() const;
    6161
     62        virtual bool paintCheckbox(RenderObject*, const PaintInfo&, const IntRect&);
     63        virtual void setCheckboxSize(RenderStyle*) const;
     64
     65        virtual bool paintRadio(RenderObject*, const PaintInfo&, const IntRect&);
     66        virtual void setRadioSize(RenderStyle*) const;
     67
     68        virtual bool paintButton(RenderObject*, const PaintInfo&, const IntRect&);
     69        virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&);
     70        virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&);
     71        virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
     72        virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
     73
    6274        virtual void adjustInnerSpinButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
    6375        virtual bool paintInnerSpinButton(RenderObject*, const PaintInfo&, const IntRect&);
     76
     77#if ENABLE(PROGRESS_TAG)
     78        virtual bool paintProgressBar(RenderObject*, const PaintInfo&, const IntRect&);
     79#endif
    6480
    6581        static void setSelectionColors(unsigned activeBackgroundColor,
  • trunk/Source/WebCore/rendering/RenderThemeChromiumSkia.cpp

    r76340 r76379  
    6969static const float defaultSearchFieldResultsButtonWidth = 18;
    7070
    71 static void setSizeIfAuto(RenderStyle* style, const IntSize& size)
    72 {
    73     if (style->width().isIntrinsicOrAuto())
    74         style->setWidth(Length(size.width(), Fixed));
    75     if (style->height().isAuto())
    76         style->setHeight(Length(size.height(), Fixed));
    77 }
    78 
    79 static void drawVertLine(SkCanvas* canvas, int x, int y1, int y2, const SkPaint& paint)
    80 {
    81     SkIRect skrect;
    82     skrect.set(x, y1, x + 1, y2 + 1);
    83     canvas->drawIRect(skrect, paint);
    84 }
    85 
    86 static void drawHorizLine(SkCanvas* canvas, int x1, int x2, int y, const SkPaint& paint)
    87 {
    88     SkIRect skrect;
    89     skrect.set(x1, y, x2 + 1, y + 1);
    90     canvas->drawIRect(skrect, paint);
    91 }
    92 
    93 static void drawBox(SkCanvas* canvas, const IntRect& rect, const SkPaint& paint)
    94 {
    95     const int right = rect.x() + rect.width() - 1;
    96     const int bottom = rect.y() + rect.height() - 1;
    97     drawHorizLine(canvas, rect.x(), right, rect.y(), paint);
    98     drawVertLine(canvas, right, rect.y(), bottom, paint);
    99     drawHorizLine(canvas, rect.x(), right, bottom, paint);
    100     drawVertLine(canvas, rect.x(), rect.y(), bottom, paint);
    101 }
    102 
    10371// We aim to match IE here.
    10472// -IE uses a font based on the encoding as the default font for form controls.
     
    238206}
    239207
    240 bool RenderThemeChromiumSkia::paintCheckbox(RenderObject* o, const PaintInfo& i, const IntRect& rect)
    241 {
    242     static Image* const checkedImage = Image::loadPlatformResource("linuxCheckboxOn").releaseRef();
    243     static Image* const uncheckedImage = Image::loadPlatformResource("linuxCheckboxOff").releaseRef();
    244     static Image* const indeterminateImage = Image::loadPlatformResource("linuxCheckboxIndeterminate").releaseRef();
    245     static Image* const disabledCheckedImage = Image::loadPlatformResource("linuxCheckboxDisabledOn").releaseRef();
    246     static Image* const disabledUncheckedImage = Image::loadPlatformResource("linuxCheckboxDisabledOff").releaseRef();
    247     static Image* const disabledIndeterminateImage = Image::loadPlatformResource("linuxCheckboxDisabledIndeterminate").releaseRef();
    248 
    249     Image* image;
    250 
    251     if (isIndeterminate(o))
    252         image = isEnabled(o) ? indeterminateImage : disabledIndeterminateImage;
    253     else if (isChecked(o))
    254         image = isEnabled(o) ? checkedImage : disabledCheckedImage;
    255     else
    256         image = isEnabled(o) ? uncheckedImage : disabledUncheckedImage;
    257 
    258     i.context->drawImage(image, o->style()->colorSpace(), center(rect, widgetStandardHeight, widgetStandardWidth));
    259     return false;
    260 }
    261 
    262208void RenderThemeChromiumSkia::setCheckboxSize(RenderStyle* style) const
    263209{
     
    271217    // DPI.  Until our entire engine honors a DPI setting other than 96, we
    272218    // can't rely on the theme's metrics.
    273     const IntSize size(widgetStandardHeight, widgetStandardWidth);
     219    const IntSize size(widgetStandardWidth, widgetStandardHeight);
    274220    setSizeIfAuto(style, size);
    275 }
    276 
    277 bool RenderThemeChromiumSkia::paintRadio(RenderObject* o, const PaintInfo& i, const IntRect& rect)
    278 {
    279     static Image* const checkedImage = Image::loadPlatformResource("linuxRadioOn").releaseRef();
    280     static Image* const uncheckedImage = Image::loadPlatformResource("linuxRadioOff").releaseRef();
    281     static Image* const disabledCheckedImage = Image::loadPlatformResource("linuxRadioDisabledOn").releaseRef();
    282     static Image* const disabledUncheckedImage = Image::loadPlatformResource("linuxRadioDisabledOff").releaseRef();
    283 
    284     Image* image;
    285     if (this->isEnabled(o))
    286         image = this->isChecked(o) ? checkedImage : uncheckedImage;
    287     else
    288         image = this->isChecked(o) ? disabledCheckedImage : disabledUncheckedImage;
    289 
    290     i.context->drawImage(image, o->style()->colorSpace(), center(rect, widgetStandardHeight, widgetStandardWidth));
    291     return false;
    292221}
    293222
     
    296225    // Use same sizing for radio box as checkbox.
    297226    setCheckboxSize(style);
    298 }
    299 
    300 static SkColor brightenColor(double h, double s, double l, float brightenAmount)
    301 {
    302     l += brightenAmount;
    303     if (l > 1.0)
    304         l = 1.0;
    305     if (l < 0.0)
    306         l = 0.0;
    307 
    308     return makeRGBAFromHSLA(h, s, l, 1.0);
    309 }
    310 
    311 static void paintButtonLike(RenderTheme* theme, RenderObject* o, const PaintInfo& i, const IntRect& rect)
    312 {
    313     SkCanvas* const canvas = i.context->platformContext()->canvas();
    314     SkPaint paint;
    315     SkRect skrect;
    316     const int right = rect.x() + rect.width();
    317     const int bottom = rect.y() + rect.height();
    318     SkColor baseColor = SkColorSetARGB(0xff, 0xdd, 0xdd, 0xdd);
    319     if (o->hasBackground())
    320         baseColor = o->style()->visitedDependentColor(CSSPropertyBackgroundColor).rgb();
    321     double h, s, l;
    322     Color(baseColor).getHSL(h, s, l);
    323     // Our standard gradient is from 0xdd to 0xf8. This is the amount of
    324     // increased luminance between those values.
    325     SkColor lightColor(brightenColor(h, s, l, 0.105));
    326 
    327     // If the button is too small, fallback to drawing a single, solid color
    328     if (rect.width() < 5 || rect.height() < 5) {
    329         paint.setColor(baseColor);
    330         skrect.set(rect.x(), rect.y(), right, bottom);
    331         canvas->drawRect(skrect, paint);
    332         return;
    333     }
    334 
    335     const int borderAlpha = theme->isHovered(o) ? 0x80 : 0x55;
    336     paint.setARGB(borderAlpha, 0, 0, 0);
    337     canvas->drawLine(rect.x() + 1, rect.y(), right - 1, rect.y(), paint);
    338     canvas->drawLine(right - 1, rect.y() + 1, right - 1, bottom - 1, paint);
    339     canvas->drawLine(rect.x() + 1, bottom - 1, right - 1, bottom - 1, paint);
    340     canvas->drawLine(rect.x(), rect.y() + 1, rect.x(), bottom - 1, paint);
    341 
    342     paint.setColor(SK_ColorBLACK);
    343     SkPoint p[2];
    344     const int lightEnd = theme->isPressed(o) ? 1 : 0;
    345     const int darkEnd = !lightEnd;
    346     p[lightEnd].set(SkIntToScalar(rect.x()), SkIntToScalar(rect.y()));
    347     p[darkEnd].set(SkIntToScalar(rect.x()), SkIntToScalar(bottom - 1));
    348     SkColor colors[2];
    349     colors[0] = lightColor;
    350     colors[1] = baseColor;
    351 
    352     SkShader* shader = SkGradientShader::CreateLinear(
    353         p, colors, NULL, 2, SkShader::kClamp_TileMode, NULL);
    354     paint.setStyle(SkPaint::kFill_Style);
    355     paint.setShader(shader);
    356     shader->unref();
    357 
    358     skrect.set(rect.x() + 1, rect.y() + 1, right - 1, bottom - 1);
    359     canvas->drawRect(skrect, paint);
    360 
    361     paint.setShader(NULL);
    362     paint.setColor(brightenColor(h, s, l, -0.0588));
    363     canvas->drawPoint(rect.x() + 1, rect.y() + 1, paint);
    364     canvas->drawPoint(right - 2, rect.y() + 1, paint);
    365     canvas->drawPoint(rect.x() + 1, bottom - 2, paint);
    366     canvas->drawPoint(right - 2, bottom - 2, paint);
    367 }
    368 
    369 bool RenderThemeChromiumSkia::paintButton(RenderObject* o, const PaintInfo& i, const IntRect& rect)
    370 {
    371     paintButtonLike(this, o, i, rect);
    372     return false;
    373227}
    374228
     
    379233        style->setLineHeight(RenderStyle::initialLineHeight());
    380234    }
    381 }
    382 
    383 
    384 bool RenderThemeChromiumSkia::paintTextField(RenderObject* o, const PaintInfo& i, const IntRect& rect)
    385 {
    386     return true;
    387235}
    388236
     
    623471}
    624472
    625 bool RenderThemeChromiumSkia::paintMenuList(RenderObject* o, const PaintInfo& i, const IntRect& rect)
    626 {
    627     SkCanvas* const canvas = i.context->platformContext()->canvas();
    628     const int right = rect.x() + rect.width();
    629     const int middle = rect.y() + rect.height() / 2;
    630 
    631     paintButtonLike(this, o, i, rect);
    632 
    633     SkPaint paint;
    634     paint.setColor(SK_ColorBLACK);
    635     paint.setAntiAlias(true);
    636     paint.setStyle(SkPaint::kFill_Style);
    637 
    638     int arrowXPosition = (o->style()->direction() == RTL) ? rect.x() + 7 : right - 13;
    639     SkPath path;
    640     path.moveTo(arrowXPosition, middle - 3);
    641     path.rLineTo(6, 0);
    642     path.rLineTo(-3, 6);
    643     path.close();
    644     canvas->drawPath(path, paint);
    645 
    646     return false;
    647 }
    648 
    649473void RenderThemeChromiumSkia::adjustMenuListButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
    650474{
     
    658482}
    659483
    660 bool RenderThemeChromiumSkia::paintSliderTrack(RenderObject*, const PaintInfo& i, const IntRect& rect)
    661 {
    662     // Just paint a grey box for now (matches the color of a scrollbar background.
    663     SkCanvas* const canvas = i.context->platformContext()->canvas();
    664     int verticalCenter = rect.y() + rect.height() / 2;
    665     int top = std::max(rect.y(), verticalCenter - 2);
    666     int bottom = std::min(rect.y() + rect.height(), verticalCenter + 2);
    667 
    668     SkPaint paint;
    669     const SkColor grey = SkColorSetARGB(0xff, 0xe3, 0xdd, 0xd8);
    670     paint.setColor(grey);
    671 
    672     SkRect skrect;
    673     skrect.set(rect.x(), top, rect.x() + rect.width(), bottom);
    674     canvas->drawRect(skrect, paint);
    675 
    676     return false;
    677 }
    678 
    679 bool RenderThemeChromiumSkia::paintSliderThumb(RenderObject* o, const PaintInfo& i, const IntRect& rect)
    680 {
    681     // Make a thumb similar to the scrollbar thumb.
    682     const bool hovered = isHovered(o) || toRenderSlider(o->parent())->inDragMode();
    683     const int midx = rect.x() + rect.width() / 2;
    684     const int midy = rect.y() + rect.height() / 2;
    685     const bool vertical = (o->style()->appearance() == SliderThumbVerticalPart);
    686     SkCanvas* const canvas = i.context->platformContext()->canvas();
    687 
    688     const SkColor thumbLightGrey = SkColorSetARGB(0xff, 0xf4, 0xf2, 0xef);
    689     const SkColor thumbDarkGrey = SkColorSetARGB(0xff, 0xea, 0xe5, 0xe0);
    690     SkPaint paint;
    691     paint.setColor(hovered ? SK_ColorWHITE : thumbLightGrey);
    692 
    693     SkIRect skrect;
    694     if (vertical)
    695         skrect.set(rect.x(), rect.y(), midx + 1, rect.bottom());
    696     else
    697         skrect.set(rect.x(), rect.y(), rect.right(), midy + 1);
    698 
    699     canvas->drawIRect(skrect, paint);
    700 
    701     paint.setColor(hovered ? thumbLightGrey : thumbDarkGrey);
    702 
    703     if (vertical)
    704         skrect.set(midx + 1, rect.y(), rect.right(), rect.bottom());
    705     else
    706         skrect.set(rect.x(), midy + 1, rect.right(), rect.bottom());
    707 
    708     canvas->drawIRect(skrect, paint);
    709 
    710     const SkColor borderDarkGrey = SkColorSetARGB(0xff, 0x9d, 0x96, 0x8e);
    711     paint.setColor(borderDarkGrey);
    712     drawBox(canvas, rect, paint);
    713 
    714     if (rect.height() > 10 && rect.width() > 10) {
    715         drawHorizLine(canvas, midx - 2, midx + 2, midy, paint);
    716         drawHorizLine(canvas, midx - 2, midx + 2, midy - 3, paint);
    717         drawHorizLine(canvas, midx - 2, midx + 2, midy + 3, paint);
    718     }
    719 
    720     return false;
    721 }
    722 
    723484int RenderThemeChromiumSkia::popupInternalPaddingLeft(RenderStyle* style) const
    724485{
     
    757518{
    758519    return RenderTheme::caretBlinkInterval();
     520}
     521
     522// static
     523void RenderThemeChromiumSkia::setSizeIfAuto(RenderStyle* style, const IntSize& size)
     524{
     525    if (style->width().isIntrinsicOrAuto())
     526        style->setWidth(Length(size.width(), Fixed));
     527    if (style->height().isAuto())
     528        style->setHeight(Length(size.height(), Fixed));
    759529}
    760530
     
    802572    if (movableWidth <= 0)
    803573        return IntRect();
    804    
     574
    805575    double progress = renderProgress->animationProgress();
    806576    if (progress < 0.5)
     
    819589}
    820590
    821 bool RenderThemeChromiumSkia::paintProgressBar(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    822 {
    823     static Image* barImage = Image::loadPlatformResource("linuxProgressBar").releaseRef();
    824     static Image* valueImage = Image::loadPlatformResource("linuxProgressValue").releaseRef();
    825     static Image* leftBorderImage = Image::loadPlatformResource("linuxProgressBorderLeft").releaseRef();
    826     static Image* rightBorderImage = Image::loadPlatformResource("linuxProgressBorderRight").releaseRef();
    827     ASSERT(barImage->height() == valueImage->height());
    828 
    829     if (!renderObject->isProgress())
    830         return true;
    831 
    832     paintInfo.context->platformContext()->setImageResamplingHint(barImage->size(), rect.size());
    833 
    834     RenderProgress* renderProgress = toRenderProgress(renderObject);
    835     double tileScale = static_cast<double>(rect.height()) / barImage->height();
    836     IntSize barTileSize(static_cast<int>(barImage->width() * tileScale), rect.height());
    837     ColorSpace colorSpace = renderObject->style()->colorSpace();
    838 
    839     paintInfo.context->drawTiledImage(barImage, colorSpace, rect, IntPoint(0, 0), barTileSize);
    840 
    841     IntRect valueRect = progressValueRectFor(renderProgress, rect);
    842     if (valueRect.width()) {
    843 
    844         IntSize valueTileSize(std::max(1, static_cast<int>(valueImage->width() * tileScale)), valueRect.height());
    845 
    846         int leftOffset = valueRect.x() - rect.x();
    847         int roundedLeftOffset= (leftOffset / valueTileSize.width()) * valueTileSize.width();
    848         int dstLeftValueWidth = roundedLeftOffset - leftOffset + (leftOffset % valueImage->width()) ? valueTileSize.width() : 0;
    849 
    850         IntRect dstLeftValueRect(valueRect.x(), valueRect.y(), dstLeftValueWidth, valueRect.height());
    851         int srcLeftValueWidth = dstLeftValueWidth / tileScale;
    852         IntRect srcLeftValueRect(valueImage->width() - srcLeftValueWidth, 0, srcLeftValueWidth, valueImage->height());
    853         paintInfo.context->drawImage(valueImage, colorSpace, dstLeftValueRect, srcLeftValueRect);
    854 
    855         int rightOffset = valueRect.right() - rect.x();
    856         int roundedRightOffset = (rightOffset / valueTileSize.width()) * valueTileSize.width();
    857         int dstRightValueWidth = rightOffset - roundedRightOffset;
    858         IntRect dstRightValueRect(rect.x() + roundedRightOffset, valueRect.y(), dstRightValueWidth, valueTileSize.height());
    859         int srcRightValueWidth = dstRightValueWidth / tileScale;
    860         IntRect srcRightValueRect(0, 0, srcRightValueWidth, valueImage->height());
    861         paintInfo.context->drawImage(valueImage, colorSpace, dstRightValueRect, srcRightValueRect);
    862        
    863         IntRect alignedValueRect(dstLeftValueRect.right(), dstLeftValueRect.y(),
    864                                  dstRightValueRect.x() - dstLeftValueRect.right(), dstLeftValueRect.height());
    865         paintInfo.context->drawTiledImage(valueImage, colorSpace, alignedValueRect, IntPoint(0, 0), valueTileSize);
    866     }
    867 
    868     int dstLeftBorderWidth = leftBorderImage->width() * tileScale;
    869     IntRect dstLeftBorderRect(rect.x(), rect.y(), dstLeftBorderWidth, rect.height());
    870     paintInfo.context->drawImage(leftBorderImage, colorSpace, dstLeftBorderRect, leftBorderImage->rect());
    871 
    872     int dstRightBorderWidth = rightBorderImage->width() * tileScale;
    873     IntRect dstRightBorderRect(rect.right() - dstRightBorderWidth, rect.y(), dstRightBorderWidth, rect.height());
    874     paintInfo.context->drawImage(rightBorderImage, colorSpace, dstRightBorderRect, rightBorderImage->rect());
    875 
    876     paintInfo.context->platformContext()->clearImageResamplingHint();
    877 
    878     return false;
    879 }
    880 
    881 
    882591IntRect RenderThemeChromiumSkia::progressValueRectFor(RenderProgress* renderProgress, const IntRect& rect) const
    883592{
  • trunk/Source/WebCore/rendering/RenderThemeChromiumSkia.h

    r62104 r76379  
    3535class RenderProgress;
    3636
    37     class RenderThemeChromiumSkia : public RenderTheme {
     37class RenderThemeChromiumSkia : public RenderTheme {
    3838    public:
    3939        RenderThemeChromiumSkia();
     
    6767        virtual int minimumMenuListSize(RenderStyle*) const;
    6868
    69         virtual bool paintCheckbox(RenderObject*, const PaintInfo&, const IntRect&);
    7069        virtual void setCheckboxSize(RenderStyle*) const;
    7170
    72         virtual bool paintRadio(RenderObject*, const PaintInfo&, const IntRect&);
    7371        virtual void setRadioSize(RenderStyle*) const;
    7472
    75         virtual bool paintButton(RenderObject*, const PaintInfo&, const IntRect&);
    7673        virtual void adjustButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
    77 
    78         virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&);
    7974
    8075        virtual bool paintTextArea(RenderObject*, const PaintInfo&, const IntRect&);
     
    113108        // entire menulist.
    114109        virtual void adjustMenuListStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
    115         virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&);
    116110        virtual void adjustMenuListButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
    117111        virtual bool paintMenuListButton(RenderObject*, const PaintInfo&, const IntRect&);
    118 
    119         virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
    120         virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
    121112
    122113#if ENABLE(PROGRESS_TAG)
    123114        virtual double animationRepeatIntervalForProgressBar(RenderProgress*) const;
    124115        virtual double animationDurationForProgressBar(RenderProgress*) const;
    125         virtual bool paintProgressBar(RenderObject*, const PaintInfo&, const IntRect&);
    126116#endif
    127117
     
    154144        virtual double caretBlinkIntervalInternal() const;
    155145
     146        static void setSizeIfAuto(RenderStyle*, const IntSize&);
     147
    156148#if ENABLE(PROGRESS_TAG)
    157149        IntRect determinateProgressValueRectFor(RenderProgress*, const IntRect&) const;
  • trunk/Source/WebKit/chromium/ChangeLog

    r76378 r76379  
     12011-01-21  Xiyuan Xia  <xiyuan@chromium.org>
     2
     3        Reviewed by Tony Chang.
     4
     5        Use WebThemeEngine for relevant RenderTheme parts for chromium/linux.
     6        https://bugs.webkit.org/show_bug.cgi?id=52826
     7
     8        * WebKit.gyp:
     9        * src/ChromiumBridge.cpp:
     10        (WebCore::WebThemePart):
     11        (WebCore::GetWebThemeExtraParams):
     12
    1132011-01-21  Sam Weinig  <sam@webkit.org>
    214
  • trunk/Source/WebKit/chromium/WebKit.gyp

    r76340 r76379  
    953953                                'repack_path': '<(chromium_src_dir)/tools/data_pack/repack.py',
    954954                                'pak_inputs': [
     955                                    '<(SHARED_INTERMEDIATE_DIR)/gfx/gfx_resources.pak',
    955956                                    '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
    956957                                    '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.pak',
  • trunk/Source/WebKit/chromium/src/PlatformBridge.cpp

    r76340 r76379  
    792792    case PlatformBridge::PartScrollbarHorizontalTrack: return WebThemeEngine::PartScrollbarHorizontalTrack;
    793793    case PlatformBridge::PartScrollbarVerticalTrack: return WebThemeEngine::PartScrollbarVerticalTrack;
     794    case PlatformBridge::PartCheckbox: return WebThemeEngine::PartCheckbox;
     795    case PlatformBridge::PartRadio: return WebThemeEngine::PartRadio;
     796    case PlatformBridge::PartButton: return WebThemeEngine::PartButton;
     797    case PlatformBridge::PartTextField: return WebThemeEngine::PartTextField;
     798    case PlatformBridge::PartMenuList: return WebThemeEngine::PartMenuList;
     799    case PlatformBridge::PartSliderTrack: return WebThemeEngine::PartSliderTrack;
     800    case PlatformBridge::PartSliderThumb: return WebThemeEngine::PartSliderThumb;
     801    case PlatformBridge::PartInnerSpinButton: return WebThemeEngine::PartInnerSpinButton;
     802    case PlatformBridge::PartProgressBar: return WebThemeEngine::PartProgressBar;
    794803    }
    795804    ASSERT_NOT_REACHED();
     
    811820static void GetWebThemeExtraParams(PlatformBridge::ThemePart part, PlatformBridge::ThemePaintState state, const PlatformBridge::ThemePaintExtraParams* extraParams, WebThemeEngine::ExtraParams* webThemeExtraParams)
    812821{
    813     if (part == PlatformBridge::PartScrollbarHorizontalTrack || part == PlatformBridge::PartScrollbarVerticalTrack) {
     822    switch (part) {
     823    case PlatformBridge::PartScrollbarHorizontalTrack:
     824    case PlatformBridge::PartScrollbarVerticalTrack:
    814825        webThemeExtraParams->scrollbarTrack.trackX = extraParams->scrollbarTrack.trackX;
    815826        webThemeExtraParams->scrollbarTrack.trackY = extraParams->scrollbarTrack.trackY;
    816827        webThemeExtraParams->scrollbarTrack.trackWidth = extraParams->scrollbarTrack.trackWidth;
    817828        webThemeExtraParams->scrollbarTrack.trackHeight = extraParams->scrollbarTrack.trackHeight;
     829        break;
     830    case PlatformBridge::PartCheckbox:
     831        webThemeExtraParams->button.checked = extraParams->button.checked;
     832        webThemeExtraParams->button.indeterminate = extraParams->button.indeterminate;
     833        break;
     834    case PlatformBridge::PartRadio:
     835        webThemeExtraParams->button.checked = extraParams->button.checked;
     836        break;
     837    case PlatformBridge::PartButton:
     838        webThemeExtraParams->button.isDefault = extraParams->button.isDefault;
     839        webThemeExtraParams->button.backgroundColor = extraParams->button.backgroundColor;
     840        break;
     841    case PlatformBridge::PartTextField:
     842        webThemeExtraParams->textField.isTextArea = extraParams->textField.isTextArea;
     843        webThemeExtraParams->textField.isListbox = extraParams->textField.isListbox;
     844        webThemeExtraParams->textField.backgroundColor = extraParams->textField.backgroundColor;
     845        break;
     846    case PlatformBridge::PartMenuList:
     847        webThemeExtraParams->menuList.arrowX = extraParams->menuList.arrowX;
     848        webThemeExtraParams->menuList.arrowY = extraParams->menuList.arrowY;
     849        webThemeExtraParams->menuList.backgroundColor = extraParams->menuList.backgroundColor;
     850        break;
     851    case PlatformBridge::PartSliderTrack:
     852    case PlatformBridge::PartSliderThumb:
     853        webThemeExtraParams->slider.vertical = extraParams->slider.vertical;
     854        webThemeExtraParams->slider.inDrag = extraParams->slider.inDrag;
     855        break;
     856    case PlatformBridge::PartInnerSpinButton:
     857        webThemeExtraParams->innerSpin.spinUp = extraParams->innerSpin.spinUp;
     858        webThemeExtraParams->innerSpin.readOnly = extraParams->innerSpin.readOnly;
     859        break;
     860    case PlatformBridge::PartProgressBar:
     861        webThemeExtraParams->progressBar.determinate = extraParams->progressBar.determinate;
     862        webThemeExtraParams->progressBar.valueRectX = extraParams->progressBar.valueRectX;
     863        webThemeExtraParams->progressBar.valueRectY = extraParams->progressBar.valueRectY;
     864        webThemeExtraParams->progressBar.valueRectWidth = extraParams->progressBar.valueRectWidth;
     865        webThemeExtraParams->progressBar.valueRectHeight = extraParams->progressBar.valueRectHeight;
     866        break;
     867    default:
     868        break; // Parts that have no extra params get here.
    818869    }
    819870}
Note: See TracChangeset for help on using the changeset viewer.