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

Timeline



Jul 2, 2018:

8:55 PM Changeset in webkit [233456] by Dewei Zhu
  • 3 edits in trunk/Websites/perf.webkit.org

Manifest.reset should clear static map for BugTracker and Bug objects.
https://bugs.webkit.org/show_bug.cgi?id=187186

Reviewed by Ryosuke Niwa

If static maps of BugTracker and Bug objects are not cleared up, updating singleton
of Bug object will fail assertion.

  • public/v3/models/manifest.js: Clear static map for BugTracker and Bug.

(Manifest.reset):

  • server-tests/api-manifest-tests.js: Added a unit test for this change.
8:55 PM Changeset in webkit [233455] by Dewei Zhu
  • 3 edits in trunk/Websites/perf.webkit.org

Fix a bug in range bisector that start commit may be counted twice.
https://bugs.webkit.org/show_bug.cgi?id=187205

Reviewed by Darin Adler.

Range bisector counted start commit twice if start commit is the same as end commit.

  • public/v3/commit-set-range-bisector.js:

(CommitSetRangeBisector.async.commitSetClosestToMiddleOfAllCommits):

  • unit-tests/commit-set-range-bisector-tests.js: Added a unit test for this change.
6:07 PM Changeset in webkit [233454] by Adrian Perez de Castro
  • 2 edits in trunk

[CMake] Use JOB_POOLS to avoid memory-hungry linker processes running at the same time
https://bugs.webkit.org/show_bug.cgi?id=187254

Reviewed by Michael Catanzaro.

  • Source/cmake/WebKitCommon.cmake: Set the maximum number of

concurrent link processes using job pools (four for release builds,
two otherwise) to avoid running out of memory during builds.

6:03 PM Changeset in webkit [233453] by Sukolsak Sakshuwong
  • 5 edits in trunk

Regular expressions with ".?" expressions at the start and the end match the entire string
https://bugs.webkit.org/show_bug.cgi?id=119191

Reviewed by Michael Saboff.

Source/JavaScriptCore:

r90962 optimized regular expressions in the form of /.*abc.*/ by looking
for "abc" first and then processing the leading and trailing dot stars
to find the beginning and the end of the match. However, it erroneously
enabled this optimization for regular expressions whose leading or
trailing dots had quantifiers that were not of arbitrary length, e.g.,
/.?abc.*/, /.*abc.?/, /.{0,4}abc.*/, etc. This caused the expression to
match the entire string when it shouldn't. This patch disables the
optimization for those cases.

  • yarr/YarrPattern.cpp:

(JSC::Yarr::YarrPatternConstructor::optimizeDotStarWrappedExpressions):

LayoutTests:

  • fast/regex/dotstar-expected.txt:
  • fast/regex/script-tests/dotstar.js:
5:51 PM Changeset in webkit [233452] by Antti Koivisto
  • 5 edits in trunk

Tighter limit for canvas memory use on iOS
https://bugs.webkit.org/show_bug.cgi?id=187279
<rdar://problem/38420562>

Reviewed by Simon Fraser.

Source/WebCore:

We allowed 448MB of canvas buffer memory. This is still too much in some cases. Painting a large
canvas may also requires several other temporary canvas sized buffers getting us easily over
the process size limit.

  • html/HTMLCanvasElement.cpp:

(WebCore::maxActivePixelMemory):

Drop to (ramSize() / 4) which computes to 224MB on 2GB devices.

LayoutTests:

  • platform/ios-simulator/fast/canvas/canvas-crash-expected.txt:
  • platform/ios-simulator/fast/canvas/canvas-skia-excessive-size-expected.txt:
5:49 PM Changeset in webkit [233451] by Sukolsak Sakshuwong
  • 7 edits
    1 add in trunk

RegExp.exec returns wrong value with a long integer quantifier
https://bugs.webkit.org/show_bug.cgi?id=187042

Reviewed by Saam Barati.

JSTests:

  • stress/regexp-large-quantifier.js: Added.

(testRegExp):

  • stress/regress-159744.js:

Source/JavaScriptCore:

Prior to this patch, the Yarr parser checked for integer overflow when
parsing quantifiers in regular expressions by adding one digit at a time
to a number and checking if the result got larger. This is wrong;
The parser would fail to detect overflow when parsing, for example,
10,000,000,003 because (1000000000*10 + 3) % (232) = 1410065411 > 1000000000.

Another issue was that once it detected overflow, it stopped consuming
the remaining digits. Since it didn't find the closing bracket, it
parsed the quantifier as a normal string instead.

This patch fixes these issues by reading all the digits and checking for
overflow with Checked<unsigned, RecordOverflow>. If it overflows, it
returns the largest possible value (quantifyInfinite in this case). This
matches Chrome [1], Firefox [2], and Edge [3].

[1] https://chromium.googlesource.com/v8/v8.git/+/23222f0a88599dcf302ccf395883944620b70fd5/src/regexp/regexp-parser.cc#1042
[2] https://dxr.mozilla.org/mozilla-central/rev/aea3f3457f1531706923b8d4c595a1f271de83da/js/src/irregexp/RegExpParser.cpp#1310
[3] https://github.com/Microsoft/ChakraCore/blob/fc08987381da141bb686b5d0c71d75da96f9eb8a/lib/Parser/RegexParser.cpp#L1149

  • yarr/YarrParser.h:

(JSC::Yarr::Parser::consumeNumber):

LayoutTests:

  • fast/regex/overflow-expected.txt:
  • fast/regex/script-tests/overflow.js:
5:34 PM Changeset in webkit [233450] by youenn@apple.com
  • 2 edits
    1 move in trunk/Source/WebKit

Add sandbox to microdone plugin
https://bugs.webkit.org/show_bug.cgi?id=187149
<rdar://problem/41538057>

Unreviewed.

  • Resources/PlugInSandboxProfiles/cn.microdone.cmb.safari.sb: Renamed from Source/WebKit/Resources/PlugInSandboxProfiles/cn.microdone.cmb.safari.
  • WebKit.xcodeproj/project.pbxproj:
5:21 PM Changeset in webkit [233449] by timothy_horton@apple.com
  • 2 edits in trunk/Source/WebKit

Adjust now-incorrect animated resize logging after r232544
https://bugs.webkit.org/show_bug.cgi?id=187281
<rdar://problem/41645347>

Reviewed by Simon Fraser.

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _didCommitLayerTree:]):
(-[WKWebView _didCompleteAnimatedResize]):
(-[WKWebView _beginAnimatedResizeWithUpdates:]):
_beginAnimatedResizeWithUpdate: and _didCompleteAnimatedResize are
not strictly paired; we could instead track the SPI, but it's a bit
tricky since resizeWithContentHidden has an implicit endAnimatedResize.
Instead, just log if we still have a resizeAnimationView when we're
committing outside of an animated resize, which seems to be the original concern,
and point toward the possibility of unpaired begin/end.
Also fix logging that has the wrong method name.

