Changeset 98608 in webkit
- Timestamp:
- Oct 27, 2011, 10:59:32 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 15 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r98607 r98608 1 2011-10-27 Dan Bernstein <mitz@apple.com> 2 3 <rdar://problem/10262205> Allow column progression to be independent of writing mode 4 https://bugs.webkit.org/show_bug.cgi?id=71028 5 6 Reviewed by Darin Adler. 7 8 * fast/multicol/block-axis-horizontal-bt.html: Added. 9 * fast/multicol/block-axis-horizontal-tb.html: Added. 10 * fast/multicol/block-axis-vertical-lr.html: Added. 11 * fast/multicol/block-axis-vertical-rl.html: Added. 12 * fast/multicol/flipped-blocks-hit-test-expected.txt: Added. 13 * fast/multicol/flipped-blocks-hit-test.html: Added. 14 * fast/multicol/resources/block-axis.css: Added. 15 * platform/mac/fast/multicol/block-axis-horizontal-bt-expected.png: Added. 16 * platform/mac/fast/multicol/block-axis-horizontal-bt-expected.txt: Added. 17 * platform/mac/fast/multicol/block-axis-horizontal-tb-expected.png: Added. 18 * platform/mac/fast/multicol/block-axis-horizontal-tb-expected.txt: Added. 19 * platform/mac/fast/multicol/block-axis-vertical-lr-expected.png: Added. 20 * platform/mac/fast/multicol/block-axis-vertical-lr-expected.txt: Added. 21 * platform/mac/fast/multicol/block-axis-vertical-rl-expected.png: Added. 22 * platform/mac/fast/multicol/block-axis-vertical-rl-expected.txt: Added. 23 1 24 2011-10-27 John Gregg <johnnyg@google.com> 2 25 -
trunk/Source/WebCore/ChangeLog
r98600 r98608 1 2011-10-27 Dan Bernstein <mitz@apple.com> 2 3 <rdar://problem/10262205> Allow column progression to be independent of writing mode 4 https://bugs.webkit.org/show_bug.cgi?id=71028 5 6 Reviewed by Darin Adler. 7 8 Tests: fast/multicol/block-axis-horizontal-bt.html 9 fast/multicol/block-axis-horizontal-tb.html 10 fast/multicol/block-axis-vertical-lr.html 11 fast/multicol/block-axis-vertical-rl.html 12 fast/multicol/flipped-blocks-hit-test.html 13 14 Allow “columns” to be stacked along the block axis rather than the inline axis. This can facilitate 15 paginated interfaces. A column-axis property is added in order to enable this mode. 16 17 * css/CSSComputedStyleDeclaration.cpp: 18 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Handle the column-axis property. 19 * css/CSSParser.cpp: 20 (WebCore::CSSParser::parseValue): Ditto. 21 * css/CSSPrimitiveValueMappings.h: 22 (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Map ColumnAxis values to identifiers. 23 (WebCore::CSSPrimitiveValue::operator ColumnAxis): Map identifiers to ColumnAxis values. 24 * css/CSSProperty.cpp: 25 (WebCore::CSSProperty::isInheritedProperty): Updated to return false for the column-axis property. 26 * css/CSSPropertyNames.in: Added -webkit-column-axis. 27 * css/CSSStyleSelector.cpp: 28 (WebCore::CSSStyleSelector::applyProperty): Handle column-axis. 29 * rendering/ColumnInfo.h: 30 (WebCore::ColumnInfo::ColumnInfo): Added m_progressionAxis to the initialization list. 31 (WebCore::ColumnInfo::progressionAxis): Added this getter. 32 (WebCore::ColumnInfo::setProgressionAxis): Added this setter. 33 * rendering/RenderBlock.cpp: 34 (WebCore::RenderBlock::addOverflowFromChildren): Simplified, and thus also made this function work 35 with block-axis column progression. 36 (WebCore::RenderBlock::paintColumnRules): Added code to paint rules between columns with block-axis 37 progression. 38 (WebCore::RenderBlock::paintColumnContents): Adjusted the painting offset for the block-axis 39 column progression case. 40 (WebCore::RenderBlock::nodeAtPoint): Fixed hit-testing in flipped-blocks writing modes. This is 41 covered by flipped-blocks-hit-test.html. 42 (WebCore::RenderBlock::hitTestColumns): Adjusted the offset for the block-axis column progression 43 case. 44 (WebCore::RenderBlock::calcColumnWidth): Set the column width to the content logical width in 45 the block-axis column progression case. The column-width and column-count properties are ignored. 46 (WebCore::RenderBlock::setDesiredColumnCountAndWidth): Set the column progression axis based on 47 the style. 48 (WebCore::RenderBlock::columnCount): Broke up an assertion into two. 49 (WebCore::RenderBlock::columnRectAt): Updated for block-axis column progression. 50 (WebCore::RenderBlock::adjustPointToColumnContents): Ditto. 51 (WebCore::RenderBlock::adjustRectForColumns): Ditto. 52 (WebCore::RenderBlock::adjustForColumns): Ditto. 53 * rendering/RenderLayer.cpp: 54 (WebCore::RenderLayer::paintChildLayerIntoColumns): Adjusted the offser for the block-axis column 55 progression case. 56 (WebCore::RenderLayer::hitTestChildLayerColumns): Ditto. 57 * rendering/style/RenderStyle.h: 58 (WebCore::InheritedFlags::columnAxis): Added this getter. 59 (WebCore::InheritedFlags::hasInlineColumnAxis): Added. Checks the column axis against the writing 60 mode. 61 (WebCore::InheritedFlags::specifiesColumns): Changed to return true if the specified column axis 62 is the block axis. 63 (WebCore::InheritedFlags::setColumnAxis): Added this setter. 64 (WebCore::InheritedFlags::initialColumnAxis): Added. Returns AutoColumnAxis. 65 * rendering/style/RenderStyleConstants.h: Added a ColumnAxis enum. 66 * rendering/style/StyleMultiColData.cpp: 67 (WebCore::StyleMultiColData::StyleMultiColData): Added m_axis to the initialization list. 68 (WebCore::StyleMultiColData::operator==): Compare m_axis. 69 * rendering/style/StyleMultiColData.h: Added m_axis member variable. 70 1 71 2011-10-27 Mihnea Ovidenie <mihnea@adobe.com> 2 72 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r97854 r98608 1 1 /* 2 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 4 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 5 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> … … 200 200 CSSPropertyWebkitColumnBreakBefore, 201 201 CSSPropertyWebkitColumnBreakInside, 202 CSSPropertyWebkitColumnAxis, 202 203 CSSPropertyWebkitColumnCount, 203 204 CSSPropertyWebkitColumnGap, … … 1335 1336 case CSSPropertyColor: 1336 1337 return primitiveValueCache->createColorValue(m_allowVisitedStyle ? style->visitedDependentColor(CSSPropertyColor).rgb() : style->color().rgb()); 1338 case CSSPropertyWebkitColumnAxis: 1339 return primitiveValueCache->createValue(style->columnAxis()); 1337 1340 case CSSPropertyWebkitColumnCount: 1338 1341 if (style->hasAutoColumnCount()) -
trunk/Source/WebCore/css/CSSParser.cpp
r98374 r98608 2 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) 3 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 6 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> … … 1813 1813 else 1814 1814 validPrimitive = validUnit(value, FLength | FNonNeg, m_strict); 1815 break; 1816 case CSSPropertyWebkitColumnAxis: 1817 if (id == CSSValueHorizontal || id == CSSValueVertical || id == CSSValueAuto) 1818 validPrimitive = true; 1815 1819 break; 1816 1820 case CSSPropertyWebkitColumnSpan: // all | 1 -
trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h
r97854 r98608 1 1 /* 2 2 * Copyright (C) 2007 Alexey Proskuryakov <ap@nypop.com>. 3 * Copyright (C) 2008, 2009, 2010 Apple Inc. All rights reserved.3 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 4 4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/) 5 5 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> … … 3326 3326 } 3327 3327 3328 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ColumnAxis e) 3329 : m_type(CSS_IDENT) 3330 , m_hasCachedCSSText(false) 3331 { 3332 switch (e) { 3333 case HorizontalColumnAxis: 3334 m_value.ident = CSSValueHorizontal; 3335 break; 3336 case VerticalColumnAxis: 3337 m_value.ident = CSSValueVertical; 3338 break; 3339 case AutoColumnAxis: 3340 m_value.ident = CSSValueAuto; 3341 break; 3342 } 3343 } 3344 3345 template<> inline CSSPrimitiveValue::operator ColumnAxis() const 3346 { 3347 switch (m_value.ident) { 3348 case CSSValueHorizontal: 3349 return HorizontalColumnAxis; 3350 case CSSValueVertical: 3351 return VerticalColumnAxis; 3352 case CSSValueAuto: 3353 return AutoColumnAxis; 3354 default: 3355 ASSERT_NOT_REACHED(); 3356 return AutoColumnAxis; 3357 } 3358 } 3359 3328 3360 #if ENABLE(SVG) 3329 3361 … … 3612 3644 } 3613 3645 3646 #endif // ENABLE(SVG) 3647 3648 } 3649 3614 3650 #endif 3615 3616 }3617 3618 #endif -
trunk/Source/WebCore/css/CSSProperty.cpp
r98542 r98608 542 542 case CSSPropertyWebkitBoxReflect: 543 543 case CSSPropertyWebkitBoxShadow: 544 case CSSPropertyWebkitColumnAxis: 544 545 case CSSPropertyWebkitColumnBreakAfter: 545 546 case CSSPropertyWebkitColumnBreakBefore: -
trunk/Source/WebCore/css/CSSPropertyNames.in
r97701 r98608 237 237 -webkit-box-shadow 238 238 -webkit-color-correction 239 -webkit-column-axis 239 240 -webkit-column-break-after 240 241 -webkit-column-break-before -
trunk/Source/WebCore/css/CSSStyleSelector.cpp
r98600 r98608 3777 3777 return; 3778 3778 } 3779 3780 case CSSPropertyWebkitColumnAxis: 3781 HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(columnAxis, ColumnAxis); 3782 return; 3779 3783 3780 3784 case CSSPropertyWebkitWrapShape: -
trunk/Source/WebCore/rendering/ColumnInfo.h
r95901 r98608 1 1 /* 2 * Copyright (C) 2010 Apple Inc.All rights reserved.2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 38 38 : m_desiredColumnWidth(0) 39 39 , m_desiredColumnCount(1) 40 , m_progressionAxis(InlineAxis) 40 41 , m_columnCount(1) 41 42 , m_columnHeight(0) … … 44 45 , m_maximumDistanceBetweenForcedBreaks(0) 45 46 , m_forcedBreakOffset(0) 46 { } 47 47 { 48 } 49 48 50 LayoutUnit desiredColumnWidth() const { return m_desiredColumnWidth; } 49 51 void setDesiredColumnWidth(LayoutUnit width) { m_desiredColumnWidth = width; } … … 51 53 unsigned desiredColumnCount() const { return m_desiredColumnCount; } 52 54 void setDesiredColumnCount(unsigned count) { m_desiredColumnCount = count; } 55 56 enum Axis { InlineAxis, BlockAxis }; 57 58 Axis progressionAxis() const { return m_progressionAxis; } 59 void setProgressionAxis(Axis progressionAxis) { m_progressionAxis = progressionAxis; } 53 60 54 61 unsigned columnCount() const { return m_columnCount; } … … 90 97 LayoutUnit m_desiredColumnWidth; 91 98 unsigned m_desiredColumnCount; 92 99 Axis m_progressionAxis; 100 93 101 unsigned m_columnCount; 94 102 LayoutUnit m_columnHeight; -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r98561 r98608 3 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 4 4 * (C) 2007 David Smith (catfish.man@gmail.com) 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 6 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 7 7 * … … 1395 1395 if (columnCount(colInfo)) { 1396 1396 LayoutRect lastRect = columnRectAt(colInfo, columnCount(colInfo) - 1); 1397 if (isHorizontalWritingMode()) { 1398 LayoutUnit overflowLeft = !style()->isLeftToRightDirection() ? min<LayoutUnit>(0, lastRect.x()) : 0; 1399 LayoutUnit overflowRight = style()->isLeftToRightDirection() ? max(width(), lastRect.maxX()) : 0; 1400 LayoutUnit overflowHeight = borderBefore() + paddingBefore() + colInfo->columnHeight(); 1401 addLayoutOverflow(LayoutRect(overflowLeft, 0, overflowRight - overflowLeft, overflowHeight)); 1402 if (!hasOverflowClip()) 1403 addVisualOverflow(LayoutRect(overflowLeft, 0, overflowRight - overflowLeft, overflowHeight)); 1404 } else { 1405 LayoutRect lastRect = columnRectAt(colInfo, columnCount(colInfo) - 1); 1406 LayoutUnit overflowTop = !style()->isLeftToRightDirection() ? min<LayoutUnit>(0, lastRect.y()) : 0; 1407 LayoutUnit overflowBottom = style()->isLeftToRightDirection() ? max(height(), lastRect.maxY()) : 0; 1408 LayoutUnit overflowWidth = borderBefore() + paddingBefore() + colInfo->columnHeight(); 1409 addLayoutOverflow(LayoutRect(0, overflowTop, overflowWidth, overflowBottom - overflowTop)); 1410 if (!hasOverflowClip()) 1411 addVisualOverflow(LayoutRect(0, overflowTop, overflowWidth, overflowBottom - overflowTop)); 1412 } 1397 addLayoutOverflow(lastRect); 1398 if (!hasOverflowClip()) 1399 addVisualOverflow(lastRect); 1413 1400 } 1414 1401 } … … 2385 2372 bool ruleTransparent = style()->columnRuleIsTransparent(); 2386 2373 EBorderStyle ruleStyle = style()->columnRuleStyle(); 2387 LayoutUnit rule Width= style()->columnRuleWidth();2374 LayoutUnit ruleThickness = style()->columnRuleWidth(); 2388 2375 LayoutUnit colGap = columnGap(); 2389 bool renderRule = ruleStyle > BHIDDEN && !ruleTransparent && rule Width<= colGap;2376 bool renderRule = ruleStyle > BHIDDEN && !ruleTransparent && ruleThickness <= colGap; 2390 2377 if (!renderRule) 2391 2378 return; 2392 2379 2393 // We need to do multiple passes, breaking up our child painting into strips.2394 2380 ColumnInfo* colInfo = columnInfo(); 2395 2381 unsigned colCount = columnCount(colInfo); 2396 LayoutUnit currLogicalLeftOffset = style()->isLeftToRightDirection() ? 0 : contentLogicalWidth();2397 LayoutUnit ruleAdd = logicalLeftOffsetForContent();2398 LayoutUnit ruleLogicalLeft = style()->isLeftToRightDirection() ? 0 : contentLogicalWidth();2399 2400 2382 bool antialias = shouldAntialiasLines(paintInfo.context); 2401 LayoutUnit inlineDirectionSize = colInfo->desiredColumnWidth(); 2402 2403 for (unsigned i = 0; i < colCount; i++) { 2404 // Move to the next position. 2405 if (style()->isLeftToRightDirection()) { 2406 ruleLogicalLeft += inlineDirectionSize + colGap / 2; 2407 currLogicalLeftOffset += inlineDirectionSize + colGap; 2408 } else { 2409 ruleLogicalLeft -= (inlineDirectionSize + colGap / 2); 2410 currLogicalLeftOffset -= (inlineDirectionSize + colGap); 2411 } 2412 2413 // Now paint the column rule. 2414 if (i < colCount - 1) { 2415 LayoutUnit ruleLeft = isHorizontalWritingMode() ? paintOffset.x() + ruleLogicalLeft - ruleWidth / 2 + ruleAdd : paintOffset.x() + borderLeft() + paddingLeft(); 2416 LayoutUnit ruleRight = isHorizontalWritingMode() ? ruleLeft + ruleWidth : ruleLeft + contentWidth(); 2417 LayoutUnit ruleTop = isHorizontalWritingMode() ? paintOffset.y() + borderTop() + paddingTop() : paintOffset.y() + ruleLogicalLeft - ruleWidth / 2 + ruleAdd; 2418 LayoutUnit ruleBottom = isHorizontalWritingMode() ? ruleTop + contentHeight() : ruleTop + ruleWidth; 2419 BoxSide side = isHorizontalWritingMode() 2420 ? style()->isLeftToRightDirection() ? BSLeft : BSRight 2421 : style()->isLeftToRightDirection() ? BSTop : BSBottom; 2422 drawLineForBoxSide(paintInfo.context, ruleLeft, ruleTop, ruleRight, ruleBottom, side, ruleColor, ruleStyle, 0, 0, antialias); 2423 } 2424 2425 ruleLogicalLeft = currLogicalLeftOffset; 2383 2384 if (colInfo->progressionAxis() == ColumnInfo::InlineAxis) { 2385 LayoutUnit currLogicalLeftOffset = style()->isLeftToRightDirection() ? 0 : contentLogicalWidth(); 2386 LayoutUnit ruleAdd = logicalLeftOffsetForContent(); 2387 LayoutUnit ruleLogicalLeft = style()->isLeftToRightDirection() ? 0 : contentLogicalWidth(); 2388 LayoutUnit inlineDirectionSize = colInfo->desiredColumnWidth(); 2389 BoxSide boxSide = isHorizontalWritingMode() 2390 ? style()->isLeftToRightDirection() ? BSLeft : BSRight 2391 : style()->isLeftToRightDirection() ? BSTop : BSBottom; 2392 2393 for (unsigned i = 0; i < colCount; i++) { 2394 // Move to the next position. 2395 if (style()->isLeftToRightDirection()) { 2396 ruleLogicalLeft += inlineDirectionSize + colGap / 2; 2397 currLogicalLeftOffset += inlineDirectionSize + colGap; 2398 } else { 2399 ruleLogicalLeft -= (inlineDirectionSize + colGap / 2); 2400 currLogicalLeftOffset -= (inlineDirectionSize + colGap); 2401 } 2402 2403 // Now paint the column rule. 2404 if (i < colCount - 1) { 2405 LayoutUnit ruleLeft = isHorizontalWritingMode() ? paintOffset.x() + ruleLogicalLeft - ruleThickness / 2 + ruleAdd : paintOffset.x() + borderLeft() + paddingLeft(); 2406 LayoutUnit ruleRight = isHorizontalWritingMode() ? ruleLeft + ruleThickness : ruleLeft + contentWidth(); 2407 LayoutUnit ruleTop = isHorizontalWritingMode() ? paintOffset.y() + borderTop() + paddingTop() : paintOffset.y() + ruleLogicalLeft - ruleThickness / 2 + ruleAdd; 2408 LayoutUnit ruleBottom = isHorizontalWritingMode() ? ruleTop + contentHeight() : ruleTop + ruleThickness; 2409 drawLineForBoxSide(paintInfo.context, ruleLeft, ruleTop, ruleRight, ruleBottom, boxSide, ruleColor, ruleStyle, 0, 0, antialias); 2410 } 2411 2412 ruleLogicalLeft = currLogicalLeftOffset; 2413 } 2414 } else { 2415 LayoutUnit ruleLeft = isHorizontalWritingMode() ? borderLeft() + paddingLeft() : colGap / 2 - colGap - ruleThickness / 2 + borderBefore() + paddingBefore(); 2416 LayoutUnit ruleWidth = isHorizontalWritingMode() ? contentWidth() : ruleThickness; 2417 LayoutUnit ruleTop = isHorizontalWritingMode() ? colGap / 2 - colGap - ruleThickness / 2 + borderBefore() + paddingBefore() : borderStart() + paddingStart(); 2418 LayoutUnit ruleHeight = isHorizontalWritingMode() ? ruleThickness : contentHeight(); 2419 LayoutRect ruleRect(ruleLeft, ruleTop, ruleWidth, ruleHeight); 2420 2421 flipForWritingMode(ruleRect); 2422 ruleRect.moveBy(paintOffset); 2423 2424 BoxSide boxSide = isHorizontalWritingMode() 2425 ? !style()->isFlippedBlocksWritingMode() ? BSTop : BSBottom 2426 : !style()->isFlippedBlocksWritingMode() ? BSLeft : BSRight; 2427 2428 LayoutSize step(0, !style()->isFlippedBlocksWritingMode() ? colInfo->columnHeight() + colGap : -(colInfo->columnHeight() + colGap)); 2429 if (!isHorizontalWritingMode()) 2430 step = step.transposedSize(); 2431 2432 for (unsigned i = 1; i < colCount; i++) { 2433 ruleRect.move(step); 2434 drawLineForBoxSide(paintInfo.context, ruleRect.x(), ruleRect.y(), ruleRect.maxX(), ruleRect.maxY(), boxSide, ruleColor, ruleStyle, 0, 0, antialias); 2435 } 2426 2436 } 2427 2437 } … … 2442 2452 LayoutUnit logicalLeftOffset = (isHorizontalWritingMode() ? colRect.x() : colRect.y()) - logicalLeftOffsetForContent(); 2443 2453 LayoutSize offset = isHorizontalWritingMode() ? LayoutSize(logicalLeftOffset, currLogicalTopOffset) : LayoutSize(currLogicalTopOffset, logicalLeftOffset); 2454 if (colInfo->progressionAxis() == ColumnInfo::BlockAxis) { 2455 if (isHorizontalWritingMode()) 2456 offset.expand(0, colRect.y() - borderTop() - paddingTop()); 2457 else 2458 offset.expand(colRect.x() - borderLeft() - paddingLeft(), 0); 2459 } 2444 2460 colRect.moveBy(paintOffset); 2445 2461 PaintInfo info(paintInfo); … … 4143 4159 return true; 4144 4160 } else if (hitTestColumns(request, result, pointInContainer, toLayoutPoint(scrolledOffset), hitTestAction)) { 4145 updateHitTestResult(result, pointInContainer - localOffset);4161 updateHitTestResult(result, flipForWritingMode(pointInContainer - localOffset)); 4146 4162 return true; 4147 4163 } … … 4198 4214 return false; 4199 4215 LayoutUnit logicalLeft = logicalLeftOffsetForContent(); 4200 LayoutUnit currLogicalTopOffset = 0; 4201 int i; 4216 LayoutUnit currLogicalTopOffset = !style()->isFlippedBlocksWritingMode() ? -colCount * colInfo->columnHeight() : colCount * colInfo->columnHeight(); 4202 4217 bool isHorizontal = isHorizontalWritingMode(); 4203 LayoutUnit blockDelta = colInfo->columnHeight(); 4204 for (i = 0; i < colCount; i++) { 4205 if (style()->isFlippedBlocksWritingMode()) 4206 currLogicalTopOffset += blockDelta; 4207 else 4208 currLogicalTopOffset -= blockDelta; 4209 } 4210 for (i = colCount - 1; i >= 0; i--) { 4218 4219 for (int i = colCount - 1; i >= 0; i--) { 4211 4220 LayoutRect colRect = columnRectAt(colInfo, i); 4212 4221 flipForWritingMode(colRect); … … 4224 4233 4225 4234 LayoutSize offset = isHorizontal ? IntSize(currLogicalLeftOffset, currLogicalTopOffset) : LayoutSize(currLogicalTopOffset, currLogicalLeftOffset); 4235 if (colInfo->progressionAxis() == ColumnInfo::BlockAxis) { 4236 if (isHorizontal) 4237 offset.expand(0, colRect.y() - accumulatedOffset.y() - borderTop() - paddingTop()); 4238 else 4239 offset.expand(colRect.x() - accumulatedOffset.x() - borderLeft() - paddingLeft(), 0); 4240 } 4241 4226 4242 LayoutPoint finalLocation = accumulatedOffset + offset; 4227 4243 if (result.isRectBasedTest() && !colRect.contains(result.rectForPoint(pointInContainer))) … … 4456 4472 4457 4473 // For now, we don't support multi-column layouts when printing, since we have to do a lot of work for proper pagination. 4458 if (document()->paginated() || (style()->hasAutoColumnCount() && style()->hasAutoColumnWidth()) ) {4474 if (document()->paginated() || (style()->hasAutoColumnCount() && style()->hasAutoColumnWidth()) || !style()->hasInlineColumnAxis()) { 4459 4475 setDesiredColumnCountAndWidth(desiredColumnCount, desiredColumnWidth); 4460 4476 return; … … 4482 4498 { 4483 4499 bool destroyColumns = !firstChild() 4484 || (count == 1 && style()->hasAutoColumnWidth() )4500 || (count == 1 && style()->hasAutoColumnWidth() && style()->hasInlineColumnAxis()) 4485 4501 || firstChild()->isAnonymousColumnsBlock() 4486 4502 || firstChild()->isAnonymousColumnSpanBlock(); … … 4502 4518 } 4503 4519 info->setDesiredColumnCount(count); 4504 info->setDesiredColumnWidth(width); 4520 info->setDesiredColumnWidth(width); 4521 info->setProgressionAxis(style()->hasInlineColumnAxis() ? ColumnInfo::InlineAxis : ColumnInfo::BlockAxis); 4505 4522 } 4506 4523 } … … 4529 4546 unsigned RenderBlock::columnCount(ColumnInfo* colInfo) const 4530 4547 { 4531 ASSERT(hasColumns() && gColumnInfoMap->get(this) == colInfo); 4548 ASSERT(hasColumns()); 4549 ASSERT(gColumnInfoMap->get(this) == colInfo); 4532 4550 return colInfo->columnCount(); 4533 4551 } … … 4541 4559 LayoutUnit colLogicalHeight = colInfo->columnHeight(); 4542 4560 LayoutUnit colLogicalTop = borderBefore() + paddingBefore(); 4561 LayoutUnit colLogicalLeft = logicalLeftOffsetForContent(); 4543 4562 int colGap = columnGap(); 4544 LayoutUnit colLogicalLeft = style()->isLeftToRightDirection() ? 4545 logicalLeftOffsetForContent() + (index * (colLogicalWidth + colGap)) 4546 : logicalLeftOffsetForContent() + contentLogicalWidth() - colLogicalWidth - (index * (colLogicalWidth + colGap)); 4563 if (colInfo->progressionAxis() == ColumnInfo::InlineAxis) { 4564 if (style()->isLeftToRightDirection()) 4565 colLogicalLeft += index * (colLogicalWidth + colGap); 4566 else 4567 colLogicalLeft += contentLogicalWidth() - colLogicalWidth - index * (colLogicalWidth + colGap); 4568 } else 4569 colLogicalTop += index * (colLogicalHeight + colGap); 4547 4570 4548 4571 if (isHorizontalWritingMode()) … … 4613 4636 // Add in half the column gap to the left and right of the rect. 4614 4637 LayoutRect colRect = columnRectAt(colInfo, i); 4615 if (isHorizontalWritingMode()) { 4638 flipForWritingMode(colRect); 4639 if (isHorizontalWritingMode() == (colInfo->progressionAxis() == ColumnInfo::InlineAxis)) { 4616 4640 LayoutRect gapAndColumnRect(colRect.x() - halfColGap, colRect.y(), colRect.width() + colGap, colRect.height()); 4617 4641 if (point.x() >= gapAndColumnRect.x() && point.x() < gapAndColumnRect.maxX()) { … … 4629 4653 4630 4654 // We're inside the column. Translate the x and y into our column coordinate space. 4631 point.move(columnPoint.x() - colRect.x(), logicalOffset); 4655 if (colInfo->progressionAxis() == ColumnInfo::InlineAxis) 4656 point.move(columnPoint.x() - colRect.x(), logicalOffset); 4657 else 4658 point.move((!style()->isFlippedBlocksWritingMode() ? logicalOffset : -logicalOffset) - colRect.x() + borderLeft() + paddingLeft(), 0); 4632 4659 return; 4633 4660 } 4634 4661 4635 4662 // Move to the next position. 4636 logicalOffset += col Rect.height();4663 logicalOffset += colInfo->progressionAxis() == ColumnInfo::InlineAxis ? colRect.height() : colRect.width(); 4637 4664 } else { 4638 4665 LayoutRect gapAndColumnRect(colRect.x(), colRect.y() - halfColGap, colRect.width(), colRect.height() + colGap); … … 4651 4678 4652 4679 // We're inside the column. Translate the x and y into our column coordinate space. 4653 point.move(logicalOffset, columnPoint.y() - colRect.y()); 4680 if (colInfo->progressionAxis() == ColumnInfo::InlineAxis) 4681 point.move(logicalOffset, columnPoint.y() - colRect.y()); 4682 else 4683 point.move(0, (!style()->isFlippedBlocksWritingMode() ? logicalOffset : -logicalOffset) - colRect.y() + borderTop() + paddingTop()); 4654 4684 return; 4655 4685 } 4656 4686 4657 4687 // Move to the next position. 4658 logicalOffset += col Rect.width();4688 logicalOffset += colInfo->progressionAxis() == ColumnInfo::InlineAxis ? colRect.width() : colRect.height(); 4659 4689 } 4660 4690 } … … 4695 4725 LayoutRect colRect = columnRectAt(colInfo, startColumn); 4696 4726 LayoutRect repaintRect = r; 4697 if (isHorizontal) 4698 repaintRect.move(colRect.x() - logicalLeftOffset, - static_cast<int>(startColumn) * colHeight); 4699 else 4700 repaintRect.move(- static_cast<int>(startColumn) * colHeight, colRect.y() - logicalLeftOffset); 4727 if (colInfo->progressionAxis() == ColumnInfo::InlineAxis) { 4728 if (isHorizontal) 4729 repaintRect.move(colRect.x() - logicalLeftOffset, - static_cast<int>(startColumn) * colHeight); 4730 else 4731 repaintRect.move(- static_cast<int>(startColumn) * colHeight, colRect.y() - logicalLeftOffset); 4732 } else { 4733 if (isHorizontal) 4734 repaintRect.move(0, colRect.y() - startColumn * colHeight - beforeBorderPadding); 4735 else 4736 repaintRect.move(colRect.x() - startColumn * colHeight - beforeBorderPadding, 0); 4737 } 4701 4738 repaintRect.intersect(colRect); 4702 4739 result.unite(repaintRect); … … 4763 4800 if (isHorizontalWritingMode()) { 4764 4801 if (point.y() >= sliceRect.y() && point.y() < sliceRect.maxY()) { 4765 offset.expand(columnRectAt(colInfo, i).x() - logicalLeft, -logicalOffset); 4802 if (colInfo->progressionAxis() == ColumnInfo::InlineAxis) 4803 offset.expand(columnRectAt(colInfo, i).x() - logicalLeft, -logicalOffset); 4804 else 4805 offset.expand(0, columnRectAt(colInfo, i).y() - logicalOffset - borderBefore() - paddingBefore()); 4766 4806 return; 4767 4807 } 4768 4808 } else { 4769 4809 if (point.x() >= sliceRect.x() && point.x() < sliceRect.maxX()) { 4770 offset.expand(-logicalOffset, columnRectAt(colInfo, i).y() - logicalLeft); 4810 if (colInfo->progressionAxis() == ColumnInfo::InlineAxis) 4811 offset.expand(-logicalOffset, columnRectAt(colInfo, i).y() - logicalLeft); 4812 else 4813 offset.expand(columnRectAt(colInfo, i).x() - logicalOffset - borderBefore() - paddingBefore(), 0); 4771 4814 return; 4772 4815 } -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r98361 r98608 1 1 /* 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 3 * 4 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. … … 2919 2919 columnBlock->flipForWritingMode(colRect); 2920 2920 int logicalLeftOffset = (isHorizontal ? colRect.x() : colRect.y()) - columnBlock->logicalLeftOffsetForContent(); 2921 LayoutSize offset = isHorizontal ? LayoutSize(logicalLeftOffset, currLogicalTopOffset) : LayoutSize(currLogicalTopOffset, logicalLeftOffset); 2921 LayoutSize offset; 2922 if (isHorizontal) { 2923 if (colInfo->progressionAxis() == ColumnInfo::InlineAxis) 2924 offset = LayoutSize(logicalLeftOffset, currLogicalTopOffset); 2925 else 2926 offset = LayoutSize(0, colRect.y() + currLogicalTopOffset - columnBlock->borderTop() - columnBlock->paddingTop()); 2927 } else { 2928 if (colInfo->progressionAxis() == ColumnInfo::InlineAxis) 2929 offset = LayoutSize(currLogicalTopOffset, logicalLeftOffset); 2930 else 2931 offset = LayoutSize(colRect.x() + currLogicalTopOffset - columnBlock->borderLeft() - columnBlock->paddingLeft(), 0); 2932 } 2922 2933 2923 2934 colRect.moveBy(layerOffset); … … 3397 3408 else 3398 3409 currLogicalTopOffset += blockDelta; 3410 3411 LayoutSize offset; 3412 if (isHorizontal) { 3413 if (colInfo->progressionAxis() == ColumnInfo::InlineAxis) 3414 offset = LayoutSize(currLogicalLeftOffset, currLogicalTopOffset); 3415 else 3416 offset = LayoutSize(0, colRect.y() + currLogicalTopOffset - columnBlock->borderTop() - columnBlock->paddingTop()); 3417 } else { 3418 if (colInfo->progressionAxis() == ColumnInfo::InlineAxis) 3419 offset = LayoutSize(currLogicalTopOffset, currLogicalLeftOffset); 3420 else 3421 offset = LayoutSize(colRect.x() + currLogicalTopOffset - columnBlock->borderLeft() - columnBlock->paddingLeft(), 0); 3422 } 3423 3399 3424 colRect.moveBy(layerOffset); 3400 3425 3401 3426 LayoutRect localClipRect(hitTestRect); 3402 3427 localClipRect.intersect(colRect); 3403 3404 LayoutSize offset = isHorizontal ? LayoutSize(currLogicalLeftOffset, currLogicalTopOffset) : LayoutSize(currLogicalTopOffset, currLogicalLeftOffset);3405 3428 3406 3429 if (!localClipRect.isEmpty() && localClipRect.intersects(result.rectForPoint(hitTestPoint))) { -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r98542 r98608 3 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 4 4 * (C) 2000 Dirk Mueller (mueller@kde.org) 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 6 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 7 * … … 759 759 EBorderFit borderFit() const { return static_cast<EBorderFit>(rareNonInheritedData->m_borderFit); } 760 760 EResize resize() const { return static_cast<EResize>(rareInheritedData->resize); } 761 ColumnAxis columnAxis() const { return static_cast<ColumnAxis>(rareNonInheritedData->m_multiCol->m_axis); } 762 bool hasInlineColumnAxis() const { 763 ColumnAxis axis = columnAxis(); 764 return axis == AutoColumnAxis || isHorizontalWritingMode() == (axis == HorizontalColumnAxis); 765 } 761 766 float columnWidth() const { return rareNonInheritedData->m_multiCol->m_width; } 762 767 bool hasAutoColumnWidth() const { return rareNonInheritedData->m_multiCol->m_autoWidth; } 763 768 unsigned short columnCount() const { return rareNonInheritedData->m_multiCol->m_count; } 764 769 bool hasAutoColumnCount() const { return rareNonInheritedData->m_multiCol->m_autoCount; } 765 bool specifiesColumns() const { return !hasAutoColumnCount() || !hasAutoColumnWidth() ; }770 bool specifiesColumns() const { return !hasAutoColumnCount() || !hasAutoColumnWidth() || !hasInlineColumnAxis(); } 766 771 float columnGap() const { return rareNonInheritedData->m_multiCol->m_gap; } 767 772 bool hasNormalColumnGap() const { return rareNonInheritedData->m_multiCol->m_normalGap; } … … 1147 1152 void setBorderFit(EBorderFit b) { SET_VAR(rareNonInheritedData, m_borderFit, b); } 1148 1153 void setResize(EResize r) { SET_VAR(rareInheritedData, resize, r); } 1154 void setColumnAxis(ColumnAxis axis) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_axis, axis); } 1149 1155 void setColumnWidth(float f) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_autoWidth, false); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_width, f); } 1150 1156 void setHasAutoColumnWidth() { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_autoWidth, true); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_width, 0); } … … 1352 1358 static EClear initialClear() { return CNONE; } 1353 1359 static ColorSpace initialColorSpace() { return ColorSpaceDeviceRGB; } 1360 static ColumnAxis initialColumnAxis() { return AutoColumnAxis; } 1354 1361 static TextDirection initialDirection() { return LTR; } 1355 1362 static WritingMode initialWritingMode() { return TopToBottomWritingMode; } -
trunk/Source/WebCore/rendering/style/RenderStyleConstants.h
r97638 r98608 449 449 enum RegionOverflow { AutoRegionOverflow, BreakRegionOverflow }; 450 450 451 enum ColumnAxis { HorizontalColumnAxis, VerticalColumnAxis, AutoColumnAxis }; 452 451 453 } // namespace WebCore 452 454 -
trunk/Source/WebCore/rendering/style/StyleMultiColData.cpp
r97638 r98608 38 38 , m_breakAfter(RenderStyle::initialPageBreak()) 39 39 , m_breakInside(RenderStyle::initialPageBreak()) 40 , m_axis(RenderStyle::initialColumnAxis()) 40 41 { 41 42 } … … 55 56 , m_breakAfter(o.m_breakAfter) 56 57 , m_breakInside(o.m_breakInside) 58 , m_axis(o.m_axis) 57 59 { 58 60 } … … 63 65 && m_rule == o.m_rule && m_visitedLinkColumnRuleColor == o.m_visitedLinkColumnRuleColor && m_breakBefore == o.m_breakBefore 64 66 && m_autoWidth == o.m_autoWidth && m_autoCount == o.m_autoCount && m_normalGap == o.m_normalGap 65 && m_columnSpan == o.m_columnSpan && m_breakAfter == o.m_breakAfter && m_breakInside == o.m_breakInside ;67 && m_columnSpan == o.m_columnSpan && m_breakAfter == o.m_breakAfter && m_breakInside == o.m_breakInside && m_axis == o.m_axis; 66 68 } 67 69 -
trunk/Source/WebCore/rendering/style/StyleMultiColData.h
r97638 r98608 67 67 unsigned m_breakAfter : 2; // EPageBreak 68 68 unsigned m_breakInside : 2; // EPageBreak 69 69 unsigned m_axis : 2; // ColumnAxis 70 70 71 private: 71 72 StyleMultiColData();
Note:
See TracChangeset
for help on using the changeset viewer.