| 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 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 return 0; // This can still happen in case of an orphaned tree | 653 return 0; // This can still happen in case of an orphaned tree |
| 654 | 654 |
| 655 return toRenderBlock(o); | 655 return toRenderBlock(o); |
| 656 } | 656 } |
| 657 | 657 |
| 658 bool RenderObject::canRenderBorderImage() const | 658 bool RenderObject::canRenderBorderImage() const |
| 659 { | 659 { |
| 660 ASSERT(style()->hasBorder()); | 660 ASSERT(style()->hasBorder()); |
| 661 | 661 |
| 662 StyleImage* borderImage = style()->borderImage().image(); | 662 StyleImage* borderImage = style()->borderImage().image(); |
| 663 return borderImage && borderImage->canRender(*this, style()->effectiveZoom()
) && borderImage->isLoaded(); | 663 return borderImage && borderImage->canRender(*this) && borderImage->isLoaded
(); |
| 664 } | 664 } |
| 665 | 665 |
| 666 bool RenderObject::mustInvalidateFillLayersPaintOnWidthChange(const FillLayer& l
ayer) const | 666 bool RenderObject::mustInvalidateFillLayersPaintOnWidthChange(const FillLayer& l
ayer) const |
| 667 { | 667 { |
| 668 // Nobody will use multiple layers without wanting fancy positioning. | 668 // Nobody will use multiple layers without wanting fancy positioning. |
| 669 if (layer.next()) | 669 if (layer.next()) |
| 670 return true; | 670 return true; |
| 671 | 671 |
| 672 // Make sure we have a valid image. | 672 // Make sure we have a valid image. |
| 673 StyleImage* img = layer.image(); | 673 StyleImage* img = layer.image(); |
| 674 if (!img || !img->canRender(*this, style()->effectiveZoom())) | 674 if (!img || !img->canRender(*this)) |
| 675 return false; | 675 return false; |
| 676 | 676 |
| 677 if (layer.repeatX() != RepeatFill && layer.repeatX() != NoRepeatFill) | 677 if (layer.repeatX() != RepeatFill && layer.repeatX() != NoRepeatFill) |
| 678 return true; | 678 return true; |
| 679 | 679 |
| 680 if (layer.xPosition().isPercent() && !layer.xPosition().isZero()) | 680 if (layer.xPosition().isPercent() && !layer.xPosition().isZero()) |
| 681 return true; | 681 return true; |
| 682 | 682 |
| 683 if (layer.backgroundXOrigin() != LeftEdge) | 683 if (layer.backgroundXOrigin() != LeftEdge) |
| 684 return true; | 684 return true; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 701 } | 701 } |
| 702 | 702 |
| 703 bool RenderObject::mustInvalidateFillLayersPaintOnHeightChange(const FillLayer&
layer) const | 703 bool RenderObject::mustInvalidateFillLayersPaintOnHeightChange(const FillLayer&
layer) const |
| 704 { | 704 { |
| 705 // Nobody will use multiple layers without wanting fancy positioning. | 705 // Nobody will use multiple layers without wanting fancy positioning. |
| 706 if (layer.next()) | 706 if (layer.next()) |
| 707 return true; | 707 return true; |
| 708 | 708 |
| 709 // Make sure we have a valid image. | 709 // Make sure we have a valid image. |
| 710 StyleImage* img = layer.image(); | 710 StyleImage* img = layer.image(); |
| 711 if (!img || !img->canRender(*this, style()->effectiveZoom())) | 711 if (!img || !img->canRender(*this)) |
| 712 return false; | 712 return false; |
| 713 | 713 |
| 714 if (layer.repeatY() != RepeatFill && layer.repeatY() != NoRepeatFill) | 714 if (layer.repeatY() != RepeatFill && layer.repeatY() != NoRepeatFill) |
| 715 return true; | 715 return true; |
| 716 | 716 |
| 717 if (layer.yPosition().isPercent() && !layer.yPosition().isZero()) | 717 if (layer.yPosition().isPercent() && !layer.yPosition().isZero()) |
| 718 return true; | 718 return true; |
| 719 | 719 |
| 720 if (layer.backgroundYOrigin() != TopEdge) | 720 if (layer.backgroundYOrigin() != TopEdge) |
| 721 return true; | 721 return true; |
| (...skipping 1758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2480 void RenderObject::imageChanged(ImageResource* image, const IntRect* rect) | 2480 void RenderObject::imageChanged(ImageResource* image, const IntRect* rect) |
| 2481 { | 2481 { |
| 2482 imageChanged(static_cast<WrappedImagePtr>(image), rect); | 2482 imageChanged(static_cast<WrappedImagePtr>(image), rect); |
| 2483 } | 2483 } |
| 2484 | 2484 |
| 2485 Element* RenderObject::offsetParent() const | 2485 Element* RenderObject::offsetParent() const |
| 2486 { | 2486 { |
| 2487 if (isDocumentElement()) | 2487 if (isDocumentElement()) |
| 2488 return 0; | 2488 return 0; |
| 2489 | 2489 |
| 2490 // If A is an area HTML element which has a map HTML element somewhere in th
e ancestor | |
| 2491 // chain return the nearest ancestor map HTML element and stop this algorith
m. | |
| 2492 // FIXME: Implement! | |
| 2493 | |
| 2494 float effectiveZoom = style()->effectiveZoom(); | |
| 2495 Node* node = 0; | 2490 Node* node = 0; |
| 2496 for (RenderObject* ancestor = parent(); ancestor; ancestor = ancestor->paren
t()) { | 2491 for (RenderObject* ancestor = parent(); ancestor; ancestor = ancestor->paren
t()) { |
| 2497 // Spec: http://www.w3.org/TR/cssom-view/#offset-attributes | 2492 // Spec: http://www.w3.org/TR/cssom-view/#offset-attributes |
| 2498 | |
| 2499 node = ancestor->node(); | 2493 node = ancestor->node(); |
| 2500 | |
| 2501 if (!node) | 2494 if (!node) |
| 2502 continue; | 2495 continue; |
| 2503 | 2496 |
| 2504 if (ancestor->isPositioned()) | 2497 if (ancestor->isPositioned()) |
| 2505 break; | 2498 break; |
| 2506 | |
| 2507 // Webkit specific extension where offsetParent stops at zoom level chan
ges. | |
| 2508 if (effectiveZoom != ancestor->style()->effectiveZoom()) | |
| 2509 break; | |
| 2510 } | 2499 } |
| 2511 | 2500 |
| 2512 return node && node->isElementNode() ? toElement(node) : 0; | 2501 return node && node->isElementNode() ? toElement(node) : 0; |
| 2513 } | 2502 } |
| 2514 | 2503 |
| 2515 PositionWithAffinity RenderObject::createPositionWithAffinity(int offset, EAffin
ity affinity) | 2504 PositionWithAffinity RenderObject::createPositionWithAffinity(int offset, EAffin
ity affinity) |
| 2516 { | 2505 { |
| 2517 // If this is a non-anonymous renderer in an editable area, then it's simple
. | 2506 // If this is a non-anonymous renderer in an editable area, then it's simple
. |
| 2518 if (Node* node = nonPseudoNode()) { | 2507 if (Node* node = nonPseudoNode()) { |
| 2519 if (!node->hasEditableStyle()) { | 2508 if (!node->hasEditableStyle()) { |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2711 { | 2700 { |
| 2712 if (object1) { | 2701 if (object1) { |
| 2713 const blink::RenderObject* root = object1; | 2702 const blink::RenderObject* root = object1; |
| 2714 while (root->parent()) | 2703 while (root->parent()) |
| 2715 root = root->parent(); | 2704 root = root->parent(); |
| 2716 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 2705 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
| 2717 } | 2706 } |
| 2718 } | 2707 } |
| 2719 | 2708 |
| 2720 #endif | 2709 #endif |
| OLD | NEW |