OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. |
7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 1557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1568 if (diff.needsPaintInvalidationLayer() && !hasLayer()) { | 1568 if (diff.needsPaintInvalidationLayer() && !hasLayer()) { |
1569 diff.clearNeedsPaintInvalidation(); | 1569 diff.clearNeedsPaintInvalidation(); |
1570 diff.setNeedsPaintInvalidationObject(); | 1570 diff.setNeedsPaintInvalidationObject(); |
1571 } | 1571 } |
1572 | 1572 |
1573 return diff; | 1573 return diff; |
1574 } | 1574 } |
1575 | 1575 |
1576 void RenderObject::setPseudoStyle(PassRefPtr<RenderStyle> pseudoStyle) | 1576 void RenderObject::setPseudoStyle(PassRefPtr<RenderStyle> pseudoStyle) |
1577 { | 1577 { |
1578 ASSERT(pseudoStyle->styleType() == BEFORE || pseudoStyle->styleType() == AFT
ER || pseudoStyle->styleType() == FIRST_LETTER); | 1578 ASSERT(pseudoStyle->styleType() == BEFORE || pseudoStyle->styleType() == AFT
ER || pseudoStyle->styleType() == FIRST_LETTER || |
| 1579 (RuntimeEnabledFeatures::listMarkerPseudoElementEnabled() && pseudoStyle
->styleType() == MARKER)); |
1579 | 1580 |
1580 // FIXME: We should consider just making all pseudo items use an inherited s
tyle. | 1581 // FIXME: We should consider just making all pseudo items use an inherited s
tyle. |
1581 | 1582 |
1582 // Images are special and must inherit the pseudoStyle so the width and heig
ht of | 1583 // Images are special and must inherit the pseudoStyle so the width and heig
ht of |
1583 // the pseudo element doesn't change the size of the image. In all other cas
es we | 1584 // the pseudo element doesn't change the size of the image. In all other cas
es we |
1584 // can just share the style. | 1585 // can just share the style. |
1585 // | 1586 // |
1586 // Quotes are also RenderInline, so we need to create an inherited style to
avoid | 1587 // Quotes are also RenderInline, so we need to create an inherited style to
avoid |
1587 // getting an inline with positioning or an invalid display. | 1588 // getting an inline with positioning or an invalid display. |
1588 // | 1589 // |
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2619 ASSERT(document().styleEngine()->usesFirstLineRules()); | 2620 ASSERT(document().styleEngine()->usesFirstLineRules()); |
2620 | 2621 |
2621 if (RefPtr<RenderStyle> style = firstLineStyleForCachedUncachedType(Cached,
isText() ? parent() : this, m_style.get())) | 2622 if (RefPtr<RenderStyle> style = firstLineStyleForCachedUncachedType(Cached,
isText() ? parent() : this, m_style.get())) |
2622 return style.get(); | 2623 return style.get(); |
2623 | 2624 |
2624 return m_style.get(); | 2625 return m_style.get(); |
2625 } | 2626 } |
2626 | 2627 |
2627 RenderStyle* RenderObject::getCachedPseudoStyle(PseudoId pseudo, RenderStyle* pa
rentStyle) const | 2628 RenderStyle* RenderObject::getCachedPseudoStyle(PseudoId pseudo, RenderStyle* pa
rentStyle) const |
2628 { | 2629 { |
2629 if (pseudo < FIRST_INTERNAL_PSEUDOID && !style()->hasPseudoStyle(pseudo)) | 2630 // FIXME: adding display != LIST_ITEM seems wrong ... wrap in method? |
| 2631 if (pseudo < FIRST_INTERNAL_PSEUDOID && !style()->hasPseudoStyle(pseudo) &&
style()->display() != LIST_ITEM) |
2630 return 0; | 2632 return 0; |
2631 | 2633 |
2632 RenderStyle* cachedStyle = style()->getCachedPseudoStyle(pseudo); | 2634 RenderStyle* cachedStyle = style()->getCachedPseudoStyle(pseudo); |
2633 if (cachedStyle) | 2635 if (cachedStyle) |
2634 return cachedStyle; | 2636 return cachedStyle; |
2635 | 2637 |
2636 RefPtr<RenderStyle> result = getUncachedPseudoStyle(PseudoStyleRequest(pseud
o), parentStyle); | 2638 RefPtr<RenderStyle> result = getUncachedPseudoStyle(PseudoStyleRequest(pseud
o), parentStyle); |
2637 if (result) | 2639 if (result) |
2638 return style()->addCachedPseudoStyle(result.release()); | 2640 return style()->addCachedPseudoStyle(result.release()); |
2639 return 0; | 2641 return 0; |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3120 { | 3122 { |
3121 if (object1) { | 3123 if (object1) { |
3122 const blink::RenderObject* root = object1; | 3124 const blink::RenderObject* root = object1; |
3123 while (root->parent()) | 3125 while (root->parent()) |
3124 root = root->parent(); | 3126 root = root->parent(); |
3125 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3127 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
3126 } | 3128 } |
3127 } | 3129 } |
3128 | 3130 |
3129 #endif | 3131 #endif |
OLD | NEW |