Title: [207679] trunk/Source/WebCore
- Revision
- 207679
- Author
- hy...@apple.com
- Date
- 2016-10-21 10:03:10 -0700 (Fri, 21 Oct 2016)
Log Message
[CSS Parser] Add support for -webkit-line-box-contain
https://bugs.webkit.org/show_bug.cgi?id=163794
Reviewed by Zalan Bujtas.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeLineBoxContain):
(WebCore::CSSPropertyParser::parseSingleValue):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (207678 => 207679)
--- trunk/Source/WebCore/ChangeLog 2016-10-21 17:00:14 UTC (rev 207678)
+++ trunk/Source/WebCore/ChangeLog 2016-10-21 17:03:10 UTC (rev 207679)
@@ -1,5 +1,16 @@
2016-10-21 Dave Hyatt <hy...@apple.com>
+ [CSS Parser] Add support for -webkit-line-box-contain
+ https://bugs.webkit.org/show_bug.cgi?id=163794
+
+ Reviewed by Zalan Bujtas.
+
+ * css/parser/CSSPropertyParser.cpp:
+ (WebCore::consumeLineBoxContain):
+ (WebCore::CSSPropertyParser::parseSingleValue):
+
+2016-10-21 Dave Hyatt <hy...@apple.com>
+
[CSS Parser] Add support for @-webkit-region rules
https://bugs.webkit.org/show_bug.cgi?id=163787
Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp (207678 => 207679)
--- trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp 2016-10-21 17:00:14 UTC (rev 207678)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp 2016-10-21 17:03:10 UTC (rev 207679)
@@ -44,6 +44,7 @@
#include "CSSGridTemplateAreasValue.h"
#include "CSSInheritedValue.h"
#include "CSSInitialValue.h"
+#include "CSSLineBoxContainValue.h"
#include "CSSParserFastPaths.h"
#include "CSSParserIdioms.h"
#include "CSSPendingSubstitutionValue.h"
@@ -3045,6 +3046,54 @@
}
#endif
+static RefPtr<CSSValue> consumeLineBoxContain(CSSParserTokenRange& range)
+{
+ if (range.peek().id() == CSSValueNone)
+ return consumeIdent(range);
+
+ LineBoxContain lineBoxContain = LineBoxContainNone;
+
+ while (range.peek().type() == IdentToken) {
+ auto id = range.peek().id();
+ if (id == CSSValueBlock) {
+ if (lineBoxContain & LineBoxContainBlock)
+ return nullptr;
+ lineBoxContain |= LineBoxContainBlock;
+ } else if (id == CSSValueInline) {
+ if (lineBoxContain & LineBoxContainInline)
+ return nullptr;
+ lineBoxContain |= LineBoxContainInline;
+ } else if (id == CSSValueFont) {
+ if (lineBoxContain & LineBoxContainFont)
+ return nullptr;
+ lineBoxContain |= LineBoxContainFont;
+ } else if (id == CSSValueGlyphs) {
+ if (lineBoxContain & LineBoxContainGlyphs)
+ return nullptr;
+ lineBoxContain |= LineBoxContainGlyphs;
+ } else if (id == CSSValueReplaced) {
+ if (lineBoxContain & LineBoxContainReplaced)
+ return nullptr;
+ lineBoxContain |= LineBoxContainReplaced;
+ } else if (id == CSSValueInlineBox) {
+ if (lineBoxContain & LineBoxContainInlineBox)
+ return nullptr;
+ lineBoxContain |= LineBoxContainInlineBox;
+ } else if (id == CSSValueInitialLetter) {
+ if (lineBoxContain & LineBoxContainInitialLetter)
+ return nullptr;
+ lineBoxContain |= LineBoxContainInitialLetter;
+ } else
+ return nullptr;
+ range.consumeIncludingWhitespace();
+ }
+
+ if (!lineBoxContain)
+ return nullptr;
+
+ return CSSLineBoxContainValue::create(lineBoxContain);
+}
+
RefPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSPropertyID property, CSSPropertyID currentShorthand)
{
if (CSSParserFastPaths::isKeywordPropertyID(property)) {
@@ -3359,6 +3408,8 @@
return consumeWebkitBorderImage(property, m_range, m_context);
case CSSPropertyWebkitBoxReflect:
return consumeReflect(m_range, m_context);
+ case CSSPropertyWebkitLineBoxContain:
+ return consumeLineBoxContain(m_range);
#if ENABLE(CSS_IMAGE_ORIENTATION)
case CSSPropertyImageOrientation:
return consumeImageOrientation(m_range, m_context.mode);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes