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 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 LayoutUnit logicalTop = logicalTopForFloat(floatingObjec
t); | 851 LayoutUnit logicalTop = logicalTopForFloat(floatingObjec
t); |
852 LayoutUnit oldLogicalTop = logicalTopForFloat(oldFloatin
gObject); | 852 LayoutUnit oldLogicalTop = logicalTopForFloat(oldFloatin
gObject); |
853 if (logicalTop != oldLogicalTop) { | 853 if (logicalTop != oldLogicalTop) { |
854 changeLogicalTop = min(changeLogicalTop, min(logical
Top, oldLogicalTop)); | 854 changeLogicalTop = min(changeLogicalTop, min(logical
Top, oldLogicalTop)); |
855 changeLogicalBottom = max(changeLogicalBottom, max(l
ogicalTop, oldLogicalTop)); | 855 changeLogicalBottom = max(changeLogicalBottom, max(l
ogicalTop, oldLogicalTop)); |
856 } | 856 } |
857 } | 857 } |
858 | 858 |
859 floatMap.remove(floatingObject->renderer()); | 859 floatMap.remove(floatingObject->renderer()); |
860 if (oldFloatingObject->originatingLine() && !selfNeedsLayout
()) { | 860 if (oldFloatingObject->originatingLine() && !selfNeedsLayout
()) { |
861 ASSERT(oldFloatingObject->originatingLine()->renderer()
== this); | 861 ASSERT(&oldFloatingObject->originatingLine()->renderer()
== this); |
862 oldFloatingObject->originatingLine()->markDirty(); | 862 oldFloatingObject->originatingLine()->markDirty(); |
863 } | 863 } |
864 delete oldFloatingObject; | 864 delete oldFloatingObject; |
865 } else { | 865 } else { |
866 changeLogicalTop = 0; | 866 changeLogicalTop = 0; |
867 changeLogicalBottom = max(changeLogicalBottom, logicalBottom
); | 867 changeLogicalBottom = max(changeLogicalBottom, logicalBottom
); |
868 } | 868 } |
869 } | 869 } |
870 } | 870 } |
871 | 871 |
(...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2283 if (logicalBottom < 0 || logicalBottom < logicalTop || logicalTo
p == LayoutUnit::max()) { | 2283 if (logicalBottom < 0 || logicalBottom < logicalTop || logicalTo
p == LayoutUnit::max()) { |
2284 logicalBottom = LayoutUnit::max(); | 2284 logicalBottom = LayoutUnit::max(); |
2285 } else { | 2285 } else { |
2286 // Special-case zero- and less-than-zero-height floats: thos
e don't touch | 2286 // Special-case zero- and less-than-zero-height floats: thos
e don't touch |
2287 // the line that they're on, but it still needs to be dirtie
d. This is | 2287 // the line that they're on, but it still needs to be dirtie
d. This is |
2288 // accomplished by pretending they have a height of 1. | 2288 // accomplished by pretending they have a height of 1. |
2289 logicalBottom = max(logicalBottom, logicalTop + 1); | 2289 logicalBottom = max(logicalBottom, logicalTop + 1); |
2290 } | 2290 } |
2291 if (floatingObject->originatingLine()) { | 2291 if (floatingObject->originatingLine()) { |
2292 if (!selfNeedsLayout()) { | 2292 if (!selfNeedsLayout()) { |
2293 ASSERT(floatingObject->originatingLine()->renderer() ==
this); | 2293 ASSERT(&floatingObject->originatingLine()->renderer() ==
this); |
2294 floatingObject->originatingLine()->markDirty(); | 2294 floatingObject->originatingLine()->markDirty(); |
2295 } | 2295 } |
2296 #if !ASSERT_DISABLED | 2296 #if !ASSERT_DISABLED |
2297 floatingObject->setOriginatingLine(0); | 2297 floatingObject->setOriginatingLine(0); |
2298 #endif | 2298 #endif |
2299 } | 2299 } |
2300 markLinesDirtyInBlockRange(0, logicalBottom); | 2300 markLinesDirtyInBlockRange(0, logicalBottom); |
2301 } | 2301 } |
2302 m_floatingObjects->remove(floatingObject); | 2302 m_floatingObjects->remove(floatingObject); |
2303 } | 2303 } |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2803 TextRun RenderBlockFlow::constructTextRun(RenderObject* context, const Font& fon
t, const String& string, RenderStyle* style, TextRun::ExpansionBehavior expansio
n, TextRunFlags flags) | 2803 TextRun RenderBlockFlow::constructTextRun(RenderObject* context, const Font& fon
t, const String& string, RenderStyle* style, TextRun::ExpansionBehavior expansio
n, TextRunFlags flags) |
2804 { | 2804 { |
2805 bool hasStrongDirectionality; | 2805 bool hasStrongDirectionality; |
2806 return constructTextRun(context, font, string, style, | 2806 return constructTextRun(context, font, string, style, |
2807 determineDirectionality(string, hasStrongDirectionality), | 2807 determineDirectionality(string, hasStrongDirectionality), |
2808 expansion, flags); | 2808 expansion, flags); |
2809 } | 2809 } |
2810 | 2810 |
2811 RootInlineBox* RenderBlockFlow::createRootInlineBox() | 2811 RootInlineBox* RenderBlockFlow::createRootInlineBox() |
2812 { | 2812 { |
2813 return new RootInlineBox(this); | 2813 return new RootInlineBox(*this); |
2814 } | 2814 } |
2815 | 2815 |
2816 void RenderBlockFlow::createMultiColumnFlowThreadIfNeeded() | 2816 void RenderBlockFlow::createMultiColumnFlowThreadIfNeeded() |
2817 { | 2817 { |
2818 if ((style()->hasAutoColumnCount() && style()->hasAutoColumnWidth()) || !doc
ument().regionBasedColumnsEnabled()) | 2818 if ((style()->hasAutoColumnCount() && style()->hasAutoColumnWidth()) || !doc
ument().regionBasedColumnsEnabled()) |
2819 return; | 2819 return; |
2820 | 2820 |
2821 if (multiColumnFlowThread()) | 2821 if (multiColumnFlowThread()) |
2822 return; | 2822 return; |
2823 | 2823 |
2824 setChildrenInline(false); | 2824 setChildrenInline(false); |
2825 RenderMultiColumnFlowThread* flowThread = RenderMultiColumnFlowThread::creat
eAnonymous(document(), style()); | 2825 RenderMultiColumnFlowThread* flowThread = RenderMultiColumnFlowThread::creat
eAnonymous(document(), style()); |
2826 RenderBlock::addChild(flowThread); | 2826 RenderBlock::addChild(flowThread); |
2827 RenderBlockFlowRareData& rareData = ensureRareData(); | 2827 RenderBlockFlowRareData& rareData = ensureRareData(); |
2828 ASSERT(!rareData.m_multiColumnFlowThread); | 2828 ASSERT(!rareData.m_multiColumnFlowThread); |
2829 rareData.m_multiColumnFlowThread = flowThread; | 2829 rareData.m_multiColumnFlowThread = flowThread; |
2830 } | 2830 } |
2831 | 2831 |
2832 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() | 2832 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() |
2833 { | 2833 { |
2834 if (m_rareData) | 2834 if (m_rareData) |
2835 return *m_rareData; | 2835 return *m_rareData; |
2836 | 2836 |
2837 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); | 2837 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); |
2838 return *m_rareData; | 2838 return *m_rareData; |
2839 } | 2839 } |
2840 | 2840 |
2841 } // namespace WebCore | 2841 } // namespace WebCore |
OLD | NEW |