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

Unified Diff: third_party/WebKit/Source/core/editing/EditingStyleUtilities.h

Issue 2628943009: Introduce EditingStyleUtilities.{cpp,h} (Closed)
Patch Set: add STATIC_ONLY Created 3 years, 11 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/editing/EditingStyleUtilities.h
diff --git a/third_party/WebKit/Source/core/editing/EditingStyleUtilities.h b/third_party/WebKit/Source/core/editing/EditingStyleUtilities.h
new file mode 100644
index 0000000000000000000000000000000000000000..7157de311ca86f65325d7286169cf06a037cf5b9
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/EditingStyleUtilities.h
@@ -0,0 +1,52 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef EditingStyleUtilities_h
+#define EditingStyleUtilities_h
+
+#include "core/CSSPropertyNames.h"
+#include "core/CSSValueKeywords.h"
+#include "core/editing/VisibleSelection.h"
+#include "core/editing/WritingDirection.h"
+
+namespace blink {
+
+class ContainerNode;
+class CSSStyleDeclaration;
+class EditingStyle;
+class MutableStylePropertySet;
+class Node;
+class StylePropertySet;
+
+class EditingStyleUtilities {
+ STATIC_ONLY(EditingStyleUtilities);
+
+ public:
+ static EditingStyle* createStyleAtSelectionStart(
+ const VisibleSelection&,
+ bool shouldUseBackgroundColorInEffect = false,
+ MutableStylePropertySet* styleToCheck = nullptr);
+ static EditingStyle* createWrappingStyleForSerialization(
+ ContainerNode* context);
+ static EditingStyle* createWrappingStyleForAnnotatedSerialization(
+ ContainerNode* context);
+ static WritingDirection textDirectionForSelection(
+ const VisibleSelection&,
+ EditingStyle* typingStyle,
+ bool& hasNestedOrMultipleEmbeddings);
+ static bool isEmbedOrIsolate(CSSValueID unicodeBidi) {
+ return unicodeBidi == CSSValueIsolate ||
+ unicodeBidi == CSSValueWebkitIsolate || unicodeBidi == CSSValueEmbed;
+ }
+
+ static bool isTransparentColorValue(const CSSValue*);
+ static bool hasTransparentBackgroundColor(CSSStyleDeclaration*);
+ static bool hasTransparentBackgroundColor(StylePropertySet*);
+ static const CSSValue* backgroundColorValueInEffect(Node*);
+ static bool hasAncestorVerticalAlignStyle(Node&, CSSValueID);
+};
+
+} // namespace blink
+
+#endif // EditingStyleUtilities_h

Powered by Google App Engine
This is Rietveld 408576698