Browse Source

LibWeb: Port CanvasGradient interface from DeprecatedString to String

Shannon Booth 1 year ago
parent
commit
c4f12feadc

+ 1 - 1
Userland/Libraries/LibWeb/HTML/CanvasGradient.cpp

@@ -54,7 +54,7 @@ void CanvasGradient::initialize(JS::Realm& realm)
 }
 }
 
 
 // https://html.spec.whatwg.org/multipage/canvas.html#dom-canvasgradient-addcolorstop
 // https://html.spec.whatwg.org/multipage/canvas.html#dom-canvasgradient-addcolorstop
-WebIDL::ExceptionOr<void> CanvasGradient::add_color_stop(double offset, DeprecatedString const& color)
+WebIDL::ExceptionOr<void> CanvasGradient::add_color_stop(double offset, StringView color)
 {
 {
     // 1. If the offset is less than 0 or greater than 1, then throw an "IndexSizeError" DOMException.
     // 1. If the offset is less than 0 or greater than 1, then throw an "IndexSizeError" DOMException.
     if (offset < 0 || offset > 1)
     if (offset < 0 || offset > 1)

+ 1 - 1
Userland/Libraries/LibWeb/HTML/CanvasGradient.h

@@ -20,7 +20,7 @@ public:
     static WebIDL::ExceptionOr<JS::NonnullGCPtr<CanvasGradient>> create_linear(JS::Realm&, double x0, double y0, double x1, double y1);
     static WebIDL::ExceptionOr<JS::NonnullGCPtr<CanvasGradient>> create_linear(JS::Realm&, double x0, double y0, double x1, double y1);
     static WebIDL::ExceptionOr<JS::NonnullGCPtr<CanvasGradient>> create_conic(JS::Realm&, double start_angle, double x, double y);
     static WebIDL::ExceptionOr<JS::NonnullGCPtr<CanvasGradient>> create_conic(JS::Realm&, double start_angle, double x, double y);
 
 
-    WebIDL::ExceptionOr<void> add_color_stop(double offset, DeprecatedString const& color);
+    WebIDL::ExceptionOr<void> add_color_stop(double offset, StringView color);
 
 
     ~CanvasGradient();
     ~CanvasGradient();
 
 

+ 1 - 1
Userland/Libraries/LibWeb/HTML/CanvasGradient.idl

@@ -1,4 +1,4 @@
-[Exposed=(Window,Worker), UseDeprecatedAKString]
+[Exposed=(Window,Worker)]
 interface CanvasGradient {
 interface CanvasGradient {
     // opaque object
     // opaque object
     undefined addColorStop(double offset, DOMString color);
     undefined addColorStop(double offset, DOMString color);