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

Side by Side Diff: third_party/WebKit/Source/core/testing/Internals.cpp

Issue 2922233002: [ActiveSuggestionMarker #1] Introduce abstract StyleableMarker subclass of DocumentMarker (Closed)
Patch Set: Add test for IsStyleableMarker() Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/editing/markers/StyleableMarker.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after
1054 Color& color, 1054 Color& color,
1055 ExceptionState& exception_state, 1055 ExceptionState& exception_state,
1056 String error_message) { 1056 String error_message) {
1057 if (!color.SetFromString(value)) { 1057 if (!color.SetFromString(value)) {
1058 exception_state.ThrowDOMException(kInvalidAccessError, error_message); 1058 exception_state.ThrowDOMException(kInvalidAccessError, error_message);
1059 return false; 1059 return false;
1060 } 1060 }
1061 return true; 1061 return true;
1062 } 1062 }
1063 1063
1064 static WTF::Optional<CompositionMarker::Thickness> ThicknessFrom( 1064 static WTF::Optional<StyleableMarker::Thickness> ThicknessFrom(
1065 const String& thickness) { 1065 const String& thickness) {
1066 if (EqualIgnoringASCIICase(thickness, "thin")) 1066 if (EqualIgnoringASCIICase(thickness, "thin"))
1067 return CompositionMarker::Thickness::kThin; 1067 return StyleableMarker::Thickness::kThin;
1068 if (EqualIgnoringASCIICase(thickness, "thick")) 1068 if (EqualIgnoringASCIICase(thickness, "thick"))
1069 return CompositionMarker::Thickness::kThick; 1069 return StyleableMarker::Thickness::kThick;
1070 return WTF::nullopt; 1070 return WTF::nullopt;
1071 } 1071 }
1072 1072
1073 void Internals::addCompositionMarker(const Range* range, 1073 void Internals::addCompositionMarker(const Range* range,
1074 const String& underline_color_value, 1074 const String& underline_color_value,
1075 const String& thickness_value, 1075 const String& thickness_value,
1076 const String& background_color_value, 1076 const String& background_color_value,
1077 ExceptionState& exception_state) { 1077 ExceptionState& exception_state) {
1078 DCHECK(range); 1078 DCHECK(range);
1079 range->OwnerDocument().UpdateStyleAndLayoutIgnorePendingStylesheets(); 1079 range->OwnerDocument().UpdateStyleAndLayoutIgnorePendingStylesheets();
1080 1080
1081 WTF::Optional<CompositionMarker::Thickness> thickness = 1081 WTF::Optional<StyleableMarker::Thickness> thickness =
1082 ThicknessFrom(thickness_value); 1082 ThicknessFrom(thickness_value);
1083 if (!thickness) { 1083 if (!thickness) {
1084 exception_state.ThrowDOMException( 1084 exception_state.ThrowDOMException(
1085 kSyntaxError, 1085 kSyntaxError,
1086 "The thickness provided ('" + thickness_value + "') is invalid."); 1086 "The thickness provided ('" + thickness_value + "') is invalid.");
1087 return; 1087 return;
1088 } 1088 }
1089 1089
1090 Color underline_color; 1090 Color underline_color;
1091 Color background_color; 1091 Color background_color;
(...skipping 2246 matching lines...) Expand 10 before | Expand all | Expand 10 after
3338 3338
3339 void Internals::crash() { 3339 void Internals::crash() {
3340 CHECK(false) << "Intentional crash"; 3340 CHECK(false) << "Intentional crash";
3341 } 3341 }
3342 3342
3343 void Internals::setIsLowEndDevice(bool is_low_end_device) { 3343 void Internals::setIsLowEndDevice(bool is_low_end_device) {
3344 MemoryCoordinator::SetIsLowEndDeviceForTesting(is_low_end_device); 3344 MemoryCoordinator::SetIsLowEndDeviceForTesting(is_low_end_device);
3345 } 3345 }
3346 3346
3347 } // namespace blink 3347 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/markers/StyleableMarker.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698