| 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 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1244 // Clearing these bits is required to avoid leaving stale renderers. | 1244 // Clearing these bits is required to avoid leaving stale renderers. |
| 1245 // FIXME: We shouldn't need that hack if our logic was totally correct. | 1245 // FIXME: We shouldn't need that hack if our logic was totally correct. |
| 1246 if (diff.needsLayout()) { | 1246 if (diff.needsLayout()) { |
| 1247 clearPositionedState(); | 1247 clearPositionedState(); |
| 1248 } | 1248 } |
| 1249 } else { | 1249 } else { |
| 1250 s_affectsParentBlock = false; | 1250 s_affectsParentBlock = false; |
| 1251 } | 1251 } |
| 1252 } | 1252 } |
| 1253 | 1253 |
| 1254 static bool areNonIdenticalCursorListsEqual(const RenderStyle* a, const RenderSt
yle* b) | |
| 1255 { | |
| 1256 ASSERT(a->cursors() != b->cursors()); | |
| 1257 return a->cursors() && b->cursors() && *a->cursors() == *b->cursors(); | |
| 1258 } | |
| 1259 | |
| 1260 static inline bool areCursorsEqual(const RenderStyle* a, const RenderStyle* b) | |
| 1261 { | |
| 1262 return a->cursor() == b->cursor() && (a->cursors() == b->cursors() || areNon
IdenticalCursorListsEqual(a, b)); | |
| 1263 } | |
| 1264 | |
| 1265 void RenderObject::styleDidChange(StyleDifference diff, const RenderStyle* oldSt
yle) | 1254 void RenderObject::styleDidChange(StyleDifference diff, const RenderStyle* oldSt
yle) |
| 1266 { | 1255 { |
| 1267 if (s_affectsParentBlock) { | 1256 if (s_affectsParentBlock) { |
| 1268 // An object that was floating or positioned became a normal flow object
again. We have to make sure the | 1257 // An object that was floating or positioned became a normal flow object
again. We have to make sure the |
| 1269 // render tree updates as needed to accommodate the new normal flow obje
ct. | 1258 // render tree updates as needed to accommodate the new normal flow obje
ct. |
| 1270 setInline(style()->isDisplayInlineType()); | 1259 setInline(style()->isDisplayInlineType()); |
| 1271 ASSERT(isInline() == parent()->isRenderParagraph()); | 1260 ASSERT(isInline() == parent()->isRenderParagraph()); |
| 1272 } | 1261 } |
| 1273 | 1262 |
| 1274 if (!m_parent) | 1263 if (!m_parent) |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1287 if (needsOverflowRecalcAfterStyleChange() && oldStyle->position() != m_s
tyle->position()) | 1276 if (needsOverflowRecalcAfterStyleChange() && oldStyle->position() != m_s
tyle->position()) |
| 1288 markContainingBlocksForOverflowRecalc(); | 1277 markContainingBlocksForOverflowRecalc(); |
| 1289 | 1278 |
| 1290 if (diff.needsFullLayout()) | 1279 if (diff.needsFullLayout()) |
| 1291 setNeedsLayoutAndPrefWidthsRecalc(); | 1280 setNeedsLayoutAndPrefWidthsRecalc(); |
| 1292 } else if (diff.needsPositionedMovementLayout()) | 1281 } else if (diff.needsPositionedMovementLayout()) |
| 1293 setNeedsPositionedMovementLayout(); | 1282 setNeedsPositionedMovementLayout(); |
| 1294 | 1283 |
| 1295 // Don't check for paint invalidation here; we need to wait until the layer
has been | 1284 // Don't check for paint invalidation here; we need to wait until the layer
has been |
| 1296 // updated by subclasses before we know if we have to invalidate paints (in
setStyle()). | 1285 // updated by subclasses before we know if we have to invalidate paints (in
setStyle()). |
| 1297 | |
| 1298 if (oldStyle && !areCursorsEqual(oldStyle, style())) { | |
| 1299 if (LocalFrame* frame = this->frame()) | |
| 1300 frame->eventHandler().scheduleCursorUpdate(); | |
| 1301 } | |
| 1302 } | 1286 } |
| 1303 | 1287 |
| 1304 void RenderObject::propagateStyleToAnonymousChildren(bool blockChildrenOnly) | 1288 void RenderObject::propagateStyleToAnonymousChildren(bool blockChildrenOnly) |
| 1305 { | 1289 { |
| 1306 // FIXME: We could save this call when the change only affected non-inherite
d properties. | 1290 // FIXME: We could save this call when the change only affected non-inherite
d properties. |
| 1307 for (RenderObject* child = slowFirstChild(); child; child = child->nextSibli
ng()) { | 1291 for (RenderObject* child = slowFirstChild(); child; child = child->nextSibli
ng()) { |
| 1308 if (!child->isAnonymous()) | 1292 if (!child->isAnonymous()) |
| 1309 continue; | 1293 continue; |
| 1310 | 1294 |
| 1311 if (blockChildrenOnly && !child->isRenderBlock()) | 1295 if (blockChildrenOnly && !child->isRenderBlock()) |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1907 | 1891 |
| 1908 PositionWithAffinity RenderObject::createPositionWithAffinity(const Position& po
sition) | 1892 PositionWithAffinity RenderObject::createPositionWithAffinity(const Position& po
sition) |
| 1909 { | 1893 { |
| 1910 if (position.isNotNull()) | 1894 if (position.isNotNull()) |
| 1911 return PositionWithAffinity(position); | 1895 return PositionWithAffinity(position); |
| 1912 | 1896 |
| 1913 ASSERT(!node()); | 1897 ASSERT(!node()); |
| 1914 return createPositionWithAffinity(0, DOWNSTREAM); | 1898 return createPositionWithAffinity(0, DOWNSTREAM); |
| 1915 } | 1899 } |
| 1916 | 1900 |
| 1917 CursorDirective RenderObject::getCursor(const LayoutPoint&, Cursor&) const | |
| 1918 { | |
| 1919 return SetCursorBasedOnStyle; | |
| 1920 } | |
| 1921 | |
| 1922 bool RenderObject::canUpdateSelectionOnRootLineBoxes() | 1901 bool RenderObject::canUpdateSelectionOnRootLineBoxes() |
| 1923 { | 1902 { |
| 1924 if (needsLayout()) | 1903 if (needsLayout()) |
| 1925 return false; | 1904 return false; |
| 1926 | 1905 |
| 1927 RenderBlock* containingBlock = this->containingBlock(); | 1906 RenderBlock* containingBlock = this->containingBlock(); |
| 1928 return containingBlock ? !containingBlock->needsLayout() : false; | 1907 return containingBlock ? !containingBlock->needsLayout() : false; |
| 1929 } | 1908 } |
| 1930 | 1909 |
| 1931 bool RenderObject::nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const
FloatPoint&) | 1910 bool RenderObject::nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const
FloatPoint&) |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1969 { | 1948 { |
| 1970 if (object1) { | 1949 if (object1) { |
| 1971 const blink::RenderObject* root = object1; | 1950 const blink::RenderObject* root = object1; |
| 1972 while (root->parent()) | 1951 while (root->parent()) |
| 1973 root = root->parent(); | 1952 root = root->parent(); |
| 1974 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 1953 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
| 1975 } | 1954 } |
| 1976 } | 1955 } |
| 1977 | 1956 |
| 1978 #endif | 1957 #endif |
| OLD | NEW |