Changeset 136411 in webkit
- Timestamp:
- Dec 3, 2012 10:21:57 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r136409 r136411 1 2012-12-03 Anton Vayvod <avayvod@chromium.org> 2 3 Text Autosizing: don't autosize horizontal menu items implemented via floating list items 4 https://bugs.webkit.org/show_bug.cgi?id=103840 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Floating list items are often used to implement horizontal menus. Currently, text autosizing 9 disregards such elements as autosizing containers. List items are often then autosized as part 10 of a bigger cluster (usually the whole page) and look too big. 11 This change turns floating list items into autosizing clusters so they are autosized separately 12 resulting in no font size multiplication for menu items implemented in this manner. 13 14 * fast/text-autosizing/cluster-list-item-expected.html: Renamed from LayoutTests/fast/text-autosizing/list-item-out-of-flow-expected.html. 15 * fast/text-autosizing/cluster-list-item.html: Renamed from LayoutTests/fast/text-autosizing/list-item-out-of-flow.html; added case for a floating list item. 16 1 17 2012-12-03 Tony Chang <tony@chromium.org> 2 18 -
trunk/LayoutTests/fast/text-autosizing/cluster-list-item-expected.html
r136410 r136411 17 17 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 18 18 </li> 19 <li style=" position: absolute; width: 800px; font-size: 2.5rem">20 This list element becomes a separate autosizing cluster since it's positioned out of the list flow. Hence its computed font size is 40px (16 * 400 / 320).<br>19 <li style="font-size: 1.25rem"> 20 This element is autosized to computed font size of 20px similarly to the first list item.<br> 21 21 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 22 22 </li> 23 <li style="font-size: 1.25rem"> 24 This element is autosized to computed font size of 20px similarly to the first list item.<br> 23 <li style="float: left; width: 800px; font-size: 2.5rem"> 24 This list element becomes a separate autosizing cluster since it's floating. Hence its computed font size is 40px (16 * 400 / 320).<br> 25 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 26 </li> 27 <li style="position: absolute; margin-top: 280px; width: 800px; font-size: 2.5rem"> 28 This list element becomes a separate autosizing cluster since it's positioned out of the list flow. Hence its computed font size is 40px (16 * 400 / 320).<br> 29 Margin is added so it doesn't overlap with the previous element.<br> 25 30 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 26 31 </li> -
trunk/LayoutTests/fast/text-autosizing/cluster-list-item.html
r136410 r136411 26 26 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 27 27 </li> 28 <li style="position: absolute; width: 800px">29 This list element becomes a separate autosizing cluster since it's positioned out of the list flow. Hence its computed font size is 40px (16 * 400 / 320).<br>28 <li> 29 This element is autosized to computed font size of 20px similarly to the first list item.<br> 30 30 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 31 31 </li> 32 <li> 33 This element is autosized to computed font size of 20px similarly to the first list item.<br> 32 <li style="float: left; width: 800px"> 33 This list element becomes a separate autosizing cluster since it's floating. Hence its computed font size is 40px (16 * 400 / 320).<br> 34 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 35 </li> 36 <li style="position: absolute; margin-top: 280px; width: 800px"> 37 This list element becomes a separate autosizing cluster since it's positioned out of the list flow. Hence its computed font size is 40px (16 * 400 / 320).<br> 38 Margin is added so it doesn't overlap with the previous element.<br> 34 39 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 35 40 </li> -
trunk/Source/WebCore/ChangeLog
r136410 r136411 1 2012-12-03 Anton Vayvod <avayvod@chromium.org> 2 3 Text Autosizing: don't autosize horizontal menu items implemented via floating list items 4 https://bugs.webkit.org/show_bug.cgi?id=103840 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Floating list items are often used to implement horizontal menus. Currently, text autosizing 9 disregards such elements as autosizing containers. List items are often then autosized as part 10 of a bigger cluster (usually the whole page) and look too big. 11 This change turns floating list items into autosizing clusters so they are autosized separately 12 resulting in no font size multiplication for menu items implemented in this manner. 13 14 Test: fast/text-autosizing/cluster-list-item.html 15 16 * rendering/TextAutosizer.cpp: 17 (WebCore::TextAutosizer::isAutosizingContainer): Returns true for floating list items; split the 18 condition logically. 19 1 20 2012-12-03 Viatcheslav Ostapenko <v.ostapenko@samsung.com> 2 21 -
trunk/Source/WebCore/rendering/TextAutosizer.cpp
r136047 r136411 206 206 // - Must not be inline, as different multipliers on one line looks terrible. 207 207 // - Must not be list items, as items in the same list should look consistent (*). 208 // * except for those list items positioned out of the list's flow. 209 return renderer->isRenderBlock() 210 && !renderer->isInline() 211 && (!renderer->isListItem() || renderer->isOutOfFlowPositioned()); 208 // - Must not be normal list items, as items in the same list should look 209 // consistent, unless they are floating or position:absolute/fixed. 210 if (!renderer->isRenderBlock() || renderer->isInline()) 211 return false; 212 if (renderer->isListItem()) 213 return renderer->isFloating() || renderer->isOutOfFlowPositioned(); 214 return true; 212 215 } 213 216
Note: See TracChangeset
for help on using the changeset viewer.