OLD | NEW |
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 1467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1478 } | 1478 } |
1479 | 1479 |
1480 bool LayoutThemeMac::paintSearchFieldCancelButton(LayoutObject* o, const PaintIn
fo& paintInfo, const IntRect& r) | 1480 bool LayoutThemeMac::paintSearchFieldCancelButton(LayoutObject* o, const PaintIn
fo& paintInfo, const IntRect& r) |
1481 { | 1481 { |
1482 if (!o->node()) | 1482 if (!o->node()) |
1483 return false; | 1483 return false; |
1484 Element* input = o->node()->shadowHost(); | 1484 Element* input = o->node()->shadowHost(); |
1485 if (!input) | 1485 if (!input) |
1486 input = toElement(o->node()); | 1486 input = toElement(o->node()); |
1487 | 1487 |
1488 if (!input->renderer()->isBox()) | 1488 if (!input->layoutObject()->isBox()) |
1489 return false; | 1489 return false; |
1490 | 1490 |
1491 GraphicsContextStateSaver stateSaver(*paintInfo.context); | 1491 GraphicsContextStateSaver stateSaver(*paintInfo.context); |
1492 | 1492 |
1493 float zoomLevel = o->style()->effectiveZoom(); | 1493 float zoomLevel = o->style()->effectiveZoom(); |
1494 FloatRect unzoomedRect(r); | 1494 FloatRect unzoomedRect(r); |
1495 if (zoomLevel != 1.0f) { | 1495 if (zoomLevel != 1.0f) { |
1496 unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel); | 1496 unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel); |
1497 unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel); | 1497 unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel); |
1498 paintInfo.context->translate(unzoomedRect.x(), unzoomedRect.y()); | 1498 paintInfo.context->translate(unzoomedRect.x(), unzoomedRect.y()); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1577 style.setBoxShadow(nullptr); | 1577 style.setBoxShadow(nullptr); |
1578 } | 1578 } |
1579 | 1579 |
1580 bool LayoutThemeMac::paintSearchFieldResultsDecoration(LayoutObject* o, const Pa
intInfo& paintInfo, const IntRect& r) | 1580 bool LayoutThemeMac::paintSearchFieldResultsDecoration(LayoutObject* o, const Pa
intInfo& paintInfo, const IntRect& r) |
1581 { | 1581 { |
1582 if (!o->node()) | 1582 if (!o->node()) |
1583 return false; | 1583 return false; |
1584 Node* input = o->node()->shadowHost(); | 1584 Node* input = o->node()->shadowHost(); |
1585 if (!input) | 1585 if (!input) |
1586 input = o->node(); | 1586 input = o->node(); |
1587 if (!input->renderer()->isBox()) | 1587 if (!input->layoutObject()->isBox()) |
1588 return false; | 1588 return false; |
1589 | 1589 |
1590 GraphicsContextStateSaver stateSaver(*paintInfo.context); | 1590 GraphicsContextStateSaver stateSaver(*paintInfo.context); |
1591 | 1591 |
1592 float zoomLevel = o->style()->effectiveZoom(); | 1592 float zoomLevel = o->style()->effectiveZoom(); |
1593 FloatRect unzoomedRect(r); | 1593 FloatRect unzoomedRect(r); |
1594 if (zoomLevel != 1) { | 1594 if (zoomLevel != 1) { |
1595 unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel); | 1595 unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel); |
1596 unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel); | 1596 unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel); |
1597 paintInfo.context->translate(unzoomedRect.x(), unzoomedRect.y()); | 1597 paintInfo.context->translate(unzoomedRect.x(), unzoomedRect.y()); |
1598 paintInfo.context->scale(zoomLevel, zoomLevel); | 1598 paintInfo.context->scale(zoomLevel, zoomLevel); |
1599 paintInfo.context->translate(-unzoomedRect.x(), -unzoomedRect.y()); | 1599 paintInfo.context->translate(-unzoomedRect.x(), -unzoomedRect.y()); |
1600 } | 1600 } |
1601 | 1601 |
1602 LocalCurrentGraphicsContext localContext(paintInfo.context, r); | 1602 LocalCurrentGraphicsContext localContext(paintInfo.context, r); |
1603 | 1603 |
1604 NSSearchFieldCell* search = this->search(); | 1604 NSSearchFieldCell* search = this->search(); |
1605 setSearchCellState(input->renderer(), r); | 1605 setSearchCellState(input->layoutObject(), r); |
1606 [search setControlSize:searchFieldControlSizeForFont(o->styleRef())]; | 1606 [search setControlSize:searchFieldControlSizeForFont(o->styleRef())]; |
1607 if ([search searchMenuTemplate] != nil) | 1607 if ([search searchMenuTemplate] != nil) |
1608 [search setSearchMenuTemplate:nil]; | 1608 [search setSearchMenuTemplate:nil]; |
1609 | 1609 |
1610 updateActiveState([search searchButtonCell], o); | 1610 updateActiveState([search searchButtonCell], o); |
1611 | 1611 |
1612 [[search searchButtonCell] drawWithFrame:unzoomedRect inView:documentViewFor
(o)]; | 1612 [[search searchButtonCell] drawWithFrame:unzoomedRect inView:documentViewFor
(o)]; |
1613 [[search searchButtonCell] setControlView:nil]; | 1613 [[search searchButtonCell] setControlView:nil]; |
1614 return false; | 1614 return false; |
1615 } | 1615 } |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1844 | 1844 |
1845 bool LayoutThemeMac::shouldUseFallbackTheme(const LayoutStyle& style) const | 1845 bool LayoutThemeMac::shouldUseFallbackTheme(const LayoutStyle& style) const |
1846 { | 1846 { |
1847 ControlPart part = style.appearance(); | 1847 ControlPart part = style.appearance(); |
1848 if (part == CheckboxPart || part == RadioPart) | 1848 if (part == CheckboxPart || part == RadioPart) |
1849 return style.effectiveZoom() != 1; | 1849 return style.effectiveZoom() != 1; |
1850 return false; | 1850 return false; |
1851 } | 1851 } |
1852 | 1852 |
1853 } // namespace blink | 1853 } // namespace blink |
OLD | NEW |