5:17 PM Changeset in webkit [233448] by Wenson Hsieh
  • 2 edits in trunk/Tools

Fix a leak in ActionSheetTests.DismissingActionSheetShouldNotDismissPresentingViewController
https://bugs.webkit.org/show_bug.cgi?id=187280

Reviewed by Tim Horton.

Add a missing adoptNS().

  • TestWebKitAPI/Tests/ios/ActionSheetTests.mm:

(TestWebKitAPI::TEST):

5:15 PM Changeset in webkit [233447] by mmaxfield@apple.com
  • 10 edits
    2 adds in trunk

[Cocoa] Google Fonts doesn't work if the user has the requested font locally-installed
https://bugs.webkit.org/show_bug.cgi?id=187228
<rdar://problem/40967280>

Reviewed by Brent Fulgham.

Source/WebCore:

This is due to the local() items in the src: descriptor in the @font-family blocks.

This is because of a behavior difference between CSSFontFaceSource::load() and CSSFontFaceSource::font().
load() is supposed to set the status() to Success iff the font can be used, and then CSSFontFaceSource::font()
is supposed to return the font itself to use. load() works by constructing a dummy FontDescription and
performing a system lookup (to see if the local font really exists). However, this dummy FontDescription
doesn't set the ShouldAllowUserInstalledFonts flag. Then, in CSSFontFaceSource::font(), a similar lookup is
performed, except this one has the original FontDescription (with the correct value of the
ShouldAllowUserInstalledFonts flag set. Therefore, the two functions disagree about the state of the flag.

When the CSSFontFaceSource's status gets set to Success, that means "this is the font face source that
represents the @font-face block" but when CSSFontFaceSource::font() returns nullptr, that means "The font face
source can't be used for some reason" so we then continue searching down the font-family list (and render the
text in Helvetica or whatever comes next).

The solution is simple - just set the ShouldAllowUserInstalledFonts flag correctly in the dummy
FontDescription.

Test: fast/text/user-installed-fonts/local.html

  • css/CSSFontFace.cpp:

(WebCore::CSSFontFace::allowUserInstalledFonts const):

  • css/CSSFontFace.h:
  • css/CSSFontFaceSet.cpp:

(WebCore::CSSFontFaceSet::ensureLocalFontFacesForFamilyRegistered):

  • css/CSSFontFaceSource.cpp:

(WebCore::CSSFontFaceSource::load):

Tools:

The test only fails before the patch if the lookup for Helvetica2 is allowed to occur.

  • WebKitTestRunner/mac/TestControllerMac.mm:

(WTR::allowedFontFamilySet):

LayoutTests:

  • fast/text/user-installed-fonts/local-expected.html: Added.
  • fast/text/user-installed-fonts/local.html: Added.
4:45 PM Changeset in webkit [233446] by rniwa@webkit.org
  • 2 edits
    1 copy
    1 delete in trunk

Repository fix after r233427 and r233443.
.:

  • jstests: Removed.

JSTests:

Added back the test which got erroneously deleted in r233443.

  • stress/instanceof-non-object-prototype.js:
4:17 PM Changeset in webkit [233445] by rniwa@webkit.org
  • 2 edits in trunk/Tools

run-benchmark should include the version number of MotionMark's results
https://bugs.webkit.org/show_bug.cgi?id=187274

Reviewed by Jon Lee.

Append the version number as a part of the suite name.

  • Scripts/webkitpy/benchmark_runner/data/patches/webserver/MotionMark.patch:
4:15 PM Changeset in webkit [233444] by youenn@apple.com
  • 2 edits in trunk/Source/WebKit

Update com.apple.NPSafeInput.sb to make it functional
https://bugs.webkit.org/show_bug.cgi?id=187276

Reviewed by Brent Fulgham.

  • Resources/PlugInSandboxProfiles/com.apple.NPSafeInput.sb:
3:54 PM Changeset in webkit [233443] by rniwa@webkit.org
  • 14 edits
    1 delete in trunk

Generate event and event target interface types directly instead of via macros
https://bugs.webkit.org/show_bug.cgi?id=187215

Reviewed by Chris Dumez.

Made make_event_factory.pl directly generate EventInterface enum values and toJSNewlyCreated for Event,
and EventTargetInterface enum values and toJS for EventTarget. Removed the code to generate EventFactory::create
since it was never even compiled or used anywhere.

This patch faithfully replicates what the macro used to generate but we should consider always generating either
toJS or toJSNewlyCreated for both interfaces in the future.

No new tests since there should be no observable behavioral changes.

  • DerivedSources.make: Generate EventTargetFactory.cpp, which is used to generate toJS function for EventTarget.
  • Sources.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSEventCustom.cpp:

(WebCore::toJSNewlyCreated): Deleted. Now generated directly in EventFactory.cpp.

  • bindings/js/JSEventTargetCustom.cpp:

(WebCore::JSEventTarget::toWrapped): Removed the use of TRY_TO_UNWRAP_WITH_INTERFACE.
(WebCore::toJS): Deleted. Now generated directly in EventFactory.cpp.

  • bindings/scripts/InFilesCompiler.pm:

(generateInterfacesHeader): Use #pragma once. Generate enum values directly. Added the support for suffixing
each type name with namespace for EventTarget.

  • dom/Event.h: Removed the declaration of EventInterface enum. It's now directly generated in EventInterfaces.h
  • dom/EventNames.in: Generate toJSNewlyCreated.
  • dom/EventTarget.h: Removed the declaration of EventTargetInterface as it's now done in EventTargetInterfaces.h.
  • dom/EventTargetFactory.in: Generate toJS.
  • dom/make_event_factory.pl:

(defaultParameters): Added two new options. factoryFunction specifies whether toJS or toJSNewlyCreated is generated,
and useNamespaceAsSuffix specifies whether each entry should be suffixed by the namespace (used by EventTarget).
(generateCode): Added a missing semicolon.
(generateImplementation): Removed the early exit for EventTarget since we now need to generate its toJS function.
Replaced the code to generate EventFactory::create by the one to generate toJS / toJSNewlyCreated.

3:47 PM Changeset in webkit [233442] by Alan Bujtas
  • 2 edits in trunk/Source/WebCore

HTML widget displays blank when playing on page
https://bugs.webkit.org/show_bug.cgi?id=187272
<rdar://problem/39317899>

Reviewed by Simon Fraser.

When a composited layer gains content (in this particular case, going from NoContentsLayer to ContentsLayerForMedia),
we need to size the associated graphics layer accordingly (NoContentsLayer means zero sized graphics layer).

Not testable on iOS.

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::updateConfiguration):

3:27 PM Changeset in webkit [233441] by ddkilzer@apple.com
  • 4 edits in trunk/Source/WebCore

Refactor InlineTextBox::emphasisMarkExistsAndIsAbove()
<https://webkit.org/b/187204>

