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

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

Issue 1812763002: Pseudo and non pseudo elements should return correct computed content value (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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) 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 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 } 650 }
651 651
652 void StyleBuilderFunctions::applyInheritCSSPropertyContent(StyleResolverState&) 652 void StyleBuilderFunctions::applyInheritCSSPropertyContent(StyleResolverState&)
653 { 653 {
654 // FIXME: In CSS3, it will be possible to inherit content. In CSS2 it is not . This 654 // FIXME: In CSS3, it will be possible to inherit content. In CSS2 it is not . This
655 // note is a reminder that eventually "inherit" needs to be supported. 655 // note is a reminder that eventually "inherit" needs to be supported.
656 } 656 }
657 657
658 void StyleBuilderFunctions::applyValueCSSPropertyContent(StyleResolverState& sta te, CSSValue* value) 658 void StyleBuilderFunctions::applyValueCSSPropertyContent(StyleResolverState& sta te, CSSValue* value)
659 { 659 {
660 bool didSet = false;
661 if (state.style()->hasPseudoElementStyle()) {
662 state.style()->setContent(ContentDataNormal, didSet);
663 return;
664 }
665
660 // list of string, uri, counter, attr, i 666 // list of string, uri, counter, attr, i
661 667
662 bool didSet = false;
663 for (auto& item : toCSSValueList(*value)) { 668 for (auto& item : toCSSValueList(*value)) {
664 if (item->isImageGeneratorValue()) { 669 if (item->isImageGeneratorValue()) {
665 state.style()->setContent(StyleGeneratedImage::create(toCSSImageGene ratorValue(*item)), didSet); 670 state.style()->setContent(StyleGeneratedImage::create(toCSSImageGene ratorValue(*item)), didSet);
666 didSet = true; 671 didSet = true;
667 } else if (item->isImageSetValue()) { 672 } else if (item->isImageSetValue()) {
668 state.style()->setContent(state.elementStyleResources().setOrPending FromValue(CSSPropertyContent, toCSSImageSetValue(*item)), didSet); 673 state.style()->setContent(state.elementStyleResources().setOrPending FromValue(CSSPropertyContent, toCSSImageSetValue(*item)), didSet);
669 didSet = true; 674 didSet = true;
670 } 675 }
671 676
672 if (item->isImageValue()) { 677 if (item->isImageValue()) {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 didSet = true; 722 didSet = true;
718 break; 723 break;
719 case CSSValueNoOpenQuote: 724 case CSSValueNoOpenQuote:
720 state.style()->setContent(NO_OPEN_QUOTE, didSet); 725 state.style()->setContent(NO_OPEN_QUOTE, didSet);
721 didSet = true; 726 didSet = true;
722 break; 727 break;
723 case CSSValueNoCloseQuote: 728 case CSSValueNoCloseQuote:
724 state.style()->setContent(NO_CLOSE_QUOTE, didSet); 729 state.style()->setContent(NO_CLOSE_QUOTE, didSet);
725 didSet = true; 730 didSet = true;
726 break; 731 break;
732 case CSSValueNormal:
733 if (state.style()->styleType() == PseudoIdBefore || state.style( )->styleType() == PseudoIdAfter) {
734 state.style()->setContent(ContentDataNone, didSet);
735 didSet = true;
736 } else {
737 didSet = false;
738 }
739 break;
727 default: 740 default:
728 // normal and none do not have any effect. 741 // none does not have any effect.
729 { } 742 { }
730 } 743 }
731 } 744 }
732 } 745 }
733 if (!didSet) 746 if (!didSet)
734 state.style()->clearContent(); 747 state.style()->clearContent();
735 } 748 }
736 749
737 void StyleBuilderFunctions::applyValueCSSPropertyWebkitLocale(StyleResolverState & state, CSSValue* value) 750 void StyleBuilderFunctions::applyValueCSSPropertyWebkitLocale(StyleResolverState & state, CSSValue* value)
738 { 751 {
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 } 855 }
843 } 856 }
844 857
845 void StyleBuilderFunctions::applyInheritCSSPropertyPosition(StyleResolverState& state) 858 void StyleBuilderFunctions::applyInheritCSSPropertyPosition(StyleResolverState& state)
846 { 859 {
847 if (!state.parentNode()->isDocumentNode()) 860 if (!state.parentNode()->isDocumentNode())
848 state.style()->setPosition(state.parentStyle()->position()); 861 state.style()->setPosition(state.parentStyle()->position());
849 } 862 }
850 863
851 } // namespace blink 864 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698