Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a70377af0564cae4749383349407e6e2c6be4b1e
      
https://github.com/WebKit/WebKit/commit/a70377af0564cae4749383349407e6e2c6be4b1e
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-09-01 (Tue, 01 Sep 2026)

  Changed paths:
    M Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/CopyHTML.mm

  Log Message:
  -----------
  LegacyWebArchive iframe wrapper for copied framesets emits literal "98%%" 
width/height
https://bugs.webkit.org/show_bug.cgi?id=322902
rdar://186161217

Reviewed by Chris Dumez.

When a frameset document is copied, LegacyWebArchive::createFromSelection() 
wraps
the frameset in an <iframe> so it can be pasted into a document that has its own
body or frameset. The wrapper markup is built with makeString(), which does no
printf-style format expansion, but the width and height were written as "98%%".
The doubled percent is only meaningful to a printf-family formatter; 
makeString()
copies it verbatim, so the generated markup contained the invalid literal
width="98%%" height="98%%" instead of width="98%" height="98%".

Use a single percent so the wrapper iframe is sized correctly.

Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/CopyHTML.mm

* Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::createFromSelection): Emit "98%" instead of "98%%".

* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/CopyHTML.mm:
(TestWebKitAPI::readWebArchiveDataFromPasteboard): Added.
(TestWebKitAPI::TEST(CopyHTML, 
FramesetSelectionIframeWrapperUsesSinglePercent)):
Added. Copies a frameset, reads the web archive off the pasteboard, and asserts
the wrapper main resource uses width="98%"/he%".

Canonical link: https://commits.webkit.org/320317@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to