Timeline



Jan 2, 2017:

6:56 PM Changeset in webkit [210231] by Yusuke Suzuki
  • 2 edits in trunk/Source/WebCore

Unreviewed, follow-up fix for r210227
https://bugs.webkit.org/show_bug.cgi?id=166586

Suggested in the above bug.

  • bindings/scripts/StaticString.pm:

(GenerateStrings):

6:40 PM Changeset in webkit [210230] by Yusuke Suzuki
  • 5 edits in trunk

Leverage Substring to create new AtomicStringImpl for StaticStringImpl and SymbolImpl
https://bugs.webkit.org/show_bug.cgi?id=166636

Reviewed by Darin Adler.

Source/WTF:

Previously we always create the full atomic string if we need to create the same string
based on the given value. For example, when generating AtomicStringImpl from the SymbolImpl,
we need to create a new AtomicStringImpl since SymbolImpl never becomes isAtomic() == true.
But it is costly.

This patch leverages the substring system of StringImpl. Instead of allocating the completely
duplicate string, we create a substring StringImpl that shares the same content with the
base string.

  • wtf/text/AtomicStringImpl.cpp:

(WTF::stringTable):
(WTF::addToStringTable):
(WTF::addSubstring):
(WTF::AtomicStringImpl::addSlowCase):
(WTF::AtomicStringImpl::remove):
(WTF::AtomicStringImpl::lookUpSlowCase):

  • wtf/text/StringImpl.h:

(WTF::StringImpl::StaticStringImpl::operator StringImpl&):

Tools:

  • TestWebKitAPI/Tests/WTF/StringImpl.cpp:

(TestWebKitAPI::TEST):

5:57 PM Changeset in webkit [210229] by jfbastien@apple.com
  • 41 edits
    1 copy
    2 adds in trunk

WebAssembly: handle and optimize wasm export → wasm import calls
https://bugs.webkit.org/show_bug.cgi?id=165282

Reviewed by Saam Barati.

JSTests:

  • wasm/Builder.js: Add a Proxy to Builder.js, which intercepts

unknown property lookups. This creates way better error messages
on typos than 'undefined is not a function', which happens
semi-frequently as I typo opcode names (and which one is a typo is
hard to find because we chain builders).
(const._isValidValue):
(get target):
(const._importFunctionContinuation):
(const._importMemoryContinuation):
(const._importTableContinuation):
(const._exportFunctionContinuation):
(export.default.Builder.prototype._registerSectionBuilders.const.section.in.WASM.description.section.switch.section.case.string_appeared_here.this.section):
(export.default.Builder.prototype._registerSectionBuilders.this.Unknown):

  • wasm/LowLevelBinary.js: Add limited support for var{u}int64 (only the 32-bit values)

(export.default.LowLevelBinary.prototype.varint32):
(export.default.LowLevelBinary.prototype.varuint64):
(export.default.LowLevelBinary.prototype.varint64):

  • wasm/function-tests/exceptions.js: update error message
  • wasm/function-tests/trap-load.js: update error message
  • wasm/function-tests/trap-store.js: update error message
  • wasm/js-api/wasm-to-wasm-bad-signature.js: Added. Test a bunch of bad wasm->wasm import signatures

(const.makeImportee.signature.switch):
(BadSignatureDropStartParams):

  • wasm/js-api/wasm-to-wasm.js: Added. Test 64-bit wasm->wasm import calls

(const.callerModule):
(const.calleeModule):
(WasmToWasm):

Source/JavaScriptCore:

  • Add a new JSType for WebAssemblyFunction, and use it when creating its structure. This will is used to quickly detect from wasm whether the import call is to another wasm module, or whether it's to JS.
  • Generate two stubs from the import stub generator: one for wasm->JS and one for wasm -> wasm. This is done at Module time. Which is called will only be known at Instance time, once we've received the import object. We want to avoid codegen at Instance time, so having both around is great.
  • Restore the WebAssembly global state (VM top Instance, and pinned registers) after call / call_indirect, and in the JS->wasm entry stub.
  • Pinned registers are now a global thing, not per-Memory, because the wasm -> wasm stubs are generated at Module time where we don't really have enough information to do the right thing (doing so would generate too much code).
  • CMakeLists.txt:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • runtime/JSType.h: add WebAssemblyFunctionType as a JSType
  • wasm/WasmB3IRGenerator.cpp: significantly rework how calls which

could be external work, and how we save / restore global state:
VM's top Instance, and pinned registers
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::getMemoryBaseAndSize):
(JSC::Wasm::restoreWebAssemblyGlobalState):
(JSC::Wasm::createJSToWasmWrapper):
(JSC::Wasm::parseAndCompile):

  • wasm/WasmB3IRGenerator.h:
  • wasm/WasmBinding.cpp:

(JSC::Wasm::materializeImportJSCell):
(JSC::Wasm::wasmToJS):
(JSC::Wasm::wasmToWasm): the main goal of this patch was adding this function
(JSC::Wasm::exitStubGenerator):

  • wasm/WasmBinding.h:
  • wasm/WasmFormat.h: Get rid of much of the function index space:

we already have all of its information elsewhere, and as-is it
provides no extra efficiency.
(JSC::Wasm::ModuleInformation::functionIndexSpaceSize):
(JSC::Wasm::ModuleInformation::isImportedFunctionFromFunctionIndexSpace):
(JSC::Wasm::ModuleInformation::signatureIndexFromFunctionIndexSpace):

  • wasm/WasmFunctionParser.h:

(JSC::Wasm::FunctionParser<Context>::FunctionParser):

  • wasm/WasmMemory.cpp: Add some logging.

(JSC::Wasm::Memory::dump): this was nice when debugging
(JSC::Wasm::Memory::makeString):
(JSC::Wasm::Memory::Memory):
(JSC::Wasm::Memory::~Memory):
(JSC::Wasm::Memory::grow):

  • wasm/WasmMemory.h: don't use extra indirection, it wasn't

needed. Reorder some of the fields which are looked up at runtime
so they're more cache-friendly.
(JSC::Wasm::Memory::Memory):
(JSC::Wasm::Memory::mode):
(JSC::Wasm::Memory::offsetOfSize):

  • wasm/WasmMemoryInformation.cpp: Pinned registers are now a

global thing for all of JSC, not a per-Memory thing
anymore. wasm->wasm calls are more complex otherwise: they have to
figure out how to bridge between the caller and callee's
special-snowflake pinning.
(JSC::Wasm::PinnedRegisterInfo::get):
(JSC::Wasm::PinnedRegisterInfo::PinnedRegisterInfo):
(JSC::Wasm::MemoryInformation::MemoryInformation):

  • wasm/WasmMemoryInformation.h:
  • wasm/WasmModuleParser.cpp:
  • wasm/WasmModuleParser.h:
  • wasm/WasmPageCount.cpp: Copied from Source/JavaScriptCore/wasm/WasmBinding.h.

(JSC::Wasm::PageCount::dump): nice for debugging

  • wasm/WasmPageCount.h:
  • wasm/WasmPlan.cpp:

(JSC::Wasm::Plan::parseAndValidateModule):
(JSC::Wasm::Plan::run):

  • wasm/WasmPlan.h:

(JSC::Wasm::Plan::takeWasmExitStubs):

  • wasm/WasmSignature.cpp:

(JSC::Wasm::Signature::toString):
(JSC::Wasm::Signature::dump):

  • wasm/WasmSignature.h:
  • wasm/WasmValidate.cpp:

(JSC::Wasm::validateFunction):

  • wasm/WasmValidate.h:
  • wasm/js/JSWebAssemblyInstance.h:

(JSC::JSWebAssemblyInstance::offsetOfTable):
(JSC::JSWebAssemblyInstance::offsetOfImportFunctions):
(JSC::JSWebAssemblyInstance::offsetOfImportFunction):

  • wasm/js/JSWebAssemblyMemory.cpp:

(JSC::JSWebAssemblyMemory::create):
(JSC::JSWebAssemblyMemory::JSWebAssemblyMemory):
(JSC::JSWebAssemblyMemory::buffer):
(JSC::JSWebAssemblyMemory::grow):

  • wasm/js/JSWebAssemblyMemory.h:

(JSC::JSWebAssemblyMemory::memory):
(JSC::JSWebAssemblyMemory::offsetOfMemory):
(JSC::JSWebAssemblyMemory::offsetOfSize):

  • wasm/js/JSWebAssemblyModule.cpp:

(JSC::JSWebAssemblyModule::create):
(JSC::JSWebAssemblyModule::JSWebAssemblyModule):

  • wasm/js/JSWebAssemblyModule.h:

(JSC::JSWebAssemblyModule::signatureIndexFromFunctionIndexSpace):
(JSC::JSWebAssemblyModule::functionImportCount):

  • wasm/js/WebAssemblyFunction.cpp:

