-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regression(262976@main) Images do not show in Microsoft Word Online
https://bugs.webkit.org/show_bug.cgi?id=261524 rdar://114573089 Reviewed by Brent Fulgham. Images do not show in Microsoft Word Online since the data URL change in 262976@main. It is a surprising since 262976@main was meant to align us with other browsers and yet images show correctly in Chrome & Firefox. After some investigation, I found that the data URL used by Word Online for images in Safari have incorrect padding, while the ones it uses in Chrome have correct padding. As a result, it doesn't appear to be a WebKit bug but rather Safari getting served different content than Chrome for some reason. To address the issue, I am introducing a quirk to disable padding validation in data URLs on Microsoft Word Online. * Source/WTF/wtf/text/Base64.cpp: (WTF::base64DecodeInternal): * Source/WTF/wtf/text/Base64.h: * Source/WebCore/loader/ResourceLoader.cpp: (WebCore::ResourceLoader::loadDataURL): * Source/WebCore/page/Quirks.cpp: (WebCore::Quirks::shouldDisableDataURLPaddingValidation const): * Source/WebCore/page/Quirks.h: * Source/WebCore/platform/network/DataURLDecoder.cpp: (WebCore::DataURLDecoder::DecodeTask::DecodeTask): (WebCore::DataURLDecoder::createDecodeTask): (WebCore::DataURLDecoder::decodeSynchronously): (WebCore::DataURLDecoder::decode): * Source/WebCore/platform/network/DataURLDecoder.h: Canonical link: https://commits.webkit.org/267969@main
- Loading branch information
Showing
8 changed files
with
42 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1568,4 +1568,15 @@ bool Quirks::shouldStarBeFeaturePolicyDefaultValue() const | |
return *m_shouldStarBeFeaturePolicyDefaultValueQuirk; | ||
} | ||
|
||
// Microsoft office online generates data URLs with incorrect padding on Safari only (rdar://114573089). | ||
bool Quirks::shouldDisableDataURLPaddingValidation() const | ||
{ | ||
if (!needsQuirks()) | ||
return false; | ||
|
||
if (!m_shouldDisableDataURLPaddingValidation) | ||
m_shouldDisableDataURLPaddingValidation = m_document->url().host().endsWith("officeapps.live.com"_s); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
cdumez
Author
Contributor
|
||
return *m_shouldDisableDataURLPaddingValidation; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I need to double check if it solves the issue for office.com too.
Also maybe use the new helper. :)