Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(491)

Side by Side Diff: Source/core/rendering/RenderBlock.cpp

Issue 26588002: Remove support for -webkit-line-clamp Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Base files missing... Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 5475 matching lines...) Expand 10 before | Expand all | Expand 10 after
5486 // CSS2.1 states that the baseline of an inline block is the baseline of the last line box in 5486 // CSS2.1 states that the baseline of an inline block is the baseline of the last line box in
5487 // the normal flow. We make an exception for marquees, since their base lines are meaningless 5487 // the normal flow. We make an exception for marquees, since their base lines are meaningless
5488 // (the content inside them moves). This matches WinIE as well, which j ust bottom-aligns them. 5488 // (the content inside them moves). This matches WinIE as well, which j ust bottom-aligns them.
5489 // We also give up on finding a baseline if we have a vertical scrollbar , or if we are scrolled 5489 // We also give up on finding a baseline if we have a vertical scrollbar , or if we are scrolled
5490 // vertically (e.g., an overflow:hidden block that has had scrollTop mov ed). 5490 // vertically (e.g., an overflow:hidden block that has had scrollTop mov ed).
5491 bool ignoreBaseline = (layer() && (isMarquee() || (direction == Horizont alLine ? (layer()->verticalScrollbar() || layer()->scrollYOffset()) 5491 bool ignoreBaseline = (layer() && (isMarquee() || (direction == Horizont alLine ? (layer()->verticalScrollbar() || layer()->scrollYOffset())
5492 : (layer()->horizontalScrollbar() || layer()->scrollXOffset())))) || (isWritingModeRoot() && !isRubyRun()); 5492 : (layer()->horizontalScrollbar() || layer()->scrollXOffset())))) || (isWritingModeRoot() && !isRubyRun());
5493 5493
5494 int baselinePos = ignoreBaseline ? -1 : inlineBlockBaseline(direction); 5494 int baselinePos = ignoreBaseline ? -1 : inlineBlockBaseline(direction);
5495 5495
5496 if (isDeprecatedFlexibleBox()) {
5497 // Historically, we did this check for all baselines. But we can't
5498 // remove this code from deprecated flexbox, because it effectively
5499 // breaks -webkit-line-clamp, which is used in the wild -- we would
5500 // calculate the baseline as if -webkit-line-clamp wasn't used.
5501 // For simplicity, we use this for all uses of deprecated flexbox.
5502 LayoutUnit bottomOfContent = direction == HorizontalLine ? borderTop () + paddingTop() + contentHeight() : borderRight() + paddingRight() + contentWi dth();
5503 if (baselinePos > bottomOfContent)
5504 baselinePos = -1;
5505 }
5506 if (baselinePos != -1) 5496 if (baselinePos != -1)
5507 return direction == HorizontalLine ? marginTop() + baselinePos : mar ginRight() + baselinePos; 5497 return direction == HorizontalLine ? marginTop() + baselinePos : mar ginRight() + baselinePos;
5508 5498
5509 return RenderBox::baselinePosition(baselineType, firstLine, direction, l inePositionMode); 5499 return RenderBox::baselinePosition(baselineType, firstLine, direction, l inePositionMode);
5510 } 5500 }
5511 5501
5512 // If we're not replaced, we'll only get called with PositionOfInteriorLineB oxes. 5502 // If we're not replaced, we'll only get called with PositionOfInteriorLineB oxes.
5513 // Note that inline-block counts as replaced here. 5503 // Note that inline-block counts as replaced here.
5514 ASSERT(linePositionMode == PositionOfInteriorLineBoxes); 5504 ASSERT(linePositionMode == PositionOfInteriorLineBoxes);
5515 5505
(...skipping 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after
6801 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const 6791 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const
6802 { 6792 {
6803 showRenderObject(); 6793 showRenderObject();
6804 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 6794 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
6805 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 6795 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
6806 } 6796 }
6807 6797
6808 #endif 6798 #endif
6809 6799
6810 } // namespace WebCore 6800 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/EllipsisBox.cpp ('k') | Source/core/rendering/RenderDeprecatedFlexibleBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698