(JSC::callWebAssemblyFunction):
(JSC::WebAssemblyFunction::create):
(JSC::WebAssemblyFunction::createStructure):
(JSC::WebAssemblyFunction::WebAssemblyFunction):
(JSC::WebAssemblyFunction::finishCreation):

  • wasm/js/WebAssemblyFunction.h:

(JSC::WebAssemblyFunction::wasmEntrypoint):
(JSC::WebAssemblyFunction::offsetOfInstance):
(JSC::WebAssemblyFunction::offsetOfWasmEntryPointCode):

  • wasm/js/WebAssemblyInstanceConstructor.cpp:

(JSC::constructJSWebAssemblyInstance): always start with a dummy
memory, so wasm->wasm calls don't need to null-check

  • wasm/js/WebAssemblyMemoryConstructor.cpp:

(JSC::constructJSWebAssemblyMemory):

  • wasm/js/WebAssemblyModuleConstructor.cpp:

(JSC::WebAssemblyModuleConstructor::createModule):

  • wasm/js/WebAssemblyModuleRecord.cpp:

(JSC::WebAssemblyModuleRecord::link):
(JSC::WebAssemblyModuleRecord::evaluate):

  • wasm/js/WebAssemblyModuleRecord.h:
4:32 PM Changeset in webkit [210228] by sbarati@apple.com
  • 4 edits
    1 add in trunk

WebAssembly: Some loads don't take into account the offset
https://bugs.webkit.org/show_bug.cgi?id=166616
<rdar://problem/29841541>

Reviewed by Keith Miller.

JSTests:

  • wasm/function-tests/load-offset.js: Added.

Source/JavaScriptCore:

  • wasm/WasmB3IRGenerator.cpp:

(JSC::Wasm::B3IRGenerator::emitLoadOp):

1:22 PM Changeset in webkit [210227] by Yusuke Suzuki
  • 8 edits in trunk/Source

Use StaticStringImpl instead of StaticASCIILiteral
https://bugs.webkit.org/show_bug.cgi?id=166586

Reviewed by Darin Adler.

Source/WebCore:

  • bindings/scripts/StaticString.pm:

(GenerateStrings):

Source/WTF:

It is more handy way to define static StringImpl. It calculates the length
and hash value by using the constexpr constructor and function. So we do
not need to calculate these things in Perl script.
And it allows us to use StaticStringImpl in the hand written C++ code.
Previously, we need to calculate the length and hash value by hand if we
would like to use StaticASCIILiteral in the hand written C++ code, and it
meant that we cannot use it at all in the hand written C++ code.

  • wtf/text/AtomicStringImpl.cpp:

(WTF::AtomicStringImpl::addSlowCase):
(WTF::AtomicStringImpl::lookUpSlowCase):

  • wtf/text/AtomicStringImpl.h:
  • wtf/text/StringImpl.h:
  • wtf/text/SymbolImpl.h:
  • wtf/text/UniquedStringImpl.h:
1:20 PM WebInspectorCodingStyleGuide edited by BJ Burg
(diff)
1:16 PM Changeset in webkit [210226] by akling@apple.com
  • 8 edits in trunk/Source/WebCore

Drop the render tree for documents in the page cache.
<https://webkit.org/b/121798>

Reviewed by Antti Koivisto.

To save memory and reduce complexity, have documents tear down their render tree
when entering the page cache. I've wanted to do this for a long time and it seems
like we can actually do it now.

This patch will enable a number of clean-ups since it's no longer valid for renderers
to exist while the document is in page cache.

  • dom/Document.cpp:

(WebCore::Document::destroyRenderTree): Remove assertion that we're not in the page cache
since we will now be tearing down render trees right as they enter the page cache.

  • dom/PageCache.cpp:

(WebCore::destroyRenderTree):
(WebCore::PageCache::addIfCacheable): Tear down the render tree right before setting
the in-cache flag. The render tree is destroyed in bottom-up order to ensure that the
main frame renderers die last.

  • history/CachedFrame.cpp:

(WebCore::CachedFrameBase::restore):

  • page/FrameView.h:
  • page/FrameView.cpp:

(WebCore::FrameView::didRestoreFromPageCache): Update the scollable area set after restoring
a frame from the page cache. This dirties the scrolling tree, which was covered by tests.

  • page/animation/AnimationBase.cpp:

(WebCore::AnimationBase::setNeedsStyleRecalc):

  • page/animation/AnimationController.cpp:

(WebCore::AnimationController::cancelAnimations): Make these no-ops if called
while the render tree is being torn down. This fixes some assertion failures
on layout tests and avoids pointless style invalidation.

8:41 AM Changeset in webkit [210225] by Manuel Rego Casasnovas
  • 2 edits in trunk/Tools

[GTK] WebCore/CSSParser unit test is not being built
https://bugs.webkit.org/show_bug.cgi?id=166492

Reviewed by Michael Catanzaro.

This test was introduced in r175930, but we were not building
it on GTK+ port since r176015.
This patch marks the test to be built again on GTK+.
JFTR, the test is passing right now.

  • TestWebKitAPI/PlatformGTK.cmake: Add CSSParser.cpp test file and use

ADD_WHOLE_ARCHIVE_TO_LIBRARIES to avoid linking errors.

7:36 AM Changeset in webkit [210224] by akling@apple.com
  • 9 edits in trunk/Source

Discard media controls JS/CSS caches under memory pressure.
<https://webkit.org/b/166639>

Reviewed by Antti Koivisto.

Source/WebCore:

Add a RenderTheme::purgeCaches() virtual and teach the iOS and macOS implementations
to drop their cached media controls JS/CSS strings there. The strings are only cleared
if nothing else is referencing them, which gives us a decent "weak cache" behavior.

This sheds ~300kB memory on iOS with the current media controls.

  • page/MemoryRelease.cpp:

(WebCore::releaseNoncriticalMemory):

  • rendering/RenderTheme.h:

(WebCore::RenderTheme::purgeCaches):

  • rendering/RenderThemeIOS.h:
  • rendering/RenderThemeIOS.mm:

(WebCore::RenderThemeIOS::purgeCaches):

  • rendering/RenderThemeMac.h:
  • rendering/RenderThemeMac.mm:

(WebCore::RenderThemeMac::purgeCaches):

Source/WTF:

  • wtf/text/WTFString.h:

(WTF::String::clearImplIfNotShared): Add a helper for clearing a String if the underlying
StringImpl is not referenced by anyone else.

5:54 AM Changeset in webkit [210223] by Carlos Garcia Campos
  • 2 edits in trunk/Source/WebCore

[GTK] Since the memory pressure relief has been activated, my disk has a high usage and the desktop stalls
https://bugs.webkit.org/show_bug.cgi?id=164052

Reviewed by Michael Catanzaro.

Check how much memory is freed by the memory pressure handler and wait for a long time if we didn't free that
much.

  • platform/linux/MemoryPressureHandlerLinux.cpp:

(WebCore::MemoryPressureHandler::EventFDPoller::EventFDPoller):

1:02 AM Changeset in webkit [210222] by Chris Fleizach
  • 9 edits
    2 adds in trunk

AX: Expose block quote level to iOS API
https://bugs.webkit.org/show_bug.cgi?id=166629
<rdar://problem/29834793>

Reviewed by Darin Adler.

Source/WebCore:

Expose the blockquote level to iOS Accessbility API.
Change the return type of blockquote level to unsigned.

Test: accessibility/ios-simulator/blockquote-level.html

  • accessibility/AccessibilityObject.cpp:

(WebCore::AccessibilityObject::blockquoteLevel):

  • accessibility/AccessibilityObject.h:
  • accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:

(-[WebAccessibilityObjectWrapper accessibilityBlockquoteLevel]):

  • accessibility/mac/WebAccessibilityObjectWrapperMac.mm:

