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

Unified Diff: Source/core/css/parser/CSSPropertyParser.cpp

Issue 471893002: Support consecutive slash operators for border-image value (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove white spaces Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/css/parser/CSSPropertyParser.cpp
diff --git a/Source/core/css/parser/CSSPropertyParser.cpp b/Source/core/css/parser/CSSPropertyParser.cpp
index 19d4bf96eb308ba7587df494dae7d02b7bec1ad4..06ecc83c16b113f2a05cf4807d5e5f956db9ab36 100644
--- a/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/Source/core/css/parser/CSSPropertyParser.cpp
@@ -5815,7 +5815,7 @@ public:
, m_allowImageSlice(true)
, m_allowRepeat(true)
, m_allowForwardSlashOperator(false)
- , m_requireWidth(false)
rwlbuis 2014/08/21 15:54:25 Renaming this variable makes the review much harde
je_julie(Not used) 2014/08/22 00:31:39 From the spec,http://www.w3.org/TR/css3-background
+ , m_allowWidth(false)
, m_requireOutset(false)
{}
@@ -5827,8 +5827,8 @@ public:
bool allowImageSlice() const { return m_allowImageSlice; }
bool allowRepeat() const { return m_allowRepeat; }
bool allowForwardSlashOperator() const { return m_allowForwardSlashOperator; }
+ bool allowWidth() const { return m_allowWidth; }
- bool requireWidth() const { return m_requireWidth; }
bool requireOutset() const { return m_requireOutset; }
void commitImage(PassRefPtrWillBeRawPtr<CSSValue> image)
@@ -5836,7 +5836,7 @@ public:
m_image = image;
m_canAdvance = true;
m_allowCommit = true;
- m_allowImage = m_allowForwardSlashOperator = m_requireWidth = m_requireOutset = false;
+ m_allowImage = m_allowForwardSlashOperator = m_allowWidth = m_requireOutset = false;
m_allowImageSlice = !m_imageSlice;
m_allowRepeat = !m_repeat;
}
@@ -5845,20 +5845,22 @@ public:
m_imageSlice = slice;
m_canAdvance = true;
m_allowCommit = m_allowForwardSlashOperator = true;
- m_allowImageSlice = m_requireWidth = m_requireOutset = false;
+ m_allowImageSlice = m_allowWidth = m_requireOutset = false;
m_allowImage = !m_image;
m_allowRepeat = !m_repeat;
}
void commitForwardSlashOperator()
{
m_canAdvance = true;
- m_allowCommit = m_allowImage = m_allowImageSlice = m_allowRepeat = m_allowForwardSlashOperator = false;
- if (!m_borderWidth) {
- m_requireWidth = true;
+ m_allowCommit = m_allowImage = m_allowImageSlice = m_allowRepeat = false;
+ if (!m_borderWidth && !m_allowWidth) {
+ m_allowForwardSlashOperator = true;
+ m_allowWidth = true;
m_requireOutset = false;
} else {
+ m_allowForwardSlashOperator = false;
m_requireOutset = true;
- m_requireWidth = false;
+ m_allowWidth = false;
}
}
void commitBorderWidth(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> width)
@@ -5866,7 +5868,7 @@ public:
m_borderWidth = width;
m_canAdvance = true;
m_allowCommit = m_allowForwardSlashOperator = true;
- m_allowImageSlice = m_requireWidth = m_requireOutset = false;
+ m_allowImageSlice = m_allowWidth = m_requireOutset = false;
m_allowImage = !m_image;
m_allowRepeat = !m_repeat;
}
@@ -5875,7 +5877,7 @@ public:
m_outset = outset;
m_canAdvance = true;
m_allowCommit = true;
- m_allowImageSlice = m_allowForwardSlashOperator = m_requireWidth = m_requireOutset = false;
+ m_allowImageSlice = m_allowForwardSlashOperator = m_allowWidth = m_requireOutset = false;
m_allowImage = !m_image;
m_allowRepeat = !m_repeat;
}
@@ -5884,7 +5886,7 @@ public:
m_repeat = repeat;
m_canAdvance = true;
m_allowCommit = true;
- m_allowRepeat = m_allowForwardSlashOperator = m_requireWidth = m_requireOutset = false;
+ m_allowRepeat = m_allowForwardSlashOperator = m_allowWidth = m_requireOutset = false;
m_allowImageSlice = !m_imageSlice;
m_allowImage = !m_image;
}
@@ -5930,7 +5932,7 @@ public:
bool m_allowRepeat;
bool m_allowForwardSlashOperator;
- bool m_requireWidth;
+ bool m_allowWidth;
bool m_requireOutset;
RefPtrWillBeMember<CSSValue> m_image;
@@ -5981,7 +5983,7 @@ bool BorderImageParseContext::buildFromParser(CSSPropertyParser& parser, CSSProp
context.commitRepeat(repeat.release());
}
- if (!context.canAdvance() && context.requireWidth()) {
+ if (!context.canAdvance() && context.allowWidth()) {
RefPtrWillBeRawPtr<CSSPrimitiveValue> borderWidth = nullptr;
if (parser.parseBorderImageWidth(borderWidth))
context.commitBorderWidth(borderWidth.release());

Powered by Google App Engine
This is Rietveld 408576698