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

Side by Side Diff: Source/core/css/resolver/StyleBuilderCustom.cpp

Issue 772103002: Collect content:attr(...)-features in RuleFeatureSet. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Avoid findPropertyIndex when possible. Created 6 years 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
« no previous file with comments | « Source/core/css/RuleFeature.cpp ('k') | Source/core/css/resolver/StyleResolver.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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. 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. (http://www.t orchmobile.com/) 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 } else if (contentValue->isAttr()) { 790 } else if (contentValue->isAttr()) {
791 // FIXME: Can a namespace be specified for an attr(foo)? 791 // FIXME: Can a namespace be specified for an attr(foo)?
792 if (state.style()->styleType() == NOPSEUDO) 792 if (state.style()->styleType() == NOPSEUDO)
793 state.style()->setUnique(); 793 state.style()->setUnique();
794 else 794 else
795 state.parentStyle()->setUnique(); 795 state.parentStyle()->setUnique();
796 QualifiedName attr(nullAtom, AtomicString(contentValue->getStringVal ue()), nullAtom); 796 QualifiedName attr(nullAtom, AtomicString(contentValue->getStringVal ue()), nullAtom);
797 const AtomicString& value = state.element()->getAttribute(attr); 797 const AtomicString& value = state.element()->getAttribute(attr);
798 state.style()->setContent(value.isNull() ? emptyString() : value.str ing(), didSet); 798 state.style()->setContent(value.isNull() ? emptyString() : value.str ing(), didSet);
799 didSet = true; 799 didSet = true;
800 // register the fact that the attribute value affects the style
801 state.contentAttrValues().append(attr.localName());
802 } else if (contentValue->isCounter()) { 800 } else if (contentValue->isCounter()) {
803 Counter* counterValue = contentValue->getCounterValue(); 801 Counter* counterValue = contentValue->getCounterValue();
804 EListStyleType listStyleType = NoneListStyle; 802 EListStyleType listStyleType = NoneListStyle;
805 CSSValueID listStyleIdent = counterValue->listStyleIdent(); 803 CSSValueID listStyleIdent = counterValue->listStyleIdent();
806 if (listStyleIdent != CSSValueNone) 804 if (listStyleIdent != CSSValueNone)
807 listStyleType = static_cast<EListStyleType>(listStyleIdent - CSS ValueDisc); 805 listStyleType = static_cast<EListStyleType>(listStyleIdent - CSS ValueDisc);
808 OwnPtr<CounterContent> counter = adoptPtr(new CounterContent(AtomicS tring(counterValue->identifier()), listStyleType, AtomicString(counterValue->sep arator()))); 806 OwnPtr<CounterContent> counter = adoptPtr(new CounterContent(AtomicS tring(counterValue->identifier()), listStyleType, AtomicString(counterValue->sep arator())));
809 state.style()->setContent(counter.release(), didSet); 807 state.style()->setContent(counter.release(), didSet);
810 didSet = true; 808 didSet = true;
811 } else { 809 } else {
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 return; 905 return;
908 case CSSValueSuper: 906 case CSSValueSuper:
909 svgStyle.setBaselineShift(BS_SUPER); 907 svgStyle.setBaselineShift(BS_SUPER);
910 return; 908 return;
911 default: 909 default:
912 ASSERT_NOT_REACHED(); 910 ASSERT_NOT_REACHED();
913 } 911 }
914 } 912 }
915 913
916 } // namespace blink 914 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/RuleFeature.cpp ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698