(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

Tools:

  • DumpRenderTree/ios/AccessibilityUIElementIOS.mm:

(AccessibilityUIElement::numberAttributeValue):

  • WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:

(WTR::AccessibilityUIElement::numberAttributeValue):

LayoutTests:

  • accessibility/ios-simulator/blockquote-level-expected.txt: Added.
  • accessibility/ios-simulator/blockquote-level.html: Added.

Jan 1, 2017:

12:23 PM Changeset in webkit [210221] by jeffm@apple.com
  • 19 edits in trunk

Update user-visible copyright strings to include 2017
https://bugs.webkit.org/show_bug.cgi?id=166278

Reviewed by Dan Bernstein.

Source/JavaScriptCore:

  • Info.plist:

Source/WebCore:

  • Info.plist:

Source/WebKit/mac:

  • Info.plist:

Source/WebKit2:

  • DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService/Info.plist:
  • Info.plist:
  • NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist:
  • NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist:
  • NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-iOS.plist:
  • PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist:
  • PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
  • WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist:
  • WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
  • WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist:

WebKitLibraries:

  • win/tools/scripts/COPYRIGHT-END-YEAR:
8:46 AM Changeset in webkit [210220] by zandobersek@gmail.com
  • 2 edits in trunk/Source/WebCore

GraphicsContextCairo: setMiterLimit() is missing the DisplayListRecorder diversion
https://bugs.webkit.org/show_bug.cgi?id=166539

Reviewed by Michael Catanzaro.

  • platform/graphics/cairo/GraphicsContextCairo.cpp:

(WebCore::GraphicsContext::setMiterLimit): Call the setMiterLimit() method on the
m_displayListRecorder object when the GraphicsContext object is in recording mode.

8:15 AM Changeset in webkit [210219] by zandobersek@gmail.com
  • 4 edits in trunk/Source/WebCore

Clean up GraphicsContext3D forward declarations, header inclusion
https://bugs.webkit.org/show_bug.cgi?id=166537

Reviewed by Alex Christensen.

Remove two unnecessary GraphicsContext3D forward declarations from the
EmptyClients and ChromeClient header files, and remove the unnecessary
GraphicsContext3D.h header inclusion from RenderLayerBacking.

No changes in behavior.

  • loader/EmptyClients.h:
  • page/ChromeClient.h:
  • rendering/RenderLayerBacking.cpp:

Dec 31, 2016:

4:48 PM Changeset in webkit [210218] by Michael Catanzaro
  • 7 edits
    1 add in trunk

SecurityOrigin::create triplet constructor does not canonicalize port
https://bugs.webkit.org/show_bug.cgi?id=166624

Reviewed by Daniel Bates.

Source/WebCore:

It is currently possible to create two different unequal SecurityOrigin objects that
represent the same security origin. The SecurityOrigin create functions that take URL and
String parameters convert the port to nullopt if it is the default port for the protocol,
but the separate protocol/host/port constructor doesn't. Change it to parallel the other
constructors.

  • page/SecurityOrigin.cpp:

(WebCore::SecurityOrigin::create):

  • page/SecurityOrigin.h: Export isSameOriginAs for use by tests.

Tools:

  • TestWebKitAPI/PlatformGTK.cmake:
  • TestWebKitAPI/PlatformWin.cmake:
  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WebCore/SecurityOrigin.cpp: Added.

(TestWebKitAPI::SecurityOriginTest::SetUp):
(TestWebKitAPI::TEST_F):

1:57 AM Changeset in webkit [210217] by Darin Adler
  • 31 edits
    1 delete in trunk/Source/WebCore

Remove setDOMException and a few custom bindings
https://bugs.webkit.org/show_bug.cgi?id=166002

Reviewed by Sam Weinig.

  • CMakeLists.txt: Removed JSFileReaderCustom.cpp.
  • WebCore.xcodeproj/project.pbxproj: Removed JSFileReaderCustom.cpp.
  • bindings/js/CallbackFunction.cpp:

(WebCore::checkFunctionOnlyCallback): Use throwTypeMismatchError instead
of calling setDOMException with TYPE_MISMATCH_ERR.

  • bindings/js/JSBindingsAllInOne.cpp: Removed JSFileReaderCustom.cpp.
  • bindings/js/JSCSSStyleDeclarationCustom.cpp:

(WebCore::JSCSSStyleDeclaration::putDelegate): Pass a throw scope in to
propagateException.

  • bindings/js/JSCryptoAlgorithmDictionary.cpp:

(WebCore::JSCryptoAlgorithmDictionary::parseAlgorithmIdentifier):
Renamed from getAlgorithmIdentifier. Got rid of bool return value, instead
use a conventional return value and conventional JavaScript exception
handling. Added a ThrowScope argument.
(WebCore::optionalHashAlgorithm): Added. Returns an optional hash algorithm.
Also makes the same changes as above, conventional exception handling and
ThrowScope argument.
(WebCore::requiredHashAlgorithm): Added. Like the above but throws an
exception if the algorithm is omitted.
(WebCore::getHashAlgorithm): Deleted. Replaced by the two functions above.
(WebCore::createAesCbcParams): Updated for above changes.
(WebCore::createHmacParams): Ditto.
(WebCore::createHmacKeyParams): Ditto.
(WebCore::createRsaKeyGenParams): Ditto.
(WebCore::createRsaOaepParams): Ditto.
(WebCore::createRsaSsaParams): Ditto.
(WebCore::JSCryptoAlgorithmDictionary::createParametersForEncrypt): Added
a ThrowScope argument, and changed to use throwNotSupportedError instead
of setDOMException with NOT_SUPPORTED_ERROR.
(WebCore::JSCryptoAlgorithmDictionary::createParametersForDecrypt): Ditto.
(WebCore::JSCryptoAlgorithmDictionary::createParametersForSign): Ditto.
(WebCore::JSCryptoAlgorithmDictionary::createParametersForVerify):
(WebCore::JSCryptoAlgorithmDictionary::createParametersForDigest): Ditto.
(WebCore::JSCryptoAlgorithmDictionary::createParametersForGenerateKey): Ditto.
(WebCore::JSCryptoAlgorithmDictionary::createParametersForDeriveKey): Ditto.
(WebCore::JSCryptoAlgorithmDictionary::createParametersForDeriveBits): Ditto.
(WebCore::JSCryptoAlgorithmDictionary::createParametersForImportKey): Ditto.
(WebCore::JSCryptoAlgorithmDictionary::createParametersForExportKey): Ditto.

  • bindings/js/JSCryptoAlgorithmDictionary.h: Updated for the above changes.
  • bindings/js/JSCryptoOperationData.cpp:

(WebCore::cryptoOperationDataFromJSValue): Got rid of bool return value and
instead use a conventional return value and conventional JS exception handling.
Added a ThrowScope argument.

  • bindings/js/JSCryptoOperationData.h: Updated for the above.
  • bindings/js/JSCustomXPathNSResolver.cpp:

(WebCore::JSCustomXPathNSResolver::create): Use ExceptionOr.
(WebCore::JSCustomXPathNSResolver::JSCustomXPathNSResolver): Take a VM&
rather than an ExecState*.

  • bindings/js/JSCustomXPathNSResolver.h: Updated for the changes above.

Also marked class final and fixed indentation.

  • bindings/js/JSDOMBinding.cpp:

(WebCore::createDOMException): Updated comment.
(WebCore::throwDOMException): Deleted.
(WebCore::propagateException): Deleted non-inline overload that does not take
a throw scope, now that all callers pass a throw scope.
(WebCore::setDOMExceptionSlow): Deleted.
(WebCore::setDOMException): Deleted.
(WebCore::throwNotSupportedError): Added.
(WebCore::throwDOMSyntaxError): Added.
(WebCore::throwDataCloneError): Added.
(WebCore::throwIndexSizeError): Added.
(WebCore::throwTypeMismatchError): Added.

  • bindings/js/JSDOMBinding.h: Updated for the additions and removals

above. Also grouped the standard DOM exception throwing functions separately
from the special ones for getters and setters, and sorted them alphabetically.

  • bindings/js/JSDataCueCustom.cpp:

(WebCore::createJSDataCue): Added, helper function for the below.
(WebCore::constructJSDataCue): Tightened and tweaked a bit.

  • bindings/js/JSFileReaderCustom.cpp: Removed.
  • bindings/js/JSHTMLOptionsCollectionCustom.cpp:

(WebCore::JSHTMLOptionsCollection::setLength): Use throwIndexSizeError instead
of setDOMException with INDEX_SIZE_ERR.

  • bindings/js/JSHTMLSelectElementCustom.cpp:

(WebCore::selectElementIndexSetter): Use throwTypeMismatchError instead of
setDOMExceptoin with TYPEMISMATCH_ERR.

  • bindings/js/JSIDBRequestCustom.cpp:

(WebCore::JSIDBRequest::result): Pass a throw scope in to
propagateException.

  • bindings/js/JSSQLResultSetRowListCustom.cpp:

(WebCore::JSSQLResultSetRowList::item): Use throwTypeMismatchError and
throwIndexSizeError instead of setDOMException with TYPE_MISMATCH_ERR and
INDEX_ERR. This required adding a throw scope.

  • bindings/js/JSSQLTransactionCustom.cpp:

(WebCore::JSSQLTransaction::executeSql): Use throwDOMSyntaxError and
throwTypeMismatchError instead of setDOMException with SYNTAX_ERR and
TYPE_MISMATCH_ERR.

  • bindings/js/JSStorageCustom.cpp:

(WebCore::JSStorage::nameGetter): Pass a throw scope in to
propagateException.

  • bindings/js/JSSubtleCryptoCustom.cpp:

(WebCore::normalizeCryptoAlgorithmParameters): Use throwNotSupportedError
instead of setDOMException with NOT_SUPPORTED_ERR.
(WebCore::createAlgorithm): Deleted.
(WebCore::supportExportKeyThrow): Added ThrowScope argument and use
throwNotSupportedError instead of setDOMException with NOT_SUPPORTED_ERR.
(WebCore::jsSubtleCryptoFunctionEncryptPromise): Updated for above changes,
throwing a not supported exception at this level rather than in a helper.
(WebCore::jsSubtleCryptoFunctionDecryptPromise): Ditto.
(WebCore::jsSubtleCryptoFunctionSignPromise): Ditto.
(WebCore::jsSubtleCryptoFunctionVerifyPromise): Ditto.
(WebCore::jsSubtleCryptoFunctionDigestPromise): Ditto.
(WebCore::jsSubtleCryptoFunctionGenerateKeyPromise): Ditto.
(WebCore::jsSubtleCryptoFunctionImportKeyPromise): Ditto.
(WebCore::jsSubtleCryptoFunctionExportKeyPromise): Ditto.
(WebCore::jsSubtleCryptoFunctionWrapKeyPromise): Ditto.
(WebCore::jsSubtleCryptoFunctionUnwrapKeyPromise): Ditto.

  • bindings/js/JSWebKitSubtleCryptoCustom.cpp:

(WebCore::createAlgorithmFromJSValue): Got rid of bool return value and
instead use a conventional return value and conventional JS exception handling.
Added a ThrowScope argument.
(WebCore::cryptoKeyFormatFromJSValue): Ditto.
(WebCore::cryptoKeyUsagesFromJSValue): Ditto.
(WebCore::JSWebKitSubtleCrypto::encrypt): Updated for above changes.
(WebCore::JSWebKitSubtleCrypto::decrypt): Ditto.
(WebCore::JSWebKitSubtleCrypto::sign): Ditto.
(WebCore::JSWebKitSubtleCrypto::verify): Ditto.
(WebCore::JSWebKitSubtleCrypto::digest): Ditto.
(WebCore::JSWebKitSubtleCrypto::generateKey): Ditto.
(WebCore::JSWebKitSubtleCrypto::importKey): Ditto.
(WebCore::JSWebKitSubtleCrypto::exportKey): Ditto.
(WebCore::JSWebKitSubtleCrypto::wrapKey): Ditto.
(WebCore::JSWebKitSubtleCrypto::unwrapKey): Ditto.

  • bindings/js/JSXMLHttpRequestCustom.cpp:

(WebCore::JSXMLHttpRequest::send): Pass a throw scope in to
propagateException.
(WebCore::JSXMLHttpRequest::responseText): Ditto.

  • bindings/js/JSXPathNSResolverCustom.cpp:

(WebCore::JSXPathNSResolver::toWrapped): Updated since
JSCustomXPathNSResolver::create now uses ExceptionOr.

  • bindings/js/SerializedScriptValue.cpp:

(WebCore::maybeThrowExceptionIfSerializationFailed): Updated to take
a reference instead of a pointer. Fixed the handling of success to be
simpler; no need to check the code twice. Use throwDataCloneError instead
of setDOMException with DATA_CLONE_ERR.
(WebCore::SerializedScriptValue::create): Updated for above.
(WebCore::SerializedScriptValue::deserialize): Ditto.

  • bindings/js/StructuredClone.cpp:

(WebCore::structuredCloneArrayBuffer): Use throwDataCloneError instead of
setDOMException with DATA_CLONE_ERR.
(WebCore::structuredCloneArrayBufferView): Ditto.

  • crypto/CryptoAlgorithmParametersDeprecated.h: Removed unneeded empty

constructor.

  • crypto/parameters/CryptoAlgorithmHmacKeyParamsDeprecated.h: Ditto,

moving initialization to where the data member is defined.

  • crypto/parameters/CryptoAlgorithmRsaKeyGenParamsDeprecated.h: Ditto.
  • crypto/parameters/CryptoAlgorithmRsaOaepParamsDeprecated.h: Ditto.
  • fileapi/FileReader.cpp:

(WebCore::FileReader::result): Added. Returns a combination of optional
and variant that matches what the ID specifies. Moved the code from the
two following functions in here.
(WebCore::FileReader::arrayBufferResult): Deleted.
(WebCore::FileReader::stringResult): Deleted.

  • fileapi/FileReader.h: Updated for the above.
  • fileapi/FileReader.idl: Removed [Custom] from the result attribute and

declared it with the type mentioned in the specification, a nullable union.

1:51 AM Changeset in webkit [210216] by Darin Adler
  • 94 edits
    1 delete in trunk

Remove PassRefPtr use from the "dom" directory, related cleanup
https://bugs.webkit.org/show_bug.cgi?id=166569

Reviewed by Alex Christensen.

Source/WebCore:

  • CMakeLists.txt: Removed DocumentMarker.cpp.
  • WebCore.xcodeproj/project.pbxproj: Ditto.
  • bindings/js/JSPopStateEventCustom.cpp:

(WebCore::JSPopStateEvent::state): Pass ExecState by reference.

  • dom/CharacterData.cpp:

(WebCore::CharacterData::dispatchModifiedEvent): Use auto.

  • dom/DOMAllInOne.cpp: Removed DocumentMarker.cpp.
  • dom/DOMNamedFlowCollection.cpp:

(WebCore::DOMNamedFlowCollection::DOMNamedFlowCollection): Updated to take
ownership of the passed in vector.
(WebCore::DOMNamedFlowCollection::create): Moved here from header.
(WebCore::DOMNamedFlowCollection::~DOMNamedFlowCollection): Moved here so we
don't need to include "WebKitNamedFlow.h" in the header.
(WebCore::DOMNamedFlowCollection::item): Rewrote to use Vector.
(WebCore::DOMNamedFlowCollection::namedItem): Rewrote to use a HashSet that
we build from the Vector. Uses a set of hash functions defined right here.
Note that the privor version of this class had incorrect use of ListHashSet
with safeToCompareToEmptyOrDeleted inaccurately set to true.
(WebCore::DOMNamedFlowCollection::supportedPropertyNames): Added this.
Old version just had an empty placeholder.

  • dom/DOMNamedFlowCollection.h: Changed to no longer use ListHashSet, not

the right data structure for this. Removed incorrect use of "long" and
made some other simplifications.

  • dom/DOMNamedFlowCollection.idl: Changed return types of item and namedItem

to accurately reflect the fact that they return null when the index or name
not found in the collection.

  • dom/DataTransfer.h: Remove indentation. Remove unimplemented

incorrect declarations of items for ENABLE(DATA_TRANSFER_ITEMS).
Will be added back when someone implements that feature, or perhaps
ENABLE(DATA_TRANSFER_ITEMS) should be entirely removed for now?

  • dom/DataTransferItem.h: Changed return type for getAsFile to

RefPtr. Again, part of ENABLE(DATA_TRANSFER_ITEMS), so dead code for now.

  • dom/Document.cpp:

(WebCore::canonicalizedTitle): Removed incorrect comment claiming we
convert control characters to spaces. Simplified logic, removing two
extra loops. Changed to work on just a String rather than StringWithDirection.
(WebCore::Document::updateTitle): Updated to call the function above.
Also updated since StringWithDirection is now a struct instead of a class.
Call displayBuffer on the encoding directly instead of calling a member
function named displayBufferModifiedByEncoding.
(WebCore::Document::updateTitleFromTitleElement): Updated since
StringWithDirection is now a struct.
(WebCore::Document::setTitle): Removed code that unnecessarily calls
updateTitle twice; once indirectly by calling setTextContent on the
title elmeent and once by directly calling updateTitle.
(WebCore::Document::setWindowAttributeEventListener): Take a RefPtr&&.
(WebCore::Document::statePopped): Take a Ref&&.
(WebCore::Document::displayStringModifiedByEncoding): Deleted unused overload.
(WebCore::Document::displayBufferModifiedByEncodingInternal): Deleted.
(WebCore::Document::requestAnimationFrame): Take a Ref&&.

  • dom/Document.h: Updated for changes above. Also changed the title function

to return a const String& to slightly cut down on reference count churn.
(WebCore::Document::displayBufferModifiedByEncoding): Deleted.

  • dom/DocumentMarker.cpp: Removed.
  • dom/DocumentMarker.h: Reworked the DocumentMarker class to use a variant

instead of a separate reference counted DocumentMarkerDetails object.

  • dom/DocumentMarkerController.cpp:

(WebCore::DocumentMarkerController::addMarkerToNode): Changed argument
type to DocumentMarker::Data&&.
(DocumentMarkerController::clearDescriptionOnMarkersIntersectingRange):
clearDetails -> clearData
(DocumentMarkerController::showMarkers): activeMatch -> isActiveMatch

  • dom/DocumentMarkerController.h: Updated for the above.
  • dom/DocumentParser.h: Fixed incorrect reference to PassRefPtr in a comment.
  • dom/Element.cpp:

(WebCore::Element::willModifyAttribute): Use auto.

  • dom/Event.cpp:

(WebCore::Event::isDragEvent): Deleted. Unused.
(WebCore::Event::cloneFor): Deleted. Unused function left over from the
start of an implementation of seamless frames.

  • dom/Event.h: Updated for the above.
  • dom/EventContext.cpp: Tweaked blank lines.
  • dom/EventContext.h: Removed unnecessary includes and forward declarations.

Changed setRelatedTarget to take a raw pointer instead of PassRefPtr since
callers aren't passing ownership. Moved TouchEventContext::touchList body
out of the class definition since it's a bit long. Deleted unused
toTouchEventContext functions. FIxed incorrect comment.

  • dom/MessageEvent.cpp:

(WebCore::MessageEvent::initMessageEvent): Removed unused overload.

  • dom/MessageEvent.h: Updated for above. Also changed the

dataAsSerializedScriptValue function to return a raw pointer instead of
PassRefPtr since it is not passing ownership.

  • dom/MouseEvent.cpp:

(WebCore::MouseEvent::create): Use raw pointer instead of PassRefPtr for
data transfer and related target arguments.
(WebCore::MouseEvent::MouseEvent): Ditto. Also use IntPoint instead of
separate ints for the various X/Y pairs.
(WebCore::MouseEvent::initMouseEvent): Take a raw pointer for event target.
(WebCore::MouseEvent::isDragEvent): Reformatted, sorted alphabetically,
added comment about why this function probably needs to go.
(WebCore::adjustedClientX): Deleted.
(WebCore::adjustedClientY): Deleted.
(WebCore::MouseEvent::cloneFor): Deleted.

  • dom/MouseEvent.h: Updated for the above. Also made more functions private

and final and initialized more of the data members.

  • dom/MutationEvent.cpp:

(WebCore::MutationEvent::MutationEvent): Pass related node as a raw pointer.
(WebCore::MutationEvent::initMutationEvent): Ditto.

  • dom/MutationEvent.h: Updated for the above. Fixed indentation. Removed

unnecessary explicit destructor; default generated one is fine. Initialize
m_attrChange in the class definition.

  • dom/MutationObserver.cpp:

(WebCore::MutationObserver::observe): Pass reference.
(WebCore::MutationObserver::disconnect): Call unregisterMutationObserver
directly instead of calling unregisterAndDelete.

  • dom/MutationObserverInterestGroup.cpp:

(WebCore::MutationObserverInterestGroup::MutationObserverInterestGroup):
Take an rvalue reference to the HashMap and use move.
(WebCore::MutationObserverInterestGroup::createIfNeeded): Updated to call
registeredMutationObservers.

  • dom/MutationObserverInterestGroup.h: Updated for the above.
  • dom/MutationObserverRegistration.cpp:

(WebCore::MutationObserverRegistration::MutationObserverRegistration):
Take a reference to the observer instead of PassRefPtr. Also take a
refererence to the node rather than a pointer.
(WebCore::MutationObserverRegistration::observedSubtreeNodeWillDetach):
Updated to use references instead of pointers.
(WebCore::MutationObserverRegistration::clearTransientRegistrations): Ditto.
(WebCore::MutationObserverRegistration::unregisterAndDelete): Deleted.
(WebCore::MutationObserverRegistration::shouldReceiveMutationFrom): Ditto.
(WebCore::MutationObserverRegistration::addRegistrationNodesToSet): Ditto.

  • dom/MutationObserverRegistration.h: Updated for above changes. Also added

a node member function. Changed m_observer to a Ref and m_node to a reference.
Removed the NodeHashSet typedef.

  • dom/NamedFlowCollection.cpp:

(WebCore::NamedFlowCollection::createCSSOMSnapshot): Pass a vector of Ref
instead of a vector of raw pointers and pass it as an rvalue reference so
it can be taken over by the named flow collection wrapper.

  • dom/Node.cpp:

(WebCore::Node::mutationObserverRegistry): Use auto and nullptr.
(WebCore::Node::transientMutationObserverRegistry): Ditto.
(WebCore::collectMatchingObserversForMutation): Use references instead of pointers.
(WebCore::Node::registeredMutationObservers): Changed to return a map instead of
filling one in and renamed to remove "get" from name.
(WebCore::Node::registerMutationObserver): Use references instead of pointers.
(WebCore::Node::unregisterMutationObserver): Ditto.
(WebCore::Node::registerTransientMutationObserver): Ditto.
(WebCore::Node::unregisterTransientMutationObserver): Ditto.
(WebCore::Node::notifyMutationObserversNodeWillDetach): Ditto.

  • dom/Node.h: Updated for the above.
  • dom/PopStateEvent.cpp:

(WebCore::PopStateEvent::PopStateEvent): Use RefPtr&& instead of PassRefPtr.
(WebCore::PopStateEvent::create): Use a raw pointer instead of PassRefPtr.
(WebCore::PopStateEvent::trySerializeState): Take a reference to ExecState.

  • dom/PopStateEvent.h: Updated for the above.
  • dom/Position.cpp:

(WebCore::Position::Position): Take a raw pointer instead of PassRefPtr.
(WebCore::Position::moveToPosition): Ditto.

  • dom/Position.h: Updated for the above, also changed createLegacyEditingPosition

in the same way and got rid of the LegacyEditingPosition class.

  • dom/Range.cpp:

(WebCore::Range::Range): Changed startContainer and endContainer to RefPtr<Node>&&.
Later this needs to be changed more, but for now this keeps code changes to a minimum.
(WebCore::Range::create): Changed startContainer and endContainer to Node*.

  • dom/Range.h: Updated for the above.
  • dom/ScopedEventQueue.cpp:

(WebCore::ScopedEventQueue::dispatchEvent): Removed a comment that talks about
PassRefPtr, and simplified the code since the comment is no longer valid.

  • dom/ScriptExecutionContext.cpp:

(WebCore::ScriptExecutionContext::PendingException::PendingException):
Take a RefPtr&& instead of a PassRefPtr.
(WebCore::ScriptExecutionContext::ScriptExecutionContext): Moved initialization
of all the data members up to the class definition.
(WebCore::ScriptExecutionContext::sanitizeScriptError): Use ASCIILiteral.
(WebCore::ScriptExecutionContext::reportException): Use WTFMove when passing
arguments to the PendingException constructor and using a value from the
PendingException just before destroying it.

  • dom/ScriptExecutionContext.h: Changed addTimeout to take a reference rather

than a PassRefPtr to the timer. Callers were not passing ownership. Also
initialize all the data members here in the class definition.

  • dom/ScriptedAnimationController.cpp:

(WebCore::ScriptedAnimationController::registerCallback): Take a Ref&&.

  • dom/ScriptedAnimationController.h: Updated for the above.
  • dom/SimulatedClick.cpp:

(WebCore::SimulatedMouseEvent::SimulatedMouseEvent): Updated since MouseEvent
constructor arguments changed to use IntPoint.

  • dom/WheelEvent.cpp:

(WebCore::WheelEvent::WheelEvent): Ditto. Also removed some unneeded initializers
now that the header does more.
(WebCore::WheelEvent::initWheelEvent): Tweaed style a bit.
(WebCore::WheelEvent::initWebKitWheelEvent): Deleted. Moved to the header since it's
just an inline that forwards to initWheelEvent.

  • dom/WheelEvent.h: Updated for the above.
  • dom/make_event_factory.pl:

(generateImplementation): Use RefPtr instead of PassRefPtr. A couple other tweaks.

  • editing/AlternativeTextController.cpp:

(WebCore::AlternativeTextController::respondToMarkerAtEndOfWord): Use the data
insetad of details.
(WebCore::AlternativeTextController::removeDictationAlternativesForMarker):
Ditto, also changed to take reference instead of pointer.
(WebCore::AlternativeTextController::dictationAlternativesForMarker): Ditto.
(WebCore::AlternativeTextController::applyDictationAlternative): Ditto.

  • editing/AlternativeTextController.h: Updated for the above.
  • editing/ApplyBlockElementCommand.cpp:

(WebCore::ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded):
Updated since Position now takes a raw pointer.

  • editing/ApplyStyleCommand.cpp:

(WebCore::ApplyStyleCommand::joinChildTextNodes): Ditto.

  • editing/CompositeEditCommand.cpp:

(WebCore::CompositeEditCommand::replaceSelectedTextInNode): Ditto.
(WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring): Ditto.

  • editing/DictationCommand.cpp:

(WebCore::DictationMarkerSupplier::addMarkersToTextNode): Updated to use the
DictationData struct.

  • editing/Editor.cpp:

(WebCore::Editor::updateMarkersForWordsAffectedByEditing): Pass a reference.
(WebCore::Editor::dictationAlternativesForMarker): Take a reference.

  • editing/Editor.h: Updated for the above.
  • editing/InsertTextCommand.cpp:

(WebCore::InsertTextCommand::performOverwrite): Updated since Position now takes
a raw pointer.
(WebCore::InsertTextCommand::doApply): Ditto.
(WebCore::InsertTextCommand::insertTab): Ditto.

  • editing/ReplaceSelectionCommand.cpp:

(WebCore::ReplaceSelectionCommand::mergeTextNodesAroundPosition): Ditto.

  • html/HTMLTitleElement.cpp:

(WebCore::HTMLTitleElement::computedTextWithDirection): Updated since
StringWithDirection is now a struct.

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::submitForm): Use Ref&& for the form submission.
(WebCore::FrameLoader::receivedFirstData): Updated for change to StringWithDirection.
(WebCore::FrameLoader::commitProvisionalLoad):
(WebCore::FrameLoader::didBeginDocument): Pass a reference.
(WebCore::FrameLoader::loadURLIntoChildFrame): Pass a Ref to loadArchive.
(WebCore::FrameLoader::loadArchive): Take a Ref&& for the archive.
(WebCore::FrameLoader::loadInSameDocument): Take a raw pointer for the
serialized script value state object. No one was passing ownership.
But pass it along to statePopped as a Ref since we need to pass ownership
of the null value, at least for now.
(WebCore::FrameLoader::loadFrameRequest): Take a raw pointer for form state.
No one was passing ownership.
(WebCore::FrameLoader::loadURL): Ditto.
(WebCore::FrameLoader::load): Ditto.
(WebCore::FrameLoader::loadWithNavigationAction): Ditto.
(WebCore::FrameLoader::loadWithDocumentLoader): Ditto.
(WebCore::FrameLoader::loadPostRequest): Ditto.
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy): Ditto.
(WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): Ditto.

  • loader/FrameLoader.h: Updated for the above and to remove an unneeded forward

declaration of StringWithDirection, which is not used here.

  • loader/FrameLoaderClient.h: Updated forward declaration of StringWithDirection.

Also sorted the others and removed unneeded conditionals.

  • loader/HistoryController.cpp:

(WebCore::HistoryController::setCurrentItemTitle): Updated to use struct.
(WebCore::HistoryController::initializeItem): Ditto.

  • loader/HistoryController.h: Updated forward declaration of StringWithDirection.
  • loader/PolicyCallback.cpp:

(WebCore::PolicyCallback::PolicyCallback): Deleted. Default works fine.
(WebCore::PolicyCallback::~PolicyCallback): Ditto.
(WebCore::PolicyCallback::set): Take a raw pointer to form state.

  • loader/PolicyCallback.h: Use raw pointer for form state.
  • loader/PolicyChecker.cpp:

(WebCore::PolicyChecker::checkNavigationPolicy): Take a raw pointer for form state.
(WebCore::PolicyChecker::checkNewWindowPolicy): Ditto.

  • loader/PolicyChecker.h: Updated for the above.
  • page/DOMTimer.cpp:

(WebCore::DOMTimer::DOMTimer): Pass reference to addTimeout function.

  • page/DOMWindow.cpp:

(WebCore::DOMWindow::requestAnimationFrame): Use Ref&& for callback.
(WebCore::DOMWindow::webkitRequestAnimationFrame): Ditto.
(WebCore::DOMWindow::cancelAnimationFrame): Tweak coding style.

  • page/DOMWindow.h: Updated for the above.
  • platform/PlatformWheelEvent.h: Use pragma once. Tweaked header indentation.

