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

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/ElementResolveContext.cpp

Issue 2450093005: Support display: contents for elements, first-line and first-letter pseudos. (Closed)
Patch Set: Support display: contents for elements, first-line and first-letter pseudos. Created 3 years, 10 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 15 matching lines...) Expand all
26 #include "core/dom/Node.h" 26 #include "core/dom/Node.h"
27 #include "core/dom/NodeComputedStyle.h" 27 #include "core/dom/NodeComputedStyle.h"
28 #include "core/dom/VisitedLinkState.h" 28 #include "core/dom/VisitedLinkState.h"
29 #include "core/dom/shadow/InsertionPoint.h" 29 #include "core/dom/shadow/InsertionPoint.h"
30 30
31 namespace blink { 31 namespace blink {
32 32
33 ElementResolveContext::ElementResolveContext(const Document& document) 33 ElementResolveContext::ElementResolveContext(const Document& document)
34 : m_element(nullptr), 34 : m_element(nullptr),
35 m_parentNode(nullptr), 35 m_parentNode(nullptr),
36 m_layoutParent(nullptr),
36 m_rootElementStyle(document.documentElement() 37 m_rootElementStyle(document.documentElement()
37 ? document.documentElement()->computedStyle() 38 ? document.documentElement()->computedStyle()
38 : document.computedStyle()), 39 : document.computedStyle()),
39 m_elementLinkState(EInsideLink::kNotInsideLink), 40 m_elementLinkState(EInsideLink::kNotInsideLink),
40 m_distributedToInsertionPoint(false) {} 41 m_distributedToInsertionPoint(false) {}
41 42
42 ElementResolveContext::ElementResolveContext(Element& element) 43 ElementResolveContext::ElementResolveContext(Element& element)
43 : m_element(&element), 44 : m_element(&element),
44 m_elementLinkState( 45 m_elementLinkState(
45 element.document().visitedLinkState().determineLinkState(element)), 46 element.document().visitedLinkState().determineLinkState(element)),
46 m_distributedToInsertionPoint(false) { 47 m_distributedToInsertionPoint(false) {
47 LayoutTreeBuilderTraversal::ParentDetails parentDetails; 48 LayoutTreeBuilderTraversal::ParentDetails parentDetails;
48 m_parentNode = 49 if (element.isActiveSlotOrActiveInsertionPoint()) {
49 element.isActiveSlotOrActiveInsertionPoint() 50 m_parentNode = nullptr;
50 ? nullptr 51 m_layoutParent = nullptr;
51 : LayoutTreeBuilderTraversal::parent(element, &parentDetails); 52 } else {
53 m_parentNode = LayoutTreeBuilderTraversal::parent(element);
54 m_layoutParent =
55 LayoutTreeBuilderTraversal::layoutParent(element, &parentDetails);
56 }
52 m_distributedToInsertionPoint = parentDetails.insertionPoint(); 57 m_distributedToInsertionPoint = parentDetails.insertionPoint();
53 58
54 const Document& document = element.document(); 59 const Document& document = element.document();
55 Node* documentElement = document.documentElement(); 60 Node* documentElement = document.documentElement();
56 const ComputedStyle* documentStyle = document.computedStyle(); 61 const ComputedStyle* documentStyle = document.computedStyle();
57 m_rootElementStyle = documentElement && element != documentElement 62 m_rootElementStyle = documentElement && element != documentElement
58 ? documentElement->computedStyle() 63 ? documentElement->computedStyle()
59 : documentStyle; 64 : documentStyle;
60 if (!m_rootElementStyle) 65 if (!m_rootElementStyle)
61 m_rootElementStyle = documentStyle; 66 m_rootElementStyle = documentStyle;
62 } 67 }
63 68
64 } // namespace blink 69 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698