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

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

Issue 2220253002: [Typed-OM] Add Image typedom_types to properties and enable them to be set with StyleMap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@CSSURLImageValue
Patch Set: Add comments Created 4 years, 4 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) 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 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 } 675 }
676 676
677 void StyleBuilderFunctions::applyValueCSSPropertyContent(StyleResolverState& sta te, const CSSValue& value) 677 void StyleBuilderFunctions::applyValueCSSPropertyContent(StyleResolverState& sta te, const CSSValue& value)
678 { 678 {
679 if (value.isPrimitiveValue()) { 679 if (value.isPrimitiveValue()) {
680 DCHECK(toCSSPrimitiveValue(value).getValueID() == CSSValueNormal || toCS SPrimitiveValue(value).getValueID() == CSSValueNone); 680 DCHECK(toCSSPrimitiveValue(value).getValueID() == CSSValueNormal || toCS SPrimitiveValue(value).getValueID() == CSSValueNone);
681 state.style()->setContent(nullptr); 681 state.style()->setContent(nullptr);
682 return; 682 return;
683 } 683 }
684 684
685 if (value.isImageValue()) {
686 state.style()->setContent(ContentData::create(state.styleImage(CSSProper tyContent, value)));
687 return;
688 }
meade_UTC10 2016/08/10 07:16:05 What's this for?
anthonyhkf 2016/08/10 07:26:09 I cannot use "styleMap.set('content', ...)" if it
Timothy Loh 2016/08/10 07:44:05 Aside from the values 'none' and 'normal', content
meade_UTC10 2016/08/11 00:44:41 Also, if a reviewer asks you to do something and y
689
685 ContentData* firstContent = nullptr; 690 ContentData* firstContent = nullptr;
686 ContentData* prevContent = nullptr; 691 ContentData* prevContent = nullptr;
687 for (auto& item : toCSSValueList(value)) { 692 for (auto& item : toCSSValueList(value)) {
688 ContentData* nextContent = nullptr; 693 ContentData* nextContent = nullptr;
689 if (item->isImageGeneratorValue() || item->isImageSetValue() || item->is ImageValue()) { 694 if (item->isImageGeneratorValue() || item->isImageSetValue() || item->is ImageValue()) {
690 nextContent = ContentData::create(state.styleImage(CSSPropertyConten t, *item)); 695 nextContent = ContentData::create(state.styleImage(CSSPropertyConten t, *item));
691 } else if (item->isCounterValue()) { 696 } else if (item->isCounterValue()) {
692 const CSSCounterValue* counterValue = toCSSCounterValue(item.get()); 697 const CSSCounterValue* counterValue = toCSSCounterValue(item.get());
693 EListStyleType listStyleType = NoneListStyle; 698 EListStyleType listStyleType = NoneListStyle;
694 CSSValueID listStyleIdent = counterValue->listStyle(); 699 CSSValueID listStyleIdent = counterValue->listStyle();
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 } 863 }
859 } 864 }
860 865
861 void StyleBuilderFunctions::applyInheritCSSPropertyPosition(StyleResolverState& state) 866 void StyleBuilderFunctions::applyInheritCSSPropertyPosition(StyleResolverState& state)
862 { 867 {
863 if (!state.parentNode()->isDocumentNode()) 868 if (!state.parentNode()->isDocumentNode())
864 state.style()->setPosition(state.parentStyle()->position()); 869 state.style()->setPosition(state.parentStyle()->position());
865 } 870 }
866 871
867 } // namespace blink 872 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698