| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 inline MeterShadowElement::MeterShadowElement(Document& document) | 45 inline MeterShadowElement::MeterShadowElement(Document& document) |
| 46 : HTMLDivElement(document) | 46 : HTMLDivElement(document) |
| 47 { | 47 { |
| 48 } | 48 } |
| 49 | 49 |
| 50 HTMLMeterElement* MeterShadowElement::meterElement() const | 50 HTMLMeterElement* MeterShadowElement::meterElement() const |
| 51 { | 51 { |
| 52 return toHTMLMeterElement(shadowHost()); | 52 return toHTMLMeterElement(shadowHost()); |
| 53 } | 53 } |
| 54 | 54 |
| 55 bool MeterShadowElement::layoutObjectIsNeeded(const LayoutStyle& style) | 55 bool MeterShadowElement::layoutObjectIsNeeded(const ComputedStyle& style) |
| 56 { | 56 { |
| 57 LayoutObject* renderer = meterElement()->layoutObject(); | 57 LayoutObject* renderer = meterElement()->layoutObject(); |
| 58 return renderer && !LayoutTheme::theme().supportsMeter(renderer->style()->ap
pearance()) && HTMLDivElement::layoutObjectIsNeeded(style); | 58 return renderer && !LayoutTheme::theme().supportsMeter(renderer->style()->ap
pearance()) && HTMLDivElement::layoutObjectIsNeeded(style); |
| 59 } | 59 } |
| 60 | 60 |
| 61 inline MeterInnerElement::MeterInnerElement(Document& document) | 61 inline MeterInnerElement::MeterInnerElement(Document& document) |
| 62 : MeterShadowElement(document) | 62 : MeterShadowElement(document) |
| 63 { | 63 { |
| 64 } | 64 } |
| 65 | 65 |
| 66 PassRefPtrWillBeRawPtr<MeterInnerElement> MeterInnerElement::create(Document& do
cument) | 66 PassRefPtrWillBeRawPtr<MeterInnerElement> MeterInnerElement::create(Document& do
cument) |
| 67 { | 67 { |
| 68 RefPtrWillBeRawPtr<MeterInnerElement> element = adoptRefWillBeNoop(new Meter
InnerElement(document)); | 68 RefPtrWillBeRawPtr<MeterInnerElement> element = adoptRefWillBeNoop(new Meter
InnerElement(document)); |
| 69 element->setShadowPseudoId(AtomicString("-webkit-meter-inner-element", Atomi
cString::ConstructFromLiteral)); | 69 element->setShadowPseudoId(AtomicString("-webkit-meter-inner-element", Atomi
cString::ConstructFromLiteral)); |
| 70 return element.release(); | 70 return element.release(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 bool MeterInnerElement::layoutObjectIsNeeded(const LayoutStyle& style) | 73 bool MeterInnerElement::layoutObjectIsNeeded(const ComputedStyle& style) |
| 74 { | 74 { |
| 75 if (meterElement()->hasOpenShadowRoot()) | 75 if (meterElement()->hasOpenShadowRoot()) |
| 76 return HTMLDivElement::layoutObjectIsNeeded(style); | 76 return HTMLDivElement::layoutObjectIsNeeded(style); |
| 77 | 77 |
| 78 LayoutObject* renderer = meterElement()->layoutObject(); | 78 LayoutObject* renderer = meterElement()->layoutObject(); |
| 79 return renderer && !LayoutTheme::theme().supportsMeter(renderer->style()->ap
pearance()) && HTMLDivElement::layoutObjectIsNeeded(style); | 79 return renderer && !LayoutTheme::theme().supportsMeter(renderer->style()->ap
pearance()) && HTMLDivElement::layoutObjectIsNeeded(style); |
| 80 } | 80 } |
| 81 | 81 |
| 82 LayoutObject* MeterInnerElement::createLayoutObject(const LayoutStyle&) | 82 LayoutObject* MeterInnerElement::createLayoutObject(const ComputedStyle&) |
| 83 { | 83 { |
| 84 return new LayoutMeter(this); | 84 return new LayoutMeter(this); |
| 85 } | 85 } |
| 86 | 86 |
| 87 inline MeterBarElement::MeterBarElement(Document& document) | 87 inline MeterBarElement::MeterBarElement(Document& document) |
| 88 : MeterShadowElement(document) | 88 : MeterShadowElement(document) |
| 89 { | 89 { |
| 90 } | 90 } |
| 91 | 91 |
| 92 PassRefPtrWillBeRawPtr<MeterBarElement> MeterBarElement::create(Document& docume
nt) | 92 PassRefPtrWillBeRawPtr<MeterBarElement> MeterBarElement::create(Document& docume
nt) |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 return optimumPseudoId; | 130 return optimumPseudoId; |
| 131 } | 131 } |
| 132 } | 132 } |
| 133 | 133 |
| 134 void MeterValueElement::setWidthPercentage(double width) | 134 void MeterValueElement::setWidthPercentage(double width) |
| 135 { | 135 { |
| 136 setInlineStyleProperty(CSSPropertyWidth, width, CSSPrimitiveValue::CSS_PERCE
NTAGE); | 136 setInlineStyleProperty(CSSPropertyWidth, width, CSSPrimitiveValue::CSS_PERCE
NTAGE); |
| 137 } | 137 } |
| 138 | 138 |
| 139 } | 139 } |
| OLD | NEW |