remove CSS quotes property

The support was gone, this is just dead code.

R=ianh@google.com, ojan@chromium.org

Review URL: https://codereview.chromium.org/1070263002
This commit is contained in:
Eric Seidel 2015-04-09 14:22:29 -07:00
parent 559fd24b7e
commit 9cdf9ad09f
14 changed files with 0 additions and 197 deletions

View File

@ -963,8 +963,6 @@ sky_core_files = [
"rendering/style/NinePieceImage.cpp",
"rendering/style/NinePieceImage.h",
"rendering/style/OutlineValue.h",
"rendering/style/QuotesData.cpp",
"rendering/style/QuotesData.h",
"rendering/style/RenderStyle.cpp",
"rendering/style/RenderStyle.h",
"rendering/style/RenderStyleConstants.h",

View File

@ -2082,7 +2082,6 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
/* Other unimplemented properties */
case CSSPropertyPage: // for @page
case CSSPropertyQuotes: // FIXME: needs implementation
case CSSPropertySize: // for @page
break;

View File

@ -266,9 +266,6 @@ pointer-events inherited
// LAYOUT
position
// OBSOLETE
quotes inherited, converter=convertQuotes
// LAYOUT
right animatable, initial=initialOffset, converter=convertLengthOrAuto

View File

@ -451,13 +451,6 @@ bool CSSPropertyParser::parseValue(CSSPropertyID propId)
case CSSPropertySize: // <length>{1,2} | auto | [ <page-size> || [ portrait | landscape] ]
return parseSize(propId);
case CSSPropertyQuotes: // [<string> <string>]+ | none
if (id == CSSValueNone)
validPrimitive = true;
else
parsedValue = parseQuotes();
break;
case CSSPropertyClip: // <shape> | auto | inherit
if (id == CSSValueAuto)
validPrimitive = true;
@ -1662,23 +1655,6 @@ CSSPropertyParser::SizeParameterType CSSPropertyParser::parseSizeParameter(CSSVa
}
}
// [ <string> <string> ]+ | none, but none is handled in parseValue
PassRefPtr<CSSValue> CSSPropertyParser::parseQuotes()
{
RefPtr<CSSValueList> values = CSSValueList::createCommaSeparated();
while (CSSParserValue* val = m_valueList->current()) {
RefPtr<CSSValue> parsedValue = nullptr;
if (val->unit != CSSPrimitiveValue::CSS_STRING)
return nullptr;
parsedValue = CSSPrimitiveValue::create(val->string, CSSPrimitiveValue::CSS_STRING);
values->append(parsedValue.release());
m_valueList->next();
}
if (values->length() && values->length() % 2 == 0)
return values.release();
return nullptr;
}
PassRefPtr<CSSValue> CSSPropertyParser::parseAttr(CSSParserValueList* args)
{
if (args->size() != 1)

View File

@ -88,7 +88,6 @@ private:
bool parseShorthand(CSSPropertyID, const StylePropertyShorthand&);
bool parse4Values(CSSPropertyID, const CSSPropertyID* properties);
PassRefPtr<CSSValue> parseQuotes();
PassRefPtr<CSSValue> parseAttr(CSSParserValueList* args);

View File

@ -209,24 +209,6 @@ float StyleBuilderConverter::convertNumberOrPercentage(StyleResolverState& state
return primitiveValue->getFloatValue() / 100.0f;
}
PassRefPtr<QuotesData> StyleBuilderConverter::convertQuotes(StyleResolverState&, CSSValue* value)
{
if (value->isValueList()) {
CSSValueList* list = toCSSValueList(value);
RefPtr<QuotesData> quotes = QuotesData::create();
for (size_t i = 0; i < list->length(); i += 2) {
CSSValue* first = list->item(i);
CSSValue* second = list->item(i + 1);
String startQuote = toCSSPrimitiveValue(first)->getStringValue();
String endQuote = toCSSPrimitiveValue(second)->getStringValue();
quotes->addPair(std::make_pair(startQuote, endQuote));
}
return quotes.release();
}
// FIXME: We should assert we're a primitive value with valueID = CSSValueNone
return QuotesData::create();
}
LengthSize StyleBuilderConverter::convertRadius(StyleResolverState& state, CSSValue* value)
{
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);

View File

@ -31,7 +31,6 @@
#include "sky/engine/core/css/CSSValueList.h"
#include "sky/engine/core/css/resolver/StyleResolverState.h"
#include "sky/engine/core/rendering/RenderView.h"
#include "sky/engine/core/rendering/style/QuotesData.h"
#include "sky/engine/core/rendering/style/ShadowList.h"
#include "sky/engine/platform/LengthSize.h"
#include "sky/engine/platform/fonts/FontDescription.h"
@ -58,7 +57,6 @@ public:
static LengthPoint convertLengthPoint(StyleResolverState&, CSSValue*);
static LineBoxContain convertLineBoxContain(StyleResolverState&, CSSValue*);
static float convertNumberOrPercentage(StyleResolverState&, CSSValue*);
static PassRefPtr<QuotesData> convertQuotes(StyleResolverState&, CSSValue*);
static LengthSize convertRadius(StyleResolverState&, CSSValue*);
static PassRefPtr<ShadowList> convertShadow(StyleResolverState&, CSSValue*);
static float convertSpacing(StyleResolverState&, CSSValue*);

View File

@ -62,7 +62,6 @@
#include "sky/engine/core/css/resolver/TransformBuilder.h"
#include "sky/engine/core/frame/LocalFrame.h"
#include "sky/engine/core/frame/Settings.h"
#include "sky/engine/core/rendering/style/QuotesData.h"
#include "sky/engine/core/rendering/style/RenderStyle.h"
#include "sky/engine/core/rendering/style/RenderStyleConstants.h"
#include "sky/engine/core/rendering/style/StyleGeneratedImage.h"

View File

@ -1,67 +0,0 @@
/**
* Copyright (C) 2011 Nokia Inc. All rights reserved.
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#include "sky/engine/config.h"
#include "sky/engine/core/rendering/style/QuotesData.h"
namespace blink {
PassRefPtr<QuotesData> QuotesData::create(String open, String close)
{
RefPtr<QuotesData> data = QuotesData::create();
data->addPair(std::make_pair(open, close));
return data;
}
PassRefPtr<QuotesData> QuotesData::create(UChar open1, UChar close1, UChar open2, UChar close2)
{
RefPtr<QuotesData> data = QuotesData::create();
data->addPair(std::make_pair(String(&open1, 1), String(&close1, 1)));
data->addPair(std::make_pair(String(&open2, 1), String(&close2, 1)));
return data;
}
void QuotesData::addPair(std::pair<String, String> quotePair)
{
m_quotePairs.append(quotePair);
}
const String QuotesData::getOpenQuote(int index) const
{
ASSERT(index >= 0);
if (!m_quotePairs.size() || index < 0)
return emptyString();
if ((size_t)index >= m_quotePairs.size())
return m_quotePairs.last().first;
return m_quotePairs.at(index).first;
}
const String QuotesData::getCloseQuote(int index) const
{
ASSERT(index >= -1);
if (!m_quotePairs.size() || index < 0)
return emptyString();
if ((size_t)index >= m_quotePairs.size())
return m_quotePairs.last().second;
return m_quotePairs.at(index).second;
}
} // namespace blink

View File

@ -1,53 +0,0 @@
/*
* Copyright (C) 2011 Nokia Inc. All rights reserved.
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_QUOTESDATA_H_
#define SKY_ENGINE_CORE_RENDERING_STYLE_QUOTESDATA_H_
#include "sky/engine/wtf/PassRefPtr.h"
#include "sky/engine/wtf/RefCounted.h"
#include "sky/engine/wtf/Vector.h"
#include "sky/engine/wtf/text/WTFString.h"
namespace blink {
class QuotesData : public RefCounted<QuotesData> {
public:
static PassRefPtr<QuotesData> create() { return adoptRef(new QuotesData()); }
static PassRefPtr<QuotesData> create(const String open, const String close);
static PassRefPtr<QuotesData> create(UChar open1, UChar close1, UChar open2, UChar close2);
bool operator==(const QuotesData& o) const { return m_quotePairs == o.m_quotePairs; }
bool operator!=(const QuotesData& o) const { return !(*this == o); }
void addPair(const std::pair<String, String> quotePair);
const String getOpenQuote(int index) const;
const String getCloseQuote(int index) const;
private:
QuotesData() { }
Vector<std::pair<String, String> > m_quotePairs;
};
} // namespace blink
#endif // SKY_ENGINE_CORE_RENDERING_STYLE_QUOTESDATA_H_

View File

@ -29,7 +29,6 @@
#include "sky/engine/core/rendering/RenderTheme.h"
#include "sky/engine/core/rendering/style/AppliedTextDecoration.h"
#include "sky/engine/core/rendering/style/DataEquivalency.h"
#include "sky/engine/core/rendering/style/QuotesData.h"
#include "sky/engine/core/rendering/style/ShadowList.h"
#include "sky/engine/core/rendering/style/StyleImage.h"
#include "sky/engine/core/rendering/style/StyleInheritedData.h"
@ -376,9 +375,6 @@ bool RenderStyle::diffNeedsFullLayout(const RenderStyle& other) const
if (!rareInheritedData->shadowDataEquivalent(*other.rareInheritedData.get()))
return true;
if (!rareInheritedData->quotesDataEquivalent(*other.rareInheritedData.get()))
return true;
}
if (inherited.get() != other.inherited.get()) {
@ -457,11 +453,6 @@ void RenderStyle::updatePropertySpecificDifferences(const RenderStyle& other, St
}
}
void RenderStyle::setQuotes(PassRefPtr<QuotesData> q)
{
rareInheritedData.access()->quotes = q;
}
inline bool requireTransformOrigin(const Vector<RefPtr<TransformOperation> >& transformOperations, RenderStyle::ApplyTransformOrigin applyOrigin)
{
// transform-origin brackets the transform with translate operations.

View File

@ -1029,9 +1029,6 @@ public:
CounterDirectiveMap& accessCounterDirectives();
const CounterDirectives getCounterDirectives(const AtomicString& identifier) const;
QuotesData* quotes() const { return rareInheritedData->quotes.get(); }
void setQuotes(PassRefPtr<QuotesData>);
const AtomicString& hyphenString() const;
bool inheritedNotEqual(const RenderStyle*) const;
@ -1191,8 +1188,6 @@ public:
static WrapFlow initialWrapFlow() { return WrapFlowAuto; }
static WrapThrough initialWrapThrough() { return WrapThroughWrap; }
static QuotesData* initialQuotes() { return 0; }
// Keep these at the end.
// FIXME: Why? Seems these should all be one big sorted list.
static Color initialTapHighlightColor();

View File

@ -24,7 +24,6 @@
#include "sky/engine/core/rendering/style/AppliedTextDecoration.h"
#include "sky/engine/core/rendering/style/DataEquivalency.h"
#include "sky/engine/core/rendering/style/QuotesData.h"
#include "sky/engine/core/rendering/style/RenderStyle.h"
#include "sky/engine/core/rendering/style/RenderStyleConstants.h"
#include "sky/engine/core/rendering/style/ShadowList.h"
@ -39,7 +38,6 @@ struct SameSizeAsStyleRareInheritedData : public RefCounted<SameSizeAsStyleRareI
Color colors[2];
void* ownPtrs[1];
AtomicString atomicStrings[4];
void* refPtrs[1];
Length lengths[1];
unsigned m_bitfields[2];
unsigned unsigneds[1];
@ -173,7 +171,6 @@ bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const
&& hyphenationString == o.hyphenationString
&& locale == o.locale
&& textEmphasisCustomMark == o.textEmphasisCustomMark
&& quotesDataEquivalent(o)
&& m_tabSize == o.m_tabSize
&& m_imageRendering == o.m_imageRendering
&& m_textUnderlinePosition == o.m_textUnderlinePosition
@ -185,9 +182,4 @@ bool StyleRareInheritedData::shadowDataEquivalent(const StyleRareInheritedData&
return dataEquivalent(textShadow.get(), o.textShadow.get());
}
bool StyleRareInheritedData::quotesDataEquivalent(const StyleRareInheritedData& o) const
{
return dataEquivalent(quotes, o.quotes);
}
} // namespace blink

View File

@ -37,7 +37,6 @@
namespace blink {
class AppliedTextDecoration;
class QuotesData;
class ShadowList;
class StyleImage;
@ -58,7 +57,6 @@ public:
return !(*this == o);
}
bool shadowDataEquivalent(const StyleRareInheritedData&) const;
bool quotesDataEquivalent(const StyleRareInheritedData&) const;
StyleColor textStrokeColor() const { return m_textStrokeColorIsCurrentColor ? StyleColor::currentColor() : StyleColor(m_textStrokeColor); }
StyleColor textFillColor() const { return m_textFillColorIsCurrentColor ? StyleColor::currentColor() : StyleColor(m_textFillColor); }
@ -118,7 +116,6 @@ public:
AtomicString locale;
AtomicString textEmphasisCustomMark;
RefPtr<QuotesData> quotes;
unsigned m_tabSize;