Changeset 71055 in webkit
- Timestamp:
- Nov 1, 2010 2:13:55 PM (13 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r71049 r71055 1 2010-11-01 David Hyatt <hyatt@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 https://bugs.webkit.org/show_bug.cgi?id=48776 6 7 Change isVertical() on InlineBox to isHorizontal() instead. This makes the horizontal code path come 8 first if you branch on isHorizontal() and makes the code read better (since that's the more common code 9 path). 10 11 * rendering/InlineBox.cpp: 12 (WebCore::InlineBox::logicalHeight): 13 * rendering/InlineBox.h: 14 (WebCore::InlineBox::InlineBox): 15 (WebCore::InlineBox::isHorizontal): 16 (WebCore::InlineBox::setIsHorizontal): 17 (WebCore::InlineBox::width): 18 (WebCore::InlineBox::height): 19 (WebCore::InlineBox::logicalLeft): 20 (WebCore::InlineBox::setLogicalLeft): 21 (WebCore::InlineBox::logicalTop): 22 (WebCore::InlineBox::setLogicalTop): 23 (WebCore::InlineBox::baselinePosition): 24 (WebCore::InlineBox::lineHeight): 25 * rendering/InlineFlowBox.cpp: 26 (WebCore::InlineFlowBox::addToLine): 27 (WebCore::InlineFlowBox::placeBoxesInInlineDirection): 28 (WebCore::InlineFlowBox::computeBlockDirectionOverflow): 29 (WebCore::InlineFlowBox::paintFillLayer): 30 (WebCore::InlineFlowBox::paintBoxDecorations): 31 (WebCore::InlineFlowBox::paintMask): 32 * rendering/InlineFlowBox.h: 33 (WebCore::InlineFlowBox::marginLogicalLeft): 34 (WebCore::InlineFlowBox::marginLogicalRight): 35 (WebCore::InlineFlowBox::borderLogicalLeft): 36 (WebCore::InlineFlowBox::borderLogicalRight): 37 (WebCore::InlineFlowBox::paddingLogicalLeft): 38 (WebCore::InlineFlowBox::paddingLogicalRight): 39 (WebCore::InlineFlowBox::setInlineDirectionOverflowPositions): 40 (WebCore::InlineFlowBox::setBlockDirectionOverflowPositions): 41 * rendering/InlineTextBox.cpp: 42 (WebCore::InlineTextBox::selectionRect): 43 (WebCore::InlineTextBox::applyShadowToGraphicsContext): 44 (WebCore::paintTextWithShadows): 45 (WebCore::InlineTextBox::paint): 46 (WebCore::InlineTextBox::paintDecoration): 47 * rendering/InlineTextBox.h: 48 * rendering/RenderBlockLineLayout.cpp: 49 (WebCore::RenderBlock::createLineBoxes): 50 * rendering/RenderBox.cpp: 51 (WebCore::RenderBox::blockDirectionOverflow): 52 * rendering/RenderBox.h: 53 * rendering/RenderBoxModelObject.cpp: 54 (WebCore::RenderBoxModelObject::paintFillLayerExtended): 55 * rendering/RenderLineBoxList.cpp: 56 (WebCore::RenderLineBoxList::hitTest): 57 * rendering/RootInlineBox.cpp: 58 (WebCore::RootInlineBox::RootInlineBox): 59 (WebCore::RootInlineBox::placeEllipsis): 60 * rendering/RootInlineBox.h: 61 (WebCore::RootInlineBox::baselinePosition): 62 (WebCore::RootInlineBox::lineHeight): 63 1 64 2010-11-01 Simon Fraser <simon.fraser@apple.com> 2 65 -
trunk/WebCore/rendering/InlineBox.cpp
r71043 r71055 96 96 return m_isText ? renderer()->style(m_firstLine)->font().height() : 0; 97 97 if (renderer()->isBox() && parent()) 98 return m_isVertical ? toRenderBox(m_renderer)->width() : toRenderBox(m_renderer)->height();98 return isHorizontal() ? toRenderBox(m_renderer)->height() : toRenderBox(m_renderer)->width(); 99 99 100 100 ASSERT(isInlineFlowBox()); -
trunk/WebCore/rendering/InlineBox.h
r70917 r71055 52 52 , m_hasVirtualLogicalHeight(false) 53 53 #endif 54 , m_is Vertical(false)54 , m_isHorizontal(true) 55 55 , m_endsWithBreak(false) 56 56 , m_hasSelectedChildren(false) … … 70 70 71 71 InlineBox(RenderObject* obj, int x, int y, int logicalWidth, bool firstLine, bool constructed, 72 bool dirty, bool extracted, bool is Vertical, InlineBox* next, InlineBox* prev, InlineFlowBox* parent)72 bool dirty, bool extracted, bool isHorizontal, InlineBox* next, InlineBox* prev, InlineFlowBox* parent) 73 73 : m_next(next) 74 74 , m_prev(prev) … … 86 86 , m_hasVirtualLogicalHeight(false) 87 87 #endif 88 , m_is Vertical(isVertical)88 , m_isHorizontal(isHorizontal) 89 89 , m_endsWithBreak(false) 90 90 , m_hasSelectedChildren(false) … … 153 153 } 154 154 155 bool is Vertical() const { return m_isVertical; }156 void setIs Vertical(bool v) { m_isVertical = v; }155 bool isHorizontal() const { return m_isHorizontal; } 156 void setIsHorizontal(bool horizontal) { m_isHorizontal = horizontal; } 157 157 158 158 virtual IntRect calculateBoundaries() const … … 217 217 int y() const { return m_y; } 218 218 219 int width() const { return m_isVertical ? logicalHeight() : logicalWidth(); }220 int height() const { return m_isVertical ? logicalWidth() : logicalHeight(); }219 int width() const { return isHorizontal() ? logicalWidth() : logicalHeight(); } 220 int height() const { return isHorizontal() ? logicalHeight() : logicalWidth(); } 221 221 222 222 // The logicalLeft position is the left edge of the line box in a horizontal line and the top edge in a vertical line. 223 int logicalLeft() const { return !m_isVertical? m_x : m_y; }223 int logicalLeft() const { return isHorizontal() ? m_x : m_y; } 224 224 int logicalRight() const { return logicalLeft() + logicalWidth(); } 225 225 void setLogicalLeft(int left) 226 226 { 227 if ( !m_isVertical)227 if (isHorizontal()) 228 228 m_x = left; 229 229 else … … 232 232 233 233 // The logicalTop[ position is the top edge of the line box in a horizontal line and the left edge in a vertical line. 234 int logicalTop() const { return !m_isVertical? m_y : m_x; }234 int logicalTop() const { return isHorizontal() ? m_y : m_x; } 235 235 int logicalBottom() const { return logicalTop() + logicalHeight(); } 236 236 void setLogicalTop(int top) 237 237 { 238 if ( !m_isVertical)238 if (isHorizontal()) 239 239 m_y = top; 240 240 else … … 249 249 int logicalHeight() const; 250 250 251 virtual int baselinePosition() const { return boxModelObject()->baselinePosition(m_firstLine, m_isVertical ? VerticalLine : HorizontalLine, PositionOnContainingLine); }252 virtual int lineHeight() const { return boxModelObject()->lineHeight(m_firstLine, m_isVertical ? VerticalLine : HorizontalLine, PositionOnContainingLine); }251 virtual int baselinePosition() const { return boxModelObject()->baselinePosition(m_firstLine, isHorizontal() ? HorizontalLine : VerticalLine, PositionOnContainingLine); } 252 virtual int lineHeight() const { return boxModelObject()->lineHeight(m_firstLine, isHorizontal() ? HorizontalLine : VerticalLine, PositionOnContainingLine); } 253 253 254 254 … … 320 320 bool m_hasVirtualLogicalHeight : 1; 321 321 322 bool m_is Vertical : 1;322 bool m_isHorizontal : 1; 323 323 324 324 // for RootInlineBox -
trunk/WebCore/rendering/InlineFlowBox.cpp
r71043 r71055 81 81 } 82 82 child->setFirstLineStyleBit(m_firstLine); 83 child->setIs Vertical(m_isVertical);83 child->setIsHorizontal(isHorizontal()); 84 84 if (child->isText()) 85 85 m_hasTextChildren = true; … … 329 329 // The box can have a different writing-mode than the overall line, so this is a bit complicated. 330 330 // Just get all the physical margin and overflow values by hand based off |isVertical|. 331 int logicalLeftMargin = !isVertical() ? curr->boxModelObject()->marginLeft() : curr->boxModelObject()->marginTop();332 int logicalRightMargin = !isVertical() ? curr->boxModelObject()->marginRight() : curr->boxModelObject()->marginBottom();331 int logicalLeftMargin = isHorizontal() ? curr->boxModelObject()->marginLeft() : curr->boxModelObject()->marginTop(); 332 int logicalRightMargin = isHorizontal() ? curr->boxModelObject()->marginRight() : curr->boxModelObject()->marginBottom(); 333 333 334 334 logicalLeft += logicalLeftMargin; … … 337 337 RenderBox* box = toRenderBox(curr->renderer()); 338 338 339 int childOverflowLogicalLeft = box->hasOverflowClip() ? 0 : ( !isVertical() ? box->leftLayoutOverflow() : box->topLayoutOverflow());340 int childOverflowLogicalRight = box->hasOverflowClip() ? curr->logicalWidth() : ( !isVertical() ? box->rightLayoutOverflow() : box->bottomLayoutOverflow());339 int childOverflowLogicalLeft = box->hasOverflowClip() ? 0 : (isHorizontal() ? box->leftLayoutOverflow() : box->topLayoutOverflow()); 340 int childOverflowLogicalRight = box->hasOverflowClip() ? curr->logicalWidth() : (isHorizontal() ? box->rightLayoutOverflow() : box->bottomLayoutOverflow()); 341 341 342 342 logicalLeftLayoutOverflow = min(logicalLeft + childOverflowLogicalLeft, logicalLeftLayoutOverflow); 343 343 logicalRightLayoutOverflow = max(logicalLeft + childOverflowLogicalRight, logicalRightLayoutOverflow); 344 344 345 logicalLeftVisualOverflow = min(logicalLeft + ( !isVertical() ? box->leftVisualOverflow() : box->topVisualOverflow()), logicalLeftVisualOverflow);346 logicalRightVisualOverflow = max(logicalLeft + ( !isVertical() ? box->rightVisualOverflow() : box->bottomVisualOverflow()), logicalRightVisualOverflow);345 logicalLeftVisualOverflow = min(logicalLeft + (isHorizontal() ? box->leftVisualOverflow() : box->topVisualOverflow()), logicalLeftVisualOverflow); 346 logicalRightVisualOverflow = max(logicalLeft + (isHorizontal() ? box->rightVisualOverflow() : box->bottomVisualOverflow()), logicalRightVisualOverflow); 347 347 348 348 logicalLeft += curr->logicalWidth() + logicalRightMargin; … … 634 634 635 635 RenderBox* box = toRenderBox(curr->renderer()); 636 box->blockDirectionOverflow(is Vertical(), childTopLayoutOverflow, childBottomLayoutOverflow,636 box->blockDirectionOverflow(isHorizontal(), childTopLayoutOverflow, childBottomLayoutOverflow, 637 637 childTopVisualOverflow, childBottomVisualOverflow); 638 638 … … 774 774 for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox()) 775 775 totalLogicalWidth += curr->logicalWidth(); 776 int stripX = tx - (is Vertical() ? 0 : logicalOffsetOnLine);777 int stripY = ty - (is Vertical() ? logicalOffsetOnLine : 0);778 int stripWidth = is Vertical() ? width() : totalLogicalWidth;779 int stripHeight = is Vertical() ? totalLogicalWidth : height();776 int stripX = tx - (isHorizontal() ? logicalOffsetOnLine : 0); 777 int stripY = ty - (isHorizontal() ? 0 : logicalOffsetOnLine); 778 int stripWidth = isHorizontal() ? totalLogicalWidth : width(); 779 int stripHeight = isHorizontal() ? height() : totalLogicalWidth; 780 780 paintInfo.context->save(); 781 781 paintInfo.context->clip(IntRect(tx, ty, width(), height())); … … 803 803 int x = m_x; 804 804 int y = m_y; 805 int w = m_isVertical ? logicalHeight() : logicalWidth();806 int h = m_isVertical ? logicalWidth() : logicalHeight();805 int w = width(); 806 int h = height(); 807 807 808 808 // Constrain our background/border painting to the line top and bottom if necessary. … … 810 810 if (!hasTextChildren() && !noQuirksMode) { 811 811 RootInlineBox* rootBox = root(); 812 int& top = m_isVertical ? x : y;813 int& logicalHeight = m_isVertical ? w : h;812 int& top = isHorizontal() ? y : x; 813 int& logicalHeight = isHorizontal() ? h : w; 814 814 int bottom = min(rootBox->lineBottom(), top + logicalHeight); 815 815 top = max(rootBox->lineTop(), top); … … 866 866 for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox()) 867 867 totalLogicalWidth += curr->logicalWidth(); 868 int stripX = tx - (is Vertical() ? 0 : logicalOffsetOnLine);869 int stripY = ty - (is Vertical() ? logicalOffsetOnLine : 0);870 int stripWidth = is Vertical() ? w : totalLogicalWidth;871 int stripHeight = is Vertical() ? totalLogicalWidth :h;868 int stripX = tx - (isHorizontal() ? logicalOffsetOnLine : 0); 869 int stripY = ty - (isHorizontal() ? 0 : logicalOffsetOnLine); 870 int stripWidth = isHorizontal() ? totalLogicalWidth : w; 871 int stripHeight = isHorizontal() ? h : totalLogicalWidth; 872 872 context->save(); 873 873 context->clip(IntRect(tx, ty, w, h)); … … 886 886 int x = m_x; 887 887 int y = m_y; 888 int w = m_isVertical ? logicalHeight() : logicalWidth();889 int h = m_isVertical ? logicalWidth() : logicalHeight();888 int w = width(); 889 int h = height(); 890 890 891 891 // Constrain our background/border painting to the line top and bottom if necessary. … … 893 893 if (!hasTextChildren() && !noQuirksMode) { 894 894 RootInlineBox* rootBox = root(); 895 int& top = m_isVertical ? x : y;896 int& logicalHeight = m_isVertical ? w : h;895 int& top = isHorizontal() ? y : x; 896 int& logicalHeight = isHorizontal() ? h : w; 897 897 int bottom = min(rootBox->lineBottom(), top + logicalHeight); 898 898 top = max(rootBox->lineTop(), top); … … 944 944 for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox()) 945 945 totalLogicalWidth += curr->logicalWidth(); 946 int stripX = tx - (is Vertical() ? 0 : logicalOffsetOnLine);947 int stripY = ty - (is Vertical() ? logicalOffsetOnLine : 0);948 int stripWidth = is Vertical() ? w : totalLogicalWidth;949 int stripHeight = is Vertical() ? totalLogicalWidth :h;946 int stripX = tx - (isHorizontal() ? logicalOffsetOnLine : 0); 947 int stripY = ty - (isHorizontal() ? 0 : logicalOffsetOnLine); 948 int stripWidth = isHorizontal() ? totalLogicalWidth : w; 949 int stripHeight = isHorizontal() ? h : totalLogicalWidth; 950 950 paintInfo.context->save(); 951 951 paintInfo.context->clip(IntRect(tx, ty, w, h)); -
trunk/WebCore/rendering/InlineFlowBox.h
r71043 r71055 109 109 if (!includeLogicalLeftEdge()) 110 110 return 0; 111 return !isVertical() ? boxModelObject()->marginLeft() : boxModelObject()->marginTop();111 return isHorizontal() ? boxModelObject()->marginLeft() : boxModelObject()->marginTop(); 112 112 } 113 113 int marginLogicalRight() const … … 115 115 if (!includeLogicalRightEdge()) 116 116 return 0; 117 return !isVertical() ? boxModelObject()->marginRight() : boxModelObject()->marginBottom();117 return isHorizontal() ? boxModelObject()->marginRight() : boxModelObject()->marginBottom(); 118 118 } 119 119 int borderLogicalLeft() const … … 121 121 if (!includeLogicalLeftEdge()) 122 122 return 0; 123 return !isVertical() ? renderer()->style()->borderLeftWidth() : renderer()->style()->borderTopWidth();123 return isHorizontal() ? renderer()->style()->borderLeftWidth() : renderer()->style()->borderTopWidth(); 124 124 } 125 125 int borderLogicalRight() const … … 127 127 if (!includeLogicalRightEdge()) 128 128 return 0; 129 return !isVertical() ? renderer()->style()->borderRightWidth() : renderer()->style()->borderBottomWidth();129 return isHorizontal() ? renderer()->style()->borderRightWidth() : renderer()->style()->borderBottomWidth(); 130 130 } 131 131 int paddingLogicalLeft() const … … 133 133 if (!includeLogicalLeftEdge()) 134 134 return 0; 135 return !isVertical() ? boxModelObject()->paddingLeft() : boxModelObject()->paddingTop();135 return isHorizontal() ? boxModelObject()->paddingLeft() : boxModelObject()->paddingTop(); 136 136 } 137 137 int paddingLogicalRight() const … … 139 139 if (!includeLogicalRightEdge()) 140 140 return 0; 141 return !isVertical() ? boxModelObject()->paddingRight() : boxModelObject()->paddingBottom();141 return isHorizontal() ? boxModelObject()->paddingRight() : boxModelObject()->paddingBottom(); 142 142 } 143 143 … … 242 242 && logicalLeftVisualOverflow == logicalLeft() && logicalRightVisualOverflow == logicalRight()) 243 243 return; 244 245 int width = isVertical() ? logicalHeight() : logicalWidth(); 246 int height = isVertical() ? logicalWidth() : logicalHeight(); 247 248 m_overflow = adoptPtr(new RenderOverflow(IntRect(m_x, m_y, width, height))); 249 } 250 251 if (isVertical()) { 244 m_overflow = adoptPtr(new RenderOverflow(IntRect(m_x, m_y, width(), height()))); 245 } 246 247 if (isHorizontal()) { 248 m_overflow->setLeftLayoutOverflow(logicalLeftLayoutOverflow); 249 m_overflow->setRightLayoutOverflow(logicalRightLayoutOverflow); 250 m_overflow->setLeftVisualOverflow(logicalLeftVisualOverflow); 251 m_overflow->setRightVisualOverflow(logicalRightVisualOverflow); 252 } else { 252 253 m_overflow->setTopLayoutOverflow(logicalLeftLayoutOverflow); 253 254 m_overflow->setBottomLayoutOverflow(logicalRightLayoutOverflow); 254 255 m_overflow->setTopVisualOverflow(logicalLeftVisualOverflow); 255 256 m_overflow->setBottomVisualOverflow(logicalRightVisualOverflow); 256 } else {257 m_overflow->setLeftLayoutOverflow(logicalLeftLayoutOverflow);258 m_overflow->setRightLayoutOverflow(logicalRightLayoutOverflow);259 m_overflow->setLeftVisualOverflow(logicalLeftVisualOverflow);260 m_overflow->setRightVisualOverflow(logicalRightVisualOverflow);261 257 } 262 258 } … … 269 265 && logicalTopVisualOverflow == logicalTop() && logicalBottomVisualOverflow == logicalBottom()) 270 266 return; 271 272 int width = isVertical() ? logicalHeight() : logicalWidth(); 273 int height = isVertical() ? logicalWidth() : logicalHeight(); 274 275 m_overflow = adoptPtr(new RenderOverflow(IntRect(m_x, m_y, width, height))); 276 } 277 278 if (!isVertical()) { 267 m_overflow = adoptPtr(new RenderOverflow(IntRect(m_x, m_y, width(), height()))); 268 } 269 270 if (isHorizontal()) { 279 271 m_overflow->setTopLayoutOverflow(logicalTopLayoutOverflow); 280 272 m_overflow->setBottomLayoutOverflow(logicalBottomLayoutOverflow); -
trunk/WebCore/rendering/InlineTextBox.cpp
r71043 r71055 163 163 logicalWidth = m_logicalWidth - r.x(); 164 164 165 IntPoint topPoint = m_isVertical ? IntPoint(tx + selTop, ty + m_y + r.x()) : IntPoint(tx + m_x + r.x(), ty + selTop);166 int width = m_isVertical ? selHeight : logicalWidth;167 int height = m_isVertical ? logicalWidth : selHeight;165 IntPoint topPoint = isHorizontal() ? IntPoint(tx + m_x + r.x(), ty + selTop) : IntPoint(tx + selTop, ty + m_y + r.x()); 166 int width = isHorizontal() ? logicalWidth : selHeight; 167 int height = isHorizontal() ? selHeight : logicalWidth; 168 168 169 169 return IntRect(topPoint, IntSize(width, height)); … … 322 322 } 323 323 324 FloatSize InlineTextBox::applyShadowToGraphicsContext(GraphicsContext* context, const ShadowData* shadow, const FloatRect& textRect, bool stroked, bool opaque, bool vertical)324 FloatSize InlineTextBox::applyShadowToGraphicsContext(GraphicsContext* context, const ShadowData* shadow, const FloatRect& textRect, bool stroked, bool opaque, bool horizontal) 325 325 { 326 326 if (!shadow) … … 328 328 329 329 FloatSize extraOffset; 330 int shadowX = vertical ? shadow->y() : shadow->x();331 int shadowY = vertical ? -shadow->x() : shadow->y();330 int shadowX = horizontal ? shadow->x() : shadow->y(); 331 int shadowY = horizontal ? shadow->y() : -shadow->x(); 332 332 FloatSize shadowOffset(shadowX, shadowY); 333 333 int shadowBlur = shadow->blur(); … … 350 350 351 351 static void paintTextWithShadows(GraphicsContext* context, const Font& font, const TextRun& textRun, int startOffset, int endOffset, int truncationPoint, const IntPoint& textOrigin, 352 const IntRect& boxRect, const ShadowData* shadow, bool stroked, bool vertical)352 const IntRect& boxRect, const ShadowData* shadow, bool stroked, bool horizontal) 353 353 { 354 354 Color fillColor = context->fillColor(); … … 361 361 IntSize extraOffset; 362 362 if (shadow) 363 extraOffset = roundedIntSize(InlineTextBox::applyShadowToGraphicsContext(context, shadow, boxRect, stroked, opaque, vertical));363 extraOffset = roundedIntSize(InlineTextBox::applyShadowToGraphicsContext(context, shadow, boxRect, stroked, opaque, horizontal)); 364 364 else if (!opaque) 365 365 context->setFillColor(fillColor, fillColorSpace); … … 398 398 int logicalLeftOverflow = parent()->logicalLeft() - parent()->logicalLeftVisualOverflow(); 399 399 int logicalRightOverflow = parent()->logicalRightVisualOverflow() - (parent()->logicalLeft() + parent()->logicalWidth()); 400 int logicalStart = logicalLeft() - logicalLeftOverflow + (is Vertical() ? ty : tx);400 int logicalStart = logicalLeft() - logicalLeftOverflow + (isHorizontal() ? tx : ty); 401 401 int logicalExtent = logicalWidth() + logicalLeftOverflow + logicalRightOverflow; 402 402 403 int paintEnd = is Vertical() ? paintInfo.rect.bottom() : paintInfo.rect.right();404 int paintStart = is Vertical() ? paintInfo.rect.y() : paintInfo.rect.x();403 int paintEnd = isHorizontal() ? paintInfo.rect.right() : paintInfo.rect.bottom(); 404 int paintStart = isHorizontal() ? paintInfo.rect.x() : paintInfo.rect.y(); 405 405 406 406 if (logicalStart >= paintEnd || logicalStart + logicalExtent <= paintStart) … … 428 428 int widthOfHiddenText = m_logicalWidth - widthOfVisibleText; 429 429 // FIXME: The hit testing logic also needs to take this translation int account. 430 if ( !m_isVertical)430 if (isHorizontal()) 431 431 tx += isLeftToRightDirection() ? widthOfHiddenText : -widthOfHiddenText; 432 432 else … … 448 448 IntRect boxRect(boxOrigin, IntSize(logicalWidth(), logicalHeight())); 449 449 450 if ( m_isVertical) {450 if (!isHorizontal()) { 451 451 context->save(); 452 452 context->translate(boxRect.x(), boxRect.bottom()); … … 575 575 if (!paintSelectedTextSeparately || ePos <= sPos) { 576 576 // FIXME: Truncate right-to-left text correctly. 577 paintTextWithShadows(context, font, textRun, 0, length, length, textOrigin, boxRect, textShadow, textStrokeWidth > 0, m_isVertical);577 paintTextWithShadows(context, font, textRun, 0, length, length, textOrigin, boxRect, textShadow, textStrokeWidth > 0, isHorizontal()); 578 578 } else 579 paintTextWithShadows(context, font, textRun, ePos, sPos, length, textOrigin, boxRect, textShadow, textStrokeWidth > 0, m_isVertical);579 paintTextWithShadows(context, font, textRun, ePos, sPos, length, textOrigin, boxRect, textShadow, textStrokeWidth > 0, isHorizontal()); 580 580 581 581 if (textStrokeWidth > 0) … … 589 589 590 590 updateGraphicsContext(context, selectionFillColor, selectionStrokeColor, selectionStrokeWidth, styleToUse->colorSpace()); 591 paintTextWithShadows(context, font, textRun, sPos, ePos, length, textOrigin, boxRect, selectionShadow, selectionStrokeWidth > 0, m_isVertical);591 paintTextWithShadows(context, font, textRun, sPos, ePos, length, textOrigin, boxRect, selectionShadow, selectionStrokeWidth > 0, isHorizontal()); 592 592 593 593 if (selectionStrokeWidth > 0) … … 630 630 } 631 631 632 if ( m_isVertical)632 if (!isHorizontal()) 633 633 context->restore(); 634 634 } … … 773 773 IntRect shadowRect(localOrigin, IntSize(width, baseline + 2)); 774 774 shadowRect.inflate(s->blur()); 775 int shadowX = m_isVertical ? s->y() : s->x();776 int shadowY = m_isVertical ? -s->x() : s->y();775 int shadowX = isHorizontal() ? s->x() : s->y(); 776 int shadowY = isHorizontal() ? s->y() : -s->x(); 777 777 shadowRect.move(shadowX, shadowY); 778 778 clipRect.unite(shadowRect); … … 796 796 extraOffset = 0; 797 797 } 798 int shadowX = m_isVertical ? shadow->y() : shadow->x();799 int shadowY = m_isVertical ? -shadow->x() : shadow->y();798 int shadowX = isHorizontal() ? shadow->x() : shadow->y(); 799 int shadowY = isHorizontal() ? shadow->y() : -shadow->x(); 800 800 context->setShadow(IntSize(shadowX, shadowY - extraOffset), shadow->blur(), shadow->color(), colorSpace); 801 801 setShadow = true; -
trunk/WebCore/rendering/InlineTextBox.h
r70482 r71055 128 128 129 129 // Needs to be public, so the static paintTextWithShadows() function can use it. 130 static FloatSize applyShadowToGraphicsContext(GraphicsContext*, const ShadowData*, const FloatRect& textRect, bool stroked, bool opaque, bool vertical);130 static FloatSize applyShadowToGraphicsContext(GraphicsContext*, const ShadowData*, const FloatRect& textRect, bool stroked, bool opaque, bool horizontal); 131 131 132 132 private: -
trunk/WebCore/rendering/RenderBlockLineLayout.cpp
r70848 r71055 209 209 parentBox = static_cast<InlineFlowBox*>(newBox); 210 210 parentBox->setFirstLineStyleBit(firstLine); 211 parentBox->setIs Vertical(!style()->isHorizontalWritingMode());211 parentBox->setIsHorizontal(style()->isHorizontalWritingMode()); 212 212 constructedNewBox = true; 213 213 } -
trunk/WebCore/rendering/RenderBox.cpp
r71043 r71055 3186 3186 } 3187 3187 3188 void RenderBox::blockDirectionOverflow(bool isLine Vertical, int& logicalTopLayoutOverflow, int& logicalBottomLayoutOverflow,3188 void RenderBox::blockDirectionOverflow(bool isLineHorizontal, int& logicalTopLayoutOverflow, int& logicalBottomLayoutOverflow, 3189 3189 int& logicalTopVisualOverflow, int& logicalBottomVisualOverflow) 3190 3190 { 3191 if (isLineVertical) { 3191 if (isLineHorizontal) { 3192 logicalTopLayoutOverflow = topLayoutOverflow(); 3193 logicalBottomLayoutOverflow = bottomLayoutOverflow(); 3194 logicalTopVisualOverflow = topVisualOverflow(); 3195 logicalBottomVisualOverflow = bottomVisualOverflow(); 3196 } else { 3192 3197 logicalTopLayoutOverflow = leftLayoutOverflow(); 3193 3198 logicalBottomLayoutOverflow = rightLayoutOverflow(); 3194 3199 logicalTopVisualOverflow = leftVisualOverflow(); 3195 3200 logicalBottomVisualOverflow = rightVisualOverflow(); 3196 } else { 3197 logicalTopLayoutOverflow = topLayoutOverflow(); 3198 logicalBottomLayoutOverflow = bottomLayoutOverflow(); 3199 logicalTopVisualOverflow = topVisualOverflow(); 3200 logicalBottomVisualOverflow = bottomVisualOverflow(); 3201 } 3201 } 3202 3202 } 3203 3203 -
trunk/WebCore/rendering/RenderBox.h
r71043 r71055 156 156 void clearLayoutOverflow(); 157 157 158 void blockDirectionOverflow(bool isLine Vertical, int& logicalTopLayoutOverflow, int& logicalBottomLayoutOverflow,158 void blockDirectionOverflow(bool isLineHorizontal, int& logicalTopLayoutOverflow, int& logicalBottomLayoutOverflow, 159 159 int& logicalTopVisualOverflow, int& logicalBottomVisualOverflow); 160 160 -
trunk/WebCore/rendering/RenderBoxModelObject.cpp
r70848 r71055 527 527 if (!includeLeftEdge) { 528 528 topLeft = IntSize(); 529 if (box->isVertical()) 529 if (box->isHorizontal()) 530 bottomLeft = IntSize(); 531 else 532 topRight = IntSize(); 533 } 534 535 if (!includeRightEdge) { 536 if (box->isHorizontal()) 530 537 topRight = IntSize(); 531 538 else 532 539 bottomLeft = IntSize(); 533 }534 535 if (!includeRightEdge) {536 if (box->isVertical())537 bottomLeft = IntSize();538 else539 topRight = IntSize();540 540 bottomRight = IntSize(); 541 541 } -
trunk/WebCore/rendering/RenderLineBoxList.cpp
r70917 r71055 279 279 return false; 280 280 281 bool is Vertical = firstLineBox()->isVertical();282 283 int logicalPointStart = is Vertical ? x - result.leftPadding() : y - result.topPadding();284 int logicalPointEnd = is Vertical ? x + result.rightPadding() : y + result.bottomPadding();285 int offset = is Vertical ? tx : ty;281 bool isHorizontal = firstLineBox()->isHorizontal(); 282 283 int logicalPointStart = isHorizontal ? y - result.topPadding() : x - result.leftPadding(); 284 int logicalPointEnd = isHorizontal ? y + result.bottomPadding() : x + result.rightPadding(); 285 int offset = isHorizontal ? ty : tx; 286 286 287 287 // We can check the first box and last box and avoid hit testing if we don't -
trunk/WebCore/rendering/RootInlineBox.cpp
r70330 r71055 49 49 , m_blockLogicalHeight(0) 50 50 { 51 setIs Vertical(!block->style()->isHorizontalWritingMode());51 setIsHorizontal(block->style()->isHorizontalWritingMode()); 52 52 } 53 53 … … 100 100 EllipsisBox* ellipsisBox = new (renderer()->renderArena()) EllipsisBox(renderer(), ellipsisStr, this, 101 101 ellipsisWidth - (markupBox ? markupBox->logicalWidth() : 0), logicalHeight(), 102 y(), !prevRootBox(), is Vertical(), markupBox);102 y(), !prevRootBox(), isHorizontal(), markupBox); 103 103 104 104 if (!gEllipsisBoxMap) -
trunk/WebCore/rendering/RootInlineBox.h
r70072 r71055 89 89 virtual void clearTruncation(); 90 90 91 virtual int baselinePosition() const { return boxModelObject()->baselinePosition(m_firstLine, m_isVertical ? VerticalLine : HorizontalLine, PositionOfInteriorLineBoxes); }92 virtual int lineHeight() const { return boxModelObject()->lineHeight(m_firstLine, m_isVertical ? VerticalLine : HorizontalLine, PositionOfInteriorLineBoxes); }91 virtual int baselinePosition() const { return boxModelObject()->baselinePosition(m_firstLine, isHorizontal() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes); } 92 virtual int lineHeight() const { return boxModelObject()->lineHeight(m_firstLine, isHorizontal() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes); } 93 93 94 94 #if PLATFORM(MAC)
Note: See TracChangeset
for help on using the changeset viewer.