Simplified constructors by initializing data members.

  • platform/text/StringWithDirection.h: Use pragma once. Use struct instead of class.
  • rendering/HitTestResult.cpp:

(WebCore::HitTestResult::dictationAlternatives): Pass a reference.

  • rendering/InlineTextBox.cpp:

(WebCore::InlineTextBox::paintTextMatchMarker): activeMatch -> isActiveMatch

Source/WebKit/ios:

  • WebView/WebPDFViewIOS.mm:

(-[WebPDFView _checkPDFTitle]): Use aggregate-style syntax for StringWithDirection.
Not needed now, but useful later if we ever can get rid of the explicit constructors.

Source/WebKit/mac:

  • WebCoreSupport/WebFrameLoaderClient.mm:

(WebFrameLoaderClient::dispatchDidReceiveTitle): Updated to use struct.
(WebFrameLoaderClient::updateGlobalHistory): Ditto.
(WebFrameLoaderClient::setTitle): Ditto.
(WebFrameLoaderClient::transitionToCommittedForNewPage): Ditto.

  • WebView/WebFrame.mm:

(-[WebFrame _dispatchDidReceiveTitle:]): Use aggregate-style syntax for StringWithDirection.
Not needed now, but useful later if we ever can get rid of the explicit constructors.
(-[WebFrame loadArchive:]): Pass a reference to loadArchive.

  • WebView/WebHTMLRepresentation.mm:

(-[WebHTMLRepresentation title]): Updated to use struct.

Source/WebKit/win:

  • WebCoreSupport/WebFrameLoaderClient.cpp:

(WebFrameLoaderClient::dispatchDidReceiveTitle): Updated since StringWithDirection::title
is now a data member, not a function member.
(WebFrameLoaderClient::updateGlobalHistory): Ditto.
(WebFrameLoaderClient::setTitle): Ditto.

  • WebDataSource.cpp:

(WebDataSource::pageTitle): Ditto.

Source/WebKit2:

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:

(WebKit::WebFrameLoaderClient::dispatchDidReceiveTitle): Updated to use struct.
(WebKit::WebFrameLoaderClient::updateGlobalHistory): Ditto.
(WebKit::WebFrameLoaderClient::setTitle): Ditto.

LayoutTests:

  • fast/dom/title-text-property-2-expected.txt:
  • http/tests/globalhistory/history-delegate-basic-title-expected.txt:

Updated expected results for progression where we no longer send duplicate updates
of the title when setting the title property on a document.

  • fast/regions/cssom/webkit-named-flow-collection-expected.txt:
  • fast/regions/cssom/webkit-named-flow-collection.html:

Added test cases cover property names in the named flow collection.
Specifically, check both Object.keys for just the indices, and also
Object.getOwnPropertyNames for including the names of the flows.

1:17 AM Changeset in webkit [210215] by Darin Adler
  • 16 edits in trunk/Source/WebCore

Remove PassRefPtr use from the "css" directory, related cleanup
https://bugs.webkit.org/show_bug.cgi?id=166628

Reviewed by Alex Christensen.

  • css/CSSCalculationValue.cpp:

(WebCore::CSSCalcBinaryOperation::create): Take RefPtr&& instead of PassRefPtr.
Also added some checks for null. Code here is really inconsistent about null;
probably should change from RefPtr to Ref at some point.
(WebCore::CSSCalcBinaryOperation::createSimplified): Ditto.
(WebCore::CSSCalcBinaryOperation::CSSCalcBinaryOperation): Take Ref&& instead
of PassRefPtr.

  • css/CSSCrossfadeValue.cpp:

(WebCore::subimageKnownToBeOpaque): Take a reference instead of a pointer.
(WebCore::CSSCrossfadeValue::SubimageObserver::SubimageObserver): Moved here
from the header, and renamed.
(WebCore::CSSCrossfadeValue::SubimageObserver::imageChanged): Ditto.
(WebCore::CSSCrossfadeValue::CSSCrossfadeValue): Moved here from the header.
(WebCore::CSSCrossfadeValue::create): Ditto.
(WebCore::CSSCrossfadeValue::~CSSCrossfadeValue): Updated for data member name change.
(WebCore::CSSCrossfadeValue::fixedSize): Take a reference. Also rewrote size math to
take advantage of FloatSize multiplication and addition operators.
(WebCore::CSSCrossfadeValue::knownToBeOpaque): Take a reference.
(WebCore::CSSCrossfadeValue::loadSubimages): Set m_subimagesAreReady rather than
calling setReady on the subimage observer.
(WebCore::CSSCrossfadeValue::image): Return a raw pointer rather than a RefPtr.
Take a reference instead of a pointer.
(WebCore::CSSCrossfadeValue::crossfadeChanged): Removed unused rect argument.
Rewrote to use modern for loop.

  • css/CSSCrossfadeValue.h: Updated for above changes.
  • css/CSSGradientValue.cpp:

(WebCore::createGradient): Added. Helper so the function below can use Ref rather
than RefPtr, and it's also nice to factor out this "poor man's virtual function".
(WebCore::CSSGradientValue::image): Take a reference rather than a pointer.
(WebCore::clone): Added. Helper like createGradient above.
(WebCore::CSSGradientValue::gradientWithStylesResolved): Take a reference rather
than a pointer. Simplified by using the helper above.
(WebCore::CSSGradientValue::knownToBeOpaque): Removed unused argument. Rewrote to
use a modern for loop.

  • css/CSSGradientValue.h: Updated for above changes.
  • css/CSSImageGeneratorValue.cpp: Moved the CachedGeneratedImage class in here