Reviewed by Darin Adler.

No new tests since there is no change in behavior.

Refactor emphasisMarkExistsAndIsAbove() to return a
std::optional<bool> instead of returning a bool and taking a
std::optional<bool> argument. The state returned is now:

  • std::nullopt => emphasis mark doesn't exist or is suppressed.
  • false => emphasis mark exists and is not suppressed, but is not above.
  • true => emphasis mark exists and is not suppressed, and is above.
  • rendering/InlineFlowBox.cpp:

(WebCore::InlineFlowBox::placeBoxesInBlockDirection):
(WebCore::InlineFlowBox::addTextBoxVisualOverflow):
(WebCore::InlineFlowBox::computeOverAnnotationAdjustment const):
(WebCore::InlineFlowBox::computeUnderAnnotationAdjustment const):

  • Update for refactored method. Remove some redundant checks for TextEmphasisMark::None that already happen in emphasisMarkExistsAndIsAbove().
  • rendering/InlineTextBox.cpp:

(WebCore::emphasisPositionHasNeitherLeftNorRight): Delete.

  • Replaced by an OptionSet<TextEmphasisPosition>.

(WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove const):

  • Refactor as described above.

(WebCore::InlineTextBox::paintMarkedTextForeground):

  • Update for refactored method.
  • rendering/InlineTextBox.h:

(WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove const):

  • Update for new method signature.
3:20 PM Changeset in webkit [233440] by youenn@apple.com
  • 2 edits in trunk/Source/WebKit

Update com.cfca.npSecEditCtl.MAC.BOC.plugin.sb to make it functional
https://bugs.webkit.org/show_bug.cgi?id=187261

Reviewed by Brent Fulgham.

  • Resources/PlugInSandboxProfiles/com.cfca.npSecEditCtl.MAC.BOC.plugin.sb:
3:04 PM Changeset in webkit [233439] by Wenson Hsieh
  • 11 edits in trunk

[WK1] editing/spelling/markers.html is failing on recent builds of macOS Mojave
https://bugs.webkit.org/show_bug.cgi?id=187253

Reviewed by Tim Horton.

Tools:

Enhances and refactors LayoutTestSpellChecker, which was introduced in r233412.

  • DumpRenderTree/TestRunner.cpp:

(setSpellCheckerResultsCallback):

Rename setSpellCheckerTextReplacements to setSpellCheckerResults.

(TestRunner::staticFunctions):
(setSpellCheckerTextReplacementsCallback): Deleted.

  • DumpRenderTree/TestRunner.h:
  • DumpRenderTree/mac/TestRunnerMac.mm:

(TestRunner::setSpellCheckerResults):
(TestRunner::setSpellCheckerTextReplacements): Deleted.

  • DumpRenderTree/win/TestRunnerWin.cpp:

(TestRunner::setSpellCheckerResults):
(TestRunner::setSpellCheckerTextReplacements): Deleted.

  • TestRunnerShared/cocoa/LayoutTestSpellChecker.h:
  • TestRunnerShared/cocoa/LayoutTestSpellChecker.mm:

(-[LayoutTestTextCheckingResult initWithType:range:replacement:details:]):
(-[LayoutTestTextCheckingResult grammarDetails]):
(-[LayoutTestSpellChecker reset]):
(-[LayoutTestSpellChecker results]):
(-[LayoutTestSpellChecker setResults:]):
(-[LayoutTestSpellChecker setResultsFromJSObject:inContext:]):

Add support for passing in a list of grammar correction detail ranges. Necessary for simulating grammar errors.

(-[LayoutTestSpellChecker checkString:range:types:options:inSpellDocumentWithTag:orthography:wordCount:]):

Tweaked to always call the superclass method. This ensures that we set the orthography and wordCount
outpointers if applicable.

(-[LayoutTestSpellChecker requestCheckingOfString:range:types:options:inSpellDocumentWithTag:completionHandler:]):

Added support for simulating asynchronous spell checking.

(-[LayoutTestTextCheckingResult initWithType:range:replacement:]): Deleted.
(-[LayoutTestSpellChecker replacements]): Deleted.
(-[LayoutTestSpellChecker setReplacements:]): Deleted.
(-[LayoutTestSpellChecker setReplacementsFromJSObject:inContext:]): Deleted.

LayoutTests:

In recent builds of macOS Mojave, NSSpellChecker returns both grammar and spelling errors when asked to analyze
the string "I have a issue.". While arguably correct, the change causes this existing layout test to fail due
to one of the calls to verifyUnexpectedMarkers expecting either grammar markers and not spelling markers, or
vice versa.

To fix this, we can leverage the mechanism added in r233412 to simulate different results from the platform
spellchecker, such that the test now exercises all combinations of grammar and spelling corrections observed on
each macOS platform, regardless of the actual platform where the test is being run.

This patch also enhances the capabilities of LayoutTestSpellChecker. See Tools/ChangeLog for more details.

  • editing/spelling/markers-expected.txt:
  • editing/spelling/markers.html:
  • editing/spelling/text-replacement-after-typing-to-word.html:

Adjusted for a renamed TestRunner method.

3:02 PM Changeset in webkit [233438] by beidson@apple.com
  • 3 edits in trunk/Tools

Another unreviewed followup to:
Crash notifying observers of responsiveness state change

  • TestWebKitAPI/cocoa/TestWKWebView.h:
  • TestWebKitAPI/cocoa/TestWKWebView.mm:

(-[TestWKWebView typeCharacter:]): Move this back to the Mac-only category, as we won't be running this

test on iOS for other reasons.

2:59 PM Changeset in webkit [233437] by Michael Catanzaro
  • 2 edits
    3 adds in trunk/LayoutTests

Unreviewed GTK gardening

  • platform/gtk/TestExpectations:
  • platform/gtk/imported/w3c/web-platform-tests/web-animations/interfaces/Animatable/animate-no-browsing-context-expected.txt: Added.
2:52 PM Changeset in webkit [233436] by Megan Gardner
  • 4 edits in trunk/Source/WebCore

Enable copy paste on iOS apps for Mac
https://bugs.webkit.org/show_bug.cgi?id=187194
<rdar://problem/41451148>

Reviewed by Darin Adler.

Difficult to test this platform.

UIKit doesn't support itemProviders for iOS apps for Mac, so we need to revert to the
older way of setting a dictionary of objects and keys for items. Not everything is
availble in this form, and we haven't cleaned up our itemProvider code yet, so we
need to case some things out for now. Hopefully in the future, this will be implmented
and can just work as expected, but for now, this is the best workaround.

  • platform/ios/PlatformPasteboardIOS.mm:

(WebCore::registerItemToPasteboard):
(WebCore::PlatformPasteboard::write):
(WebCore::PlatformPasteboard::readURL):

  • platform/ios/WebItemProviderPasteboard.h:
  • platform/ios/WebItemProviderPasteboard.mm:

(-[WebItemProviderRegistrationInfoList itemProvider]):

2:49 PM Changeset in webkit [233435] by eric.carlson@apple.com
  • 9 edits in trunk

Video sometimes flickers when playing to AppleTV
https://bugs.webkit.org/show_bug.cgi?id=187193
<rdar://problem/40153865>

Reviewed by Jer Noble and Youenn Fablet.
Source/WebCore:

No new tests, existing test updated.

Delay 100ms before changing the iOS audio session category because it is an expensive and
potentially disruptive operation, and changing an audio or video element configuration
can result in several quick, ultimately unnecessary, category changes.

  • platform/audio/PlatformMediaSession.cpp:

(WebCore::PlatformMediaSession::clientWillBeginPlayback): Add logging.

  • platform/audio/PlatformMediaSessionManager.cpp:

(WebCore::PlatformMediaSessionManager::PlatformMediaSessionManager): Initialize timer.
(WebCore::PlatformMediaSessionManager::removeSession): Deactivate audio session when there
are no sessions.
(WebCore::PlatformMediaSessionManager::updateSessionStateTimerFired): New, update session now.
(WebCore::PlatformMediaSessionManager::updateSessionState): Add parameter.

  • platform/audio/PlatformMediaSessionManager.h:
  • platform/audio/cocoa/MediaSessionManagerCocoa.cpp:

(PlatformMediaSessionManager::updateSessionState): Defer update if it isn't supposed to happen
immediately.

  • platform/audio/ios/AudioSessionIOS.mm:

(WebCore::AudioSession::setCategory): Drive-by: setting the audio category to nil is a noop,
so don't waste time doing it.
(WebCore::AudioSession::tryToSetActive): Allow other apps to resume playback when we deactivate
the audio session.

  • platform/Timer.h:

(WebCore::DeferrableOneShotTimer): Add WTF_MAKE_FAST_ALLOCATED so it can be used in a unique_ptr.

LayoutTests:

  • platform/mac/media/audio-session-category-audio-autoplay.html: Update as audio category

doesn't change immediately.

1:56 PM Changeset in webkit [233434] by Wenson Hsieh
  • 6 edits in trunk/Source/WebCore

Clean up some spellchecking code
https://bugs.webkit.org/show_bug.cgi?id=187238

Reviewed by Tim Horton.

A few minor tweaks to modernize some spellchecking code. No change in behavior.

  • editing/AlternativeTextController.cpp:

(WebCore::AlternativeTextController::timerFired):

  • editing/Editor.cpp:

(WebCore::Editor::markMisspellingsAfterTypingToWord):

Use move semantics when passing Ranges to markAllMisspellingsAndBadGrammarInRanges.

(WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):

Change this to take RefPtr<Range>&& instead of Range*.

(WebCore::Editor::markMisspellingsAndBadGrammar):

Remove an unnecessary call to RefPtr::get().

  • editing/Editor.h:
  • editing/TextCheckingHelper.cpp:

(WebCore::TextCheckingParagraph::invalidateParagraphRangeValues):
(WebCore::TextCheckingParagraph::checkingStart const):
(WebCore::TextCheckingParagraph::checkingEnd const):
(WebCore::TextCheckingParagraph::checkingLength const):
(WebCore::TextCheckingParagraph::automaticReplacementStart const):
(WebCore::TextCheckingParagraph::automaticReplacementLength const):

Currently, all of these cached range offsets are ints, and use a value of -1 to denote that their values are
missing and must be recomputed. Instead, make these std::optionals and let std::nullopt represent the
missing value.

  • editing/TextCheckingHelper.h:
1:54 PM Changeset in webkit [233433] by beidson@apple.com
  • 2 edits in trunk/Tools

Unreviewed followup to:
Crash notifying observers of responsiveness state change

  • TestWebKitAPI/Tests/WebKit/ResponsivenessTimerCrash.mm: Need the C-SPI for this test.
1:52 PM Changeset in webkit [233432] by beidson@apple.com
  • 6 edits
    1 add in trunk

Crash notifying observers of responsiveness state change
<rdar://problem/41267796> and https://bugs.webkit.org/show_bug.cgi?id=187262

Reviewed by Tim Horton.

Source/WebKit:

  • UIProcess/PageLoadState.cpp:

(WebKit::PageLoadState::callObserverCallback): Copy the container ahead of time.

Tools:

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WebKit/ResponsivenessTimerCrash.mm: Added.

(-[RTObserver observeValueForKeyPath:ofObject:change:context:]):
(TestWebKitAPI::TEST):

  • TestWebKitAPI/cocoa/TestWKWebView.h:
  • TestWebKitAPI/cocoa/TestWKWebView.mm:

(-[TestWKWebView typeCharacter:]):
(-[TestWKWebView hostWindow]):

1:50 PM Changeset in webkit [233431] by sihui_liu@apple.com
  • 3 edits in trunk/Source/WebKit

Remove InitWebCoreThreadSystemInterface() in WKProcessPool _initWithConfiguration
https://bugs.webkit.org/show_bug.cgi?id=187252

Reviewed by Dan Bernstein.

Clean up after <rdar://problem/15256572>.

  • UIProcess/API/Cocoa/WKProcessGroup.mm:

(-[WKProcessGroup initWithInjectedBundleURL:]):

  • UIProcess/API/Cocoa/WKProcessPool.mm:

(-[WKProcessPool _initWithConfiguration:]):

1:46 PM Changeset in webkit [233430] by graouts@webkit.org
  • 2 edits in trunk/Source/WebCore

Crash in WebCore::WebAnimation::timeToNextRequiredTick when running imported/w3c/web-platform-tests/web-animations/interfaces/Animatable/animate-no-browsing-context.html
https://bugs.webkit.org/show_bug.cgi?id=187145

Reviewed by Dean Jackson.

Ensure we have a resolved time value before trying to use it.

  • animation/WebAnimation.cpp:

(WebCore::WebAnimation::timeToNextRequiredTick const):

1:45 PM Changeset in webkit [233429] by graouts@webkit.org
  • 2 edits in trunk/Source/WebCore

[Web Animations] Crash in KeyframeEffectReadOnly::applyPendingAcceleratedActions()
https://bugs.webkit.org/show_bug.cgi?id=187139

Reviewed by Dean Jackson.

Ensure we have a resolved time value before trying to use it.

  • animation/KeyframeEffectReadOnly.cpp:

(WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):

12:02 PM Changeset in webkit [233428] by Michael Catanzaro
  • 2 edits in trunk/Tools

[WPE][GTK] flatpakutils.py should respect set-webkit-configuration build type
https://bugs.webkit.org/show_bug.cgi?id=187218

Reviewed by Philippe Normand.

Using the webkitpy Config module, if the build type is not passed on the command line, we
read it from WebKitBuild/Configuration and respect it.

  • flatpak/flatpakutils.py:

(WebkitFlatpak.init):
(WebkitFlatpak.clean_args):

