OLD | NEW |
1 /** | 1 /** |
2 * This file is part of the theme implementation for form controls in WebCore. | 2 * This file is part of the theme implementation for form controls in WebCore. |
3 * | 3 * |
4 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Computer, Inc. | 4 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Computer, Inc. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 return o.node()->active(); | 541 return o.node()->active(); |
542 } | 542 } |
543 | 543 |
544 bool LayoutTheme::isSpinUpButtonPartPressed(const LayoutObject& o) | 544 bool LayoutTheme::isSpinUpButtonPartPressed(const LayoutObject& o) |
545 { | 545 { |
546 Node* node = o.node(); | 546 Node* node = o.node(); |
547 if (!node || !node->active() || !node->isElementNode() | 547 if (!node || !node->active() || !node->isElementNode() |
548 || !toElement(node)->isSpinButtonElement()) | 548 || !toElement(node)->isSpinButtonElement()) |
549 return false; | 549 return false; |
550 SpinButtonElement* element = toSpinButtonElement(node); | 550 SpinButtonElement* element = toSpinButtonElement(node); |
551 return element->upDownState() == SpinButtonElement::Up; | 551 return element->getUpDownState() == SpinButtonElement::Up; |
552 } | 552 } |
553 | 553 |
554 bool LayoutTheme::isReadOnlyControl(const LayoutObject& o) | 554 bool LayoutTheme::isReadOnlyControl(const LayoutObject& o) |
555 { | 555 { |
556 Node* node = o.node(); | 556 Node* node = o.node(); |
557 if (!node || !node->isElementNode() || !toElement(node)->isFormControlElemen
t()) | 557 if (!node || !node->isElementNode() || !toElement(node)->isFormControlElemen
t()) |
558 return false; | 558 return false; |
559 HTMLFormControlElement* element = toHTMLFormControlElement(node); | 559 HTMLFormControlElement* element = toHTMLFormControlElement(node); |
560 return element->isReadOnly(); | 560 return element->isReadOnly(); |
561 } | 561 } |
562 | 562 |
563 bool LayoutTheme::isHovered(const LayoutObject& o) | 563 bool LayoutTheme::isHovered(const LayoutObject& o) |
564 { | 564 { |
565 Node* node = o.node(); | 565 Node* node = o.node(); |
566 if (!node) | 566 if (!node) |
567 return false; | 567 return false; |
568 if (!node->isElementNode() || !toElement(node)->isSpinButtonElement()) | 568 if (!node->isElementNode() || !toElement(node)->isSpinButtonElement()) |
569 return node->hovered(); | 569 return node->hovered(); |
570 SpinButtonElement* element = toSpinButtonElement(node); | 570 SpinButtonElement* element = toSpinButtonElement(node); |
571 return element->hovered() && element->upDownState() != SpinButtonElement::In
determinate; | 571 return element->hovered() && element->getUpDownState() != SpinButtonElement:
:Indeterminate; |
572 } | 572 } |
573 | 573 |
574 bool LayoutTheme::isSpinUpButtonPartHovered(const LayoutObject& o) | 574 bool LayoutTheme::isSpinUpButtonPartHovered(const LayoutObject& o) |
575 { | 575 { |
576 Node* node = o.node(); | 576 Node* node = o.node(); |
577 if (!node || !node->isElementNode() || !toElement(node)->isSpinButtonElement
()) | 577 if (!node || !node->isElementNode() || !toElement(node)->isSpinButtonElement
()) |
578 return false; | 578 return false; |
579 SpinButtonElement* element = toSpinButtonElement(node); | 579 SpinButtonElement* element = toSpinButtonElement(node); |
580 return element->upDownState() == SpinButtonElement::Up; | 580 return element->getUpDownState() == SpinButtonElement::Up; |
581 } | 581 } |
582 | 582 |
583 void LayoutTheme::adjustCheckboxStyle(ComputedStyle& style) const | 583 void LayoutTheme::adjustCheckboxStyle(ComputedStyle& style) const |
584 { | 584 { |
585 // A summary of the rules for checkbox designed to match WinIE: | 585 // A summary of the rules for checkbox designed to match WinIE: |
586 // width/height - honored (WinIE actually scales its control for small width
s, but lets it overflow for small heights.) | 586 // width/height - honored (WinIE actually scales its control for small width
s, but lets it overflow for small heights.) |
587 // font-size - not honored (control has no text), but we use it to decide wh
ich control size to use. | 587 // font-size - not honored (control has no text), but we use it to decide wh
ich control size to use. |
588 setCheckboxSize(style); | 588 setCheckboxSize(style); |
589 | 589 |
590 // padding - not honored by WinIE, needs to be removed. | 590 // padding - not honored by WinIE, needs to be removed. |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
942 | 942 |
943 // padding - not honored by WinIE, needs to be removed. | 943 // padding - not honored by WinIE, needs to be removed. |
944 style.resetPadding(); | 944 style.resetPadding(); |
945 | 945 |
946 // border - honored by WinIE, but looks terrible (just paints in the control
box and turns off the Windows XP theme) | 946 // border - honored by WinIE, but looks terrible (just paints in the control
box and turns off the Windows XP theme) |
947 // for now, we will not honor it. | 947 // for now, we will not honor it. |
948 style.resetBorder(); | 948 style.resetBorder(); |
949 } | 949 } |
950 | 950 |
951 } // namespace blink | 951 } // namespace blink |
OLD | NEW |