from the header. Also changed it to use const and Ref.
(WebCore::CSSImageGeneratorValue::addClient): Take a reference rather than a pointer.
(WebCore::CSSImageGeneratorValue::removeClient): Ditto.
(WebCore::CSSImageGeneratorValue::cachedImageForSize): Updated since image now returns
a reference rather than a pointer.
(WebCore::CSSImageGeneratorValue::saveCachedImageForSize): Take a reference rather
than PassRefPtr.
(WebCore::CSSImageGeneratorValue::image): Take a reference rather than a pointer.
(WebCore::CSSImageGeneratorValue::fixedSize): Ditto.
(WebCore::CSSImageGeneratorValue::knownToBeOpaque): Ditto.

  • css/CSSImageGeneratorValue.h: Updated for above changes.
  • css/CSSValuePool.cpp:

(WebCore::CSSValuePool::createFontFaceValue): Return a RefPtr rather than PassRefPtr.

  • css/CSSValuePool.h: Updated for the above.
  • css/StyleBuilderConverter.h: Change convertStyleImage and convertShapeValue to

return RefPtr instead of PassRefPtr.

  • css/StyleBuilderCustom.h:

(WebCore::StyleBuilderCustom::applyValueContent): Since gradientWithStylesResolved
returns a Ref now, no need to dereference it any more. This also removes reference
count churn since we are now passing a Ref temporary to a Ref&&.

  • css/StyleResolver.cpp:

(WebCore::StyleResolver::styleImage): Ditto.

  • platform/graphics/GradientImage.cpp:

(WebCore::GradientImage::GradientImage): Pass generator as a reference rather than
as a PassRefPtr.
(WebCore::GradientImage::draw): Updated since m_gradient is now a Ref rather than
a RefPtr.
(WebCore::GradientImage::drawPattern): Ditto.

  • platform/graphics/GradientImage.h: Updated for the above changes. Make things

private rather than protected since this class is final.

  • rendering/style/StyleGeneratedImage.cpp:

(WebCore::StyleGeneratedImage::imageSize): Pass renderer as a reference. Later, we
should change the interface to this function, too.
(WebCore::StyleGeneratedImage::addClient): Ditto.
(WebCore::StyleGeneratedImage::removeClient): Ditto.
(WebCore::StyleGeneratedImage::image): Ditto.
(WebCore::StyleGeneratedImage::knownToBeOpaque): Ditto.

Dec 30, 2016:

5:28 PM Changeset in webkit [210214] by Michael Catanzaro
  • 2 edits in trunk/Source/WebCore/platform/gtk/po

[GTK] German translation update
https://bugs.webkit.org/show_bug.cgi?id=152228

Patch by Bernd Homuth <dev@hmt.im> on 2016-12-30
Rubber-stamped by Michael Catanzaro.

  • de.po:
8:16 AM Changeset in webkit [210213] by commit-queue@webkit.org
  • 2 edits in trunk/Source/WebCore

[EFL] fix buffer over-read in RenderThemeEfl::mediaControlsStyleSheet()
https://bugs.webkit.org/show_bug.cgi?id=166622

Patch by Olivier Blin <Olivier Blin> on 2016-12-30
Reviewed by Gyuyoung Kim.

This has been detected by a charactersAreAllASCII() assert failure.
Initially in WebKitForWayland (WPE), but the code was likely borrowed from EFL.

This is because ASCIILiteral() is wrongly used in mediaControlsStyleSheet().
mediaControlsBaseUserAgentStyleSheet is a char array, not a null-terminated string.
It is thus incorrect to use StringImpl::createFromLiteral() that calls
strlen() to get the string length.

The String::ConstructFromLiteral constructor can not be used, since it
skips the last character.

  • rendering/RenderThemeEfl.cpp:

(WebCore::RenderThemeEfl::mediaControlsStyleSheet):
Explicitely pass the size to the String constructor.

6:00 AM Changeset in webkit [210212] by commit-queue@webkit.org
  • 6 edits in trunk/Source/WebCore

Unreviewed, rolling out r210206.
https://bugs.webkit.org/show_bug.cgi?id=166621

Crashes on macOS PLT (Requested by kling on #webkit).

Reverted changeset:

"Drop the render tree for documents in the page cache."
https://bugs.webkit.org/show_bug.cgi?id=121798
http://trac.webkit.org/changeset/210206

2:53 AM Changeset in webkit [210211] by svillar@igalia.com
  • 4 edits
    4 adds in trunk

[css-grid] Isolate instrinsic size computation from layout
https://bugs.webkit.org/show_bug.cgi?id=166530

Reviewed by Darin Adler.

Source/WebCore:

This is the last patch of the items placement data refactoring. By using a different Grid
instance in computeIntrinsicLogicalWidths we effectively isolate the intrinsic size
computation from the layout. They are now using different data structures so they don't
interfere each other.

This also means that we no longer reuse the placement of items done in the intrinsic size
computation. That shouldn't be a big issue once we make m_grid persistent on RenderGrid.

Last but not least, this patch finally removes the ugly const_cast's we had in
computeIntrinsicLogicalWidths() as we no longer modify the internal state of RenderGrid.

Tests: fast/css-grid-layout/grid-auto-repeat-intrinsic.html

fast/css-grid-layout/grid-change-intrinsic-size-with-auto-repeat-tracks.html

  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::computeIntrinsicLogicalWidths): Use a new instance of Grid.
(WebCore::RenderGrid::computeEmptyTracksForAutoRepeat): Fixed a missing m_grid -> grid
rename.
(WebCore::RenderGrid::placeItemsOnGrid): Constify it. It nows repositions the items if the
number of auto repeat tracks has changed.

  • rendering/RenderGrid.h:

LayoutTests:

  • fast/css-grid-layout/grid-auto-repeat-intrinsic-expected.txt: Added.
  • fast/css-grid-layout/grid-auto-repeat-intrinsic.html: Added.
  • fast/css-grid-layout/grid-change-intrinsic-size-with-auto-repeat-tracks-expected.txt: Added.
  • fast/css-grid-layout/grid-change-intrinsic-size-with-auto-repeat-tracks.html: Added.
2:09 AM Changeset in webkit [210210] by Carlos Garcia Campos
  • 2 edits in releases/WebKitGTK/webkit-2.14/Source/WebKit2

Merge r210180 - Ensure NetworkProcess is ready before whitelisting TLS certificates
https://bugs.webkit.org/show_bug.cgi?id=162962

Patch by Emanuele Aina <Emanuele Aina> on 2016-12-27
Reviewed by Alex Christensen.

If the API user tries to whitelist TLS certificates before any web
view has been created, the action will be ignored because the
NetworkProcess hasn't been fired up yet.

For example, the snippet below using the GTK+ API does not work,
unless the whitelisting is moved after the web view creation:

webkit_web_context_allow_tls_certificate_for_host(webkit_web_context_get_default(), crt, host);
webView = webkit_web_view_new();

  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::allowSpecificHTTPSCertificateForHost): Ensure
that the NetworkProcess has been already fired up when adding
certificates, so they can be whitelisted before the first web view is
instantiated.

2:07 AM WebKitGTK/2.14.x edited by Carlos Garcia Campos
(diff)
2:06 AM Changeset in webkit [210209] by Carlos Garcia Campos
  • 4 edits in releases/WebKitGTK/webkit-2.14

Merge r210207 - [GTK] Improve user agent construction
https://bugs.webkit.org/show_bug.cgi?id=142074

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Using the macOS quirk rather than the Chrome quirk for Google domains was a mistake: it
broke Hangouts in a different way than the Chrome quirk, and also prevents use of the nice
Earth mode on Google Maps. Google is making it really hard to develop a sane quirk.
Eventually I settled on the combination of two quirks: (1) Firefox browser, and (2) Linux
x86_64 platform. See the bug for full discussion on why these quirks are the best way to
make Google domains work properly in WebKit. This is an extremely sad state of affairs, but
I'm confident it is the best option. Note this effectively includes a rollout of r210168.

Also, fix a bug that caused an extra space to be inserted in the middle of the user agent.

  • platform/UserAgentQuirks.cpp:

(WebCore::isGoogle):
(WebCore::urlRequiresFirefoxBrowser):
(WebCore::urlRequiresMacintoshPlatform):
(WebCore::urlRequiresLinuxDesktopPlatform):
(WebCore::UserAgentQuirks::quirksForURL):
(WebCore::UserAgentQuirks::stringForQuirk):
(WebCore::UserAgentQuirks::firefoxRevisionString):

  • platform/UserAgentQuirks.h:
  • platform/gtk/UserAgentGtk.cpp:

(WebCore::buildUserAgentString):

Tools:

  • TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp:

(TestWebKitAPI::assertUserAgentForURLHasChromeBrowserQuirk):
(TestWebKitAPI::assertUserAgentForURLHasFirefoxBrowserQuirk):
(TestWebKitAPI::assertUserAgentForURLHasLinuxPlatformQuirk):
(TestWebKitAPI::assertUserAgentForURLHasMacPlatformQuirk):
(TestWebKitAPI::TEST):

1:39 AM Changeset in webkit [210208] by Carlos Garcia Campos
  • 4 edits in releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore

