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

Side by Side Diff: Source/WebCore/css/CSSPrimitiveValue.cpp

Issue 7941005: Merge 95071 - Fix cssText property of counter-valued CSSPrimitiveValue and avoid uninitialized read (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 years, 3 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
« no previous file with comments | « no previous file | no next file » | 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 * (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 754 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 result.uncheckedAppend(')'); 765 result.uncheckedAppend(')');
766 766
767 text = String::adopt(result); 767 text = String::adopt(result);
768 break; 768 break;
769 } 769 }
770 case CSS_COUNTER_NAME: 770 case CSS_COUNTER_NAME:
771 text = "counter("; 771 text = "counter(";
772 text += m_value.string; 772 text += m_value.string;
773 text += ")"; 773 text += ")";
774 break; 774 break;
775 case CSS_COUNTER: 775 case CSS_COUNTER: {
776 text = "counter("; 776 String separator = m_value.counter->separator();
777 text += String::number(m_value.num); 777 text = separator.isEmpty() ? "counter(" : "counters(";
778 text += m_value.counter->identifier();
779 if (!separator.isEmpty()) {
780 text += ", ";
781 text += quoteCSSStringIfNeeded(separator);
782 }
783 const char* listStyleName = getValueName(m_value.counter->listStyleN umber() + CSSValueDisc);
784 if (listStyleName) {
785 text += ", ";
786 text += listStyleName;
787 }
778 text += ")"; 788 text += ")";
779 // FIXME: Add list-style and separator
780 break; 789 break;
790 }
781 case CSS_RECT: { 791 case CSS_RECT: {
782 DEFINE_STATIC_LOCAL(const String, rectParen, ("rect(")); 792 DEFINE_STATIC_LOCAL(const String, rectParen, ("rect("));
783 793
784 Rect* rectVal = getRectValue(); 794 Rect* rectVal = getRectValue();
785 Vector<UChar> result; 795 Vector<UChar> result;
786 result.reserveInitialCapacity(32); 796 result.reserveInitialCapacity(32);
787 append(result, rectParen); 797 append(result, rectParen);
788 798
789 append(result, rectVal->top()->cssText()); 799 append(result, rectVal->top()->cssText());
790 result.append(' '); 800 result.append(' ');
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 return text; 900 return text;
891 } 901 }
892 902
893 void CSSPrimitiveValue::addSubresourceStyleURLs(ListHashSet<KURL>& urls, const C SSStyleSheet* styleSheet) 903 void CSSPrimitiveValue::addSubresourceStyleURLs(ListHashSet<KURL>& urls, const C SSStyleSheet* styleSheet)
894 { 904 {
895 if (m_type == CSS_URI) 905 if (m_type == CSS_URI)
896 addSubresourceURL(urls, styleSheet->completeURL(m_value.string)); 906 addSubresourceURL(urls, styleSheet->completeURL(m_value.string));
897 } 907 }
898 908
899 } // namespace WebCore 909 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698