Title: [137345] trunk/Source/WebCore
- Revision
- 137345
- Author
- [email protected]
- Date
- 2012-12-11 12:55:52 -0800 (Tue, 11 Dec 2012)
Log Message
Cleanup: Use consistent naming in CSSParser when dealing with the forward slash operator.
https://bugs.webkit.org/show_bug.cgi?id=104699
Reviewed by Daniel Bates.
http://trac.webkit.org/changeset/136525 added an helper function to
check if a CSSParserValue is a forward slash operator.
BorderImageParseContext is also dealing with the forward slash operator
but its naming is inconsistent with isForwardSlashOperator(). This is
fixed with this patch where BorderImageParseContext::{allowSlash,
commitSlash}() is now replaced by BorderImageParseContext::{allowForwardSlashOperator,
commitForwardSlashOperator}().
No new tests : just a renaming, covered by existing tests..
* css/CSSParser.cpp:
(WebCore::CSSParser::parseFillPosition): A little fixup on the way, use
isForwardSlashOperator() instead of the current code here.
(WebCore::BorderImageParseContext::BorderImageParseContext):
(WebCore::BorderImageParseContext::allowForwardSlashOperator):
(WebCore::BorderImageParseContext::commitImage):
(WebCore::BorderImageParseContext::commitImageSlice):
(WebCore::BorderImageParseContext::commitForwardSlashOperator):
(WebCore::BorderImageParseContext::commitBorderWidth):
(WebCore::BorderImageParseContext::commitBorderOutset):
(WebCore::BorderImageParseContext::commitRepeat):
(BorderImageParseContext):
(WebCore::CSSParser::parseBorderImage):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (137344 => 137345)
--- trunk/Source/WebCore/ChangeLog 2012-12-11 20:54:39 UTC (rev 137344)
+++ trunk/Source/WebCore/ChangeLog 2012-12-11 20:55:52 UTC (rev 137345)
@@ -1,3 +1,34 @@
+2012-12-11 Alexis Menard <[email protected]>
+
+ Cleanup: Use consistent naming in CSSParser when dealing with the forward slash operator.
+ https://bugs.webkit.org/show_bug.cgi?id=104699
+
+ Reviewed by Daniel Bates.
+
+ http://trac.webkit.org/changeset/136525 added an helper function to
+ check if a CSSParserValue is a forward slash operator.
+ BorderImageParseContext is also dealing with the forward slash operator
+ but its naming is inconsistent with isForwardSlashOperator(). This is
+ fixed with this patch where BorderImageParseContext::{allowSlash,
+ commitSlash}() is now replaced by BorderImageParseContext::{allowForwardSlashOperator,
+ commitForwardSlashOperator}().
+
+ No new tests : just a renaming, covered by existing tests..
+
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseFillPosition): A little fixup on the way, use
+ isForwardSlashOperator() instead of the current code here.
+ (WebCore::BorderImageParseContext::BorderImageParseContext):
+ (WebCore::BorderImageParseContext::allowForwardSlashOperator):
+ (WebCore::BorderImageParseContext::commitImage):
+ (WebCore::BorderImageParseContext::commitImageSlice):
+ (WebCore::BorderImageParseContext::commitForwardSlashOperator):
+ (WebCore::BorderImageParseContext::commitBorderWidth):
+ (WebCore::BorderImageParseContext::commitBorderOutset):
+ (WebCore::BorderImageParseContext::commitRepeat):
+ (BorderImageParseContext):
+ (WebCore::CSSParser::parseBorderImage):
+
2012-12-11 Nate Chapin <[email protected]>
cr-linux valgrind is showing leaks due to r137333.
Modified: trunk/Source/WebCore/css/CSSParser.cpp (137344 => 137345)
--- trunk/Source/WebCore/css/CSSParser.cpp 2012-12-11 20:54:39 UTC (rev 137344)
+++ trunk/Source/WebCore/css/CSSParser.cpp 2012-12-11 20:55:52 UTC (rev 137345)
@@ -3884,7 +3884,7 @@
unsigned numberOfValues = 0;
for (unsigned i = valueList->currentIndex(); i < valueList->size(); ++i, ++numberOfValues) {
CSSParserValue* current = valueList->valueAt(i);
- if (isComma(current) || !current || (current->unit == CSSParserValue::Operator && current->iValue == '/') || !isPotentialPositionValue(current))
+ if (isComma(current) || !current || isForwardSlashOperator(current) || !isPotentialPositionValue(current))
break;
}
@@ -6284,7 +6284,7 @@
, m_allowImage(true)
, m_allowImageSlice(true)
, m_allowRepeat(true)
- , m_allowSlash(false)
+ , m_allowForwardSlashOperator(false)
, m_requireWidth(false)
, m_requireOutset(false)
{}
@@ -6296,7 +6296,7 @@
bool allowImage() const { return m_allowImage; }
bool allowImageSlice() const { return m_allowImageSlice; }
bool allowRepeat() const { return m_allowRepeat; }
- bool allowSlash() const { return m_allowSlash; }
+ bool allowForwardSlashOperator() const { return m_allowForwardSlashOperator; }
bool requireWidth() const { return m_requireWidth; }
bool requireOutset() const { return m_requireOutset; }
@@ -6306,7 +6306,7 @@
m_image = image;
m_canAdvance = true;
m_allowCommit = true;
- m_allowImage = m_allowSlash = m_requireWidth = m_requireOutset = false;
+ m_allowImage = m_allowForwardSlashOperator = m_requireWidth = m_requireOutset = false;
m_allowImageSlice = !m_imageSlice;
m_allowRepeat = !m_repeat;
}
@@ -6314,15 +6314,15 @@
{
m_imageSlice = slice;
m_canAdvance = true;
- m_allowCommit = m_allowSlash = true;
+ m_allowCommit = m_allowForwardSlashOperator = true;
m_allowImageSlice = m_requireWidth = m_requireOutset = false;
m_allowImage = !m_image;
m_allowRepeat = !m_repeat;
}
- void commitSlash()
+ void commitForwardSlashOperator()
{
m_canAdvance = true;
- m_allowCommit = m_allowImage = m_allowImageSlice = m_allowRepeat = m_allowSlash = false;
+ m_allowCommit = m_allowImage = m_allowImageSlice = m_allowRepeat = m_allowForwardSlashOperator = false;
if (!m_borderSlice) {
m_requireWidth = true;
m_requireOutset = false;
@@ -6335,7 +6335,7 @@
{
m_borderSlice = slice;
m_canAdvance = true;
- m_allowCommit = m_allowSlash = true;
+ m_allowCommit = m_allowForwardSlashOperator = true;
m_allowImageSlice = m_requireWidth = m_requireOutset = false;
m_allowImage = !m_image;
m_allowRepeat = !m_repeat;
@@ -6345,7 +6345,7 @@
m_outset = outset;
m_canAdvance = true;
m_allowCommit = true;
- m_allowImageSlice = m_allowSlash = m_requireWidth = m_requireOutset = false;
+ m_allowImageSlice = m_allowForwardSlashOperator = m_requireWidth = m_requireOutset = false;
m_allowImage = !m_image;
m_allowRepeat = !m_repeat;
}
@@ -6354,7 +6354,7 @@
m_repeat = repeat;
m_canAdvance = true;
m_allowCommit = true;
- m_allowRepeat = m_allowSlash = m_requireWidth = m_requireOutset = false;
+ m_allowRepeat = m_allowForwardSlashOperator = m_requireWidth = m_requireOutset = false;
m_allowImageSlice = !m_imageSlice;
m_allowImage = !m_image;
}
@@ -6387,7 +6387,7 @@
bool m_allowImage;
bool m_allowImageSlice;
bool m_allowRepeat;
- bool m_allowSlash;
+ bool m_allowForwardSlashOperator;
bool m_requireWidth;
bool m_requireOutset;
@@ -6407,8 +6407,8 @@
while (CSSParserValue* val = m_valueList->current()) {
context.setCanAdvance(false);
- if (!context.canAdvance() && context.allowSlash() && isForwardSlashOperator(val))
- context.commitSlash();
+ if (!context.canAdvance() && context.allowForwardSlashOperator() && isForwardSlashOperator(val))
+ context.commitForwardSlashOperator();
if (!context.canAdvance() && context.allowImage()) {
if (val->unit == CSSPrimitiveValue::CSS_URI)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes