Changeset 274395 in webkit
- Timestamp:
- Mar 13, 2021, 7:32:31 PM (5 years ago)
- Location:
- trunk
- Files:
- 
      - 3 added
- 8 edited
 
 - 
          
  LayoutTests/ChangeLog (modified) (1 diff)
- 
          
  LayoutTests/TestExpectations (modified) (1 diff)
- 
          
  LayoutTests/fast/images/image-extraction (added)
- 
          
  LayoutTests/fast/images/image-extraction/basic-image-overlay-expected-mismatch.html (added)
- 
          
  LayoutTests/fast/images/image-extraction/basic-image-overlay.html (added)
- 
          
  Source/WebCore/ChangeLog (modified) (1 diff)
- 
          
  Source/WebCore/dom/DOMPointReadOnly.h (modified) (2 diffs)
- 
          
  Source/WebCore/dom/DOMPointReadOnly.idl (modified) (1 diff)
- 
          
  Source/WebCore/testing/Internals.cpp (modified) (4 diffs)
- 
          
  Source/WebCore/testing/Internals.h (modified) (2 diffs)
- 
          
  Source/WebCore/testing/Internals.idl (modified) (2 diffs)
 
Legend:
- Unmodified
- Added
- Removed
- 
      trunk/LayoutTests/ChangeLogr274393 r274395 1 2021-03-13 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Add support for accessibility image overlays in layout tests 4 https://bugs.webkit.org/show_bug.cgi?id=223146 5 6 Reviewed by Tim Horton. 7 8 Add a very basic test to ensure that image overlay content can be installed. 9 10 * TestExpectations: 11 * fast/images/image-extraction/basic-image-overlay-expected-mismatch.html: Added. 12 * fast/images/image-extraction/basic-image-overlay.html: Added. 13 1 14 2021-03-13 Commit Queue <commit-queue@webkit.org> 2 15 
- 
      trunk/LayoutTests/TestExpectationsr274389 r274395 39 39 fast/forms/textarea/ios [ Skip ] 40 40 fast/forms/watchos [ Skip ] 41 fast/images/image-extraction [ Skip ] 41 42 fast/sandbox/ios [ Skip ] 42 43 fast/sandbox/mac [ Skip ] 
- 
      trunk/Source/WebCore/ChangeLogr274393 r274395 1 2021-03-13 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Add support for accessibility image overlays in layout tests 4 https://bugs.webkit.org/show_bug.cgi?id=223146 5 6 Reviewed by Tim Horton. 7 8 Introduce an internal testing hook to install image overlay content, for layout and API tests. 9 10 Test: fast/images/image-extraction/basic-image-overlay.html 11 12 * dom/DOMPointReadOnly.h: 13 * dom/DOMPointReadOnly.idl: 14 15 Additionally add WebCore export macros to `DOMPointReadOnly`, so that Internals code can this class. 16 17 * testing/Internals.cpp: 18 (WebCore::Internals::installImageOverlay): 19 * testing/Internals.h: 20 * testing/Internals.idl: 21 1 22 2021-03-13 Commit Queue <commit-queue@webkit.org> 2 23 
- 
      trunk/Source/WebCore/dom/DOMPointReadOnly.hr243887 r274395 34 34 #include "ExceptionOr.h" 35 35 #include "ScriptWrappable.h" 36 #include <wtf/IsoMalloc.h> 36 37 #include <wtf/RefCounted.h> 37 38 … … 42 43 43 44 class DOMPointReadOnly : public ScriptWrappable, public RefCounted<DOMPointReadOnly> { 44 WTF_MAKE_ISO_ALLOCATED (DOMPointReadOnly);45 WTF_MAKE_ISO_ALLOCATED_EXPORT(DOMPointReadOnly, WEBCORE_EXPORT); 45 46 public: 46 47 static Ref<DOMPointReadOnly> create(double x, double y, double z, double w) { return adoptRef(*new DOMPointReadOnly(x, y, z, w)); } 
