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

Unified Diff: third_party/WebKit/Source/core/css/StylePropertySerializer.h

Issue 1988013003: Move generic shorthand serialization checks out of specific routines (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shorthand1
Patch Set: actually fix test Created 4 years, 7 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: third_party/WebKit/Source/core/css/StylePropertySerializer.h
diff --git a/third_party/WebKit/Source/core/css/StylePropertySerializer.h b/third_party/WebKit/Source/core/css/StylePropertySerializer.h
index e075dad4cfa47c85693bf09ecc3cbcfbe6343bb5..e2d85582f0bf045e6b4abe42b7d785c11024089a 100644
--- a/third_party/WebKit/Source/core/css/StylePropertySerializer.h
+++ b/third_party/WebKit/Source/core/css/StylePropertySerializer.h
@@ -48,13 +48,21 @@ private:
String getShorthandValue(const StylePropertyShorthand&, String separator = " ") const;
String fontValue() const;
String fontVariantValue() const;
- void appendFontLonghandValueIfNotNormal(CSSPropertyID, StringBuilder& result, String& value) const;
+ void appendFontLonghandValueIfNotNormal(CSSPropertyID, StringBuilder& result) const;
String backgroundRepeatPropertyValue() const;
String getPropertyText(CSSPropertyID, const String& value, bool isImportant, bool isNotFirstDecl) const;
bool isPropertyShorthandAvailable(const StylePropertyShorthand&) const;
bool shorthandHasOnlyInitialOrInheritedValue(const StylePropertyShorthand&) const;
void appendBackgroundPropertyAsText(StringBuilder& result, unsigned& numDecls) const;
+ // This function does checks common to all shorthands, and returns:
+ // - The serialization if the shorthand serializes as a css-wide keyword.
+ // - An empty string if either some longhands are not set, the important
+ // flag is not set consistently, or css-wide keywords are used. In these
+ // cases serialization will always fail.
+ // - A null string otherwise.
+ String commonShorthandChecks(const StylePropertyShorthand&) const;
+
// Only StylePropertySerializer uses the following two classes.
class PropertyValueForSerializer {
STACK_ALLOCATED();

Powered by Google App Engine
This is Rietveld 408576698