⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Timeline



Sep 7, 2020:

9:30 PM Changeset in webkit [266714] by rniwa@webkit.org
  • 11 edits in trunk/Source/WebCore

Move all remaining flags from ElementRareData to Node to reduce the frequency
https://bugs.webkit.org/show_bug.cgi?id=216208

Reviewed by Darin Adler.

This patch moves all remaining bit flags from ElementRareData to Node::m_nodeFlags. It also stores
tabIndex of 0 and -1 in Node::m_nodeFlags to avoid creating ElementRareData for these common values.

No new tests since there should be no behavioral change.

  • dom/Element.cpp:

(WebCore::Element::clearTabIndexExplicitlyIfNeeded): Deleted. Merged into setTabIndexExplicitly.
(WebCore::Element::setTabIndexExplicitly): Now takes Optional<int>. Stores 0 and -1 as node flags.
(WebCore::Element::tabIndexSetExplicitly const): Added the special casing for 0 and -1.
(WebCore::Element::removedFromAncestor):
(WebCore::Element::containsFullScreenElement const): Deleted.
(WebCore::Element::setContainsFullScreenElement):
(WebCore::Element::hasPendingResources const): Deleted.
(WebCore::Element::setHasPendingResources): Deleted.
(WebCore::Element::clearHasPendingResources): Deleted.
(WebCore::Element::hasCSSAnimation const): Deleted.
(WebCore::Element::setHasCSSAnimation): Deleted.
(WebCore::Element::clearHasCSSAnimation): Deleted.
(WebCore::Element::createElementIdentifier):

  • dom/Element.h:

(WebCore::Element::hasPendingResources const): Moved here from Element.cpp.
(WebCore::Element::setHasPendingResources): Ditto.
(WebCore::Element::clearHasPendingResources): Ditto.
(WebCore::Element::hasCSSAnimation const): Ditto.
(WebCore::Element::setHasCSSAnimation): Ditto.
(WebCore::Element::clearHasCSSAnimation): Ditto.
(WebCore::Element::containsFullScreenElement const): Ditto.

  • dom/ElementRareData.cpp:
  • dom/ElementRareData.h:

(WebCore::ElementRareData::tabIndex const): Deleted.
(WebCore::ElementRareData::setTabIndexExplicitly): Deleted.
(WebCore::ElementRareData::tabIndexSetExplicitly const): Deleted.
(WebCore::ElementRareData::clearTabIndexExplicitly): Deleted.
(WebCore::ElementRareData::containsFullScreenElement): Deleted.
(WebCore::ElementRareData::setContainsFullScreenElement): Deleted.
(WebCore::ElementRareData::hasPendingResources const): Deleted.
(WebCore::ElementRareData::setHasPendingResources): Deleted.
(WebCore::ElementRareData::hasCSSAnimation const): Deleted.
(WebCore::ElementRareData::setHasCSSAnimation): Deleted.
(WebCore::ElementRareData::hasElementIdentifier const): Deleted.
(WebCore::ElementRareData::setHasElementIdentifier): Deleted.
(WebCore::ElementRareData::useTypes const): Added the missing use types for style maps, part list,
and part names.
(WebCore::ElementRareData::ElementRareData):
(WebCore::ElementRareData::unusualTabIndex const): Renamed from tabIndex.
(WebCore::ElementRareData::setUnusualTabIndex): Ditto from setTabIndexExplicitly.

  • dom/Node.cpp:

(WebCore::stringForRareDataUseType): Added the missing strings.

  • dom/Node.h:

(WebCore::Node::NodeFlags): Moved bit flags from ElementRareData and reserved the two highest bits
to store TabIndexState.
(WebCore::Node::s_tabIndexStateBitOffset): Added.
(WebCore::Node::s_tabIndexStateBitMask): Added.
(WebCore::Node::TabIndexState): Added.
(WebCore::Node::tabIndexState const): Added.
(WebCore::Node::setTabIndexState): Added.

  • dom/NodeRareData.h:

(WebCore::NodeRareData::UseType): Added the missing use types: style maps, part list, and part names.

  • html/HTMLElement.cpp:

(WebCore::HTMLElement::parseAttribute):

  • mathml/MathMLElement.cpp:

(WebCore::MathMLElement::parseAttribute):

  • svg/SVGElement.cpp:

(WebCore::SVGElement::parseAttribute):

8:50 PM Changeset in webkit [266713] by rniwa@webkit.org
  • 5 edits in trunk

Make CompactUniquePtrTuple actually work with subclassing and custom deleter
https://bugs.webkit.org/show_bug.cgi?id=216225

Reviewed by Darin Adler.

Source/WTF:

Fixed bugs in CompactUniquePtrTuple which prevented subclassing and custom deleter to work.

  • wtf/CompactPointerTuple.h:

(WTF::CompactPointerTuple::CompactPointerTuple): Added move constructor with implicit cast
of a convertible pointer type.

  • wtf/CompactUniquePtrTuple.h:

(WTF::makeCompactUniquePtr): Added the missing deleter from the return type.
(WTF::CompactUniquePtrTuple::CompactUniquePtrTuple): Allow Deleter to be different if it's
the default deleter in the move constructor so that CompactUniquePtrTuple<U, Type> could be
moved to CompactUniquePtrTuple<T, Type> if U is convertible to T without having to specify
the same deleter (std::default_delete<U> is not same as std::default_delete<T> but allow it).
(WTF::CompactUniquePtrTuple::operator=): Ditto.
(WTF::CompactUniquePtrTuple::setPointer): Ditto from std::unique_ptr.
(WTF::CompactUniquePtrTuple): Friend declare all other specializations of CompactUniquePtrTuple
so that the above fixes work.

Tools:

  • TestWebKitAPI/Tests/WTF/CompactUniquePtrTuple.cpp:

(TestWebKitAPI::A::~A): Make this virtual.
(TestWebKitAPI::B): Added.
(TestWebKitAPI::B::B): Added.
(TestWebKitAPI::B::~B): Added.
(WTF_CompactUniquePtrTuple.Subclassing): Added. Tests subclassing.
(TestWebKitAPI::ADeleter): Added.
(TestWebKitAPI::ADeleter::operator() const):
(WTF_CompactUniquePtrTuple.Deleter): Added. Tests a custom deleter.

7:46 PM Debugging With Visual Studio edited by Fujii Hironori
(diff)
6:35 PM Changeset in webkit [266712] by Chris Dumez
  • 12 edits
    5 adds
    2 deletes in trunk

AudioParam.cancelAndHoldAtTime() is missing
https://bugs.webkit.org/show_bug.cgi?id=215947
<rdar://problem/68362061>

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline WPT tests that are now passing.

  • web-platform-tests/webaudio/idlharness.https.window-expected.txt:
  • web-platform-tests/webaudio/the-audio-api/the-audioparam-interface/audioparam-setValueCurveAtTime-expected.txt:
  • web-platform-tests/webaudio/the-audio-api/the-audioparam-interface/retrospective-setValueCurveAtTime-expected.txt:

Source/WebCore:

Add implementation for AudioParam.cancelAndHoldAtTime():

This patch is based on the following Blink commit by Raymond Toy:

Tests: webaudio/audioparam-cancel-and-hold.html

webaudio/cancel-values-crash-913217.html

  • Modules/webaudio/AudioParam.cpp:
  • Modules/webaudio/AudioParam.h:
  • Modules/webaudio/AudioParam.idl:
  • Modules/webaudio/AudioParamTimeline.cpp:

(WebCore::AudioParamTimeline::setValueAtTime):
(WebCore::AudioParamTimeline::linearRampToValueAtTime):
(WebCore::AudioParamTimeline::exponentialRampToValueAtTime):
(WebCore::AudioParamTimeline::setTargetAtTime):
(WebCore::AudioParamTimeline::setValueCurveAtTime):
(WebCore::AudioParamTimeline::insertEvent):
(WebCore::AudioParamTimeline::cancelAndHoldAtTime):
(WebCore::AudioParamTimeline::removeCancelledEvents):
(WebCore::AudioParamTimeline::valueForContextTime):
(WebCore::AudioParamTimeline::valuesForTimeRangeImpl):
(WebCore::AudioParamTimeline::linearRampAtTime):
(WebCore::AudioParamTimeline::exponentialRampAtTime):
(WebCore::AudioParamTimeline::valueCurveAtTime):
(WebCore::AudioParamTimeline::handleCancelValues):

  • Modules/webaudio/AudioParamTimeline.h:

(WebCore::AudioParamTimeline::ParamEvent::createSetValueEvent):
(WebCore::AudioParamTimeline::ParamEvent::createLinearRampEvent):
(WebCore::AudioParamTimeline::ParamEvent::createExponentialRampEvent):
(WebCore::AudioParamTimeline::ParamEvent::createSetTargetEvent):
(WebCore::AudioParamTimeline::ParamEvent::createSetValueCurveEvent):
(WebCore::AudioParamTimeline::ParamEvent::createCancelValuesEvent):
(WebCore::AudioParamTimeline::ParamEvent::ParamEvent):
(WebCore::AudioParamTimeline::ParamEvent::type const):
(WebCore::AudioParamTimeline::ParamEvent::savedEvent):
(WebCore::AudioParamTimeline::ParamEvent::setCancelledValue):
(WebCore::AudioParamTimeline::ParamEvent::hasDefaultCancelledValue const):
(WebCore::AudioParamTimeline::ParamEvent::curvePointsPerSecond const):
(WebCore::AudioParamTimeline::ParamEvent::curveEndValue const):

LayoutTests:

  • webaudio/audioparam-cancel-and-hold-expected.txt: Added.
  • webaudio/audioparam-cancel-and-hold.html: Added.
  • webaudio/cancel-values-crash-913217-expected.txt: Added.
  • webaudio/cancel-values-crash-913217.html: Added.
  • webaudio/resources/audio-param.js: Added.

Import layout test coverage from Blink.

  • webaudio/audioparam-setValueCurveAtTime-expected.txt: Removed.
  • webaudio/audioparam-setValueCurveAtTime.html: Removed.

Remove outdated test. This test is now part of web-platform-tests at
webaudio/the-audio-api/the-audioparam-interface/audioparam-setValueCurveAtTime.html
and is now passing.

3:35 PM Changeset in webkit [266711] by Karl Rackler
  • 1 edit
    9 deletes in trunk/LayoutTests

Remove duplicate test expectaions from platform/mac-bigsur
rdar://68372418

Unreviewed test gardening.

  • platform/mac-bigsur/fast/css/text-overflow-input-expected.txt: Removed.
  • platform/mac-bigsur/fast/forms/button-sizes-expected.txt: Removed.
  • platform/mac-bigsur/fast/forms/button-table-styles-expected.txt: Removed.
  • platform/mac-bigsur/fast/forms/input-button-sizes-expected.txt: Removed.
  • platform/mac-bigsur/fast/forms/listbox-bidi-align-expected.txt: Removed.
  • platform/mac-bigsur/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt: Removed.
  • platform/mac-bigsur/tables/mozilla/bugs/bug2479-3-expected.txt: Removed.
  • platform/mac-bigsur/tables/mozilla/bugs/bug33855-expected.txt: Removed.
  • platform/mac-bigsur/tables/mozilla_expected_failures/bugs/bug2479-5-expected.txt: Removed.
1:55 PM Changeset in webkit [266710] by commit-queue@webkit.org
  • 6 edits in trunk/Source

Unreviewed, reverting r266645.
https://bugs.webkit.org/show_bug.cgi?id=216251

Caused MotionMark regression

Reverted changeset:

"Move lazy DisplayLink tear down logic from the WebProcess to
the UIProcess"
https://bugs.webkit.org/show_bug.cgi?id=216195
https://trac.webkit.org/changeset/266645

12:36 PM Changeset in webkit [266709] by weinig@apple.com
  • 12 edits
    12 adds in trunk

[WebIDL] Fix issues found by preprocess-idls.pl parser validation and enabled parser validation by default for the tests
https://bugs.webkit.org/show_bug.cgi?id=216246

Reviewed by Darin Adler.

Source/WebCore:

Enabling preprocess-idls.pl's validation parser for run-bindings-tests revealed a few issues
that this change fixes:

  • Includes statements (as well as any other non-extended attribute related statement) in a comment were being treated as being part of the document. Fixed this by moving the existing c/c++ style comment removal from getInterfaceExtendedAttributesFromIDL to processIDL so it is run for all IDLs. Since getInterfaceExtendedAttributesFromIDL was called for most files anyway, this doesn't measurably change the performance.
  • Some test IDLs did not have their primary interface name matching the name of the IDL file. This resulted in a number of tests not actually producing any output. Updated the tests themselves to match name.

To ensure we don't regress here, the validation parser is now always enabled when running
the tests, and preprocess-idls.pl has been updated to be a little less noisy when running
with the validation parser enabled (unless you specify --verbose) so that the test output
is not disturbed.

  • bindings/scripts/preprocess-idls.pl:

(processIDL):
(getPartialNamesFromIDL):
(getIncludedInterfacesFromIDL):
(isCallbackInterfaceFromIDL):
(isMixinInterfaceFromIDL):
(containsIterableInterfaceFromIDL):
(containsInterfaceOrCallbackInterfaceFromIDL):
(containsInterfaceWithConstantsFromIDL):
(getInterfaceExtendedAttributesFromIDL):
(getUndefinedBaseDictionariesFromIDL):

  • bindings/scripts/test/JS/JSTestDomainSecurity.cpp: Added.
  • bindings/scripts/test/JS/JSTestDomainSecurity.h: Added.
  • bindings/scripts/test/JS/JSTestMapLike.cpp: Added.
  • bindings/scripts/test/JS/JSTestMapLike.h: Added.
  • bindings/scripts/test/JS/JSTestReadOnlyMapLike.cpp: Added.
  • bindings/scripts/test/JS/JSTestReadOnlyMapLike.h: Added.
  • bindings/scripts/test/JS/JSTestReadOnlySetLike.cpp: Added.
  • bindings/scripts/test/JS/JSTestReadOnlySetLike.h: Added.
  • bindings/scripts/test/JS/JSTestReportExtraMemoryCost.cpp: Added.
  • bindings/scripts/test/JS/JSTestReportExtraMemoryCost.h: Added.
  • bindings/scripts/test/JS/JSTestSetLike.cpp: Added.
  • bindings/scripts/test/JS/JSTestSetLike.h: Added.
  • bindings/scripts/test/SupplementalDependencies.dep:
  • bindings/scripts/test/TestDomainSecurity.idl:
  • bindings/scripts/test/TestMapLike.idl:
  • bindings/scripts/test/TestObj.idl:
  • bindings/scripts/test/TestReadOnlyMapLike.idl:
  • bindings/scripts/test/TestReadOnlySetLike.idl:
  • bindings/scripts/test/TestReportExtraMemoryCost.idl:
  • bindings/scripts/test/TestSetLike.idl:

Tools:

  • Scripts/webkitpy/bindings/main.py:

(BindingsTests.generate_supplemental_dependency):
Enable the parser validation for preprocess-idls.pl to catch accidental differences between
the fast regex based scanner in preprocess-idls.pl and the real IDL parser.

12:04 PM Changeset in webkit [266708] by youenn@apple.com
  • 2 edits in trunk/Source/WebCore

Fix https://trac.webkit.org/changeset/266508 as per post-commit comments
https://bugs.webkit.org/show_bug.cgi?id=216242

Reviewed by Alex Christensen.

No change of behavior.

  • platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:

(WebCore::toRTCRtpCapabilities):

11:54 AM Changeset in webkit [266707] by Alan Bujtas
  • 3 edits in trunk/LayoutTests

Unreviewed rebaselining.

The test output (render tree dump) is sensitive to float precision.

r266509 slightly changed the way we compute the run's horizontal position
and its new position is 0.000061px more to the right. The integral ceil that we apply
to the run's width computation in the dump-render-tree-as-text makes the final value go from 39px to 40px.
(Note that final width value has dependency on the horizontal positon.)

  • platform/ios-wk2/TestExpectations:
  • platform/ios/css2.1/t0905-c5525-fltwidth-00-c-g-expected.txt:
11:42 AM Changeset in webkit [266706] by weinig@apple.com
  • 17 edits
    1 copy
    3 adds in trunk/Source/WebCore

[WebIDL] Support extended attributes on includes statements to allow for conditionalized inclusion
https://bugs.webkit.org/show_bug.cgi?id=216235

Reviewed by Darin Adler.

In some circumstancs, such as with the AnimationFrameProvider interface mixin, it is
useful to only include a mixin based on some conditional. For AnimationFrameProvider,
we currently only want to include it in DedicatedWorkerGlobalScope if ENABLE(OFFSCREEN_CANVAS)
is set at compile time, and the runtime feature flag offscreenCanvasEnabled() is turned
on. To support that, this change adds support for specifying extended attributes on the
includes statement itself, and having those extended attributes applied to each member
of the mixin. For AnimationFrameProvider in DedicatedWorkerGlobalScope, that looks like:

[Conditional=OFFSCREEN_CANVAS, EnabledAtRuntime=OffscreenCanvas] DedicatedWorkerGlobalScope includes AnimationFrameProvider;

  • CMakeLists.txt:
  • DerivedSources-input.xcfilelist:
  • DerivedSources-output.xcfilelist:
  • DerivedSources.make:
  • WebCore.xcodeproj/project.pbxproj:

Add new files, update xcfilelists.

  • animation/AnimationFrameProvider.idl: Added.
  • page/DOMWindow.idl:
  • workers/DedicatedWorkerGlobalScope.idl:

Split AnimationFrameProvider.idl out into its own mixin (as specified) and included it in
both DOMWindow and DedicatedWorkerGlobalScope (conditionally).

  • bindings/scripts/CodeGenerator.pm:

(ProcessDocument):
(ProcessDictionaryAndEnumerationImplementedAsOverrides):
(ProcessInterfaces):
(ProcessCallbackFunctions):
(ProcessDictionaries):
(ProcessEnumerations):
Split processing of each different type of top level type into its own function,
and defer processing of supplemental dependencies until the primary type has been
selected.

(MergeExtendedAttributesFromSupplemental):
(IsValidSupplementalInterface):
(IsValidSupplementalDictionary):
(ProcessInterfaceSupplementalDependencies):
(ProcessDictionarySupplementalDependencies):
Split ProcessSupplementalDependencies into ProcessInterfaceSupplementalDependencies
and ProcessDictionarySupplementalDependencies, which now get passed the primary
interface or dictionary that needs supplementing. ProcessInterfaceSupplementalDependencies
now also supports merging extended attributes from includes statements and checking
that all includes are listed in the dependency set.

  • bindings/scripts/IDLAttributes.json:

Allow setting use of Conditional, EnabledAtRuntime and EnabledBySetting for
includes statements.

  • bindings/scripts/IDLParser.pm:

(parseIncludesStatement):
Fix ordering of struct members so that extendedAttributes is always last (no real
good reason other than most of the structs already did this and the lack of consistency
bothered me). Add extendedAttributes to IDLIncludesStatement and set it when
parsing.

  • bindings/scripts/preprocess-idls.pl:

(getIncludedInterfacesFromIDL):
Fix bug in regex (found easily by the validation parser!) that incorrectly required the interface
name in the includes statement to be the first word on a line.

  • bindings/scripts/test/BindingTestGlobalConstructors.idl:
  • bindings/scripts/test/JS/JSTestConditionalIncludes.cpp: Added.
  • bindings/scripts/test/JS/JSTestConditionalIncludes.h: Added.
  • bindings/scripts/test/JS/JSTestGlobalObject.cpp:
  • bindings/scripts/test/JS/JSTestInterface.cpp:
  • bindings/scripts/test/SupplementalDependencies.dep:
  • bindings/scripts/test/TestConditionalIncludes.idl: Added.
  • bindings/scripts/test/TestIncludes.idl:

Add tests for extended attributes on includes statements.

10:55 AM Changeset in webkit [266705] by commit-queue@webkit.org
  • 4 edits in trunk/Source/WebCore

Add memory cache with/without validation to logResourceResponseSource
https://bugs.webkit.org/show_bug.cgi?id=216244
<rdar://problem/64184239>

Patch by Alex Christensen <achristensen@webkit.org> on 2020-09-07
Reviewed by Darin Adler.

  • loader/ResourceLoader.cpp:

(WebCore::logResourceResponseSource):

  • page/DiagnosticLoggingKeys.cpp:

(WebCore::DiagnosticLoggingKeys::memoryCacheKey):
(WebCore::DiagnosticLoggingKeys::memoryCacheAfterValidationKey):

  • page/DiagnosticLoggingKeys.h:
10:43 AM Changeset in webkit [266704] by Darin Adler
  • 2 edits in trunk/LayoutTests
  • platform/mac-wk2/TestExpectations: Revert change I accidentally included in my last patch.
10:11 AM Changeset in webkit [266703] by Darin Adler
  • 14 edits in trunk

Make TextCodecCJK and TextCodecSingleByte thread-safe and refactor a bit to share code
https://bugs.webkit.org/show_bug.cgi?id=216229

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

  • web-platform-tests/encoding/eof-utf-8-one.html:
  • web-platform-tests/encoding/eof-utf-8-three.html:
  • web-platform-tests/encoding/eof-utf-8-two.html:

Updated these files with fresh copies. Somehow, the trailing invalid
UTF-8 sequences from these files must have gotten lost when we
re-synced web-platform-tests/encoding from upstream. If we do that
again, then these tests will start failing again.

Source/WebCore:

The text encoding machinery is usable on multiple threads, but our new TextCodec
classes have some global data structures that need to be guarded to keep that intact.

  • platform/text/EncodingTables.cpp:

(WebCore::checkEncodingTableInvariants): One-time check for invariants that clients
of these tables depend on.

  • platform/text/EncodingTables.h: Added checkEncodingTableInvariants. Also Added

function templates for encoding tables: Added findFirstInSortedPairs,
findLastInSortedPairs and findInSortedPairs for searching a sorted array of pairs
used as a map. Added sortByFirst to aid in the creation of such a sorted array.
And added isSortedByFirst and sortedFirstsAreUnique so we can assert those invariants.
One of the good features of the findInSortedPairs functions is that they handle integer
values that don't fit in an integral key type, returning WTF::nullopt in that case.
That lets us pass code point values when looking in tables that use code units as their
key, without separately checking if they are in range, which otherwise requires
converting to UChar and checking for equality or calling U_IS_BMP.

  • platform/text/TextCodecCJK.cpp:

(WebCore::TextCodecCJK::TextCodecCJK): Call checkEncodingTableInvariants.
(WebCore::TextCodecCJK::encode const): Ditto.
(WebCore::jis0208DecodeIndex): Use std::call_once for thread safety.
Use sortByFirst and sortedFirstsAreUnique.
(WebCore::codePointJIS0208): Use findFirstInSortedPairs.
(WebCore::codePointJIS0212): Ditto.
(WebCore::TextCodecCJK::eucJPDecode): Cast to char instad of LChar when adding
an ASCII character to a StringBuilder.
(WebCore::eucJPEncode): Use the name codePoint instead of c to match other
surrounding code. Use findLastInSortedPairs.
(WebCore::iso2022JPEncode): Removed some unneeded casts to uint8_t when appending
bytes to a Vector. Added a static_assert to check the size of iso2022JPKatakana.
Use findLastInSortedPairs.
(WebCore::shiftJISEncode): Use findInSortedPairs.
(WebCore::eucKREncodingIndex): Use std::call_once for thread safety.
Use sortByFirst and sortedFirstsAreUnique.
(WebCore::eucKREncode): Removed some unneeded casts to uint8_t when appending
bytes to a Vector. Use findFirstInSortedPairs.
(WebCore::TextCodecCJK::eucKRDecode): Use findFirstInSortedPairs.
(WebCore::big5Encode): Use findInSortedPairs. Also renamed c to codePoint.
(WebCore::big5DecodeIndex): Use std::call_once for thread safety.
Use sortByFirst and sortedFirstsAreUnique.
(WebCore::TextCodecCJK::big5Decode): Use findFirstInSortedPairs. Cast to char
instad of LChar when adding an ASCII character to a StringBuilder.

  • platform/text/TextCodecSingleByte.cpp:

(WebCore::tableForEncoding): Return an IteratorRange instead of a pair of
pointer and size. This works with std::begin/end. Also make table with actual
encoded bytes, by adding 0x80 here, rather than doing that when using the table.
(WebCore::encode): Use std::call_once for thread safety.
Use sortByFirst and sortedFirstsAreUnique. The code before was not sorting at
all, which means it probably didn't work in any cases where the code units
happen to not be in ascending order. We should add some test cases.
(WebCore::decode): Use findFirstInSortedPairs. Also use StringView::codePoints
because these are likely to be 8-bit strings and we don't need to temporarily
upconvert them to 16-bit just to encode them. Should probably later measure if
the use of StringView::upconvertedCharacters plus CodePointIterator<UChar>
instead of StringView::codePoints is better for performance in the CJK encoding
functions. This approach means more branching inside the loop, but the other
version involves memory allocation and a second loop when the characters are
all 8-bit.

Tools:

  • TestWebKitAPI/Tests/WTF/StringView.cpp:

(TestWebKitAPI::TEST): Removed an unused variable. At one point, with
code that I wrote and now have rolled out, this was causing a build failure.

LayoutTests:

tests. They were failing because the tests were imported into the source
tree improperly and are passing now that is fixed.

10:02 AM Changeset in webkit [266702] by commit-queue@webkit.org
  • 2 edits in trunk/Source/WebKit

Build failure; cannot find seccomp.h
https://bugs.webkit.org/show_bug.cgi?id=216226

Patch by Mike Gorse <mgorse@suse.com> on 2020-09-07
Reviewed by Darin Adler.

No new tests (build fix only).

  • PlatformGTK.cmake: Add LIBSECCOMP_INCLUDE_DIRS to

WebKit_SYSTEM_INCLUDE_DIRECTORIES.

9:11 AM Changeset in webkit [266701] by youenn@apple.com
  • 5 edits in trunk

Fix Internals::supportsVCPEncoder on BigSur
https://bugs.webkit.org/show_bug.cgi?id=216174

Reviewed by Eric Carlson.

Source/WebCore:

Fixed by unflaked test.

  • testing/Internals.cpp:

(WebCore::Internals::supportsVCPEncoder):
All MacOS supported versions now supports VCP.

LayoutTests:

  • platform/mac-wk2/TestExpectations:
  • platform/mac/webrtc/captureCanvas-webrtc-software-encoder-expected.txt:
  • platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html:

Slight modification to make the test run faster and output more comprehensive error message if error happens.

9:11 AM Changeset in webkit [266700] by youenn@apple.com
  • 2 edits in trunk/Source/WebCore

Update IDLAttributes.json to forbid Exposed on dictionary
https://bugs.webkit.org/show_bug.cgi?id=216243

Reviewed by Alex Christensen.

  • bindings/scripts/IDLAttributes.json:
8:51 AM Changeset in webkit [266699] by youenn@apple.com
  • 7 edits
    12 adds in trunk

Safari takes too long to fetch images from memory cache
https://bugs.webkit.org/show_bug.cgi?id=216048
<rdar://problem/68260952>

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

  • web-platform-tests/fetch/stale-while-revalidate/stale-image.html:
  • web-platform-tests/html/dom/elements/images/bypass-cache-revalidation-expected.txt: Added.
  • web-platform-tests/html/dom/elements/images/bypass-cache-revalidation.html: Added.
  • web-platform-tests/html/dom/elements/images/image.py: Added.

(main):

Source/WebCore:

In case of image resource, we skip revalidation if the stored image is from the same document.
This is inline with https://html.spec.whatwg.org/#updating-the-image-data:list-of-available-images
which defines a list of available images for each Document.
In case fetch mode is different, we do not skip revalidation as we might otherwise bypass security checks.

Tests: http/wpt/html/dom/elements/images/bypass-cache-redirection-revalidation.html

http/wpt/html/dom/elements/images/hover-image-change.html
imported/w3c/web-platform-tests/html/dom/elements/images/bypass-cache-revalidation.html

  • loader/cache/CachedImage.cpp:

(WebCore::CachedImage::load):
(WebCore::CachedImage::canSkipRevalidation const):

  • loader/cache/CachedImage.h:
  • loader/cache/CachedResourceLoader.cpp:

(WebCore::CachedResourceLoader::determineRevalidationPolicy const):

LayoutTests:

  • http/wpt/html/dom/elements/images/bypass-cache-redirection-revalidation-expected.txt: Added.
  • http/wpt/html/dom/elements/images/bypass-cache-redirection-revalidation.html: Added.
  • http/wpt/html/dom/elements/images/hover-image-change-expected.html: Added.
  • http/wpt/html/dom/elements/images/hover-image-change.html: Added.
  • http/wpt/html/dom/elements/images/redirect.py: Added.