11:04 AM Changeset in webkit [233427] by keith_miller@apple.com
  • 3 edits
    3 adds in trunk

InstanceOf IC should do generic if the prototype is not an object.
https://bugs.webkit.org/show_bug.cgi?id=187250

Reviewed by Mark Lam.

JSTests:

  • stress/instanceof-non-object-prototype.js: Added.

(let):
(test):
(i.catch):

Source/JavaScriptCore:

The old code was wrong for two reasons. First, the AccessCase expected that
the prototype value would be non-null. Second, we would end up returning
false instead of throwing an exception.

  • jit/Repatch.cpp:

(JSC::tryCacheInstanceOf):

10:51 AM Changeset in webkit [233426] by mark.lam@apple.com
  • 5 edits
    1 add in trunk

Builtins and host functions should get their own structures.
https://bugs.webkit.org/show_bug.cgi?id=187211
<rdar://problem/41646336>

Reviewed by Saam Barati.

JSTests:

  • stress/regress-187211.js: Added.

Source/JavaScriptCore:

JSFunctions do lazy reification of properties, but ordinary functions applies
different rules of property reification than builtin and host functions. Hence,
we should give builtins and host functions their own structures.

  • runtime/JSFunction.cpp:

(JSC::JSFunction::selectStructureForNewFuncExp):
(JSC::JSFunction::create):
(JSC::JSFunction::getOwnPropertySlot):

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):

  • runtime/JSGlobalObject.h:

(JSC::JSGlobalObject::hostFunctionStructure const):
(JSC::JSGlobalObject::arrowFunctionStructure const):
(JSC::JSGlobalObject::sloppyFunctionStructure const):
(JSC::JSGlobalObject::strictFunctionStructure const):

10:29 AM Changeset in webkit [233425] by youenn@apple.com
  • 6 edits in trunk/Source/WebCore

Reject getUserMedia promise if capture fails
https://bugs.webkit.org/show_bug.cgi?id=187190

Reviewed by Eric Carlson.

In case PendingActivationMediaStream is notified of a change,
Check whether any track failed to capture.
If so, reject the promise.
Add more release logging in error case.

Covered by manual testing.

  • Modules/mediastream/UserMediaRequest.cpp:

(WebCore::UserMediaRequest::PendingActivationMediaStream::~PendingActivationMediaStream):
(WebCore::UserMediaRequest::PendingActivationMediaStream::characteristicsChanged):
(WebCore::UserMediaRequest::mediaStreamIsReady):
(WebCore::UserMediaRequest::mediaStreamDidFail):

  • Modules/mediastream/UserMediaRequest.h:
  • platform/mediastream/MediaStreamPrivate.h:
  • platform/mediastream/RealtimeMediaSource.cpp:

(WebCore::RealtimeMediaSource::captureFailed):

  • platform/mediastream/mac/AVVideoCaptureSource.mm:

(WebCore::AVVideoCaptureSource::setupCaptureSession):

10:16 AM Changeset in webkit [233424] by commit-queue@webkit.org
  • 2 edits in trunk/Source/WebCore/platform/gtk/po

[GTK] [l10n] Updated Ukrainian translation of WebKitGTK+
https://bugs.webkit.org/show_bug.cgi?id=187231

Patch by Yuri Chornoivan <yurchor@ukr.net> on 2018-07-02
Rubber-stamped by Michael Catanzaro.

  • uk.po:
8:27 AM Changeset in webkit [233423] by zandobersek@gmail.com
  • 2 edits in trunk/Source/WebKit

REGRESSION(r233381): Double WebResourceLoadStatisticsStore destructor invocation
https://bugs.webkit.org/show_bug.cgi?id=187247

Reviewed by Chris Dumez.

  • UIProcess/WebResourceLoadStatisticsStore.cpp:

(WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
Don't call postTask() to dispatch this task, as that keeps a reference
to this WebResourceLoadStatisticsStore object and thus causes problems
when invoked from the destructor in the form of a second destructor
invocation that ends up crashing the process. Blocking nature of this
call should be enough to avoid WebResourceLoadStatisticsStore lifetime
issues.

7:35 AM Changeset in webkit [233422] by pvollan@apple.com
  • 2 edits in trunk/Source/WebKit

Delete display link when closing page or the WebContent process has crashed.
https://bugs.webkit.org/show_bug.cgi?id=186895

Reviewed by Brent Fulgham.

If there is a running display link in the UI process, there is no need to keep it around if the
page is being closed or the WebContent process has crashed.

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::resetStateAfterProcessExited):

4:51 AM Changeset in webkit [233421] by zandobersek@gmail.com
  • 5 edits in trunk/Tools

[WPE] Add touch support to WindowViewBackend
https://bugs.webkit.org/show_bug.cgi?id=187245

Reviewed by Carlos Garcia Campos.

Add touch input support to the WindowViewBackend implementation,
plugging into the Wayland protocol in order to get properly notified
about these events, and then dispatching them against the appropriate
wpe_view_backend object so that WebKit can process them.

  • wpe/backends/ViewBackend.cpp:

(WPEToolingBackends::ViewBackend::dispatchInputTouchEvent):

  • wpe/backends/ViewBackend.h:
  • wpe/backends/WindowViewBackend.cpp:
  • wpe/backends/WindowViewBackend.h:
4:41 AM Changeset in webkit [233420] by aboya@igalia.com
  • 2 edits in trunk/Source/WTF

[Linux] Fix memory leak in WTF::forEachLine()
https://bugs.webkit.org/show_bug.cgi?id=187174

Reviewed by Žan Doberšek.

  • wtf/linux/MemoryFootprintLinux.cpp:

(WTF::forEachLine):

4:30 AM Changeset in webkit [233419] by zandobersek@gmail.com
  • 2 edits
    2 adds
    1 delete in trunk/LayoutTests

Unreviewed WPE gardening.

Adjust or add a few test expectations. Remove a bad text baseline for
one W3C Fetch test, add a proper text baseline for another.

  • platform/wpe/TestExpectations:
  • platform/wpe/imported/w3c/web-platform-tests/fetch/api/headers: Added.
  • platform/wpe/imported/w3c/web-platform-tests/fetch/api/headers/header-values-expected.txt: Added.
  • platform/wpe/imported/w3c/web-platform-tests/fetch/security: Removed.
3:12 AM Changeset in webkit [233418] by fred.wang@free.fr
  • 2 edits in trunk/LayoutTests

WTF's internal std::optional implementation should abort() on bad optional access
https://bugs.webkit.org/show_bug.cgi?id=186536

Unreviewed test gardening.

Patch by Frederic Wang <fwang@igalia.com> on 2018-07-02

12:56 AM Changeset in webkit [233417] by commit-queue@webkit.org
  • 5 edits in trunk

WTF's internal std::optional implementation should abort() on bad optional access
https://bugs.webkit.org/show_bug.cgi?id=186536