- 
      trunk/Source/WebCore/dom/DOMPointReadOnly.idlr267020 r274395 31 31 // The DOMPointInit constructor exists in https://www.w3.org/TR/geometry-1/ but is removed in https://drafts.fxtf.org/geometry/ 32 32 [ 33 ExportMacro=WEBCORE_EXPORT, 33 34 Exposed=(Window,Worker), 34 35 ImplementationLacksVTable 
- 
      trunk/Source/WebCore/testing/Internals.cppr274066 r274395 56 56 #include "CookieJar.h" 57 57 #include "Cursor.h" 58 #include "DOMPointReadOnly.h" 58 59 #include "DOMRect.h" 59 60 #include "DOMRectList.h" … … 79 80 #include "FetchResponse.h" 80 81 #include "File.h" 82 #include "FloatQuad.h" 81 83 #include "FontCache.h" 82 84 #include "FormController.h" … … 335 337 #endif 336 338 339 #if ENABLE(IMAGE_EXTRACTION) 340 #include "ImageExtractionResult.h" 341 #endif 342 337 343 using JSC::CallData; 338 344 using JSC::CodeBlock; … … 5514 5520 #endif 5515 5521 5522 Internals::ImageOverlayText::~ImageOverlayText() = default; 5523 5524 void Internals::installImageOverlay(Element& element, Vector<ImageOverlayText>&& allTextInfo) 5525 { 5526 if (!is<HTMLElement>(element)) 5527 return; 5528 5529 #if ENABLE(IMAGE_EXTRACTION) 5530 downcast<HTMLElement>(element).updateWithImageExtractionResult(ImageExtractionResult { 5531 allTextInfo.map([] (auto& textInfo) -> ImageExtractionTextData { 5532 return { textInfo.text, { 5533 FloatPoint(textInfo.topLeft->x(), textInfo.topLeft->y()), 5534 FloatPoint(textInfo.topRight->x(), textInfo.topRight->y()), 5535 FloatPoint(textInfo.bottomRight->x(), textInfo.bottomRight->y()), 5536 FloatPoint(textInfo.bottomLeft->x(), textInfo.bottomLeft->y()), 5537 }}; 5538 }) 5539 }); 5540 #else 5541 UNUSED_PARAM(allTextInfo); 5542 #endif 5543 } 5544 5516 5545 bool Internals::isSystemPreviewLink(Element& element) const 5517 5546 { 
- 
      trunk/Source/WebCore/testing/Internals.hr274066 r274395 53 53 class AudioTrack; 54 54 class CacheStorageConnection; 55 class DOMPointReadOnly; 55 56 class DOMRect; 56 57 class DOMRectList; … … 841 842 #endif 842 843 844 struct ImageOverlayText { 845 String text; 846 RefPtr<DOMPointReadOnly> topLeft; 847 RefPtr<DOMPointReadOnly> topRight; 848 RefPtr<DOMPointReadOnly> bottomRight; 849 RefPtr<DOMPointReadOnly> bottomLeft; 850 851 ~ImageOverlayText(); 852 }; 853 void installImageOverlay(Element&, Vector<ImageOverlayText>&&); 854 843 855 bool isSystemPreviewLink(Element&) const; 844 856 bool isSystemPreviewImage(Element&) const; 
- 
      trunk/Source/WebCore/testing/Internals.idlr274066 r274395 256 256 [ 257 257 ExportMacro=WEBCORE_TESTSUPPORT_EXPORT, 258 JSGenerateToJSObject, 259 ] dictionary ImageOverlayText { 260 required DOMString text; 261 required DOMPointReadOnly topLeft; 262 required DOMPointReadOnly topRight; 263 required DOMPointReadOnly bottomRight; 264 required DOMPointReadOnly bottomLeft; 265 }; 266 267 [ 268 ExportMacro=WEBCORE_TESTSUPPORT_EXPORT, 258 269 LegacyNoInterfaceObject, 259 270 ] interface Internals { … … 871 882 boolean isSystemPreviewImage(Element element); 872 883 884 undefined installImageOverlay(Element element, sequence<ImageOverlayText> allTextInfo); 885 873 886 boolean usingAppleInternalSDK(); 874 887 boolean usingGStreamer(); 
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  
