Changeset 142071 in webkit
- Timestamp:
- Feb 7, 2013 12:25:26 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r142069 r142071 1 2013-02-06 Kent Tamura <tkent@chromium.org> 2 3 Fix style of RenderTheme.cpp and RenderThemeChromiumWin.h 4 https://bugs.webkit.org/show_bug.cgi?id=109137 5 6 Reviewed by Kentaro Hara. 7 8 No new tests. Just style fix. 9 10 * rendering/RenderTheme.cpp: 11 (WebCore::RenderTheme::adjustStyle): 12 (WebCore::RenderTheme::paint): 13 (WebCore::RenderTheme::paintBorderOnly): 14 (WebCore::RenderTheme::paintDecorations): 15 (WebCore::RenderTheme::isControlStyled): 16 (WebCore::RenderTheme::adjustButtonStyle): 17 (WebCore::RenderTheme::systemColor): 18 * rendering/RenderThemeChromiumWin.h: 19 (WebCore::ThemeData::ThemeData): 20 (ThemeData): 21 (RenderThemeChromiumWin): 22 (WebCore::RenderThemeChromiumWin::RenderThemeChromiumWin): 23 (WebCore::RenderThemeChromiumWin::~RenderThemeChromiumWin): 24 1 25 2013-02-06 Kent Tamura <tkent@chromium.org> 2 26 -
trunk/Source/WebCore/rendering/RenderTheme.cpp
r140778 r142071 82 82 } 83 83 84 void RenderTheme::adjustStyle(StyleResolver* styleResolver, RenderStyle* style, Element* e, 85 bool UAHasAppearance, const BorderData& border, const FillLayer& background, const Color& backgroundColor) 84 void RenderTheme::adjustStyle(StyleResolver* styleResolver, RenderStyle* style, Element* e, bool UAHasAppearance, const BorderData& border, const FillLayer& background, const Color& backgroundColor) 86 85 { 87 86 // Force inline and table display styles to be inline-block (except for table- which is block) 88 87 ControlPart part = style->appearance(); 89 if (style->display() == INLINE || style->display() == INLINE_TABLE || style->display() == TABLE_ROW_GROUP ||90 style->display() == TABLE_HEADER_GROUP || style->display() == TABLE_FOOTER_GROUP ||91 style->display() == TABLE_ROW || style->display() == TABLE_COLUMN_GROUP || style->display() == TABLE_COLUMN ||92 style->display() == TABLE_CELL || style->display() == TABLE_CAPTION)88 if (style->display() == INLINE || style->display() == INLINE_TABLE || style->display() == TABLE_ROW_GROUP 89 || style->display() == TABLE_HEADER_GROUP || style->display() == TABLE_FOOTER_GROUP 90 || style->display() == TABLE_ROW || style->display() == TABLE_COLUMN_GROUP || style->display() == TABLE_COLUMN 91 || style->display() == TABLE_CELL || style->display() == TABLE_CAPTION) 93 92 style->setDisplay(INLINE_BLOCK); 94 93 else if (style->display() == COMPACT || style->display() == RUN_IN || style->display() == LIST_ITEM || style->display() == TABLE) … … 111 110 #if USE(NEW_THEME) 112 111 switch (part) { 113 case CheckboxPart: 114 case InnerSpinButtonPart: 115 case RadioPart: 116 case PushButtonPart: 117 case SquareButtonPart: 118 case DefaultButtonPart: 119 case ButtonPart: { 120 // Border 121 LengthBox borderBox(style->borderTopWidth(), style->borderRightWidth(), style->borderBottomWidth(), style->borderLeftWidth()); 122 borderBox = m_theme->controlBorder(part, style->font(), borderBox, style->effectiveZoom()); 123 if (borderBox.top().value() != static_cast<int>(style->borderTopWidth())) { 124 if (borderBox.top().value()) 125 style->setBorderTopWidth(borderBox.top().value()); 126 else 127 style->resetBorderTop(); 128 } 129 if (borderBox.right().value() != static_cast<int>(style->borderRightWidth())) { 130 if (borderBox.right().value()) 131 style->setBorderRightWidth(borderBox.right().value()); 132 else 133 style->resetBorderRight(); 134 } 135 if (borderBox.bottom().value() != static_cast<int>(style->borderBottomWidth())) { 112 case CheckboxPart: 113 case InnerSpinButtonPart: 114 case RadioPart: 115 case PushButtonPart: 116 case SquareButtonPart: 117 case DefaultButtonPart: 118 case ButtonPart: { 119 // Border 120 LengthBox borderBox(style->borderTopWidth(), style->borderRightWidth(), style->borderBottomWidth(), style->borderLeftWidth()); 121 borderBox = m_theme->controlBorder(part, style->font(), borderBox, style->effectiveZoom()); 122 if (borderBox.top().value() != static_cast<int>(style->borderTopWidth())) { 123 if (borderBox.top().value()) 124 style->setBorderTopWidth(borderBox.top().value()); 125 else 126 style->resetBorderTop(); 127 } 128 if (borderBox.right().value() != static_cast<int>(style->borderRightWidth())) { 129 if (borderBox.right().value()) 130 style->setBorderRightWidth(borderBox.right().value()); 131 else 132 style->resetBorderRight(); 133 } 134 if (borderBox.bottom().value() != static_cast<int>(style->borderBottomWidth())) { 135 style->setBorderBottomWidth(borderBox.bottom().value()); 136 if (borderBox.bottom().value()) 136 137 style->setBorderBottomWidth(borderBox.bottom().value()); 137 if (borderBox.bottom().value())138 style->setBorderBottomWidth(borderBox.bottom().value());139 else140 style->resetBorderBottom();141 }142 if (borderBox.left().value() != static_cast<int>(style->borderLeftWidth())) {138 else 139 style->resetBorderBottom(); 140 } 141 if (borderBox.left().value() != static_cast<int>(style->borderLeftWidth())) { 142 style->setBorderLeftWidth(borderBox.left().value()); 143 if (borderBox.left().value()) 143 144 style->setBorderLeftWidth(borderBox.left().value()); 144 if (borderBox.left().value()) 145 style->setBorderLeftWidth(borderBox.left().value()); 146 else 147 style->resetBorderLeft(); 148 } 149 150 // Padding 151 LengthBox paddingBox = m_theme->controlPadding(part, style->font(), style->paddingBox(), style->effectiveZoom()); 152 if (paddingBox != style->paddingBox()) 153 style->setPaddingBox(paddingBox); 154 155 // Whitespace 156 if (m_theme->controlRequiresPreWhiteSpace(part)) 157 style->setWhiteSpace(PRE); 145 else 146 style->resetBorderLeft(); 147 } 148 149 // Padding 150 LengthBox paddingBox = m_theme->controlPadding(part, style->font(), style->paddingBox(), style->effectiveZoom()); 151 if (paddingBox != style->paddingBox()) 152 style->setPaddingBox(paddingBox); 153 154 // Whitespace 155 if (m_theme->controlRequiresPreWhiteSpace(part)) 156 style->setWhiteSpace(PRE); 158 157 159 160 161 162 163 164 165 166 158 // Width / Height 159 // The width and height here are affected by the zoom. 160 // FIXME: Check is flawed, since it doesn't take min-width/max-width into account. 161 LengthSize controlSize = m_theme->controlSize(part, style->font(), LengthSize(style->width(), style->height()), style->effectiveZoom()); 162 if (controlSize.width() != style->width()) 163 style->setWidth(controlSize.width()); 164 if (controlSize.height() != style->height()) 165 style->setHeight(controlSize.height()); 167 166 168 169 170 171 172 173 167 // Min-Width / Min-Height 168 LengthSize minControlSize = m_theme->minimumControlSize(part, style->font(), style->effectiveZoom()); 169 if (minControlSize.width() != style->minWidth()) 170 style->setMinWidth(minControlSize.width()); 171 if (minControlSize.height() != style->minHeight()) 172 style->setMinHeight(minControlSize.height()); 174 173 175 // Font 176 FontDescription controlFont = m_theme->controlFont(part, style->font(), style->effectiveZoom()); 177 if (controlFont != style->font().fontDescription()) { 178 // Reset our line-height 179 style->setLineHeight(RenderStyle::initialLineHeight()); 180 181 // Now update our font. 182 if (style->setFontDescription(controlFont)) 183 style->font().update(0); 184 } 174 // Font 175 FontDescription controlFont = m_theme->controlFont(part, style->font(), style->effectiveZoom()); 176 if (controlFont != style->font().fontDescription()) { 177 // Reset our line-height 178 style->setLineHeight(RenderStyle::initialLineHeight()); 179 180 // Now update our font. 181 if (style->setFontDescription(controlFont)) 182 style->font().update(0); 185 183 } 186 default: 187 break; 184 } 185 default: 186 break; 188 187 } 189 188 #endif … … 192 191 switch (style->appearance()) { 193 192 #if !USE(NEW_THEME) 194 195 196 197 198 199 200 201 202 203 204 205 #endif 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 193 case CheckboxPart: 194 return adjustCheckboxStyle(styleResolver, style, e); 195 case RadioPart: 196 return adjustRadioStyle(styleResolver, style, e); 197 case PushButtonPart: 198 case SquareButtonPart: 199 case DefaultButtonPart: 200 case ButtonPart: 201 return adjustButtonStyle(styleResolver, style, e); 202 case InnerSpinButtonPart: 203 return adjustInnerSpinButtonStyle(styleResolver, style, e); 204 #endif 205 case TextFieldPart: 206 return adjustTextFieldStyle(styleResolver, style, e); 207 case TextAreaPart: 208 return adjustTextAreaStyle(styleResolver, style, e); 209 case MenulistPart: 210 return adjustMenuListStyle(styleResolver, style, e); 211 case MenulistButtonPart: 212 return adjustMenuListButtonStyle(styleResolver, style, e); 213 case MediaPlayButtonPart: 214 case MediaCurrentTimePart: 215 case MediaTimeRemainingPart: 216 case MediaEnterFullscreenButtonPart: 217 case MediaExitFullscreenButtonPart: 218 case MediaMuteButtonPart: 219 case MediaVolumeSliderContainerPart: 220 return adjustMediaControlStyle(styleResolver, style, e); 221 case MediaSliderPart: 222 case MediaVolumeSliderPart: 223 case MediaFullScreenVolumeSliderPart: 224 case SliderHorizontalPart: 225 case SliderVerticalPart: 226 return adjustSliderTrackStyle(styleResolver, style, e); 227 case SliderThumbHorizontalPart: 228 case SliderThumbVerticalPart: 229 return adjustSliderThumbStyle(styleResolver, style, e); 230 case SearchFieldPart: 231 return adjustSearchFieldStyle(styleResolver, style, e); 232 case SearchFieldCancelButtonPart: 233 return adjustSearchFieldCancelButtonStyle(styleResolver, style, e); 234 case SearchFieldDecorationPart: 235 return adjustSearchFieldDecorationStyle(styleResolver, style, e); 236 case SearchFieldResultsDecorationPart: 237 return adjustSearchFieldResultsDecorationStyle(styleResolver, style, e); 238 case SearchFieldResultsButtonPart: 239 return adjustSearchFieldResultsButtonStyle(styleResolver, style, e); 241 240 #if ENABLE(PROGRESS_ELEMENT) 242 243 241 case ProgressBarPart: 242 return adjustProgressBarStyle(styleResolver, style, e); 244 243 #endif 245 244 #if ENABLE(METER_ELEMENT) 246 247 248 249 250 251 245 case MeterPart: 246 case RelevancyLevelIndicatorPart: 247 case ContinuousCapacityLevelIndicatorPart: 248 case DiscreteCapacityLevelIndicatorPart: 249 case RatingLevelIndicatorPart: 250 return adjustMeterStyle(styleResolver, style, e); 252 251 #endif 253 252 #if ENABLE(INPUT_SPEECH) 254 255 256 #endif 257 258 253 case InputSpeechButtonPart: 254 return adjustInputFieldSpeechButtonStyle(styleResolver, style, e); 255 #endif 256 default: 257 break; 259 258 } 260 259 } … … 277 276 #if USE(NEW_THEME) 278 277 switch (part) { 279 280 281 282 283 284 285 286 287 288 289 278 case CheckboxPart: 279 case RadioPart: 280 case PushButtonPart: 281 case SquareButtonPart: 282 case DefaultButtonPart: 283 case ButtonPart: 284 case InnerSpinButtonPart: 285 m_theme->paint(part, controlStatesForRenderer(o), const_cast<GraphicsContext*>(paintInfo.context), r, o->style()->effectiveZoom(), o->view()->frameView()); 286 return false; 287 default: 288 break; 290 289 } 291 290 #endif … … 294 293 switch (part) { 295 294 #if !USE(NEW_THEME) 296 297 298 299 300 301 302 303 304 305 306 307 #endif 308 309 295 case CheckboxPart: 296 return paintCheckbox(o, paintInfo, r); 297 case RadioPart: 298 return paintRadio(o, paintInfo, r); 299 case PushButtonPart: 300 case SquareButtonPart: 301 case DefaultButtonPart: 302 case ButtonPart: 303 return paintButton(o, paintInfo, r); 304 case InnerSpinButtonPart: 305 return paintInnerSpinButton(o, paintInfo, r); 306 #endif 307 case MenulistPart: 308 return paintMenuList(o, paintInfo, r); 310 309 #if ENABLE(METER_ELEMENT) 311 312 313 314 315 316 310 case MeterPart: 311 case RelevancyLevelIndicatorPart: 312 case ContinuousCapacityLevelIndicatorPart: 313 case DiscreteCapacityLevelIndicatorPart: 314 case RatingLevelIndicatorPart: 315 return paintMeter(o, paintInfo, r); 317 316 #endif 318 317 #if ENABLE(PROGRESS_ELEMENT) 319 320 321 #endif 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 318 case ProgressBarPart: 319 return paintProgressBar(o, paintInfo, r); 320 #endif 321 case SliderHorizontalPart: 322 case SliderVerticalPart: 323 return paintSliderTrack(o, paintInfo, r); 324 case SliderThumbHorizontalPart: 325 case SliderThumbVerticalPart: 326 return paintSliderThumb(o, paintInfo, r); 327 case MediaEnterFullscreenButtonPart: 328 case MediaExitFullscreenButtonPart: 329 return paintMediaFullscreenButton(o, paintInfo, r); 330 case MediaPlayButtonPart: 331 return paintMediaPlayButton(o, paintInfo, r); 332 case MediaOverlayPlayButtonPart: 333 return paintMediaOverlayPlayButton(o, paintInfo, r); 334 case MediaMuteButtonPart: 335 return paintMediaMuteButton(o, paintInfo, r); 336 case MediaSeekBackButtonPart: 337 return paintMediaSeekBackButton(o, paintInfo, r); 338 case MediaSeekForwardButtonPart: 339 return paintMediaSeekForwardButton(o, paintInfo, r); 340 case MediaRewindButtonPart: 341 return paintMediaRewindButton(o, paintInfo, r); 342 case MediaReturnToRealtimeButtonPart: 343 return paintMediaReturnToRealtimeButton(o, paintInfo, r); 344 case MediaToggleClosedCaptionsButtonPart: 345 return paintMediaToggleClosedCaptionsButton(o, paintInfo, r); 346 case MediaSliderPart: 347 return paintMediaSliderTrack(o, paintInfo, r); 348 case MediaSliderThumbPart: 349 return paintMediaSliderThumb(o, paintInfo, r); 350 case MediaVolumeSliderMuteButtonPart: 351 return paintMediaMuteButton(o, paintInfo, r); 352 case MediaVolumeSliderContainerPart: 353 return paintMediaVolumeSliderContainer(o, paintInfo, r); 354 case MediaVolumeSliderPart: 355 return paintMediaVolumeSliderTrack(o, paintInfo, r); 356 case MediaVolumeSliderThumbPart: 357 return paintMediaVolumeSliderThumb(o, paintInfo, r); 358 case MediaFullScreenVolumeSliderPart: 359 return paintMediaFullScreenVolumeSliderTrack(o, paintInfo, r); 360 case MediaFullScreenVolumeSliderThumbPart: 361 return paintMediaFullScreenVolumeSliderThumb(o, paintInfo, r); 362 case MediaTimeRemainingPart: 363 return paintMediaTimeRemaining(o, paintInfo, r); 364 case MediaCurrentTimePart: 365 return paintMediaCurrentTime(o, paintInfo, r); 366 case MediaControlsBackgroundPart: 367 return paintMediaControlsBackground(o, paintInfo, r); 368 case MenulistButtonPart: 369 case TextFieldPart: 370 case TextAreaPart: 371 case ListboxPart: 372 return true; 373 case SearchFieldPart: 374 return paintSearchField(o, paintInfo, r); 375 case SearchFieldCancelButtonPart: 376 return paintSearchFieldCancelButton(o, paintInfo, r); 377 case SearchFieldDecorationPart: 378 return paintSearchFieldDecoration(o, paintInfo, r); 379 case SearchFieldResultsDecorationPart: 380 return paintSearchFieldResultsDecoration(o, paintInfo, r); 381 case SearchFieldResultsButtonPart: 382 return paintSearchFieldResultsButton(o, paintInfo, r); 384 383 #if ENABLE(INPUT_SPEECH) 385 386 387 #endif 388 389 384 case InputSpeechButtonPart: 385 return paintInputFieldSpeechButton(o, paintInfo, r); 386 #endif 387 default: 388 break; 390 389 } 391 390 … … 400 399 // Call the appropriate paint method based off the appearance value. 401 400 switch (o->style()->appearance()) { 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 401 case TextFieldPart: 402 return paintTextField(o, paintInfo, r); 403 case ListboxPart: 404 case TextAreaPart: 405 return paintTextArea(o, paintInfo, r); 406 case MenulistButtonPart: 407 case SearchFieldPart: 408 return true; 409 case CheckboxPart: 410 case RadioPart: 411 case PushButtonPart: 412 case SquareButtonPart: 413 case DefaultButtonPart: 414 case ButtonPart: 415 case MenulistPart: 417 416 #if ENABLE(METER_ELEMENT) 418 419 420 421 422 417 case MeterPart: 418 case RelevancyLevelIndicatorPart: 419 case ContinuousCapacityLevelIndicatorPart: 420 case DiscreteCapacityLevelIndicatorPart: 421 case RatingLevelIndicatorPart: 423 422 #endif 424 423 #if ENABLE(PROGRESS_ELEMENT) 425 426 #endif 427 428 429 430 431 432 433 434 424 case ProgressBarPart: 425 #endif 426 case SliderHorizontalPart: 427 case SliderVerticalPart: 428 case SliderThumbHorizontalPart: 429 case SliderThumbVerticalPart: 430 case SearchFieldCancelButtonPart: 431 case SearchFieldDecorationPart: 432 case SearchFieldResultsDecorationPart: 433 case SearchFieldResultsButtonPart: 435 434 #if ENABLE(INPUT_SPEECH) 436 437 #endif 438 439 435 case InputSpeechButtonPart: 436 #endif 437 default: 438 break; 440 439 } 441 440 … … 450 449 // Call the appropriate paint method based off the appearance value. 451 450 switch (o->style()->appearance()) { 452 453 454 455 456 457 458 459 460 461 462 463 451 case MenulistButtonPart: 452 return paintMenuListButton(o, paintInfo, r); 453 case TextFieldPart: 454 case TextAreaPart: 455 case ListboxPart: 456 case CheckboxPart: 457 case RadioPart: 458 case PushButtonPart: 459 case SquareButtonPart: 460 case DefaultButtonPart: 461 case ButtonPart: 462 case MenulistPart: 464 463 #if ENABLE(METER_ELEMENT) 465 466 467 468 469 464 case MeterPart: 465 case RelevancyLevelIndicatorPart: 466 case ContinuousCapacityLevelIndicatorPart: 467 case DiscreteCapacityLevelIndicatorPart: 468 case RatingLevelIndicatorPart: 470 469 #endif 471 470 #if ENABLE(PROGRESS_ELEMENT) 472 473 #endif 474 475 476 477 478 479 480 481 482 471 case ProgressBarPart: 472 #endif 473 case SliderHorizontalPart: 474 case SliderVerticalPart: 475 case SliderThumbHorizontalPart: 476 case SliderThumbVerticalPart: 477 case SearchFieldPart: 478 case SearchFieldCancelButtonPart: 479 case SearchFieldDecorationPart: 480 case SearchFieldResultsDecorationPart: 481 case SearchFieldResultsButtonPart: 483 482 #if ENABLE(INPUT_SPEECH) 484 485 #endif 486 487 483 case InputSpeechButtonPart: 484 #endif 485 default: 486 break; 488 487 } 489 488 … … 654 653 } 655 654 656 bool RenderTheme::isControlStyled(const RenderStyle* style, const BorderData& border, const FillLayer& background, 657 const Color& backgroundColor) const 655 bool RenderTheme::isControlStyled(const RenderStyle* style, const BorderData& border, const FillLayer& background, const Color& backgroundColor) const 658 656 { 659 657 switch (style->appearance()) { 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 return (style->border() != border ||678 *style->backgroundLayers() != background ||679 680 681 658 case PushButtonPart: 659 case SquareButtonPart: 660 case DefaultButtonPart: 661 case ButtonPart: 662 case ListboxPart: 663 case MenulistPart: 664 case ProgressBarPart: 665 case MeterPart: 666 case RelevancyLevelIndicatorPart: 667 case ContinuousCapacityLevelIndicatorPart: 668 case DiscreteCapacityLevelIndicatorPart: 669 case RatingLevelIndicatorPart: 670 // FIXME: Uncomment this when making search fields style-able. 671 // case SearchFieldPart: 672 case TextFieldPart: 673 case TextAreaPart: 674 // Test the style to see if the UA border and background match. 675 return (style->border() != border 676 || *style->backgroundLayers() != background 677 || style->visitedDependentColor(CSSPropertyBackgroundColor) != backgroundColor); 678 default: 679 return false; 682 680 } 683 681 } … … 903 901 void RenderTheme::adjustButtonStyle(StyleResolver*, RenderStyle* style, Element*) const 904 902 { 905 // Most platforms will completely honor all CSS, and so we have no need to adjust the style 906 // at all by default. We will still allow the theme a crack at setting up a desired vertical size. 903 // Most platforms will completely honor all CSS, and so we have no need to 904 // adjust the style at all by default. We will still allow the theme a crack 905 // at setting up a desired vertical size. 907 906 setButtonSize(style); 908 907 } … … 1129 1128 { 1130 1129 switch (cssValueId) { 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1130 case CSSValueActiveborder: 1131 return 0xFFFFFFFF; 1132 case CSSValueActivecaption: 1133 return 0xFFCCCCCC; 1134 case CSSValueAppworkspace: 1135 return 0xFFFFFFFF; 1136 case CSSValueBackground: 1137 return 0xFF6363CE; 1138 case CSSValueButtonface: 1139 return 0xFFC0C0C0; 1140 case CSSValueButtonhighlight: 1141 return 0xFFDDDDDD; 1142 case CSSValueButtonshadow: 1143 return 0xFF888888; 1144 case CSSValueButtontext: 1145 return 0xFF000000; 1146 case CSSValueCaptiontext: 1147 return 0xFF000000; 1148 case CSSValueGraytext: 1149 return 0xFF808080; 1150 case CSSValueHighlight: 1151 return 0xFFB5D5FF; 1152 case CSSValueHighlighttext: 1153 return 0xFF000000; 1154 case CSSValueInactiveborder: 1155 return 0xFFFFFFFF; 1156 case CSSValueInactivecaption: 1157 return 0xFFFFFFFF; 1158 case CSSValueInactivecaptiontext: 1159 return 0xFF7F7F7F; 1160 case CSSValueInfobackground: 1161 return 0xFFFBFCC5; 1162 case CSSValueInfotext: 1163 return 0xFF000000; 1164 case CSSValueMenu: 1165 return 0xFFC0C0C0; 1166 case CSSValueMenutext: 1167 return 0xFF000000; 1168 case CSSValueScrollbar: 1169 return 0xFFFFFFFF; 1170 case CSSValueText: 1171 return 0xFF000000; 1172 case CSSValueThreeddarkshadow: 1173 return 0xFF666666; 1174 case CSSValueThreedface: 1175 return 0xFFC0C0C0; 1176 case CSSValueThreedhighlight: 1177 return 0xFFDDDDDD; 1178 case CSSValueThreedlightshadow: 1179 return 0xFFC0C0C0; 1180 case CSSValueThreedshadow: 1181 return 0xFF888888; 1182 case CSSValueWindow: 1183 return 0xFFFFFFFF; 1184 case CSSValueWindowframe: 1185 return 0xFFCCCCCC; 1186 case CSSValueWindowtext: 1187 return 0xFF000000; 1189 1188 } 1190 1189 return Color(); -
trunk/Source/WebCore/rendering/RenderThemeChromiumWin.h
r134662 r142071 35 35 namespace WebCore { 36 36 37 38 ThemeData() : m_part(0), m_state(0), m_classicState(0) {}37 struct ThemeData { 38 ThemeData() : m_part(0), m_state(0), m_classicState(0) { } 39 39 40 unsigned m_part; 41 unsigned m_state; 42 unsigned m_classicState; 40 unsigned m_part; 41 unsigned m_state; 42 unsigned m_classicState; 43 }; 44 45 class RenderThemeChromiumWin : public RenderThemeChromiumSkia { 46 public: 47 static PassRefPtr<RenderTheme> create(); 48 49 // A method asking if the theme is able to draw the focus ring. 50 virtual bool supportsFocusRing(const RenderStyle*) const OVERRIDE; 51 52 // The platform selection color. 53 virtual Color platformActiveSelectionBackgroundColor() const OVERRIDE; 54 virtual Color platformInactiveSelectionBackgroundColor() const OVERRIDE; 55 virtual Color platformActiveSelectionForegroundColor() const OVERRIDE; 56 virtual Color platformInactiveSelectionForegroundColor() const OVERRIDE; 57 virtual Color platformActiveTextSearchHighlightColor() const OVERRIDE; 58 virtual Color platformInactiveTextSearchHighlightColor() const OVERRIDE; 59 60 virtual Color systemColor(int cssValueId) const OVERRIDE; 61 62 #if ENABLE(DATALIST_ELEMENT) 63 virtual IntSize sliderTickSize() const OVERRIDE; 64 virtual int sliderTickOffsetFromTrackCenter() const OVERRIDE; 65 #endif 66 virtual void adjustSliderThumbSize(RenderStyle*, Element*) const OVERRIDE; 67 68 // Various paint functions. 69 virtual bool paintCheckbox(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE; 70 virtual bool paintRadio(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE; 71 virtual bool paintButton(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE; 72 virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE; 73 virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE; 74 virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE; 75 76 // MenuList refers to an unstyled menulist (meaning a menulist without 77 // background-color or border set) and MenuListButton refers to a styled 78 // menulist (a menulist with background-color or border set). They have 79 // this distinction to support showing aqua style themes whenever they 80 // possibly can, which is something we don't want to replicate. 81 // 82 // In short, we either go down the MenuList code path or the MenuListButton 83 // codepath. We never go down both. And in both cases, they render the 84 // entire menulist. 85 virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE; 86 87 virtual void adjustInnerSpinButtonStyle(StyleResolver*, RenderStyle*, Element*) const OVERRIDE; 88 virtual bool paintInnerSpinButton(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE; 89 90 #if ENABLE(PROGRESS_ELEMENT) 91 virtual double animationRepeatIntervalForProgressBar(RenderProgress*) const OVERRIDE; 92 virtual double animationDurationForProgressBar(RenderProgress*) const OVERRIDE; 93 virtual void adjustProgressBarStyle(StyleResolver*, RenderStyle*, Element*) const OVERRIDE; 94 virtual bool paintProgressBar(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE; 95 #endif 96 97 virtual bool shouldOpenPickerWithF4Key() const OVERRIDE; 98 99 protected: 100 virtual double caretBlinkIntervalInternal() const OVERRIDE; 101 102 private: 103 enum ControlSubPart { 104 None, 105 SpinButtonDown, 106 SpinButtonUp, 43 107 }; 44 108 45 class RenderThemeChromiumWin : public RenderThemeChromiumSkia { 46 public: 47 static PassRefPtr<RenderTheme> create(); 109 RenderThemeChromiumWin() { } 110 virtual ~RenderThemeChromiumWin() { } 48 111 49 // A method asking if the theme is able to draw the focus ring. 50 virtual bool supportsFocusRing(const RenderStyle*) const; 112 unsigned determineState(RenderObject*, ControlSubPart = None); 113 unsigned determineSliderThumbState(RenderObject*); 114 unsigned determineClassicState(RenderObject*, ControlSubPart = None); 51 115 52 // The platform selection color. 53 virtual Color platformActiveSelectionBackgroundColor() const; 54 virtual Color platformInactiveSelectionBackgroundColor() const; 55 virtual Color platformActiveSelectionForegroundColor() const; 56 virtual Color platformInactiveSelectionForegroundColor() const; 57 virtual Color platformActiveTextSearchHighlightColor() const; 58 virtual Color platformInactiveTextSearchHighlightColor() const; 116 ThemeData getThemeData(RenderObject*, ControlSubPart = None); 59 117 60 virtual Color systemColor(int cssValueId) const; 61 62 #if ENABLE(DATALIST_ELEMENT) 63 virtual IntSize sliderTickSize() const OVERRIDE; 64 virtual int sliderTickOffsetFromTrackCenter() const OVERRIDE; 65 #endif 66 virtual void adjustSliderThumbSize(RenderStyle*, Element*) const; 67 68 // Various paint functions. 69 virtual bool paintCheckbox(RenderObject*, const PaintInfo&, const IntRect&); 70 virtual bool paintRadio(RenderObject*, const PaintInfo&, const IntRect&); 71 virtual bool paintButton(RenderObject*, const PaintInfo&, const IntRect&); 72 virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&); 73 virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect&); 74 virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect&); 75 76 // MenuList refers to an unstyled menulist (meaning a menulist without 77 // background-color or border set) and MenuListButton refers to a styled 78 // menulist (a menulist with background-color or border set). They have 79 // this distinction to support showing aqua style themes whenever they 80 // possibly can, which is something we don't want to replicate. 81 // 82 // In short, we either go down the MenuList code path or the MenuListButton 83 // codepath. We never go down both. And in both cases, they render the 84 // entire menulist. 85 virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&); 86 87 virtual void adjustInnerSpinButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 88 virtual bool paintInnerSpinButton(RenderObject*, const PaintInfo&, const IntRect&); 89 90 #if ENABLE(PROGRESS_ELEMENT) 91 virtual double animationRepeatIntervalForProgressBar(RenderProgress*) const; 92 virtual double animationDurationForProgressBar(RenderProgress*) const; 93 virtual void adjustProgressBarStyle(StyleResolver*, RenderStyle*, Element*) const; 94 virtual bool paintProgressBar(RenderObject*, const PaintInfo&, const IntRect&); 95 #endif 96 97 virtual bool shouldOpenPickerWithF4Key() const OVERRIDE; 98 99 protected: 100 virtual double caretBlinkIntervalInternal() const; 101 102 private: 103 enum ControlSubPart { 104 None, 105 SpinButtonDown, 106 SpinButtonUp, 107 }; 108 109 RenderThemeChromiumWin() { } 110 virtual ~RenderThemeChromiumWin() { } 111 112 unsigned determineState(RenderObject*, ControlSubPart = None); 113 unsigned determineSliderThumbState(RenderObject*); 114 unsigned determineClassicState(RenderObject*, ControlSubPart = None); 115 116 ThemeData getThemeData(RenderObject*, ControlSubPart = None); 117 118 bool paintTextFieldInternal(RenderObject*, const PaintInfo&, const IntRect&, bool); 119 }; 118 bool paintTextFieldInternal(RenderObject*, const PaintInfo&, const IntRect&, bool); 119 }; 120 120 121 121 } // namespace WebCore
Note: See TracChangeset
for help on using the changeset viewer.