5:37 AM Changeset in webkit [266698] by youenn@apple.com
  • 27 edits
    8 adds in trunk

Add missing members to RTCIceCandidate
https://bugs.webkit.org/show_bug.cgi?id=216075

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

  • web-platform-tests/webrtc/RTCIceCandidate-constructor-expected.txt:
  • web-platform-tests/webrtc/RTCIceCandidate-constructor.html:
  • web-platform-tests/webrtc/idlharness.https.window-expected.txt:

Source/ThirdParty/libwebrtc:

  • Configurations/libwebrtc.iOS.exp:
  • Configurations/libwebrtc.iOSsim.exp:
  • Configurations/libwebrtc.mac.exp:

Source/WebCore:

Sync IDL with latest spec.
Add missing enums and make use of libwebrtc parse routine to get fields from candidate SDP.
Covered by updated tests.

  • CMakeLists.txt:
  • DerivedSources-input.xcfilelist:
  • DerivedSources-output.xcfilelist:
  • DerivedSources.make:
  • Modules/mediastream/RTCIceCandidate.cpp:

(WebCore::RTCIceCandidate::RTCIceCandidate):
(WebCore::RTCIceCandidate::create):

  • Modules/mediastream/RTCIceCandidate.h:
  • Modules/mediastream/RTCIceCandidate.idl:
  • Modules/mediastream/RTCIceCandidateInit.h:
  • Modules/mediastream/RTCIceCandidateInit.idl:
  • Modules/mediastream/RTCIceCandidateType.h: Added.
  • Modules/mediastream/RTCIceCandidateType.idl: Added.
  • Modules/mediastream/RTCIceComponent.h: Added.
  • Modules/mediastream/RTCIceComponent.idl: Added.
  • Modules/mediastream/RTCIceProtocol.h: Added.
  • Modules/mediastream/RTCIceProtocol.idl: Added.
  • Modules/mediastream/RTCIceTcpCandidateType.h: Added.
  • Modules/mediastream/RTCIceTcpCandidateType.idl: Added.
  • Modules/mediastream/RTCStatsReport.h:
  • Modules/mediastream/RTCStatsReport.idl:
  • Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:

(WebCore::iceCandidateState):
(WebCore::fillRTCIceCandidateStats):

  • Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:

(WebCore::toRTCIceComponent):
(WebCore::toRTCIceProtocol):
(WebCore::toRTCIceTcpCandidateType):
(WebCore::toRTCIceCandidateType):
(WebCore::parseIceCandidateSDP):

  • Sources.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • testing/MockLibWebRTCPeerConnection.cpp:

(WebCore::MockLibWebRTCPeerConnectionForIceCandidates::sendCandidates):

LayoutTests:

  • fast/mediastream/RTCPeerConnection-icecandidate-event-expected.txt:
3:09 AM Changeset in webkit [266697] by commit-queue@webkit.org
  • 6 edits in trunk/Source/WebCore

[GStreamer] Convert custom GObject subclasses to WEBKIT_DEFINE_TYPE
https://bugs.webkit.org/show_bug.cgi?id=204673

Patch by Víctor Manuel Jáquez Leal <vjaquez@igalia.com> on 2020-09-07
Reviewed by Philippe Normand.

Instead of using G_DEFINE_TYPE macro use rather WEBKIT_DEFINE_TYPE
since it handles private structures.

No new tests since no functional changes.

  • platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:

Renamed the private structure to match with class name so it can
be autogeneterated by the macro.
(_WebKitWebAudioSrcPrivate::_WebKitWebAudioSrcPrivate): add
constructure.
(_WebKitWebAudioSrcPrivate::~_WebKitWebAudioSrcPrivate): add
destructor.
(webkit_web_audio_src_class_init): remove duplicated
initialization.
(webKitWebAudioSrcConstructed): add constructed vmethod to
initalize some private members.
(webKitWebAudioSrcSetProperty): renamed private structure.
(webKitWebAudioSrcGetProperty): ditto.
(webKitWebAudioSrcAllocateBuffersAndRenderAudio): ditto.
(webKitWebAudioSrcLoop): ditto.

  • platform/graphics/gstreamer/VideoSinkGStreamer.cpp:

(webkitVideoSinkConstructed): add constructed vmethod to initalize
some private members.
(webkit_video_sink_class_init): remove duplicated initialization.

  • platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:

(webkit_media_clear_key_decrypt_class_init): remove duplicated
initialization.

  • platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:

(webkit_media_common_encryption_decrypt_class_init): remove
duplicated initialization.
(constructed): add constructed vmethod to initalize some private
members.

  • platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp:

(webkit_media_thunder_decrypt_class_init): remove duplicated
initialization.

2:54 AM Changeset in webkit [266696] by svillar@igalia.com
  • 7 edits in trunk

[css-flex] Allow indefinite size flex items to be definite wrt resolving percentages inside them
https://bugs.webkit.org/show_bug.cgi?id=212264

Reviewed by Manuel Rego Casasnovas.

LayoutTests/imported/w3c:

  • web-platform-tests/css/css-flexbox/percentage-heights-003-expected.txt: There were 3 subtests

marked as failures. All of them work fine now.

Source/WebCore:

Implement https://github.com/w3c/csswg-drafts/commit/5b5db39d21f3658ae2f4d7992daaf822aca178d8 which modified
the way percentages were resolved in flexible items with indefinite sizes. From now on we can pretend that
they're really definite.

This allows us to mark 3 tests which were testing percentages in flex items as correct.

Based on Blink's crrev.com/1247184 by <cbiesinger@chromium.org>

This is a reland of r263399 which got reverted due to bug 214655. This same patch was previously relanded in
r262124 which got reverted due to the bug fixed in r263389.

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::mainSizeForPercentageResolution): Do only check flex container main size
definiteness when computing the main size for percentage resolution, no need to check flex basis at all.

LayoutTests:

  • css3/flexbox/definite-main-size-expected.txt: Updated expectation.
  • css3/flexbox/definite-main-size.html: Updated comment.
2:20 AM Changeset in webkit [266695] by svillar@igalia.com
  • 7 edits
    2 deletes in trunk

[css-flexbox] min-height: auto not applied to nested flexboxes.
https://bugs.webkit.org/show_bug.cgi?id=210089

Reviewed by Daniel Bates.

Source/WebCore:

Nested flexboxes with column direction were not computing correctly min-size:auto because
we were explicitly preventing them from doing so in the code. Implemented the required bits to
make it work correctly and thus removed the retriction. The idea is to set an indefinite override
containing block size so that percentages would be resolved to auto as spec'ed. The code which
decides whether to apply min-size:auto was refactored in the shouldApplyMinSizeAutoForChild() method.

In order not to cause regressions some other two additional changes were also implemented. First we
had to adjust childHasIntrinsicMainAxisSize() so that it also takes into account the cases where
shouldApplyMinSizeAutoForChild() is true and return true. Secondly we had to add an additional case
to mainAxisLengthIsDefinite() so that it returns false for column flows where the flexBasis is intrinsic.

Inspired by Blink's crrev.com/c/1641510, crrev.com/c/1269995 & crrev.com/c/1786297 by <cbiesinger@chromium.org>

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::shouldApplyMinSizeAutoForChild const): Refactored from
RenderFlexibleBox::adjustChildSizeForMinAndMax.
(WebCore::RenderFlexibleBox::mainAxisLengthIsDefinite const): Additional case for column flows.
(WebCore::RenderFlexibleBox::layoutFlexItems): Reset m_hasDefiniteHeight to Unknown after calling
constructFlexItem() because the latter might set now an override containing block height which basically
potentially makes any cached size value incorrect.
(WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax): Directly call shouldApplyMinSizeAutoForChild().
(WebCore::RenderFlexibleBox::constructFlexItem): Set an indefinite override containing block size for
children with percentage sizes so that they're resolved as auto.
(WebCore::RenderFlexibleBox::childHasIntrinsicMainAxisSize const): Return true for those cases where the
main axis length is indefinite and also when shouldApplyMinSizeAutoForChild().

  • rendering/RenderFlexibleBox.h:

LayoutTests:

Apart from enabling some tests we're removing a test which is now invalid as it was added
under the condition that we were not matching the specs wrt percentage height computation in
column flexboxes.

  • TestExpectations: Removed two test cases that are passing now.
  • fast/flexbox/nested-column-intrinsic-min-disabled-expected.html: Removed.
  • fast/flexbox/nested-column-intrinsic-min-disabled.html: Removed.
  • platform/ios/fast/forms/auto-fill-button/input-strong-password-auto-fill-button-expected.txt: Updated.
  • platform/mac/fast/forms/auto-fill-button/input-strong-password-auto-fill-button-expected.txt: Ditto.
1:28 AM Changeset in webkit [266694] by jh718.park@samsung.com
  • 2 edits in trunk/Source/JavaScriptCore

Unreviewed. Remove the build warning below since r266567.
warning: parameter ‘hint’ set but not used [-Wunused-but-set-parameter]

  • runtime/JSObject.cpp:

(JSC::callToPrimitiveFunction):

Sep 6, 2020:

11:19 PM Changeset in webkit [266693] by mmaxfield@apple.com
  • 8 edits in trunk/Source

[iOS] attachmentActionFont() Needs to use kCTFontSymbolicTrait: @(kCTFontTraitTightLeading | kCTFontTraitEmphasized) to get the short emphasized footnote font
https://bugs.webkit.org/show_bug.cgi?id=215707
<rdar://problem/63930892>

Reviewed by Darin Adler.

Source/WebCore:

This is the correct way to get the short emphasized footnote font.

  • rendering/RenderThemeIOS.mm:

(WebCore::attachmentActionFont):

Source/WebCore/PAL:

  • pal/spi/cocoa/CoreTextSPI.h: Add an optimzation for platforms which support it.

Source/WTF:

  • wtf/PlatformHave.h:
11:11 PM Changeset in webkit [266692] by mmaxfield@apple.com
  • 7 edits in trunk/Source/WebCore

[Cocoa] Prepare for migrating to CTFontHasTable() once it's faster than CTFontCopyAvailableTables()
https://bugs.webkit.org/show_bug.cgi?id=215688

Reviewed by Darin Adler.

Source/WebCore:

We can directly ask Core Text for the information we're looking for.

No new tests because there is no behavior change.

  • platform/graphics/cocoa/FontCacheCoreText.cpp:

(WebCore::FontType::FontType):

  • platform/graphics/cocoa/FontCocoa.mm:

(WebCore::fontHasVerticalGlyphs):

  • platform/graphics/opentype/OpenTypeCG.cpp:

(WebCore::OpenType::fontHasMathTable):

Source/WebCore/PAL:

  • pal/spi/cocoa/CoreTextSPI.h:
8:11 PM Writing testharness Tests edited by Fujii Hironori
(diff)
7:34 PM Writing Layout Tests for DumpRenderTree edited by Fujii Hironori
Use js-test.js instread of js-test-pre.js (diff)
7:22 PM Changeset in webkit [266691] by Wenson Hsieh
  • 19 edits in trunk/Source/WebCore

Make WebCore::WritingMode an 8-bit enum class
https://bugs.webkit.org/show_bug.cgi?id=216233

Reviewed by Darin Adler.

Narrow WebCore::WritingMode to an 8-bit enum class; no change in behavior.

  • css/CSSPrimitiveValueMappings.h:

(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator WritingMode const):

  • css/CSSProperty.cpp:

(WebCore::resolveToPhysicalProperty):

  • dom/Element.cpp:

(WebCore::toScrollAlignmentForInlineDirection):
(WebCore::toScrollAlignmentForBlockDirection):

  • page/FrameView.cpp:

(WebCore::paginationModeForRenderStyle):

  • platform/text/WritingMode.h:
  • rendering/GridBaselineAlignment.cpp:

(WebCore::BaselineGroup::isOppositeBlockFlow const):
(WebCore::BaselineGroup::isOrthogonalBlockFlow const):

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::adjustBorderBoxRectForPainting):
(WebCore::RenderBlock::paintRectToClipOutFromBorder):
(WebCore::RenderBlock::borderTop const):
(WebCore::RenderBlock::borderLeft const):
(WebCore::RenderBlock::borderBottom const):
(WebCore::RenderBlock::borderRight const):

  • rendering/RenderBox.cpp:

(WebCore::shouldFlipBeforeAfterMargins):
(WebCore::RenderBox::visualOverflowRectForPropagation const):
(WebCore::RenderBox::layoutOverflowRectForPropagation const):

  • rendering/RenderDetailsMarker.cpp:

(WebCore::RenderDetailsMarker::orientation const):

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::isLeftToRightFlow const):
(WebCore::RenderFlexibleBox::transformedWritingMode const):
(WebCore::RenderFlexibleBox::flowAwareBorderBefore const):
(WebCore::RenderFlexibleBox::flowAwareBorderAfter const):
(WebCore::RenderFlexibleBox::flowAwarePaddingBefore const):
(WebCore::RenderFlexibleBox::flowAwarePaddingAfter const):
(WebCore::RenderFlexibleBox::flowAwareMarginBeforeForChild const):

  • rendering/RenderTableCell.cpp:

(WebCore::RenderTableCell::paddingTop const):
(WebCore::RenderTableCell::paddingBottom const):
(WebCore::RenderTableCell::paddingLeft const):
(WebCore::RenderTableCell::paddingRight const):

  • rendering/RenderTreeAsText.cpp:

(WebCore::RenderTreeAsText::writeRenderObject):

  • rendering/SimpleLineLayout.cpp:

(WebCore::SimpleLineLayout::canUseForStyle):

  • rendering/shapes/ShapeOutsideInfo.cpp:

(WebCore::borderBeforeInWritingMode):
(WebCore::borderAndPaddingBeforeInWritingMode):

  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::RenderStyle):
(WebCore::RenderStyle::borderBefore const):
(WebCore::RenderStyle::borderAfter const):
(WebCore::RenderStyle::borderBeforeWidth const):
(WebCore::RenderStyle::borderAfterWidth const):

  • rendering/style/RenderStyle.h:

(WebCore::RenderStyle::initialWritingMode):
(WebCore::RenderStyle::setWritingMode):

  • style/StyleAdjuster.cpp:

(WebCore::Style::Adjuster::adjust const):

  • style/StyleBuilderState.cpp:

(WebCore::Style::BuilderState::adjustStyleForInterCharacterRuby):

7:07 PM BuildingCairoOnWindows edited by Fujii Hironori
(diff)
6:57 PM Debugging With Visual Studio edited by Fujii Hironori
(diff)
6:33 PM Changeset in webkit [266690] by mmaxfield@apple.com
  • 7 edits in trunk/Source

CTFontGetPhysicalSymbolicTraits() is faster than CTFontCopyPhysicalFont()/CTFontGetSymbolicTraits()
https://bugs.webkit.org/show_bug.cgi?id=215685

Reviewed by Darin Adler.

Source/WebCore:

Instead of making the two calls, we can make a single call that has the same effect.

No new tests because there is no behavior change.

  • platform/graphics/cocoa/FontCacheCoreText.cpp:

(WebCore::computeNecessarySynthesis):
(WebCore::FontCache::systemFallbackForCharacters):

  • platform/graphics/cocoa/FontCacheCoreText.h:
  • platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:

(WebCore::FontFamilySpecificationCoreText::fontRanges const):

Source/WTF:

  • wtf/PlatformHave.h:
5:59 PM Changeset in webkit [266689] by Wenson Hsieh
  • 3 edits in trunk/Source/WebCore

[MotionMark - Multiply] Web process spends ~1% of total samples in PropertyCascade::resolveDirectionAndWritingMode
https://bugs.webkit.org/show_bug.cgi?id=216223

Reviewed by Darin Adler.

A few subtests in MotionMark (Leaves, Focus, Design, and especially Multiply) spend large amounts of time in
style resolution (Document::resolveStyle) due to constant style changes across many elements during every
frame. In Multiply, ~3-4% of the time underneath Document::resolveStyle is spent resolving direction and
writing modes inside PropertyCascade::resolveDirectionAndWritingMode (i.e., ~2.3 million invocations). This
helper function is responsible for computing the text direction and CSS writing mode that is used to resolve
direction-aware CSS properties (which are enumerated in CSSProperty::isDirectionAwareProperty). Resolving the
direction and writing mode involves iterating over all of the matched CSS properties (m_matchResult) in the
property cascade in search of CSS properties for writing and direction, which can be relatively expensive when
there are lots of properties in the cascade.

However, if there are no direction-aware CSS properties in the cascade, this work can actually be elided; to
achieve this, we can store the inherited Direction in m_direction, and then lazily resolve it if needed.

I measured this locally to yield a little under ~1% in the Multiply subtest in MotionMark. Otherwise, there is
no change in behavior; see below for more details.

  • style/PropertyCascade.cpp:

(WebCore::Style::PropertyCascade::PropertyCascade):
(WebCore::Style::PropertyCascade::set):

If we encounter a direction-aware CSS property, then use direction() to ensure that the direction and writing
mode are resolved.

(WebCore::Style::PropertyCascade::direction const):

Make this getter call resolveDirectionAndWritingMode if needed.

  • style/PropertyCascade.h:

Add a new bool member to keep track of whether or not the CSS direction has not yet been resolved. Note that
since this member variable fits within the padding after Direction m_direction;, this class is still the same
size.

(WebCore::Style::PropertyCascade::direction const): Deleted.

5:52 PM Changeset in webkit [266688] by mmaxfield@apple.com
  • 11 edits
    1 add in trunk

Make GlyphBufferAdvance and GlyphBufferOrigin more robust
https://bugs.webkit.org/show_bug.cgi?id=215143

Reviewed by Zalan Bujtas.

Source/WebCore:

GlyphBuffer contains vectors of advances and origins, which are conceptually
FloatSizes and FloatPoints. However, we need to pass these arrays into CTFontShapeGlyphs()
or CTFontTransformGlyphsWithLanguage(), which expects these vectors to use platform types.
Rather than converting in/out of platform types around the call site, we can simply use
the platform types throughout. Indeed, that's what we're doing today.

However, the mechanism we use today to make this platform-independent is to make a struct
which inherits from the platform types. Then, we static_cast the array of the struct to
an array of the base type. This is brittle, because it relies on the assumption that the
struct doesn't have any members added to it, which would change the stride of the array
and feed garbage into the shaping function.

Instead, a better design is to typedef the native type, and have all interactions with the
types go through standalone functions which deal with the native type. That way, we can't
accidentally change the size of the array elements.

No new tests because there is no behavior change.

  • Headers.cmake:
  • WebCore.xcodeproj/project.pbxproj:
  • platform/graphics/ComplexTextController.cpp:

(WebCore::ComplexTextController::advance):

  • platform/graphics/FontCascade.cpp:

(WebCore::FontCascade::widthForSimpleText const):
(WebCore::FontCascade::layoutComplexText const):
(WebCore::FontCascade::drawGlyphBuffer const):
(WebCore::FontCascade::drawEmphasisMarks const):
(WebCore::GlyphToPathTranslator::extents):
(WebCore::GlyphToPathTranslator::advance):

  • platform/graphics/GlyphBuffer.h:

(WebCore::GlyphBuffer::add):
(WebCore::GlyphBuffer::makeHole):
(WebCore::GlyphBuffer::expandLastAdvance):
(WebCore::GlyphBuffer::flatten):
(WebCore::GlyphBufferAdvance::GlyphBufferAdvance): Deleted.
(WebCore::GlyphBufferAdvance::operator FloatSize): Deleted.
(WebCore::GlyphBufferAdvance::setWidth): Deleted.
(WebCore::GlyphBufferAdvance::setHeight): Deleted.
(WebCore::GlyphBufferAdvance::width const): Deleted.
(WebCore::GlyphBufferAdvance::height const): Deleted.
(WebCore::GlyphBufferAdvance::encode const): Deleted.
(WebCore::GlyphBufferAdvance::decode): Deleted.
(WebCore::GlyphBufferOrigin::GlyphBufferOrigin): Deleted.
(WebCore::GlyphBufferOrigin::operator FloatPoint): Deleted.
(WebCore::GlyphBufferOrigin::setX): Deleted.
(WebCore::GlyphBufferOrigin::setY): Deleted.
(WebCore::GlyphBufferOrigin::x const): Deleted.
(WebCore::GlyphBufferOrigin::y const): Deleted.
(WebCore::GlyphBufferOrigin::encode const): Deleted.
(WebCore::GlyphBufferOrigin::decode): Deleted.
(WebCore::toFloatSize): Deleted.

  • platform/graphics/GlyphBufferMembers.h: Added.

(WebCore::createGlyphBufferAdvance):
(WebCore::floatSizeFromGlyphBufferAdvance):
(WebCore::setGlyphBufferAdvanceWidth):
(WebCore::setGlyphBufferAdvanceHeight):
(WebCore::glyphBufferAdvanceWidth):
(WebCore::glyphBufferAdvanceHeight):
(WebCore::createGlyphBufferOrigin):
(WebCore::floatPointFromGlyphBufferOrigin):
(WebCore::setGlyphBufferOriginX):
(WebCore::setGlyphBufferOriginY):
(WebCore::glyphBufferOriginX):
(WebCore::glyphBufferOriginY):

  • platform/graphics/WidthIterator.cpp:

(WebCore::WidthIterator::applyFontTransforms):
(WebCore::WidthIterator::advanceInternal):
(WebCore::WidthIterator::advanceOneCharacter):

  • platform/graphics/displaylists/DisplayListItems.cpp:

(WebCore::DisplayList::DrawGlyphs::computeBounds):

Tools:

  • TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp:

(TestWebKitAPI::TEST_F):

5:20 PM Changeset in webkit [266687] by weinig@apple.com
  • 8 edits in trunk

[WebIDL] Add mode to preprocess-idls.pl to validate fast regex based scanner with the normal IDL parser
https://bugs.webkit.org/show_bug.cgi?id=216231

Reviewed by Darin Adler.

Source/WebCore:

To aid tracking down mistakes in the fast regex based scanner in preprocess-idls.pl, this
adds a validation mode to the script which checks the results against what the normal, much
slower, IDL parser gets. In building it, it caught that we were not creating a dependency on
RTCRtpCodingParameters.idl for dictionaries that derived from it because it was missing from
DerivedSources.make/CMakeLists.txt, which would have manifested in confusing build errors
in some cases.

  • CMakeLists.txt:
  • DerivedSources.make:
  • bindings/scripts/generate-bindings-all.pl:

Add missing RTCRtpCodingParameters.idl and update invocation of preprocess-idls.pl to
pass in idlAttributesFile, which the parser needs (it is not read when not validating).

  • bindings/scripts/test/SupplementalDependencies.dep:

Updated to include missing dictionary dependencies.

  • bindings/scripts/preprocess-idls.pl:

(GeneratePartialInterface):
(processIDL):
(getPartialNamesFromIDL):
(getIncludedInterfacesFromIDL):
(isCallbackInterfaceFromIDL):
(isMixinInterfaceFromIDL):
(containsIterableInterfaceFromIDL):
(containsInterfaceOrCallbackInterfaceFromIDL):
(containsInterfaceWithConstantsFromIDL):
(getInterfaceExtendedAttributesFromIDL):
(getUndefinedBaseDictionariesFromIDL):
(shouldExposeInterface):
(getFileContents): Deleted.
(interfaceIsIterable): Deleted.
(containsInterfaceFromIDL): Deleted.
(interfaceHasConstantAttribute): Deleted.
(updateDictionaryDependencies): Deleted.

  • Allow enabling a validation mode via the $validateAgainstParser variable which parses each IDL with the normal IDL parser and compares results.
  • Updates a bunch of naming to be more clear about which variables contain file names vs. file paths.
  • Renames functions to use more consistent naming.
  • Fixes bug in dictionary dependency analysis that silently ignored dependencies that weren't in the file list.

Tools:

  • Scripts/webkitpy/bindings/main.py:

(BindingsTests.generate_supplemental_dependency):
Update for rename from idlFilesList to idlFileNamesList and to pass the idlAttributesFile argument.

5:00 PM Changeset in webkit [266686] by mmaxfield@apple.com
  • 16 edits in trunk/Source/WebCore

Remove all non-web-exposed uses of ENABLE(VARIATION_FONTS)
https://bugs.webkit.org/show_bug.cgi?id=216211

Reviewed by Darin Adler.

This is the first step toward enabling variation fonts on all ports.
This patch compiles internal data structures on all ports, keeping care to not make
any web-exposed changes. It also stops consulting with ENABLE(VARIATION_FONTS) on
Cocoa platforms, since the flag is enabled on all Cocoa platforms and we've been
shipping it for years.

No new tests because there is no behavior change.

  • css/CSSFontVariationValue.cpp:
  • css/CSSFontVariationValue.h:
  • css/CSSValue.cpp:

(WebCore::CSSValue::equals const):
(WebCore::CSSValue::cssText const):
(WebCore::CSSValue::destroy):

  • css/CSSValue.h:

(WebCore::CSSValue::isFontFeatureValue const):
(WebCore::CSSValue::isFontVariationValue const):

  • platform/graphics/FontCache.h:

(WebCore::FontDescriptionKey::FontDescriptionKey):
(WebCore::FontDescriptionKey::operator== const):
(WebCore::FontDescriptionKey::computeHash const):

  • platform/graphics/FontCascadeDescription.cpp:
  • platform/graphics/FontDescription.h:

(WebCore::FontDescription::setFeatureSettings):
(WebCore::FontDescription::setVariationSettings):
(WebCore::FontDescription::operator== const):
(WebCore::FontDescription::encode const):
(WebCore::FontDescription::decode):

  • platform/graphics/FontTaggedSettings.cpp:

(WebCore::operator<<):

  • platform/graphics/FontTaggedSettings.h:

(WebCore::FontVariationSettings::isEmpty const): Deleted.

  • platform/graphics/cocoa/FontCacheCoreText.cpp:

(WebCore::denormalizeVariationWidth):
(WebCore::normalizeVariationWidth):
(WebCore::preparePlatformFont):
(WebCore::extractVariationBounds):
(WebCore::variationCapabilitiesForFontDescriptor):

  • platform/graphics/mac/FontCustomPlatformData.cpp:

(WebCore::FontCustomPlatformData::supportsFormat):

  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::setFontVariationSettings):

  • rendering/style/RenderStyle.h:

(WebCore::RenderStyle::fontVariationSettings const):

  • style/StyleBuilderConverter.h:

(WebCore::Style::BuilderConverter::convertFontVariationSettings):

  • style/StyleBuilderCustom.h:

(WebCore::Style::BuilderCustom::applyInheritFontFeatureSettings):
(WebCore::Style::BuilderCustom::applyInheritFontVariationSettings):

4:42 PM Changeset in webkit [266685] by Alan Bujtas
  • 17 edits
    1 move in trunk/Source/WebCore

[LFC][IFC] Rename Display::LineBox to Display::Line
https://bugs.webkit.org/show_bug.cgi?id=216232

Reviewed by Sam Weinig.

Display::LineBox represent a line and not to be confused with Layout::LineBox which represents a collection of inline boxes.

  • WebCore.xcodeproj/project.pbxproj:
  • layout/FormattingContextGeometry.cpp:

(WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):

  • layout/blockformatting/BlockFormattingContextGeometry.cpp:

(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):

  • layout/blockformatting/BlockMarginCollapse.cpp:

(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough const):

  • layout/displaytree/DisplayInlineContent.h:

(WebCore::Display::InlineContent::lineForRun const):
(WebCore::Display::InlineContent::lineBoxForRun const): Deleted.

  • layout/displaytree/DisplayLine.h: Renamed from Source/WebCore/layout/displaytree/DisplayLineBox.h.

(WebCore::Display::Line::rect const):
(WebCore::Display::Line::scrollableOverflow const):
(WebCore::Display::Line::inkOverflow const):
(WebCore::Display::Line::left const):
(WebCore::Display::Line::right const):
(WebCore::Display::Line::top const):
(WebCore::Display::Line::bottom const):
(WebCore::Display::Line::width const):
(WebCore::Display::Line::height const):
(WebCore::Display::Line::baseline const):
(WebCore::Display::Line::Line):
(WebCore::Display::Line::moveVertically):

  • layout/displaytree/DisplayPainter.cpp:

(WebCore::Display::paintInlineContent):

  • layout/inlineformatting/InlineFormattingContext.cpp:

(WebCore::Layout::InlineFormattingContext::lineLayout):
(WebCore::Layout::InlineFormattingContext::createDisplayBoxesForLineContent):

  • layout/inlineformatting/InlineFormattingContextQuirks.cpp:

(WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):

  • layout/inlineformatting/InlineFormattingState.h:

(WebCore::Layout::InlineFormattingState::shrinkDisplayInlineContent):

  • layout/inlineformatting/InlineLineBox.cpp:

(WebCore::Layout::LineBox::constructInlineBoxes):

  • layout/integration/LayoutIntegrationLineLayout.cpp:

(WebCore::LayoutIntegration::LineLayout::contentLogicalHeight const):
(WebCore::LayoutIntegration::LineLayout::lineCount const):
(WebCore::LayoutIntegration::LineLayout::firstLineBaseline const):
(WebCore::LayoutIntegration::LineLayout::lastLineBaseline const):
(WebCore::LayoutIntegration::LineLayout::collectOverflow):
(WebCore::LayoutIntegration::LineLayout::paint):

  • layout/layouttree/LayoutTreeBuilder.cpp:

(WebCore::Layout::outputInlineRuns):

  • layout/tableformatting/TableFormattingContext.cpp:

(WebCore::Layout::TableFormattingContext::setUsedGeometryForCells):

  • layout/tableformatting/TableFormattingContextGeometry.cpp:

(WebCore::Layout::TableFormattingContext::Geometry::usedBaselineForCell):

  • rendering/line/LineLayoutTraversalDisplayRunPath.h:

(WebCore::LineLayoutTraversal::DisplayRunPath::baseline const):
(WebCore::LineLayoutTraversal::DisplayRunPath::line const):
(WebCore::LineLayoutTraversal::DisplayRunPath::lineBox const): Deleted.

4:09 PM Changeset in webkit [266684] by Chris Dumez
  • 11 edits in trunk

ConvolverNode incorrectly outputs silence because m_reverb is null
https://bugs.webkit.org/show_bug.cgi?id=216230

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Unreviewed, rebaseline tests that are now passing.

  • web-platform-tests/webaudio/the-audio-api/the-convolvernode-interface/convolver-response-1-chan-expected.txt:
  • web-platform-tests/webaudio/the-audio-api/the-convolvernode-interface/convolver-response-2-chan-expected.txt:
  • web-platform-tests/webaudio/the-audio-api/the-convolvernode-interface/convolver-response-4-chan-expected.txt:
  • web-platform-tests/webaudio/the-audio-api/the-convolvernode-interface/convolver-upmixing-1-channel-response-expected.txt:
  • web-platform-tests/webaudio/the-audio-api/the-convolvernode-interface/realtime-conv-expected.txt:

Source/WebCore:

ConvolverNode relies on m_reverb to to audio processing. m_reverb would get initialized
when calling ConvolverNode::setBuffer(). However, setting the buffer would cause
ConvolverNode::checkNumberOfChannelsForInput(), which could cause unitialize() and then
initialize() to get called. The issue was that unitialize() would null out m_reverb
and nothing would re-initialize it.

No new tests, rebaselined existing tests.

  • Modules/webaudio/ConvolverNode.cpp:

(WebCore::ConvolverNode::initialize): Deleted.
(WebCore::ConvolverNode::uninitialize): Deleted.

  • Modules/webaudio/ConvolverNode.h:

LayoutTests:

Unreviewed, unskip tests that should hopefully not be flaky anymore, not that they
are passing.

3:20 PM Changeset in webkit [266683] by mmaxfield@apple.com
  • 18 edits in trunk

Letter-spacing should disable ligatures
https://bugs.webkit.org/show_bug.cgi?id=176215
<rdar://problem/17044265>

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

This test is sensitive the order of the CSSPropertyID enum values.

  • web-platform-tests/css/cssom/css-style-attr-decl-block-expected.txt: Apparently this

test is sensitive to the ordering of CSSPropertyID enum values in CSSPropertyNames.h.
I filed https://bugs.webkit.org/show_bug.cgi?id=216170 about this.

Source/WebCore:

The CSS Text spec[1] says:
"When the effective spacing between two characters is not zero (due to either justification
or a non-zero value of letter-spacing), user agents should not apply optional ligatures."

The CSS Fonts spec[2] describes exactly how this is supposed to work:
"Step 11. Feature settings determined by properties other than font-variant or
font-feature-settings are applied. For example, setting a non-default value for the
letter-spacing property disables optional ligatures."

Disabling ligatures requires modifying font features, which means that the information about
whether we should disable them or not needs to be inside the FontDescription. This patch adds
a new bit, m_shouldDisableLigaturesForSpacing, to FontDescription. preparePlatformFont()
reads this bit and disables ligatures appropriately.

There's a bit of complexity here because the letter-spacing value itself lies inside the
RenderStyle, but the derived bit lies inside the FontDescriptor, which is one reason why
this patch migrates letter-spacing to use custom codegen functions. There's also a bit of
complexity about dependencies which is explained in a comment in
maybeUpdateFontForLetterSpacing().

[1] https://drafts.csswg.org/css-text-3/#letter-spacing-property
[2] https://drafts.csswg.org/css-fonts-4/#feature-variation-precedence

Test: imported/w3c/web-platform-tests/css/css-fonts/font-feature-resolution-001.html

  • css/CSSProperties.json: letter-spacing has to be high-priority because it affects font

selection, but it has to be processed after zoom because its <length> value is sensitive to
zoom. This adds a new keyword CSSProperties.json: sink-property which can let a property
sink to the bottom of its priority bucket.

  • css/makeprop.pl:

(addProperty):
(sortByDescendingPriorityAndName):

  • platform/graphics/FontCache.h:

(WebCore::FontDescriptionKey::makeFlagsKey):

  • platform/graphics/FontDescription.h:

(WebCore::FontDescription::shouldDisableLigaturesForSpacing const):
(WebCore::FontDescription::setShouldDisableLigaturesForSpacing):
(WebCore::FontDescription::operator== const):
(WebCore::FontDescription::encode const):
(WebCore::FontDescription::decode):

  • platform/graphics/cocoa/FontCacheCoreText.cpp:

(WebCore::preparePlatformFont): We can get into a situation where "liga" and "clig" don't
match, which means whichever one is later clobbers whichever one is earlier when applied to
AAT fonts. We need to make sure these values match so we don't get surprising results.

  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::setLetterSpacing):
(WebCore::RenderStyle::setLetterSpacingWithoutUpdatingFontDescription):

  • rendering/style/RenderStyle.h:
  • style/StyleBuilderCustom.h:

(WebCore::Style::applyLetterSpacing):
(WebCore::Style::BuilderCustom::applyInheritLetterSpacing):
(WebCore::Style::BuilderCustom::applyInitialLetterSpacing):
(WebCore::Style::maybeUpdateFontForLetterSpacing):
(WebCore::Style::BuilderCustom::applyValueLetterSpacing):
(WebCore::Style::BuilderCustom::applyValueWebkitLocale):
(WebCore::Style::BuilderCustom::applyInitialFontFamily):
(WebCore::Style::BuilderCustom::applyInheritFontFamily):
(WebCore::Style::BuilderCustom::applyValueFontFamily):
(WebCore::Style::BuilderCustom::applyInitialFontSize):
(WebCore::Style::BuilderCustom::applyInheritFontSize):
(WebCore::Style::BuilderCustom::applyValueFontSize):

  • style/StyleBuilderState.h:

Tools:

  • Scripts/webkitpy/style/checkers/jsonchecker.py:

(JSONCSSPropertiesChecker.check_codegen_properties):

LayoutTests:

imported/w3c/web-platform-tests/css/css-fonts/font-feature-resolution-001.html passes now.

  • TestExpectations:
  • platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/css-style-attr-decl-block-expected.txt:

Apparently this test is sensitive to the ordering of CSSPropertyID enum values in CSSPropertyNames.h.
I filed https://bugs.webkit.org/show_bug.cgi?id=216170 about this.

  • platform/mac-wk1/editing/mac/attributed-string/letter-spacing-expected.txt: Updated.
  • platform/mac-mojave-wk1/editing/mac/attributed-string/letter-spacing-expected.txt: Updated
2:32 PM Changeset in webkit [266682] by Alan Bujtas
  • 9 edits in trunk/Source/WebCore

[LFC][IFC] LineBox should contain all inline boxes
https://bugs.webkit.org/show_bug.cgi?id=216221

Reviewed by Antti Koivisto.

In this patch we decouple the line box and the line.

Previously the LineBox was pretty much representing the line.
It was responsible for both placing the inline boxes and sizing the line and position itself based on line-height/half leading.
Now the LineBox is only responsible for placing the inline boxes and sizing itself, it has no position geometry anymore neither
does it compute the line height.
The line size is computed later using the combination of line-height property/LineBox height/FontMetrics::lineSpacing/half leading.
This geometry is preserved in Display::LineBox (this needs to be renamed to Display::Line).

  1. LineBuilder places the runs on the line after each other (at this point they only have horizontal geometry).
  2. LineBreaker tells when to stop.
  3. We start constructing inline boxes for the runs (root inline box etc) and place them inside an LineBox. This is when horizontal and vertical alignment happen.
  4. We use the fully sized LineBox to compute the line geometry. Note that the line's geometry does not necessarily match the LineBox width/height (see below).
  5. We construct a Display::LineBox for the line and Display::Runs for the runs inside the inline boxes.

LineBox:

  • fully contains all the inline boxes, both horizontally and vertically.
  • has only width and height geometry
  • height is not constrained by the line-height property
  • does not have the concept of overflow.

Line:

  • contains the LineBox, but the LineBox can overflow the line, both horizontally and vertically.
  • has position relative to the root block container.

Simple case.
<div>font went crazy with line spacing</div>

_ line

| |
| | line spacing |
| v |

| -------------------------------------------LineBox | -------------------------------------------
| |
| line box height | |
----v--------------------------------------| alignment baseline

| |
| | line spacing | |
|v_| scrollable overflow

