| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 946 } | 946 } |
| 947 LayoutUnit logicalTop = logicalTopForFloat(floatingObjec
t); | 947 LayoutUnit logicalTop = logicalTopForFloat(floatingObjec
t); |
| 948 LayoutUnit oldLogicalTop = logicalTopForFloat(*oldFloati
ngObject); | 948 LayoutUnit oldLogicalTop = logicalTopForFloat(*oldFloati
ngObject); |
| 949 if (logicalTop != oldLogicalTop) { | 949 if (logicalTop != oldLogicalTop) { |
| 950 changeLogicalTop = std::min(changeLogicalTop, std::m
in(logicalTop, oldLogicalTop)); | 950 changeLogicalTop = std::min(changeLogicalTop, std::m
in(logicalTop, oldLogicalTop)); |
| 951 changeLogicalBottom = std::max(changeLogicalBottom,
std::max(logicalTop, oldLogicalTop)); | 951 changeLogicalBottom = std::max(changeLogicalBottom,
std::max(logicalTop, oldLogicalTop)); |
| 952 } | 952 } |
| 953 } | 953 } |
| 954 | 954 |
| 955 if (oldFloatingObject->originatingLine() && !selfNeedsLayout
()) { | 955 if (oldFloatingObject->originatingLine() && !selfNeedsLayout
()) { |
| 956 ASSERT(oldFloatingObject->originatingLine()->lineLayoutI
tem().isEqual(this)); | 956 ASSERT(oldFloatingObject->originatingLine()->getLineLayo
utItem().isEqual(this)); |
| 957 oldFloatingObject->originatingLine()->markDirty(); | 957 oldFloatingObject->originatingLine()->markDirty(); |
| 958 } | 958 } |
| 959 | 959 |
| 960 floatMap.remove(floatingObject.layoutObject()); | 960 floatMap.remove(floatingObject.layoutObject()); |
| 961 } else { | 961 } else { |
| 962 changeLogicalTop = LayoutUnit(); | 962 changeLogicalTop = LayoutUnit(); |
| 963 changeLogicalBottom = std::max(changeLogicalBottom, logicalB
ottom); | 963 changeLogicalBottom = std::max(changeLogicalBottom, logicalB
ottom); |
| 964 } | 964 } |
| 965 } | 965 } |
| 966 } | 966 } |
| (...skipping 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2293 if (logicalBottom < 0 || logicalBottom < logicalTop || logicalTo
p == LayoutUnit::max()) { | 2293 if (logicalBottom < 0 || logicalBottom < logicalTop || logicalTo
p == LayoutUnit::max()) { |
| 2294 logicalBottom = LayoutUnit::max(); | 2294 logicalBottom = LayoutUnit::max(); |
| 2295 } else { | 2295 } else { |
| 2296 // Special-case zero- and less-than-zero-height floats: thos
e don't touch | 2296 // Special-case zero- and less-than-zero-height floats: thos
e don't touch |
| 2297 // the line that they're on, but it still needs to be dirtie
d. This is | 2297 // the line that they're on, but it still needs to be dirtie
d. This is |
| 2298 // accomplished by pretending they have a height of 1. | 2298 // accomplished by pretending they have a height of 1. |
| 2299 logicalBottom = std::max(logicalBottom, logicalTop + 1); | 2299 logicalBottom = std::max(logicalBottom, logicalTop + 1); |
| 2300 } | 2300 } |
| 2301 if (floatingObject.originatingLine()) { | 2301 if (floatingObject.originatingLine()) { |
| 2302 if (!selfNeedsLayout()) { | 2302 if (!selfNeedsLayout()) { |
| 2303 ASSERT(floatingObject.originatingLine()->lineLayoutItem(
).isEqual(this)); | 2303 ASSERT(floatingObject.originatingLine()->getLineLayoutIt
em().isEqual(this)); |
| 2304 floatingObject.originatingLine()->markDirty(); | 2304 floatingObject.originatingLine()->markDirty(); |
| 2305 } | 2305 } |
| 2306 #if ENABLE(ASSERT) | 2306 #if ENABLE(ASSERT) |
| 2307 floatingObject.setOriginatingLine(nullptr); | 2307 floatingObject.setOriginatingLine(nullptr); |
| 2308 #endif | 2308 #endif |
| 2309 } | 2309 } |
| 2310 markLinesDirtyInBlockRange(LayoutUnit(), logicalBottom); | 2310 markLinesDirtyInBlockRange(LayoutUnit(), logicalBottom); |
| 2311 } | 2311 } |
| 2312 m_floatingObjects->remove(&floatingObject); | 2312 m_floatingObjects->remove(&floatingObject); |
| 2313 } | 2313 } |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2856 FrameView* frameView = document().view(); | 2856 FrameView* frameView = document().view(); |
| 2857 LayoutUnit top = LayoutUnit((style()->position() == FixedPosition) ? 0 : fra
meView->scrollOffset().height()); | 2857 LayoutUnit top = LayoutUnit((style()->position() == FixedPosition) ? 0 : fra
meView->scrollOffset().height()); |
| 2858 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height(
); | 2858 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height(
); |
| 2859 if (size().height() < visibleHeight) | 2859 if (size().height() < visibleHeight) |
| 2860 top += (visibleHeight - size().height()) / 2; | 2860 top += (visibleHeight - size().height()) / 2; |
| 2861 setY(top); | 2861 setY(top); |
| 2862 dialog->setCentered(top); | 2862 dialog->setCentered(top); |
| 2863 } | 2863 } |
| 2864 | 2864 |
| 2865 } // namespace blink | 2865 } // namespace blink |
| OLD | NEW |