Changeset 166171 in webkit
- Timestamp:
- Mar 24, 2014 9:30:52 AM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r166170 r166171 1 2014-03-24 Antti Koivisto <antti@apple.com> 2 3 Text autosizing does not determine line count correctly for simple line layout 4 https://bugs.webkit.org/show_bug.cgi?id=130673 5 6 Reviewed by Daniel Bates. 7 8 We don't count lines correctly in simple line layout case. 9 10 * page/Frame.cpp: 11 (WebCore::Frame::textAutosizingWidth): 12 (WebCore::Frame::setTextAutosizingWidth): 13 * page/ios/FrameIOS.mm: 14 (WebCore::Frame::textAutosizingWidth): Deleted. 15 (WebCore::Frame::setTextAutosizingWidth): Deleted. 16 17 Move to Frame.cpp to make enabling on non-iOS build easier. 18 19 * rendering/RenderBlockFlow.cpp: 20 (WebCore::RenderBlockFlow::lineCount): 21 22 Handle simple line layout case. 23 24 (WebCore::RenderBlockFlow::lineCountForTextAutosizing): 25 26 Call lineCount() if children are inline. 27 Rename for clarity. 28 29 (WebCore::RenderBlockFlow::adjustComputedFontSizes): 30 (WebCore::RenderBlockFlow::immediateLineCount): Deleted. 31 * rendering/RenderBlockFlow.h: 32 1 33 2014-03-24 Frédéric Wang <fred.wang@free.fr> 2 34 -
trunk/Source/WebCore/page/Frame.cpp
r166047 r166171 487 487 } 488 488 489 #if ENABLE(IOS_TEXT_AUTOSIZING) 490 float Frame::textAutosizingWidth() const 491 { 492 return m_textAutosizingWidth; 493 } 494 495 void Frame::setTextAutosizingWidth(float width) 496 { 497 m_textAutosizingWidth = width; 498 } 499 #endif 500 489 501 #if PLATFORM(IOS) 490 502 void Frame::scrollOverflowLayer(RenderLayer* layer, const IntRect& visibleRect, const IntRect& exposeRect) -
trunk/Source/WebCore/page/ios/FrameIOS.mm
r166122 r166171 873 873 } 874 874 875 #if ENABLE(IOS_TEXT_AUTOSIZING)876 float Frame::textAutosizingWidth() const877 {878 return m_textAutosizingWidth;879 }880 881 void Frame::setTextAutosizingWidth(float width)882 {883 m_textAutosizingWidth = width;884 }885 #endif886 887 875 } // namespace WebCore 888 876 #endif // PLATFORM(IOS) -
trunk/Source/WebCore/rendering/RenderBlockFlow.cpp
r165890 r166171 35 35 #include "RenderIterator.h" 36 36 #include "RenderLayer.h" 37 #include "RenderListItem.h" 37 38 #include "RenderMultiColumnFlowThread.h" 38 39 #include "RenderMultiColumnSet.h" … … 2977 2978 2978 2979 if (childrenInline()) { 2980 if (m_simpleLineLayout) { 2981 ASSERT(!stopRootInlineBox); 2982 return m_simpleLineLayout->lineCount(); 2983 } 2979 2984 for (auto box = firstRootBox(); box; box = box->nextRootBox()) { 2980 2985 count++; … … 3404 3409 } 3405 3410 3406 int RenderBlockFlow::immediateLineCount() 3407 { 3408 // Copied and modified from RenderBlock::lineCount. 3411 int RenderBlockFlow::lineCountForTextAutosizing() 3412 { 3413 if (style().visibility() != VISIBLE) 3414 return 0; 3415 if (childrenInline()) 3416 return lineCount(); 3409 3417 // Only descend into list items. 3410 3418 int count = 0; 3411 if (style().visibility() == VISIBLE) { 3412 if (childrenInline()) { 3413 for (RootInlineBox* box = firstRootBox(); box; box = box->nextRootBox()) 3414 count++; 3415 } else { 3416 for (RenderObject* obj = firstChild(); obj; obj = obj->nextSibling()) { 3417 if (obj->isListItem()) 3418 count += toRenderBlockFlow(obj)->lineCount(); 3419 } 3420 } 3421 } 3419 for (auto& listItem : childrenOfType<RenderListItem>(*this)) 3420 count += listItem.lineCount(); 3422 3421 return count; 3423 3422 } … … 3452 3451 unsigned lineCount; 3453 3452 if (m_lineCountForTextAutosizing == NOT_SET) { 3454 int count = immediateLineCount();3453 int count = lineCountForTextAutosizing(); 3455 3454 if (!count) 3456 3455 lineCount = NO_LINE; -
trunk/Source/WebCore/rendering/RenderBlockFlow.h
r164867 r166171 588 588 589 589 #if ENABLE(IOS_TEXT_AUTOSIZING) 590 int immediateLineCount();590 int lineCountForTextAutosizing(); 591 591 void adjustComputedFontSizes(float size, float visibleWidth); 592 592 void resetComputedFontSize()
Note: See TracChangeset
for help on using the changeset viewer.