Merge r208018 - JSFunction::put() should not allow caching of lazily reified properties.
https://bugs.webkit.org/show_bug.cgi?id=164081

Reviewed by Geoffrey Garen.

It is incorrect for JSFunction::put() to return PutPropertySlots that indicates
that its lazily reified properties (e.g. .caller, and .arguments) are cacheable.
The reason for this is:

  1. Currently, a cacheable put may only consist of the following types of put operations:
    1. putting a new property at an offset in the object storage.
    2. changing the value of an existing property at an offset in the object storage.
    3. invoking the setter for a property at an offset in the object storage.

Returning a PutPropertySlot that indicates the property is cacheable means that
the property put must be one of the above operations.

For lazily reified properties, JSFunction::put() implements complex conditional
behavior that is different than the set of cacheable put operations above.
Hence, it should not claim that the property put is cacheable.

  1. Cacheable puts are cached on the original structure of the object before the put operation.

Reifying a lazy property will trigger a structure transition. Even though
subsequent puts to such a property may be cacheable after the structure
transition, it is incorrect to indicate that the property put is cacheable
because the caching is on the original structure, not the new transitioned
structure.

Also fixed some missing exception checks.

  • jit/JITOperations.cpp:
  • runtime/JSFunction.cpp:

(JSC::JSFunction::put):
(JSC::JSFunction::reifyLazyPropertyIfNeeded):
(JSC::JSFunction::reifyBoundNameIfNeeded):

  • runtime/JSFunction.h:
1:02 AM Changeset in webkit [210207] by Michael Catanzaro
  • 6 edits in trunk

[GTK] Improve user agent construction
https://bugs.webkit.org/show_bug.cgi?id=142074

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Using the macOS quirk rather than the Chrome quirk for Google domains was a mistake: it
broke Hangouts in a different way than the Chrome quirk, and also prevents use of the nice
Earth mode on Google Maps. Google is making it really hard to develop a sane quirk.
Eventually I settled on the combination of two quirks: (1) Firefox browser, and (2) Linux
x86_64 platform. See the bug for full discussion on why these quirks are the best way to
make Google domains work properly in WebKit. This is an extremely sad state of affairs, but
I'm confident it is the best option. Note this effectively includes a rollout of r210168.

Also, fix a bug that caused an extra space to be inserted in the middle of the user agent.

  • platform/UserAgentQuirks.cpp:

(WebCore::isGoogle):
(WebCore::urlRequiresFirefoxBrowser):
(WebCore::urlRequiresMacintoshPlatform):
(WebCore::urlRequiresLinuxDesktopPlatform):
(WebCore::UserAgentQuirks::quirksForURL):
(WebCore::UserAgentQuirks::stringForQuirk):
(WebCore::UserAgentQuirks::firefoxRevisionString):

  • platform/UserAgentQuirks.h:
  • platform/gtk/UserAgentGtk.cpp:

(WebCore::buildUserAgentString):

Tools:

  • TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp:

(TestWebKitAPI::assertUserAgentForURLHasChromeBrowserQuirk):
(TestWebKitAPI::assertUserAgentForURLHasFirefoxBrowserQuirk):
(TestWebKitAPI::assertUserAgentForURLHasLinuxPlatformQuirk):
(TestWebKitAPI::assertUserAgentForURLHasMacPlatformQuirk):
(TestWebKitAPI::TEST):

12:54 AM Changeset in webkit [210206] by akling@apple.com
  • 6 edits in trunk/Source/WebCore

Drop the render tree for documents in the page cache.
<https://webkit.org/b/121798>

Reviewed by Darin Adler.

To save memory and reduce complexity, have documents tear down their render tree
when entering the page cache. I've wanted to do this for a long time and it seems
like we can actually do it now.

This patch will enable a number of clean-ups since it's no longer valid for renderers
to exist while the document is in page cache.

  • dom/Document.cpp:

(WebCore::Document::destroyRenderTree): Remove assertion that we're not in the page cache
since we will now be tearing down render trees right as they enter the page cache.

(WebCore::Document::setPageCacheState): Tear down the render tree right before setting
the in-cache flag. From now on, there should not exist render objects for documents in
the page cache.

  • history/CachedFrame.cpp:

(WebCore::CachedFrameBase::restore):

  • page/FrameView.h:
  • page/FrameView.cpp:

(WebCore::FrameView::didRestoreFromPageCache): Update the scollable area set after restoring a
frame from the page cache. This dirties the scrolling tree, which was covered by tests.

  • page/animation/AnimationBase.cpp:

(WebCore::AnimationBase::setNeedsStyleRecalc): Make this a no-op if the render tree is being
torn down. This fixes assertions firing on animation tests.

Dec 29, 2016:

10:46 AM Changeset in webkit [210205] by Chris Fleizach
  • 2 edits in trunk/Source/WebCore

AX: Need to expose frames to iOS Accessibility
https://bugs.webkit.org/show_bug.cgi?id=166571
<rdar://problem/29823724>

Reviewed by Darin Adler.

To support navigation by frame for VoiceOver on iOS, we need to expose the frame ancestor.

  • accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:

(-[WebAccessibilityObjectWrapper _accessibilityFrameAncestor]):

10:28 AM Changeset in webkit [210204] by sbarati@apple.com
  • 57 edits in trunk/JSTests

WebAssembly: Rebase spec-tests now that wabt has been updated to produce certain kinds of invalid modules
https://bugs.webkit.org/show_bug.cgi?id=166491
<rdar://problem/29814999>

Reviewed by Yusuke Suzuki.

Based off these revisions:

The reason for the rebase is that wabt was updated to stop
silently rejecting invalid modules. This was needed because
some of the spec tests check to make sure that the module
is invalid, but wabt was silently ignoring the errors and
generating valid modules:
https://github.com/WebAssembly/wabt/issues/256

  • wasm.yaml:
  • wasm/spec-tests/address.wast.js:
  • wasm/spec-tests/binary.wast.js:
  • wasm/spec-tests/block.wast.js:
  • wasm/spec-tests/br.wast.js:
  • wasm/spec-tests/br_if.wast.js:
  • wasm/spec-tests/br_table.wast.js:
  • wasm/spec-tests/break-drop.wast.js:
  • wasm/spec-tests/call.wast.js:
  • wasm/spec-tests/call_indirect.wast.js:
  • wasm/spec-tests/comments.wast.js:
  • wasm/spec-tests/conversions.wast.js:
  • wasm/spec-tests/custom_section.wast.js:
  • wasm/spec-tests/endianness.wast.js:
  • wasm/spec-tests/exports.wast.js:
  • wasm/spec-tests/f32.wast.js:
  • wasm/spec-tests/f32_cmp.wast.js:
  • wasm/spec-tests/f64.wast.js:
  • wasm/spec-tests/f64_cmp.wast.js:
  • wasm/spec-tests/fac.wast.js:
  • wasm/spec-tests/float_exprs.wast.js:
  • wasm/spec-tests/float_literals.wast.js:
  • wasm/spec-tests/float_memory.wast.js:
  • wasm/spec-tests/float_misc.wast.js:
  • wasm/spec-tests/forward.wast.js:
  • wasm/spec-tests/func.wast.js:
  • wasm/spec-tests/func_ptrs.wast.js:
  • wasm/spec-tests/get_local.wast.js:
  • wasm/spec-tests/globals.wast.js:
  • wasm/spec-tests/i32.wast.js:
  • wasm/spec-tests/i64.wast.js:
  • wasm/spec-tests/imports.wast.js:
  • wasm/spec-tests/int_exprs.wast.js:
  • wasm/spec-tests/int_literals.wast.js:
  • wasm/spec-tests/left-to-right.wast.js:
  • wasm/spec-tests/linking.wast.js:
  • wasm/spec-tests/loop.wast.js:
  • wasm/spec-tests/memory.wast.js:
  • wasm/spec-tests/memory_redundancy.wast.js:
  • wasm/spec-tests/memory_trap.wast.js:
  • wasm/spec-tests/names.wast.js:
  • wasm/spec-tests/nop.wast.js:
  • wasm/spec-tests/resizing.wast.js:
  • wasm/spec-tests/return.wast.js:
  • wasm/spec-tests/select.wast.js:
  • wasm/spec-tests/set_local.wast.js:
  • wasm/spec-tests/skip-stack-guard-page.wast.js:
  • wasm/spec-tests/stack.wast.js:
  • wasm/spec-tests/start.wast.js:
  • wasm/spec-tests/store_retval.wast.js:
  • wasm/spec-tests/switch.wast.js:
  • wasm/spec-tests/tee_local.wast.js:
  • wasm/spec-tests/traps.wast.js:
  • wasm/spec-tests/typecheck.wast.js:
  • wasm/spec-tests/unreachable.wast.js:
  • wasm/spec-tests/unwind.wast.js:
Note: See TracTimeline for information about the timeline view.