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

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

Issue 2879813002: Make ComputedStyleBase a templated class to allow it to use functions on ComputedStyle (Closed)
Patch Set: alancutter@'s suggestions Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
6 * All rights reserved. 6 * All rights reserved.
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 state.SetStyle(ComputedStyle::Clone(*base_computed_style)); 688 state.SetStyle(ComputedStyle::Clone(*base_computed_style));
689 if (!state.ParentStyle()) { 689 if (!state.ParentStyle()) {
690 state.SetParentStyle(InitialStyleForElement()); 690 state.SetParentStyle(InitialStyleForElement());
691 state.SetLayoutParentStyle(state.ParentStyle()); 691 state.SetLayoutParentStyle(state.ParentStyle());
692 } 692 }
693 } else { 693 } else {
694 if (state.ParentStyle()) { 694 if (state.ParentStyle()) {
695 RefPtr<ComputedStyle> style = ComputedStyle::Create(); 695 RefPtr<ComputedStyle> style = ComputedStyle::Create();
696 style->InheritFrom(*state.ParentStyle(), 696 style->InheritFrom(*state.ParentStyle(),
697 IsAtShadowBoundary(element) 697 IsAtShadowBoundary(element)
698 ? ComputedStyleBase::kAtShadowBoundary 698 ? ComputedStyle::kAtShadowBoundary
699 : ComputedStyleBase::kNotAtShadowBoundary); 699 : ComputedStyle::kNotAtShadowBoundary);
700 state.SetStyle(std::move(style)); 700 state.SetStyle(std::move(style));
701 } else { 701 } else {
702 state.SetStyle(InitialStyleForElement()); 702 state.SetStyle(InitialStyleForElement());
703 state.SetParentStyle(ComputedStyle::Clone(*state.Style())); 703 state.SetParentStyle(ComputedStyle::Clone(*state.Style()));
704 state.SetLayoutParentStyle(state.ParentStyle()); 704 state.SetLayoutParentStyle(state.ParentStyle());
705 } 705 }
706 } 706 }
707 707
708 // contenteditable attribute (implemented by -webkit-user-modify) should 708 // contenteditable attribute (implemented by -webkit-user-modify) should
709 // be propagated from shadow host to distributed node. 709 // be propagated from shadow host to distributed node.
(...skipping 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after
2034 2034
2035 DEFINE_TRACE(StyleResolver) { 2035 DEFINE_TRACE(StyleResolver) {
2036 visitor->Trace(matched_properties_cache_); 2036 visitor->Trace(matched_properties_cache_);
2037 visitor->Trace(selector_filter_); 2037 visitor->Trace(selector_filter_);
2038 visitor->Trace(style_sharing_lists_); 2038 visitor->Trace(style_sharing_lists_);
2039 visitor->Trace(document_); 2039 visitor->Trace(document_);
2040 visitor->Trace(tracker_); 2040 visitor->Trace(tracker_);
2041 } 2041 }
2042 2042
2043 } // namespace blink 2043 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698