| 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 1875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1886 toImageContentData(m_style->contentData())->image() : nullptr; | 1886 toImageContentData(m_style->contentData())->image() : nullptr; |
| 1887 StyleImage* oldContentImage = oldStyle && oldStyle->contentData() && oldStyl
e->contentData()->isImage() ? | 1887 StyleImage* oldContentImage = oldStyle && oldStyle->contentData() && oldStyl
e->contentData()->isImage() ? |
| 1888 toImageContentData(oldStyle->contentData())->image() : nullptr; | 1888 toImageContentData(oldStyle->contentData())->image() : nullptr; |
| 1889 updateImage(oldContentImage, newContentImage); | 1889 updateImage(oldContentImage, newContentImage); |
| 1890 | 1890 |
| 1891 StyleImage* newBoxReflectMaskImage = m_style->boxReflect() ? m_style->boxRef
lect()->mask().image() : nullptr; | 1891 StyleImage* newBoxReflectMaskImage = m_style->boxReflect() ? m_style->boxRef
lect()->mask().image() : nullptr; |
| 1892 StyleImage* oldBoxReflectMaskImage = oldStyle && oldStyle->boxReflect() ? ol
dStyle->boxReflect()->mask().image() : nullptr; | 1892 StyleImage* oldBoxReflectMaskImage = oldStyle && oldStyle->boxReflect() ? ol
dStyle->boxReflect()->mask().image() : nullptr; |
| 1893 updateImage(oldBoxReflectMaskImage, newBoxReflectMaskImage); | 1893 updateImage(oldBoxReflectMaskImage, newBoxReflectMaskImage); |
| 1894 | 1894 |
| 1895 updateShapeImage(oldStyle ? oldStyle->shapeOutside() : 0, m_style->shapeOuts
ide()); | 1895 updateShapeImage(oldStyle ? oldStyle->shapeOutside() : 0, m_style->shapeOuts
ide()); |
| 1896 updateCursorImages(oldStyle ? oldStyle->cursors() : nullptr, m_style->cursor
s()); |
| 1896 | 1897 |
| 1897 bool doesNotNeedLayoutOrPaintInvalidation = !m_parent; | 1898 bool doesNotNeedLayoutOrPaintInvalidation = !m_parent; |
| 1898 | 1899 |
| 1899 styleDidChange(diff, oldStyle.get()); | 1900 styleDidChange(diff, oldStyle.get()); |
| 1900 | 1901 |
| 1901 // FIXME: |this| might be destroyed here. This can currently happen for a La
youtTextFragment when | 1902 // FIXME: |this| might be destroyed here. This can currently happen for a La
youtTextFragment when |
| 1902 // its first-letter block gets an update in LayoutTextFragment::styleDidChan
ge. For LayoutTextFragment(s), | 1903 // its first-letter block gets an update in LayoutTextFragment::styleDidChan
ge. For LayoutTextFragment(s), |
| 1903 // we will safely bail out with the doesNotNeedLayoutOrPaintInvalidation fla
g. We might want to broaden | 1904 // we will safely bail out with the doesNotNeedLayoutOrPaintInvalidation fla
g. We might want to broaden |
| 1904 // this condition in the future as we move layoutObject changes out of layou
t and into style changes. | 1905 // this condition in the future as we move layoutObject changes out of layou
t and into style changes. |
| 1905 if (doesNotNeedLayoutOrPaintInvalidation) | 1906 if (doesNotNeedLayoutOrPaintInvalidation) |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2110 if (currNew->image()) | 2111 if (currNew->image()) |
| 2111 currNew->image()->addClient(this); | 2112 currNew->image()->addClient(this); |
| 2112 } | 2113 } |
| 2113 | 2114 |
| 2114 for (const FillLayer* currOld = oldLayers; currOld; currOld = currOld->next(
)) { | 2115 for (const FillLayer* currOld = oldLayers; currOld; currOld = currOld->next(
)) { |
| 2115 if (currOld->image()) | 2116 if (currOld->image()) |
| 2116 currOld->image()->removeClient(this); | 2117 currOld->image()->removeClient(this); |
| 2117 } | 2118 } |
| 2118 } | 2119 } |
| 2119 | 2120 |
| 2121 void LayoutObject::updateCursorImages(const CursorList* oldCursors, const Cursor
List* newCursors) |
| 2122 { |
| 2123 if (oldCursors && newCursors && *oldCursors == *newCursors) |
| 2124 return; |
| 2125 |
| 2126 if (newCursors) { |
| 2127 for (const CursorData& cursorNew : *newCursors) { |
| 2128 if (cursorNew.image()) |
| 2129 cursorNew.image()->addClient(this); |
| 2130 } |
| 2131 } |
| 2132 removeCursorImageClient(oldCursors); |
| 2133 } |
| 2134 |
| 2120 void LayoutObject::updateImage(StyleImage* oldImage, StyleImage* newImage) | 2135 void LayoutObject::updateImage(StyleImage* oldImage, StyleImage* newImage) |
| 2121 { | 2136 { |
| 2122 if (oldImage != newImage) { | 2137 if (oldImage != newImage) { |
| 2123 if (oldImage) | 2138 if (oldImage) |
| 2124 oldImage->removeClient(this); | 2139 oldImage->removeClient(this); |
| 2125 if (newImage) | 2140 if (newImage) |
| 2126 newImage->addClient(this); | 2141 newImage->addClient(this); |
| 2127 } | 2142 } |
| 2128 } | 2143 } |
| 2129 | 2144 |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2639 if (StyleImage* maskBoxImage = m_style->maskBoxImage().image()) | 2654 if (StyleImage* maskBoxImage = m_style->maskBoxImage().image()) |
| 2640 maskBoxImage->removeClient(this); | 2655 maskBoxImage->removeClient(this); |
| 2641 | 2656 |
| 2642 if (m_style->contentData() && m_style->contentData()->isImage()) | 2657 if (m_style->contentData() && m_style->contentData()->isImage()) |
| 2643 toImageContentData(m_style->contentData())->image()->removeClient(th
is); | 2658 toImageContentData(m_style->contentData())->image()->removeClient(th
is); |
| 2644 | 2659 |
| 2645 if (m_style->boxReflect() && m_style->boxReflect()->mask().image()) | 2660 if (m_style->boxReflect() && m_style->boxReflect()->mask().image()) |
| 2646 m_style->boxReflect()->mask().image()->removeClient(this); | 2661 m_style->boxReflect()->mask().image()->removeClient(this); |
| 2647 | 2662 |
| 2648 removeShapeImageClient(m_style->shapeOutside()); | 2663 removeShapeImageClient(m_style->shapeOutside()); |
| 2664 removeCursorImageClient(m_style->cursors()); |
| 2649 } | 2665 } |
| 2650 | 2666 |
| 2651 if (frameView()) | 2667 if (frameView()) |
| 2652 setIsBackgroundAttachmentFixedObject(false); | 2668 setIsBackgroundAttachmentFixedObject(false); |
| 2653 } | 2669 } |
| 2654 | 2670 |
| 2655 void LayoutObject::insertedIntoTree() | 2671 void LayoutObject::insertedIntoTree() |
| 2656 { | 2672 { |
| 2657 // FIXME: We should ASSERT(isRooted()) here but generated content makes some
out-of-order insertion. | 2673 // FIXME: We should ASSERT(isRooted()) here but generated content makes some
out-of-order insertion. |
| 2658 | 2674 |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2824 } | 2840 } |
| 2825 | 2841 |
| 2826 void LayoutObject::removeShapeImageClient(ShapeValue* shapeValue) | 2842 void LayoutObject::removeShapeImageClient(ShapeValue* shapeValue) |
| 2827 { | 2843 { |
| 2828 if (!shapeValue) | 2844 if (!shapeValue) |
| 2829 return; | 2845 return; |
| 2830 if (StyleImage* shapeImage = shapeValue->image()) | 2846 if (StyleImage* shapeImage = shapeValue->image()) |
| 2831 shapeImage->removeClient(this); | 2847 shapeImage->removeClient(this); |
| 2832 } | 2848 } |
| 2833 | 2849 |
| 2850 void LayoutObject::removeCursorImageClient(const CursorList* cursorList) |
| 2851 { |
| 2852 if (!cursorList) |
| 2853 return; |
| 2854 for (const CursorData& cursor : *cursorList) { |
| 2855 if (cursor.image()) |
| 2856 cursor.image()->removeClient(this); |
| 2857 } |
| 2858 } |
| 2859 |
| 2834 PositionWithAffinity LayoutObject::positionForPoint(const LayoutPoint&) | 2860 PositionWithAffinity LayoutObject::positionForPoint(const LayoutPoint&) |
| 2835 { | 2861 { |
| 2836 return createPositionWithAffinity(caretMinOffset()); | 2862 return createPositionWithAffinity(caretMinOffset()); |
| 2837 } | 2863 } |
| 2838 | 2864 |
| 2839 void LayoutObject::updateDragState(bool dragOn) | 2865 void LayoutObject::updateDragState(bool dragOn) |
| 2840 { | 2866 { |
| 2841 bool valueChanged = (dragOn != isDragging()); | 2867 bool valueChanged = (dragOn != isDragging()); |
| 2842 setIsDragging(dragOn); | 2868 setIsDragging(dragOn); |
| 2843 if (valueChanged && node()) { | 2869 if (valueChanged && node()) { |
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3646 const blink::LayoutObject* root = object1; | 3672 const blink::LayoutObject* root = object1; |
| 3647 while (root->parent()) | 3673 while (root->parent()) |
| 3648 root = root->parent(); | 3674 root = root->parent(); |
| 3649 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3675 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3650 } else { | 3676 } else { |
| 3651 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); | 3677 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); |
| 3652 } | 3678 } |
| 3653 } | 3679 } |
| 3654 | 3680 |
| 3655 #endif | 3681 #endif |
| OLD | NEW |