Patch by Frederic Wang <fwang@igalia.com> on 2018-07-02
Reviewed by Michael Catanzaro.

Source/WTF:

Currently, some ports built with recent compilers will cause the program to abort when one
tries to access the value of an unset std:optional (i.e. std::nullopt) as specified by C++17.
However, most ports still use WTF's internal std::optional implementation, which does not
verify illegal access. Hence it's not possible for developers working on these ports to
detect issues like bugs #186189, #186535, #186752, #186753, #187139, #187145 or #187243.
WTF's version of std::optional was introduced in bug #164199 but it was not possible to
verify the availability of the value inside constexpr member functions because the assert
might involve asm declarations. This commit introduces a new
RELEASE_ASSERT_UNDER_CONSTEXPR_CONTEXT macro (a simplified version of RELEASE_ASSERT that can
be used in constexpr context) and uses it in WTF's implementation of std::optional.

  • wtf/Assertions.h: Define RELEASE_ASSERT_UNDER_CONSTEXPR_CONTEXT as a version of

RELEASE_ASSERT that can be used in constexpr context (in particular avoids asm declarations).

  • wtf/Optional.h:

(std::optional::operator ->): Add an assert to ensure the optional value is available.
(std::optional::operator *): Ditto.
(std::optional::value const): Ditto.
(std::optional::value): Ditto.
(std::optional<T::value const): Ditto.

LayoutTests:

12:49 AM Changeset in webkit [233416] by commit-queue@webkit.org
  • 2 edits in trunk/Tools

[GTK] ASSERTION FAILED: url == m_string in UserAgentQuirks test
https://bugs.webkit.org/show_bug.cgi?id=186838

This URL constructor expects canonicalized input, so fix the passed URL. I missed
this one some weeks ago since I had an older checkout.

Patch by Rob Buis <rbuis@igalia.com> on 2018-07-02
Reviewed by Michael Catanzaro.

  • TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp:

(TestWebKitAPI::TEST):

Jul 1, 2018:

9:24 PM Changeset in webkit [233415] by Yusuke Suzuki
  • 3 edits in trunk/Source/WTF

[WTF] RandomDevice should be initialized inside std::call_once
https://bugs.webkit.org/show_bug.cgi?id=186017

Reviewed by Darin Adler.

While Linux ports uses mutex-guarded static variables, Mac ports do not.
So we should guard static variables' initialization by using std::call_once.
This patch does it for RandomDevice.

  • wtf/OSRandomSource.cpp:

(WTF::cryptographicallyRandomValuesFromOS):

  • wtf/RandomDevice.h: Small fix for OS(FUCHSIA).
7:50 PM WebKitGTK/Gardening/Calendar edited by Michael Catanzaro
(diff)
7:48 PM WebKitGTK/Gardening/Calendar/2018Logs created by Michael Catanzaro
6:52 PM Changeset in webkit [233414] by Fujii Hironori
  • 4 edits in trunk

[WK2] fast/parser/document-open-in-unload.html makes the following test crash
https://bugs.webkit.org/show_bug.cgi?id=98345
<rdar://problem/12474923>

Reviewed by Ryosuke Niwa.

Source/WebCore:

m_documentLoader can become null in the middle of
FrameLoader::commitProvisionalLoad by stopping the loading.

No new tests (Covered by existing tests).

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::commitProvisionalLoad): Do null check of m_documentLoader.

LayoutTests:

  • platform/wk2/TestExpectations: Unskipped fast/parser/document-open-in-unload.html.
6:36 PM Changeset in webkit [233413] by mmaxfield@apple.com
  • 7 edits
    2 adds in trunk

[Cocoa] LastResort in the font family list causes emoji with joiners to be rendered as multiple .notdef characters
https://bugs.webkit.org/show_bug.cgi?id=187209
<rdar://problem/40920785>

Reviewed by Darin Adler.

Source/WebCore:

Inside our complex text codepath, we perform our own font fallback, which
includes a function that asks "can this font support this grapheme cluster?"
Because of the mechanics of how fonts work, the implementation of this
function is "Does the font's cmap table support every character of the
cluster?" We were using Font::glyphForCharacter() to determine this; however,
this function maps certain control characters to the zero width space
character (with the intention that these control characters shouldn't be
visible in the fast text codepath). That replacement, however, was causing
us to get false negatives, because Apple Color Emoji doesn't support zero
width space. Therefore, Apple Color Emoji was looking like it didn't support
emoji combining sequences.

The best solution to this would be to get Font::glyphForCharacter() to stop
performing these replacements (see https://bugs.webkit.org/show_bug.cgi?id=187166).
However, that is too risky of a change to be making right now. Instead,
a more localized solution is to implement a version of "Does the font's cmap
table support every character of the cluster" that doesn't perform the
substitutions. This patch does exactly that, and uses a bit vector to cache
the results. In order to not have a giant bit vector, we take the old code
path if we know the substitutions won't affect us (and uses ASSERT()s to
validate this) so the bit vector only holds at maximum 3 words of storage.

Test: fast/text/emoji-with-joiner.html

  • platform/graphics/Font.cpp:

(WebCore::codePointSupportIndex):
(WebCore::createAndFillGlyphPage):
(WebCore::Font::platformSupportsCodePoint const):
(WebCore::Font::supportsCodePoint const):
(WebCore::Font::canRenderCombiningCharacterSequence const):

  • platform/graphics/Font.h:
  • platform/graphics/cocoa/FontCocoa.mm:

(WebCore::Font::platformSupportsCodePoint const):

Source/WTF:

  • wtf/unicode/CharacterNames.h:

LayoutTests:

  • fast/text/emoji-with-joiner-expected.txt: Added.
  • fast/text/emoji-with-joiner.html: Added.
5:47 PM Changeset in webkit [233412] by Wenson Hsieh
  • 19 edits
    1 move
    4 adds
    1 delete in trunk

[macOS] Text replacements that end with symbols are expanded immediately
https://bugs.webkit.org/show_bug.cgi?id=187225
<rdar://problem/41112433>

Reviewed by Darin Adler.

Source/WebCore:

In shipping Safari, enabling grammar correction causes text shortcuts that end with symbols or punctuation marks
to immediately trigger when typing; normally, when grammar correction is off, this is only triggered after the
user has additionally inserted a punctuation mark or whitespace character after the replaced text.

This bug happens because enabling grammar checking causes the spell checking range to expand to the range of the
full sentence, so any text checking results that replace an existing range are triggered as long as they end
anywhere in the sentence. In contrast, when grammar checking is disabled, the spell checking range is limited to
the nearest adjacent word, which prevents text replacement from occurring elsewhere in the sentence.

However, after r232530, we now always expand the spell checking range to the extent of the sentence when a word
is typed regardless of whether grammar checking is enabled, which means that the issue described above now
happens everywhere. To fix this recent regression and the existing bug, we:

  • Augment our spellchecking codepaths to include a new automatic text replacement range, alongside

