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

Side by Side Diff: Source/core/layout/GeneratedChildren.h

Issue 1122323002: Cleanup: Remove LayoutRegion. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase master Created 5 years, 7 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
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/layout/LayoutBlock.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef GeneratedChildren_h 5 #ifndef GeneratedChildren_h
6 #define GeneratedChildren_h 6 #define GeneratedChildren_h
7 7
8 #include "core/layout/LayoutObject.h" 8 #include "core/layout/LayoutObject.h"
9 9
10 namespace blink { 10 namespace blink {
11 11
12 // We only create "generated" child layoutObjects like one for first-letter if: 12 // We only create "generated" child layoutObjects like one for first-letter if:
13 // - the firstLetterBlock can have children in the DOM and 13 // - the firstLetterBlock can have children in the DOM and
14 // - the block doesn't have any special assumption on its text children. 14 // - the block doesn't have any special assumption on its text children.
15 // This correctly prevents form controls from having such layoutObjects. 15 // This correctly prevents form controls from having such layoutObjects.
16 static bool canHaveGeneratedChildren(const LayoutObject& layoutObject) 16 static bool canHaveGeneratedChildren(const LayoutObject& layoutObject)
17 { 17 {
18 // FIXME: LayoutMedia::layout makes assumptions about what children are allo wed 18 // FIXME: LayoutMedia::layout makes assumptions about what children are allo wed
19 // so we can't support generated content. 19 // so we can't support generated content.
20 if (layoutObject.isMedia() || layoutObject.isTextControl() || layoutObject.i sMenuList()) 20 if (layoutObject.isMedia() || layoutObject.isTextControl() || layoutObject.i sMenuList())
21 return false; 21 return false;
22 22
23 if (layoutObject.isLayoutRegion())
24 return true;
25
26 // Input elements can't have generated children, but button elements can. We 'll 23 // Input elements can't have generated children, but button elements can. We 'll
27 // write the code assuming any other button types that might emerge in the f uture 24 // write the code assuming any other button types that might emerge in the f uture
28 // can also have children. 25 // can also have children.
29 if (layoutObject.isLayoutButton()) 26 if (layoutObject.isLayoutButton())
30 return !isHTMLInputElement(*layoutObject.node()); 27 return !isHTMLInputElement(*layoutObject.node());
31 28
32 return layoutObject.canHaveChildren(); 29 return layoutObject.canHaveChildren();
33 } 30 }
34 31
35 } // namespace blink 32 } // namespace blink
36 33
37 #endif // GeneratedChildren_h 34 #endif // GeneratedChildren_h
OLDNEW
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/layout/LayoutBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698