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

Side by Side Diff: third_party/WebKit/WebCore/css/CSSPrimitiveValue.cpp

Issue 20076: WebKit merge 40500:40539 [WebKit side] (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 text = "counter("; 761 text = "counter(";
762 text += String::number(m_value.num); 762 text += String::number(m_value.num);
763 text += ")"; 763 text += ")";
764 // FIXME: Add list-style and separator 764 // FIXME: Add list-style and separator
765 break; 765 break;
766 case CSS_RECT: { 766 case CSS_RECT: {
767 DEFINE_STATIC_LOCAL(const String, rectParen, ("rect(")); 767 DEFINE_STATIC_LOCAL(const String, rectParen, ("rect("));
768 768
769 Rect* rectVal = getRectValue(); 769 Rect* rectVal = getRectValue();
770 Vector<UChar> result; 770 Vector<UChar> result;
771 result.reserveCapacity(32); 771 result.reserveInitialCapacity(32);
772 append(result, rectParen); 772 append(result, rectParen);
773 773
774 append(result, rectVal->top()->cssText()); 774 append(result, rectVal->top()->cssText());
775 result.append(' '); 775 result.append(' ');
776 776
777 append(result, rectVal->right()->cssText()); 777 append(result, rectVal->right()->cssText());
778 result.append(' '); 778 result.append(' ');
779 779
780 append(result, rectVal->bottom()->cssText()); 780 append(result, rectVal->bottom()->cssText());
781 result.append(' '); 781 result.append(' ');
782 782
783 append(result, rectVal->left()->cssText()); 783 append(result, rectVal->left()->cssText());
784 result.append(')'); 784 result.append(')');
785 785
786 return String::adopt(result); 786 return String::adopt(result);
787 } 787 }
788 case CSS_RGBCOLOR: 788 case CSS_RGBCOLOR:
789 case CSS_PARSER_HEXCOLOR: { 789 case CSS_PARSER_HEXCOLOR: {
790 DEFINE_STATIC_LOCAL(const String, commaSpace, (", ")); 790 DEFINE_STATIC_LOCAL(const String, commaSpace, (", "));
791 DEFINE_STATIC_LOCAL(const String, rgbParen, ("rgb(")); 791 DEFINE_STATIC_LOCAL(const String, rgbParen, ("rgb("));
792 DEFINE_STATIC_LOCAL(const String, rgbaParen, ("rgba(")); 792 DEFINE_STATIC_LOCAL(const String, rgbaParen, ("rgba("));
793 793
794 RGBA32 rgbColor = m_value.rgbcolor; 794 RGBA32 rgbColor = m_value.rgbcolor;
795 if (m_type == CSS_PARSER_HEXCOLOR) 795 if (m_type == CSS_PARSER_HEXCOLOR)
796 Color::parseHexColor(m_value.string, rgbColor); 796 Color::parseHexColor(m_value.string, rgbColor);
797 Color color(rgbColor); 797 Color color(rgbColor);
798 798
799 Vector<UChar> result; 799 Vector<UChar> result;
800 result.reserveCapacity(32); 800 result.reserveInitialCapacity(32);
801 if (color.hasAlpha()) 801 if (color.hasAlpha())
802 append(result, rgbaParen); 802 append(result, rgbaParen);
803 else 803 else
804 append(result, rgbParen); 804 append(result, rgbParen);
805 805
806 appendNumber(result, static_cast<unsigned char>(color.red())); 806 appendNumber(result, static_cast<unsigned char>(color.red()));
807 append(result, commaSpace); 807 append(result, commaSpace);
808 808
809 appendNumber(result, static_cast<unsigned char>(color.green())); 809 appendNumber(result, static_cast<unsigned char>(color.green()));
810 append(result, commaSpace); 810 append(result, commaSpace);
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
947 } 947 }
948 948
949 void CSSPrimitiveValue::addSubresourceStyleURLs(ListHashSet<KURL>& urls, const C SSStyleSheet* styleSheet) 949 void CSSPrimitiveValue::addSubresourceStyleURLs(ListHashSet<KURL>& urls, const C SSStyleSheet* styleSheet)
950 { 950 {
951 if (m_type == CSS_URI) 951 if (m_type == CSS_URI)
952 addSubresourceURL(urls, styleSheet->completeURL(m_value.string)); 952 addSubresourceURL(urls, styleSheet->completeURL(m_value.string));
953 } 953 }
954 954
955 } // namespace WebCore 955 } // namespace WebCore
956 956
OLDNEW
« no previous file with comments | « third_party/WebKit/WebCore/css/CSSMutableStyleDeclaration.cpp ('k') | third_party/WebKit/WebCore/css/CSSStyleDeclaration.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698