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

Side by Side Diff: Source/core/rendering/RenderThemeChromiumMac.mm

Issue 173433002: Do not crash if custom scrollbars have -webkit-appearane:searchfield-foo. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Google, Inc. 3 * Copyright (C) 2008, 2009 Google, Inc.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 1645 matching lines...) Expand 10 before | Expand all | Expand 10 after
1656 style->setPaddingTop(Length(verticalPadding, Fixed)); 1656 style->setPaddingTop(Length(verticalPadding, Fixed));
1657 style->setPaddingBottom(Length(verticalPadding, Fixed)); 1657 style->setPaddingBottom(Length(verticalPadding, Fixed));
1658 1658
1659 setFontFromControlSize(style, controlSize); 1659 setFontFromControlSize(style, controlSize);
1660 1660
1661 style->setBoxShadow(nullptr); 1661 style->setBoxShadow(nullptr);
1662 } 1662 }
1663 1663
1664 bool RenderThemeChromiumMac::paintSearchFieldCancelButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r) 1664 bool RenderThemeChromiumMac::paintSearchFieldCancelButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
1665 { 1665 {
1666 if (!o->node())
1667 return false;
1666 Element* input = o->node()->shadowHost(); 1668 Element* input = o->node()->shadowHost();
1667 if (!input) 1669 if (!input)
1668 input = toElement(o->node()); 1670 input = toElement(o->node());
1669 1671
1670 if (!input->renderer()->isBox()) 1672 if (!input->renderer()->isBox())
1671 return false; 1673 return false;
1672 1674
1673 GraphicsContextStateSaver stateSaver(*paintInfo.context); 1675 GraphicsContextStateSaver stateSaver(*paintInfo.context);
1674 1676
1675 float zoomLevel = o->style()->effectiveZoom(); 1677 float zoomLevel = o->style()->effectiveZoom();
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
1754 void RenderThemeChromiumMac::adjustSearchFieldResultsDecorationStyle(RenderStyle * style, Element*) const 1756 void RenderThemeChromiumMac::adjustSearchFieldResultsDecorationStyle(RenderStyle * style, Element*) const
1755 { 1757 {
1756 IntSize size = sizeForSystemFont(style, resultsButtonSizes()); 1758 IntSize size = sizeForSystemFont(style, resultsButtonSizes());
1757 style->setWidth(Length(size.width(), Fixed)); 1759 style->setWidth(Length(size.width(), Fixed));
1758 style->setHeight(Length(size.height(), Fixed)); 1760 style->setHeight(Length(size.height(), Fixed));
1759 style->setBoxShadow(nullptr); 1761 style->setBoxShadow(nullptr);
1760 } 1762 }
1761 1763
1762 bool RenderThemeChromiumMac::paintSearchFieldResultsDecoration(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r) 1764 bool RenderThemeChromiumMac::paintSearchFieldResultsDecoration(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
1763 { 1765 {
1766 if (!o->node())
1767 return false;
1764 Node* input = o->node()->shadowHost(); 1768 Node* input = o->node()->shadowHost();
1765 if (!input) 1769 if (!input)
1766 input = o->node(); 1770 input = o->node();
1767 if (!input->renderer()->isBox()) 1771 if (!input->renderer()->isBox())
1768 return false; 1772 return false;
1769 1773
1770 GraphicsContextStateSaver stateSaver(*paintInfo.context); 1774 GraphicsContextStateSaver stateSaver(*paintInfo.context);
1771 1775
1772 float zoomLevel = o->style()->effectiveZoom(); 1776 float zoomLevel = o->style()->effectiveZoom();
1773 FloatRect unzoomedRect(r); 1777 FloatRect unzoomedRect(r);
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
2011 2015
2012 bool RenderThemeChromiumMac::shouldUseFallbackTheme(RenderStyle* style) const 2016 bool RenderThemeChromiumMac::shouldUseFallbackTheme(RenderStyle* style) const
2013 { 2017 {
2014 ControlPart part = style->appearance(); 2018 ControlPart part = style->appearance();
2015 if (part == CheckboxPart || part == RadioPart) 2019 if (part == CheckboxPart || part == RadioPart)
2016 return style->effectiveZoom() != 1; 2020 return style->effectiveZoom() != 1;
2017 return false; 2021 return false;
2018 } 2022 }
2019 2023
2020 } // namespace WebCore 2024 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/scrollbars/custom-scrollbar-appearance-property.html ('k') | Source/core/rendering/RenderThemeChromiumSkia.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698