spellchecking and paragraph ranges.

  • Let this automatic text replacement range be the range of the adjacent word in the case where the user has

finished typing a word.

  • When marking and replacing text checking results, consult this new automatic text replacement instead of the

spellchecking range.

This keeps the behavior grammar and sentence retro correction results intact, while limiting the scope in which
text replacement results are applied.

Test: editing/spelling/text-replacement-after-typing-to-word.html

  • editing/AlternativeTextController.cpp:

(WebCore::AlternativeTextController::timerFired):

  • editing/Editor.cpp:

(WebCore::Editor::replaceSelectionWithFragment):
(WebCore::Editor::markMisspellingsAfterTypingToWord):

Pass in the adjacent word range for the automaticReplacementRange, instead of the spell checking range (which
may be extended to the full range of the sentence).

(WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):

Add an automaticReplacementRange argument to markAllMisspellingsAndBadGrammarInRanges, and adjust call sites
to pass in a range (generally the same as the spell checking range, but in the case where a word has been typed,
this is a narrower range).

(WebCore::correctSpellcheckingPreservingTextCheckingParagraph):
(WebCore::Editor::markAndReplaceFor):

When replacing text, only allow text replacement in the automatic replacement range rather than the spell
checking range.

(WebCore::Editor::markMisspellingsAndBadGrammar):

  • editing/Editor.h:
  • editing/SpellChecker.cpp:

(WebCore::SpellCheckRequest::SpellCheckRequest):

Add a new version of this constructor that takes a single Range representing both the spellchecking range and
the automatic text replacement range, for convenience.

(WebCore::SpellCheckRequest::create):

  • editing/SpellChecker.h:

Add plumbing for the automatic replacement range.

(WebCore::SpellCheckRequest::automaticReplacementRange const):

  • editing/TextCheckingHelper.cpp:

Add plumbing for the automatic replacement range, and new helpers to locate the range as offsets within the
text checking paragraph range.

(WebCore::TextCheckingParagraph::TextCheckingParagraph):
(WebCore::TextCheckingParagraph::invalidateParagraphRangeValues):
(WebCore::TextCheckingParagraph::automaticReplacementStart const):
(WebCore::TextCheckingParagraph::automaticReplacementLength const):

  • editing/TextCheckingHelper.h:

Tools:

Adds testing support for mocking NSSpellChecker's text checking results. See below for more details, and the new
layout test for an example of its usage.

  • DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
  • DumpRenderTree/TestRunner.cpp:

(setSpellCheckerTextReplacementsCallback):

Add bindings support in TestRunner to specify a set of text replacement mappings. Each entry in the dictionary
maps a string representing an input to the NSSpellChecker to some information describing the spell checking
result that LayoutTestSpellChecker will return.

(TestRunner::staticFunctions):

  • DumpRenderTree/TestRunner.h:
  • DumpRenderTree/mac/DumpRenderTree.mm:

(resetWebViewToConsistentStateBeforeTesting):

Restore the original shared NSSpellchecker before transitioning to the next layout test, if needed.

  • DumpRenderTree/mac/DumpRenderTreeSpellChecker.mm: Removed.
  • DumpRenderTree/mac/TestRunnerMac.mm:

(TestRunner::setSpellCheckerLoggingEnabled):
(TestRunner::setSpellCheckerTextReplacements):

These testRunner methods ensure that -[NSSpellChecker sharedSpellChecker] is swizzled to return our mock
LayoutTestSpellChecker instance before calling into it.

  • DumpRenderTree/win/TestRunnerWin.cpp:

(TestRunner::setSpellCheckerTextReplacements):

  • TestRunnerShared/cocoa/LayoutTestSpellChecker.h: Renamed from Tools/DumpRenderTree/mac/DumpRenderTreeSpellChecker.h.
  • TestRunnerShared/cocoa/LayoutTestSpellChecker.mm: Added.

Moved DumpRenderTreeSpellChecker to LayoutTestSpellChecker, and made it compile for both WebKitTestRunner
(modern WebKit) and DumpRenderTree (legacy WebKit) by putting it in TestRunnerShared.

(existingGlobalLayoutTestSpellChecker):
(ensureGlobalLayoutTestSpellChecker):
(stringForCorrectionResponse):
(nsTextCheckingType):
(-[LayoutTestTextCheckingResult initWithType:range:replacement:]):
(-[LayoutTestTextCheckingResult range]):
(-[LayoutTestTextCheckingResult resultType]):
(-[LayoutTestTextCheckingResult replacementString]):
(-[LayoutTestTextCheckingResult description]):

LayoutTestTextCheckingResult represents a fake NSTextCheckingResult containing spell checking results supplied
by the layout test.

(+[LayoutTestSpellChecker installIfNecessary]):
(+[LayoutTestSpellChecker uninstallAndReset]):

Helper methods to begin and end swizzling the shared NSSpellChecker.

(-[LayoutTestSpellChecker reset]):

Resets the state of the LayoutTestSpellChecker (this entails clearing the fake replacements dictionary and
turning off logging for recorded spellchecking responses).

(-[LayoutTestSpellChecker replacements]):
(-[LayoutTestSpellChecker setReplacements:]):
(-[LayoutTestSpellChecker setReplacementsFromJSObject:inContext:]):

Helper method to take a JSObjectRef supplied by the test runner and transform it into a map of spell checking
string inputs to LayoutTestTextCheckingResults.

(-[LayoutTestSpellChecker checkString:range:types:options:inSpellDocumentWithTag:orthography:wordCount:]):

Consult the text replacement map and bail early if a match is found, before calling into real NSSpellChecker
logic to perform spellchecking.

(-[LayoutTestSpellChecker recordResponse:toCorrection:forWord:language:inSpellDocumentWithTag:]):

Reimplement the original functionality in DumpRenderTreeSpellChecker to make -recordResponse:… print to stdout
by overriding the method and printing if the -spellCheckerLoggingEnabled property has been set to YES.

  • WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:

LayoutTests:

Adds a layout test to check that if a user has configured a text replacement that ends with punctuation, then:

  1. Typing that text replacement won't immediately trigger replacement.
  2. Text replacement is triggered after pressing enter.
  • editing/spelling/text-replacement-after-typing-to-word-expected.txt: Added.
  • editing/spelling/text-replacement-after-typing-to-word.html: Added.
  • platform/ios/TestExpectations:
  • platform/mac-wk2/TestExpectations:
4:51 PM Changeset in webkit [233411] by commit-queue@webkit.org
  • 2 edits in trunk/Tools

[WPE][GTK] Fix retrieving backtrace from within flatpak sandbox in test runner
https://bugs.webkit.org/show_bug.cgi?id=187232

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-07-01
Reviewed by Michael Catanzaro.

The place where host tmp folder is mounted changed to /run/host/ we
need to take that into account.

Also explicitely close temporary files as relying on garbage collection to
remove them is a bad idea.