When glyphs in subsequent lines overflow:
<div style="line-height: 5px; font-size: 20px;">line box overflows the line</div>

_ LineBox

| |
| | line box height |
| | |

-Line

| | | | |
| | | line height | | |

-v--------------------

| | |

| alignment baseline

| | |
|v_|

  • layout/inlineformatting/InlineFormattingContext.cpp:

(WebCore::Layout::InlineFormattingContext::createDisplayBoxesForLineContent):

12:10 PM Changeset in webkit [266681] by Darin Adler
  • 26 edits in trunk/Source

TextCodec refinements
https://bugs.webkit.org/show_bug.cgi?id=216219

Reviewed by Sam Weinig.

Source/JavaScriptCore:

  • parser/Lexer.h:

(JSC::Lexer<UChar>::isWhiteSpace): Use byteOrderMark constant.

Source/WebCore:

  • dom/TextDecoder.cpp:

(WebCore::TextDecoder::bytesNeededForFullBOMIgnoreCheck const): Deleted.
(WebCore::TextDecoder::isBeginningOfIncompleteBOM const): Deleted.
(WebCore::TextDecoder::ignoreBOMIfNecessary): Deleted.
(WebCore::TextDecoder::decode): Call stripByteOrderMark on the TextCodec
to tell it to ignore the BOM, once when creating the codec, and also after
each non-streaming invocation. Removed the rest of the BOM handling.

  • dom/TextDecoder.h: Removed WaitForMoreBOMBytes, ignoreBOMIfNecessary,

bytesNeededForFullBOMIgnoreCheck, isBeginningOfIncompleteBOM, m_buffer,
m_bomIgnoredIfNecessary, and made m_options const.

  • platform/text/TextCodec.h: Added a virtual stripByteOrderMark function

to be used before decoding; does nothing by default. Changed the encode
function to be a const member function to help implementers remember to
not have it save any state, unlike the decode function which should.

  • platform/text/TextCodecCJK.cpp: Moved the TextCodecCJK::Encoding

enumeration in here.
(WebCore::jis0208DecodeIndex): Use a named type and use std::size
instead of WTF_ARRAY_LENGTH.
(WebCore::codePointJIS0212): Ditto.
(WebCore::iso2022JPEncode): Made this a non-member function and moved
the encoding state in here since each call to encode is separate and
we don't want to leave any state behind in the TextCodec between calls.
(WebCore::eucKREncodingIndex): Use a refernece instead of a pointer
and std::size instead of WTF_ARRAY_LENGTH.
(WebCore::big5DecodeIndex): Ditto.
(WebCore::TextCodecCJK::encode const): Made const.

  • platform/text/TextCodecCJK.h: Marked the class final, moved

the enumeration values for Encoding, ISO2022JPEncoderState, and
m_iso2022JPEncoderState out of the class definition. Made encode const.

  • platform/text/TextCodecICU.cpp:

(WebCore::TextCodecICU::encode const): Made const.

  • platform/text/TextCodecICU.h: Marked the class final, and

rearranged the class members to match other TextCodec classes,
with register functions before the constructor and destructor.
Made encode const.

  • platform/text/TextCodecLatin1.cpp:

(WebCore::TextCodecLatin1::encode const): Made const.

  • platform/text/TextCodecLatin1.h: Removed a stray blank line

and made encode const.

  • platform/text/TextCodecReplacement.cpp:

(WebCore::TextCodecReplacement::encode const): Added.

  • platform/text/TextCodecReplacement.h: Marked the class final,

changed it to no longer derive from TextCodecUTF8, and added
an encode function.

  • platform/text/TextCodecSingleByte.cpp: Moved the

TextCodecSingleByte::Encoding enumeration in here and changed
from Iso to ISO. Added SingleByteDecodeTable type and
moved TextCodecSingleByte::EncodeTable in here and renamed
it to SingleByteEncodeTable so it's not a class member any more.
Marked all the decode tables static since we don't get internal
linkage from just marking them constexpr, while moving to use
the SingleByteDecodeTable type.
(WebCore::tableForEncoding): Use SingleByteDecodeTable and
SingleByteEncodeTable type names. Use std::count to count the
replacement characters instead of writing our own loop.
Use std::size(decodeTable) instead of defining a tableSize.
Update for ISO name change. Use RELEASE_ASSERT_NOT_REACHED so
we don't have to write a dead code return statement.
(WebCore::tableForDecoding): Use SingleByteDecideTable type
for return value. Update for ISO name change. Use
RELEASE_ASSERT_NOT_REACHED so we don't have to write a dead
code return statement. Also make this constexpr since it's
just selecting a global based on an enumeration value.
(WebCore::encode): Made this a non-member function since it
does not need access to TextCodec members. This helps us keep
implementation details out of the header.
(WebCore::decode): Ditto.
(WebCore::TextCodecSingleByte::encode const): Made this const
and updated to call the non-member function.
(WebCore::TextCodecSingleByte::decode): Ditto.
(WebCore::TextCodecSingleByte::registerCodecs): Update for
the ISO name change.

  • platform/text/TextCodecSingleByte.h: Marked the class

final, and moved the enumeration values for Encoding, EncodeTable,
and the encode and decode functions that take table arguments
all out of the class definition. Made encode const.

  • platform/text/TextCodecUTF16.cpp:

(WebCore::TextCodecUTF16::decode): Added logic to drop the first
byte order mark after m_shouldStripByteOrderMark is set to true.
Changed code to call through rather than recursively calling self
in the case of an unpaired lead surrogate, removing the need to
put the processBytesShared lambda into a Function. Renamed the
processBytesShared lambda to processCodeUnit.
(WebCore::TextCodecUTF16::encode const): Made const.

  • platform/text/TextCodecUTF16.h: Marked the class final, added

a stripByteOrderMark member function and a m_shouldStripByteOrderMark
data member, and made encode const.

  • platform/text/TextCodecUTF8.cpp:

(WebCore::TextCodecUTF8::handlePartialSequence): Added logic to
drop the first byte order mark after m_shouldStripByteOrderMark is
set to true, making sure to keep it out of the hot ASCII decode loop.
(WebCore::TextCodecUTF8::decode): Ditto. Also added code to make sure
the partial sequence is cleared out as part of a flush even when
stopOnError is true.
(WebCore::TextCodecUTF8::encodeUTF8): Renamed this so it can be
a static member function, so it can be called by TextCodecReplacement.
(WebCore::TextCodecUTF8::encode const): Made this const and have it
call encodeUTF8.

  • platform/text/TextCodecUTF8.h: Marked the class final, added

a stripByteOrderMark member function and a m_shouldStripByteOrderMark
data member, added static member function encodeUTF8, and made the
encode function const.

  • platform/text/TextCodecUserDefined.cpp:

(WebCore::TextCodecUserDefined::encode const): Made const.

  • platform/text/TextCodecUserDefined.h: Marked the class final and

made encode const.

  • xml/XSLStyleSheetLibxslt.cpp:

(WebCore::XSLStyleSheet::parseString): Use byteOrderMark.

  • xml/parser/XMLDocumentParserLibxml2.cpp:

(WebCore::switchToUTF16): Ditto.
(WebCore::nativeEndianUTF16Encoding): Ditto.

Source/WTF:

  • wtf/unicode/CharacterNames.h: Use constexpr instead of just const.

Added byteOrderMark, synonym for zeroWidthNoBreakSpace.

8:59 AM Changeset in webkit [266680] by Alan Bujtas
  • 8 edits in trunk/Source/WebCore

[LFC][IFC] Move Line handing to LineBuilder
https://bugs.webkit.org/show_bug.cgi?id=216200

Reviewed by Antti Koivisto.

  1. LineBuilder owns Line now.
  2. LineBuilder can build line for both layout and intrinsic width computation (now these are two distinct code paths).
  3. LineBuilder also constructs the LineBox when needed (This was previously in InlineFormattingContext::lineLayout).
  • layout/inlineformatting/InlineFormattingContext.cpp:

(WebCore::Layout::InlineFormattingContext::lineLayout):
(WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const):
(WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine):
(WebCore::Layout::InlineFormattingContext::constraintsForLine): Deleted.

  • layout/inlineformatting/InlineFormattingContext.h:
  • layout/inlineformatting/InlineFormattingContextGeometry.cpp:

(WebCore::Layout::InlineFormattingContext::Geometry::computedTextIndent const): Deleted.

  • layout/inlineformatting/InlineLineBox.cpp:

(WebCore::Layout::LineBox::formattingContext const):
(WebCore::Layout::LineBox::root const):
(WebCore::Layout::LineBox::layoutState const):

  • layout/inlineformatting/InlineLineBox.h:

(WebCore::Layout::LineBox::contentLogicalWidth const):
(WebCore::Layout::LineBox::formattingContext const): Deleted.
(WebCore::Layout::LineBox::root const): Deleted.
(WebCore::Layout::LineBox::layoutState const): Deleted.

  • layout/inlineformatting/InlineLineBuilder.cpp:

(WebCore::Layout::LineBuilder::LineBuilder):
(WebCore::Layout::LineBuilder::layoutInlineContent):
(WebCore::Layout::LineBuilder::initialize):
(WebCore::Layout::LineBuilder::close):
(WebCore::Layout::LineBuilder::constraintsForLine):
(WebCore::Layout::LineBuilder::commitFloats):
(WebCore::Layout::LineBuilder::handleFloatsAndInlineContent):
(WebCore::Layout::LineBuilder::commitPartialContent):
(WebCore::Layout::LineBuilder::rebuildLine):
(WebCore::Layout::LineBuilder::layoutState const):

  • layout/inlineformatting/InlineLineBuilder.h:
Note: See TracTimeline for information about the timeline view.