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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObject.h

Issue 2727853002: [css-display] Support display: contents pseudo-elements.
Patch Set: Add missing nullcheck (whoops). Created 3 years, 9 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
OLDNEW
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. 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2009 Google Inc. All rights reserved. 8 * Copyright (C) 2009 Google Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 12 matching lines...) Expand all
23 * Boston, MA 02110-1301, USA. 23 * Boston, MA 02110-1301, USA.
24 * 24 *
25 */ 25 */
26 26
27 #ifndef LayoutObject_h 27 #ifndef LayoutObject_h
28 #define LayoutObject_h 28 #define LayoutObject_h
29 29
30 #include "core/CoreExport.h" 30 #include "core/CoreExport.h"
31 #include "core/dom/Document.h" 31 #include "core/dom/Document.h"
32 #include "core/dom/DocumentLifecycle.h" 32 #include "core/dom/DocumentLifecycle.h"
33 #include "core/dom/PseudoElement.h"
33 #include "core/editing/PositionWithAffinity.h" 34 #include "core/editing/PositionWithAffinity.h"
34 #include "core/layout/LayoutObjectChildList.h" 35 #include "core/layout/LayoutObjectChildList.h"
35 #include "core/layout/MapCoordinatesFlags.h" 36 #include "core/layout/MapCoordinatesFlags.h"
36 #include "core/layout/PaintInvalidationState.h" 37 #include "core/layout/PaintInvalidationState.h"
37 #include "core/layout/ScrollAlignment.h" 38 #include "core/layout/ScrollAlignment.h"
38 #include "core/layout/SubtreeLayoutScope.h" 39 #include "core/layout/SubtreeLayoutScope.h"
39 #include "core/layout/api/HitTestAction.h" 40 #include "core/layout/api/HitTestAction.h"
40 #include "core/layout/api/SelectionState.h" 41 #include "core/layout/api/SelectionState.h"
41 #include "core/layout/compositing/CompositingState.h" 42 #include "core/layout/compositing/CompositingState.h"
42 #include "core/loader/resource/ImageResourceObserver.h" 43 #include "core/loader/resource/ImageResourceObserver.h"
(...skipping 18 matching lines...) Expand all
61 class HitTestResult; 62 class HitTestResult;
62 class InlineBox; 63 class InlineBox;
63 class LayoutBoxModelObject; 64 class LayoutBoxModelObject;
64 class LayoutBlock; 65 class LayoutBlock;
65 class LayoutFlowThread; 66 class LayoutFlowThread;
66 class LayoutGeometryMap; 67 class LayoutGeometryMap;
67 class LayoutMultiColumnSpannerPlaceholder; 68 class LayoutMultiColumnSpannerPlaceholder;
68 class LayoutView; 69 class LayoutView;
69 class ObjectPaintProperties; 70 class ObjectPaintProperties;
70 class PaintLayer; 71 class PaintLayer;
72 class PseudoElement;
71 class PseudoStyleRequest; 73 class PseudoStyleRequest;
72 74
73 struct PaintInfo; 75 struct PaintInfo;
74 struct PaintInvalidatorContext; 76 struct PaintInvalidatorContext;
75 77
76 enum CursorDirective { SetCursorBasedOnStyle, SetCursor, DoNotSetCursor }; 78 enum CursorDirective { SetCursorBasedOnStyle, SetCursor, DoNotSetCursor };
77 79
78 enum HitTestFilter { HitTestAll, HitTestSelf, HitTestDescendants }; 80 enum HitTestFilter { HitTestAll, HitTestSelf, HitTestDescendants };
79 81
80 enum MarkingBehavior { 82 enum MarkingBehavior {
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 // function also doesn't handle the default association between a tag 468 // function also doesn't handle the default association between a tag
467 // and its renderer (e.g. <iframe> creates a LayoutIFrame even if the 469 // and its renderer (e.g. <iframe> creates a LayoutIFrame even if the
468 // initial 'display' value is inline). 470 // initial 'display' value is inline).
469 static LayoutObject* createObject(Element*, const ComputedStyle&); 471 static LayoutObject* createObject(Element*, const ComputedStyle&);
470 472
471 // LayoutObjects are allocated out of the rendering partition. 473 // LayoutObjects are allocated out of the rendering partition.
472 void* operator new(size_t); 474 void* operator new(size_t);
473 void operator delete(void*); 475 void operator delete(void*);
474 476
475 bool isPseudoElement() const { return node() && node()->isPseudoElement(); } 477 bool isPseudoElement() const { return node() && node()->isPseudoElement(); }
478 bool isPseudoElementGeneratedContentFor(const PseudoElement&) const;
476 479
477 virtual bool isBoxModelObject() const { return false; } 480 virtual bool isBoxModelObject() const { return false; }
478 bool isBR() const { return isOfType(LayoutObjectBr); } 481 bool isBR() const { return isOfType(LayoutObjectBr); }
479 bool isCanvas() const { return isOfType(LayoutObjectCanvas); } 482 bool isCanvas() const { return isOfType(LayoutObjectCanvas); }
480 bool isCounter() const { return isOfType(LayoutObjectCounter); } 483 bool isCounter() const { return isOfType(LayoutObjectCounter); }
481 bool isDetailsMarker() const { return isOfType(LayoutObjectDetailsMarker); } 484 bool isDetailsMarker() const { return isOfType(LayoutObjectDetailsMarker); }
482 bool isEmbeddedObject() const { return isOfType(LayoutObjectEmbeddedObject); } 485 bool isEmbeddedObject() const { return isOfType(LayoutObjectEmbeddedObject); }
483 bool isFieldset() const { return isOfType(LayoutObjectFieldset); } 486 bool isFieldset() const { return isOfType(LayoutObjectFieldset); }
484 bool isFileUploadControl() const { 487 bool isFileUploadControl() const {
485 return isOfType(LayoutObjectFileUploadControl); 488 return isOfType(LayoutObjectFileUploadControl);
(...skipping 1493 matching lines...) Expand 10 before | Expand all | Expand 10 after
1979 // Tree tear-down is when the whole tree destroyed during navigation. It is 1982 // Tree tear-down is when the whole tree destroyed during navigation. It is
1980 // handled in the code by checking if documentBeingDestroyed() returns 'true'. 1983 // handled in the code by checking if documentBeingDestroyed() returns 'true'.
1981 // In this case, the code skips some unneeded expensive operations as we know 1984 // In this case, the code skips some unneeded expensive operations as we know
1982 // the tree is not reused (e.g. avoid clearing the containing block's line 1985 // the tree is not reused (e.g. avoid clearing the containing block's line
1983 // box). 1986 // box).
1984 virtual void willBeDestroyed(); 1987 virtual void willBeDestroyed();
1985 1988
1986 virtual void insertedIntoTree(); 1989 virtual void insertedIntoTree();
1987 virtual void willBeRemovedFromTree(); 1990 virtual void willBeRemovedFromTree();
1988 1991
1992 void setPseudoForAnonymous(PseudoElement& pseudo) {
1993 DCHECK(isAnonymous());
1994 m_node = &pseudo;
1995 }
1996
1989 void setDocumentForAnonymous(Document* document) { 1997 void setDocumentForAnonymous(Document* document) {
1990 DCHECK(isAnonymous()); 1998 DCHECK(isAnonymous());
1991 m_node = document; 1999 m_node = document;
1992 } 2000 }
1993 2001
1994 // Add hit-test rects for the layout tree rooted at this node to the provided 2002 // Add hit-test rects for the layout tree rooted at this node to the provided
1995 // collection on a per-Layer basis. 2003 // collection on a per-Layer basis.
1996 // currentLayer must be the enclosing layer, and layerOffset is the current 2004 // currentLayer must be the enclosing layer, and layerOffset is the current
1997 // offset within this layer. Subclass implementations will add any offset for 2005 // offset within this layer. Subclass implementations will add any offset for
1998 // this layoutObject within it's container, so callers should provide only the 2006 // this layoutObject within it's container, so callers should provide only the
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
2777 CORE_EXPORT void showLineTree(const blink::LayoutObject*); 2785 CORE_EXPORT void showLineTree(const blink::LayoutObject*);
2778 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1); 2786 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1);
2779 // We don't make object2 an optional parameter so that showLayoutTree 2787 // We don't make object2 an optional parameter so that showLayoutTree
2780 // can be called from gdb easily. 2788 // can be called from gdb easily.
2781 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1, 2789 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1,
2782 const blink::LayoutObject* object2); 2790 const blink::LayoutObject* object2);
2783 2791
2784 #endif 2792 #endif
2785 2793
2786 #endif // LayoutObject_h 2794 #endif // LayoutObject_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698