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 3980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3991 RenderObject* firstLetterBlock = start; | 3991 RenderObject* firstLetterBlock = start; |
3992 while (true) { | 3992 while (true) { |
3993 // We include isRenderButton in these two checks because buttons are | 3993 // We include isRenderButton in these two checks because buttons are |
3994 // implemented using flex box but should still support first-letter. | 3994 // implemented using flex box but should still support first-letter. |
3995 // The flex box spec requires that flex box does not support | 3995 // The flex box spec requires that flex box does not support |
3996 // first-letter, though. | 3996 // first-letter, though. |
3997 // FIXME: Remove when buttons are implemented with align-items instead | 3997 // FIXME: Remove when buttons are implemented with align-items instead |
3998 // of flexbox. | 3998 // of flexbox. |
3999 bool canHaveFirstLetterRenderer = firstLetterBlock->style()->hasPseudoSt yle(FIRST_LETTER) | 3999 bool canHaveFirstLetterRenderer = firstLetterBlock->style()->hasPseudoSt yle(FIRST_LETTER) |
4000 && firstLetterBlock->canHaveGeneratedChildren() | 4000 && firstLetterBlock->canHaveGeneratedChildren() |
4001 && (!firstLetterBlock->isFlexibleBox() || firstLetterBlock->isRender Button()); | 4001 && (firstLetterBlock->isRenderBlockFlow() || firstLetterBlock->isRen derButton()); |
4002 if (canHaveFirstLetterRenderer) | 4002 if (canHaveFirstLetterRenderer) |
4003 return firstLetterBlock; | 4003 return firstLetterBlock; |
4004 | 4004 |
4005 RenderObject* parentBlock = firstLetterBlock->parent(); | 4005 RenderObject* parentBlock = firstLetterBlock->parent(); |
4006 if (firstLetterBlock->isReplaced() || !parentBlock | 4006 if (firstLetterBlock->isReplaced() || !parentBlock |
4007 || (!parentBlock->isRenderBlockFlow() && !parentBlock->isRenderButto n())) { | 4007 || (!parentBlock->isRenderBlockFlow() && !parentBlock->isRenderButto n())) { |
4008 return 0; | 4008 return 0; |
4009 } | 4009 } |
4010 ASSERT(parentBlock->isRenderBlock()); | 4010 ASSERT(parentBlock->isRenderBlock()); |
4011 if (toRenderBlock(parentBlock)->firstChild() != firstLetterBlock) | 4011 if (toRenderBlock(parentBlock)->firstChild() != firstLetterBlock) |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4169 break; | 4169 break; |
4170 currChild = currChild->nextSibling(); | 4170 currChild = currChild->nextSibling(); |
4171 } else if (currChild->isListMarker()) { | 4171 } else if (currChild->isListMarker()) { |
4172 currChild = currChild->nextSibling(); | 4172 currChild = currChild->nextSibling(); |
4173 } else if (currChild->isFloatingOrOutOfFlowPositioned()) { | 4173 } else if (currChild->isFloatingOrOutOfFlowPositioned()) { |
4174 if (currChild->style()->styleType() == FIRST_LETTER) { | 4174 if (currChild->style()->styleType() == FIRST_LETTER) { |
4175 currChild = currChild->slowFirstChild(); | 4175 currChild = currChild->slowFirstChild(); |
4176 break; | 4176 break; |
4177 } | 4177 } |
4178 currChild = currChild->nextSibling(); | 4178 currChild = currChild->nextSibling(); |
4179 } else if (currChild->isReplaced() || currChild->isRenderButton() || cur rChild->isMenuList()) { | 4179 } else if (currChild->isReplaced() || currChild->isRenderButton() || cur rChild->isMenuList() || (!firstLetterBlock->isRenderBlockFlow() && !firstLetterB lock->isRenderButton())) { |
Julien - ping for review
2014/08/07 20:55:57
This is repeated several now so we should put it i
Manuel Rego
2014/08/07 22:19:47
Done.
| |
4180 break; | 4180 break; |
4181 } else if (currChild->style()->hasPseudoStyle(FIRST_LETTER) && currChild ->canHaveGeneratedChildren()) { | 4181 } else if (currChild->style()->hasPseudoStyle(FIRST_LETTER) && currChild ->canHaveGeneratedChildren()) { |
4182 // We found a lower-level node with first-letter, which supersedes t he higher-level style | 4182 // We found a lower-level node with first-letter, which supersedes t he higher-level style |
4183 firstLetterBlock = currChild; | 4183 firstLetterBlock = currChild; |
4184 currChild = currChild->slowFirstChild(); | 4184 currChild = currChild->slowFirstChild(); |
4185 } else { | 4185 } else { |
4186 currChild = currChild->slowFirstChild(); | 4186 currChild = currChild->slowFirstChild(); |
4187 } | 4187 } |
4188 } | 4188 } |
4189 | 4189 |
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4835 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const | 4835 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const |
4836 { | 4836 { |
4837 showRenderObject(); | 4837 showRenderObject(); |
4838 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) | 4838 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) |
4839 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); | 4839 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); |
4840 } | 4840 } |
4841 | 4841 |
4842 #endif | 4842 #endif |
4843 | 4843 |
4844 } // namespace blink | 4844 } // namespace blink |
OLD | NEW |