Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: Source/core/rendering/RenderListBox.cpp

Issue 16357011: Remove support for -webkit-color-correction (which we've never supported on (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: resolve merge conflicts, obey brace style changes Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/rendering/RenderLayer.cpp ('k') | Source/core/rendering/RenderListMarker.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved.
3 * 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 3 * 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 409
410 Color textColor = element->renderStyle() ? element->renderStyle()->visitedDe pendentColor(CSSPropertyColor) : style()->visitedDependentColor(CSSPropertyColor ); 410 Color textColor = element->renderStyle() ? element->renderStyle()->visitedDe pendentColor(CSSPropertyColor) : style()->visitedDependentColor(CSSPropertyColor );
411 if (isOptionElement && toHTMLOptionElement(element)->selected()) { 411 if (isOptionElement && toHTMLOptionElement(element)->selected()) {
412 if (frame()->selection()->isFocusedAndActive() && document()->focusedNod e() == node()) 412 if (frame()->selection()->isFocusedAndActive() && document()->focusedNod e() == node())
413 textColor = theme()->activeListBoxSelectionForegroundColor(); 413 textColor = theme()->activeListBoxSelectionForegroundColor();
414 // Honor the foreground color for disabled items 414 // Honor the foreground color for disabled items
415 else if (!element->isDisabledFormControl() && !select->isDisabledFormCon trol()) 415 else if (!element->isDisabledFormControl() && !select->isDisabledFormCon trol())
416 textColor = theme()->inactiveListBoxSelectionForegroundColor(); 416 textColor = theme()->inactiveListBoxSelectionForegroundColor();
417 } 417 }
418 418
419 ColorSpace colorSpace = itemStyle->colorSpace(); 419 paintInfo.context->setFillColor(textColor);
420 paintInfo.context->setFillColor(textColor, colorSpace);
421 420
422 TextRun textRun(itemText, 0, 0, TextRun::AllowTrailingExpansion, itemStyle-> direction(), isOverride(itemStyle->unicodeBidi()), true, TextRun::NoRounding); 421 TextRun textRun(itemText, 0, 0, TextRun::AllowTrailingExpansion, itemStyle-> direction(), isOverride(itemStyle->unicodeBidi()), true, TextRun::NoRounding);
423 Font itemFont = style()->font(); 422 Font itemFont = style()->font();
424 LayoutRect r = itemBoundingBoxRect(paintOffset, listIndex); 423 LayoutRect r = itemBoundingBoxRect(paintOffset, listIndex);
425 r.move(itemOffsetForAlignment(textRun, itemStyle, itemFont, r)); 424 r.move(itemOffsetForAlignment(textRun, itemStyle, itemFont, r));
426 425
427 if (element->hasTagName(optgroupTag)) { 426 if (element->hasTagName(optgroupTag)) {
428 FontDescription d = itemFont.fontDescription(); 427 FontDescription d = itemFont.fontDescription();
429 d.setWeight(d.bolderWeight()); 428 d.setWeight(d.bolderWeight());
430 itemFont = Font(d, itemFont.letterSpacing(), itemFont.wordSpacing()); 429 itemFont = Font(d, itemFont.letterSpacing(), itemFont.wordSpacing());
(...skipping 15 matching lines...) Expand all
446 if (element->hasTagName(optionTag) && toHTMLOptionElement(element)->selected ()) { 445 if (element->hasTagName(optionTag) && toHTMLOptionElement(element)->selected ()) {
447 if (frame()->selection()->isFocusedAndActive() && document()->focusedNod e() == node()) 446 if (frame()->selection()->isFocusedAndActive() && document()->focusedNod e() == node())
448 backColor = theme()->activeListBoxSelectionBackgroundColor(); 447 backColor = theme()->activeListBoxSelectionBackgroundColor();
449 else 448 else
450 backColor = theme()->inactiveListBoxSelectionBackgroundColor(); 449 backColor = theme()->inactiveListBoxSelectionBackgroundColor();
451 } else 450 } else
452 backColor = element->renderStyle() ? element->renderStyle()->visitedDepe ndentColor(CSSPropertyBackgroundColor) : style()->visitedDependentColor(CSSPrope rtyBackgroundColor); 451 backColor = element->renderStyle() ? element->renderStyle()->visitedDepe ndentColor(CSSPropertyBackgroundColor) : style()->visitedDependentColor(CSSPrope rtyBackgroundColor);
453 452
454 // Draw the background for this list box item 453 // Draw the background for this list box item
455 if (!element->renderStyle() || element->renderStyle()->visibility() != HIDDE N) { 454 if (!element->renderStyle() || element->renderStyle()->visibility() != HIDDE N) {
456 ColorSpace colorSpace = element->renderStyle() ? element->renderStyle()- >colorSpace() : style()->colorSpace();
457 LayoutRect itemRect = itemBoundingBoxRect(paintOffset, listIndex); 455 LayoutRect itemRect = itemBoundingBoxRect(paintOffset, listIndex);
458 itemRect.intersect(controlClipRect(paintOffset)); 456 itemRect.intersect(controlClipRect(paintOffset));
459 paintInfo.context->fillRect(pixelSnappedIntRect(itemRect), backColor, co lorSpace); 457 paintInfo.context->fillRect(pixelSnappedIntRect(itemRect), backColor);
460 } 458 }
461 } 459 }
462 460
463 bool RenderListBox::isPointInOverflowControl(HitTestResult& result, const Layout Point& locationInContainer, const LayoutPoint& accumulatedOffset) 461 bool RenderListBox::isPointInOverflowControl(HitTestResult& result, const Layout Point& locationInContainer, const LayoutPoint& accumulatedOffset)
464 { 462 {
465 if (!m_vBar || !m_vBar->shouldParticipateInHitTesting()) 463 if (!m_vBar || !m_vBar->shouldParticipateInHitTesting())
466 return false; 464 return false;
467 465
468 LayoutRect vertRect(accumulatedOffset.x() + width() - borderRight() - m_vBar ->width(), 466 LayoutRect vertRect(accumulatedOffset.x() + width() - borderRight() - m_vBar ->width(),
469 accumulatedOffset.y() + borderTop(), 467 accumulatedOffset.y() + borderTop(),
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 888
891 if (m_vBar) 889 if (m_vBar)
892 m_vBar->styleChanged(); 890 m_vBar->styleChanged();
893 891
894 // Force an update since we know the scrollbars have changed things. 892 // Force an update since we know the scrollbars have changed things.
895 if (document()->hasAnnotatedRegions()) 893 if (document()->hasAnnotatedRegions())
896 document()->setAnnotatedRegionsDirty(true); 894 document()->setAnnotatedRegionsDirty(true);
897 } 895 }
898 896
899 } // namespace WebCore 897 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayer.cpp ('k') | Source/core/rendering/RenderListMarker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698