Also minor optimization avoiding to compile regex for each backtrace
retrieval.

  • Scripts/webkitpy/port/linux_get_crash_log.py:

(GDBCrashLogGenerator):
(GDBCrashLogGenerator._get_tmp_file_name):
(GDBCrashLogGenerator._get_trace_from_systemd):

3:38 PM Changeset in webkit [233410] by ddkilzer@apple.com
  • 4 edits in trunk/Source/JavaScriptCore

JavaScriptCore: Fix clang static analyzer warnings: Assigned value is garbage or undefined
<https://webkit.org/b/187233>

Reviewed by Mark Lam.

  • b3/air/AirEliminateDeadCode.cpp:

(JSC::B3::Air::eliminateDeadCode): Initialize changed.

  • parser/ParserTokens.h:

(JSC::JSTextPosition::JSTextPosition): Add struct member
initialization. Simplify default constructor.
(JSC::JSTokenLocation::JSTokenData): Move largest struct in the
union to the beginning to make it easy to zero out all fields.
(JSC::JSTokenLocation::JSTokenLocation): Add struct member
initialization. Simplify default constructor. Note that
endOffset was not being initialized previously.
(JSC::JSTextPosition::JSToken): Add struct member initialization
where necessary.

  • runtime/IntlObject.cpp:

(JSC::MatcherResult): Add struct member initialization.

11:23 AM Changeset in webkit [233409] by Darin Adler
  • 20 edits
    1 move
    1 add in trunk/Source

[Cocoa] Improve ARC compatibility of more code in JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=186973

Reviewed by Dan Bernstein.

Source/JavaScriptCore:

  • API/JSContext.mm:

(WeakContextRef::WeakContextRef): Deleted.
(WeakContextRef::~WeakContextRef): Deleted.
(WeakContextRef::get): Deleted.
(WeakContextRef::set): Deleted.

  • API/JSContextInternal.h: Removed unneeded header guards since this is

an Objective-C++ header. Removed unused WeakContextRef class. Removed declaration
of method -[JSContext initWithGlobalContextRef:] and JSContext property wrapperMap
since neither is used outside the class implementation.

  • API/JSManagedValue.mm:

(-[JSManagedValue initWithValue:]): Use a bridging cast.
(-[JSManagedValue dealloc]): Ditto.
(-[JSManagedValue didAddOwner:]): Ditto.
(-[JSManagedValue didRemoveOwner:]): Ditto.
(JSManagedValueHandleOwner::isReachableFromOpaqueRoots): Ditto.
(JSManagedValueHandleOwner::finalize): Ditto.

  • API/JSValue.mm:

(+[JSValue valueWithNewRegularExpressionFromPattern:flags:inContext:]): Ditto.
(+[JSValue valueWithNewErrorFromMessage:inContext:]): Ditto.
(-[JSValue valueForProperty:]): Ditto.
(-[JSValue setValue:forProperty:]): Ditto.
(-[JSValue deleteProperty:]): Ditto.
(-[JSValue hasProperty:]): Ditto.
(-[JSValue invokeMethod:withArguments:]): Ditto.
(valueToObjectWithoutCopy): Ditto. Also removed unneeded explicit type names.
(valueToArray): Ditto.
(valueToDictionary): Ditto.
(objectToValueWithoutCopy): Ditto.
(objectToValue): Ditto.

  • API/JSVirtualMachine.mm:

(+[JSVMWrapperCache addWrapper:forJSContextGroupRef:]): Ditto.
(+[JSVMWrapperCache wrapperForJSContextGroupRef:]): Ditto.
(-[JSVirtualMachine isOldExternalObject:]): Ditto.
(-[JSVirtualMachine addManagedReference:withOwner:]): Ditto.
(-[JSVirtualMachine removeManagedReference:withOwner:]): Ditto.
(-[JSVirtualMachine contextForGlobalContextRef:]): Ditto.
(-[JSVirtualMachine addContext:forGlobalContextRef:]): Ditto.
(scanExternalObjectGraph): Ditto.
(scanExternalRememberedSet): Ditto.

  • API/JSWrapperMap.mm:

(makeWrapper): Ditto.
(-[JSObjCClassInfo wrapperForObject:inContext:]): Ditto.
(-[JSWrapperMap objcWrapperForJSValueRef:inContext:]): Ditto.
(tryUnwrapObjcObject): Ditto.

  • API/ObjCCallbackFunction.mm:

(blockSignatureContainsClass): Ditto.
(objCCallbackFunctionForMethod): Switched from retain to CFRetain, but not
sure we will be keeping this the same way under ARC.
(objCCallbackFunctionForBlock): Use a bridging cast.

  • API/ObjcRuntimeExtras.h:

(protocolImplementsProtocol): Use a more specific type that includes the
explicit unsafe_unretained for copied protocol lists.
(forEachProtocolImplementingProtocol): Ditto.

  • inspector/remote/cocoa/RemoteInspectorCocoa.mm:

(Inspector::convertNSNullToNil): Added to replace the CONVERT_NSNULL_TO_NIL macro.
(Inspector::RemoteInspector::receivedSetupMessage): Use convertNSNullToNil.

  • inspector/remote/cocoa/RemoteInspectorXPCConnection.mm: Moved the

CFXPCBridge SPI to a header named CFXPCBridgeSPI.h.
(auditTokenHasEntitlement): Deleted. Moved to Entitlements.h/cpp in WTF.
(Inspector::RemoteInspectorXPCConnection::handleEvent): Use WTF::hasEntitlement.
(Inspector::RemoteInspectorXPCConnection::sendMessage): Use a bridging cast.

Source/WebKit:

  • Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:

(WebKit::XPCServiceInitializerDelegate::hasEntitlement): Use WTF::hasEntitlement.

  • Shared/mac/SandboxUtilities.h: Removed connectedProcessHasEntitlement since

we can now use WTF::hasEntitlement instead.

  • Shared/mac/SandboxUtilities.mm: Ditto.
  • StorageProcess/ios/StorageProcessIOS.mm:

(WebKit::StorageProcess::parentProcessHasServiceWorkerEntitlement): Use
WTF::hasEntitlement.

  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::WebPage::parentProcessHasServiceWorkerEntitlement): Ditto.

Source/WTF:

  • WTF.xcodeproj/project.pbxproj: Added CFXPCBridgeSPI.h, fixed a few

other small problems in the project file, and let Xcode fix a few too.

  • wtf/cocoa/Entitlements.h: Added hasEntitlement function with overloads

for an audit token and an XPC connection.

  • wtf/cocoa/Entitlements.mm:

(WTF::hasEntitlement): Added, with overloads for a SecTask, an audit token,
and an XPC connection.
(WTF::processHasEntitlement): Refactored to use the function above.

  • wtf/spi/cocoa/CFXPCBridgeSPI.h: Added.
Note: See TracTimeline for information about the timeline view.