OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r ights reserved. | 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r ights reserved. |
7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
334 } | 334 } |
335 | 335 |
336 #endif | 336 #endif |
337 | 337 |
338 // Correct version of !layoutObjectHasNoBoxEffectObsolete(). | 338 // Correct version of !layoutObjectHasNoBoxEffectObsolete(). |
339 bool hasBoxEffect() const | 339 bool hasBoxEffect() const |
340 { | 340 { |
341 return hasBoxDecorationBackground() || style()->hasVisualOverflowingEffe ct(); | 341 return hasBoxDecorationBackground() || style()->hasVisualOverflowingEffe ct(); |
342 } | 342 } |
343 | 343 |
344 // Obtains the nearest enclosing block (including this block) that contribut es a first-line style to our inline | |
345 // children. | |
346 virtual LayoutBlock* firstLineBlock() const; | |
347 | |
348 // LayoutObject tree manipulation | 344 // LayoutObject tree manipulation |
349 ////////////////////////////////////////// | 345 ////////////////////////////////////////// |
350 virtual bool canHaveChildren() const { return virtualChildren(); } | 346 virtual bool canHaveChildren() const { return virtualChildren(); } |
351 virtual bool isChildAllowed(LayoutObject*, const ComputedStyle&) const { ret urn true; } | 347 virtual bool isChildAllowed(LayoutObject*, const ComputedStyle&) const { ret urn true; } |
352 | 348 |
353 // This function is called whenever a child is inserted under |this|. | 349 // This function is called whenever a child is inserted under |this|. |
354 // | 350 // |
355 // The main purpose of this function is to generate a consistent layout | 351 // The main purpose of this function is to generate a consistent layout |
356 // tree, which means generating the missing anonymous objects. Most of the | 352 // tree, which means generating the missing anonymous objects. Most of the |
357 // time there'll be no anonymous objects to generate. | 353 // time there'll be no anonymous objects to generate. |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
743 // This is the same as node() except for layoutObjects of :before, :after an d | 739 // This is the same as node() except for layoutObjects of :before, :after an d |
744 // :first-letter pseudo elements for which their parent node is returned. | 740 // :first-letter pseudo elements for which their parent node is returned. |
745 Node* generatingNode() const { return isPseudoElement() ? node()->parentOrSh adowHostNode() : node(); } | 741 Node* generatingNode() const { return isPseudoElement() ? node()->parentOrSh adowHostNode() : node(); } |
746 | 742 |
747 Document& document() const { return m_node->document(); } | 743 Document& document() const { return m_node->document(); } |
748 LocalFrame* frame() const { return document().frame(); } | 744 LocalFrame* frame() const { return document().frame(); } |
749 | 745 |
750 virtual LayoutMultiColumnSpannerPlaceholder* spannerPlaceholder() const { re turn nullptr; } | 746 virtual LayoutMultiColumnSpannerPlaceholder* spannerPlaceholder() const { re turn nullptr; } |
751 bool isColumnSpanAll() const { return style()->columnSpan() == ColumnSpanAll && spannerPlaceholder(); } | 747 bool isColumnSpanAll() const { return style()->columnSpan() == ColumnSpanAll && spannerPlaceholder(); } |
752 | 748 |
749 // We include isLayoutButton in this check because buttons are implemented | |
750 // using flex box but should still support first-line|first-letter. | |
751 // The flex box and grid specs require that flex box and grid do not | |
752 // support first-line|first-letter, though. | |
753 // TODO(layout-team): Remove when buttons are implemented with align-items i nstead | |
mstensho (USE GERRIT)
2015/12/03 12:08:10
A reference to crbug.com/226252 here? Not sure if
Xianzhu
2015/12/03 17:38:22
Done.
| |
754 // of flex box. | |
755 bool canHaveFirstLineOrFirstLetterStyle() const { return isLayoutBlockFlow() || isLayoutButton(); } | |
756 | |
753 // This function returns the containing block of the object. | 757 // This function returns the containing block of the object. |
754 // Due to CSS being inconsistent, a containing block can be a relatively | 758 // Due to CSS being inconsistent, a containing block can be a relatively |
755 // positioned inline, thus we can't return a LayoutBlock from this function. | 759 // positioned inline, thus we can't return a LayoutBlock from this function. |
756 // | 760 // |
757 // This method is extremely similar to containingBlock(), but with a few | 761 // This method is extremely similar to containingBlock(), but with a few |
758 // notable exceptions. | 762 // notable exceptions. |
759 // (1) It can be used on orphaned subtrees, i.e., it can be called safely | 763 // (1) It can be used on orphaned subtrees, i.e., it can be called safely |
760 // even when the object is not part of the primary document subtree yet. | 764 // even when the object is not part of the primary document subtree yet. |
761 // (2) For normal flow elements, it just returns the parent. | 765 // (2) For normal flow elements, it just returns the parent. |
762 // (3) For absolute positioned elements, it will return a relative | 766 // (3) For absolute positioned elements, it will return a relative |
(...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2037 void showTree(const blink::LayoutObject*); | 2041 void showTree(const blink::LayoutObject*); |
2038 void showLineTree(const blink::LayoutObject*); | 2042 void showLineTree(const blink::LayoutObject*); |
2039 void showLayoutTree(const blink::LayoutObject* object1); | 2043 void showLayoutTree(const blink::LayoutObject* object1); |
2040 // We don't make object2 an optional parameter so that showLayoutTree | 2044 // We don't make object2 an optional parameter so that showLayoutTree |
2041 // can be called from gdb easily. | 2045 // can be called from gdb easily. |
2042 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2); | 2046 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2); |
2043 | 2047 |
2044 #endif | 2048 #endif |
2045 | 2049 |
2046 #endif // LayoutObject_h | 2050 #endif // LayoutObject_h |
OLD | NEW |