OLD | NEW |
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 6489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6500 // is turned off, checkboxes/radios will still have decent baselines. | 6500 // is turned off, checkboxes/radios will still have decent baselines. |
6501 // FIXME: Need to patch form controls to deal with vertical lines. | 6501 // FIXME: Need to patch form controls to deal with vertical lines. |
6502 if (style()->hasAppearance() && !theme()->isControlContainer(style()->ap
pearance())) | 6502 if (style()->hasAppearance() && !theme()->isControlContainer(style()->ap
pearance())) |
6503 return theme()->baselinePosition(this); | 6503 return theme()->baselinePosition(this); |
6504 | 6504 |
6505 // CSS2.1 states that the baseline of an inline block is the baseline of
the last line box in | 6505 // CSS2.1 states that the baseline of an inline block is the baseline of
the last line box in |
6506 // the normal flow. We make an exception for marquees, since their base
lines are meaningless | 6506 // the normal flow. We make an exception for marquees, since their base
lines are meaningless |
6507 // (the content inside them moves). This matches WinIE as well, which j
ust bottom-aligns them. | 6507 // (the content inside them moves). This matches WinIE as well, which j
ust bottom-aligns them. |
6508 // We also give up on finding a baseline if we have a vertical scrollbar
, or if we are scrolled | 6508 // We also give up on finding a baseline if we have a vertical scrollbar
, or if we are scrolled |
6509 // vertically (e.g., an overflow:hidden block that has had scrollTop mov
ed). | 6509 // vertically (e.g., an overflow:hidden block that has had scrollTop mov
ed). |
| 6510 // inline-block with overflow should use the bottom of margin box as wel
l. |
6510 bool ignoreBaseline = (layer() && (isMarquee() || (direction == Horizont
alLine ? (layer()->verticalScrollbar() || layer()->scrollYOffset()) | 6511 bool ignoreBaseline = (layer() && (isMarquee() || (direction == Horizont
alLine ? (layer()->verticalScrollbar() || layer()->scrollYOffset()) |
6511 : (layer()->horizontalScrollbar() || layer()->scrollXOffset() != 0))
)) || (isWritingModeRoot() && !isRubyRun()); | 6512 : (layer()->horizontalScrollbar() || layer()->scrollXOffset())))) ||
(isWritingModeRoot() && !isRubyRun()) |
| 6513 || (style()->isDisplayInlineType() && style()->overflowY() != OVISIB
LE); |
6512 | 6514 |
6513 int baselinePos = ignoreBaseline ? -1 : inlineBlockBaseline(direction); | 6515 int baselinePos = ignoreBaseline ? -1 : inlineBlockBaseline(direction); |
6514 | 6516 |
6515 if (isDeprecatedFlexibleBox()) { | 6517 if (isDeprecatedFlexibleBox()) { |
6516 // Historically, we did this check for all baselines. But we can't | 6518 // Historically, we did this check for all baselines. But we can't |
6517 // remove this code from deprecated flexbox, because it effectively | 6519 // remove this code from deprecated flexbox, because it effectively |
6518 // breaks -webkit-line-clamp, which is used in the wild -- we would | 6520 // breaks -webkit-line-clamp, which is used in the wild -- we would |
6519 // calculate the baseline as if -webkit-line-clamp wasn't used. | 6521 // calculate the baseline as if -webkit-line-clamp wasn't used. |
6520 // For simplicity, we use this for all uses of deprecated flexbox. | 6522 // For simplicity, we use this for all uses of deprecated flexbox. |
6521 LayoutUnit bottomOfContent = direction == HorizontalLine ? borderTop
() + paddingTop() + contentHeight() : borderRight() + paddingRight() + contentWi
dth(); | 6523 LayoutUnit bottomOfContent = direction == HorizontalLine ? borderTop
() + paddingTop() + contentHeight() : borderRight() + paddingRight() + contentWi
dth(); |
(...skipping 1739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8261 } | 8263 } |
8262 | 8264 |
8263 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl
oatingObject* floatingObject) | 8265 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl
oatingObject* floatingObject) |
8264 { | 8266 { |
8265 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->fr
ameRect().pixelSnappedX(), floatingObject->frameRect().pixelSnappedY(), floating
Object->frameRect().pixelSnappedMaxX(), floatingObject->frameRect().pixelSnapped
MaxY()); | 8267 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->fr
ameRect().pixelSnappedX(), floatingObject->frameRect().pixelSnappedY(), floating
Object->frameRect().pixelSnappedMaxX(), floatingObject->frameRect().pixelSnapped
MaxY()); |
8266 } | 8268 } |
8267 | 8269 |
8268 #endif | 8270 #endif |
8269 | 8271 |
8270 } // namespace WebCore | 8272 } // namespace WebCore |
OLD | NEW |