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

Timeline



Mar 17, 2019:

7:16 PM Changeset in webkit [243055] by Fujii Hironori
  • 4 edits in trunk

[Win][WK1] Null dereference in WebFrameNetworkingContext::storageSession
https://bugs.webkit.org/show_bug.cgi?id=195741

Reviewed by Ross Kirsling.

Source/WebKitLegacy/win:

  • WebCoreSupport/WebFrameNetworkingContext.cpp:

(WebFrameNetworkingContext::storageSession const): Added a null check of frame()->page() as well as Mac port does (Bug 183455).

LayoutTests:

  • platform/wincairo/TestExpectations: Unskipped http/tests/ssl/ping-with-unsafe-redirect.html.
7:08 PM Changeset in webkit [243054] by Fujii Hironori
  • 2 edits in trunk/Source/WebKit

[iOS] Block the accessibility server when accessibility is not enabled.
https://bugs.webkit.org/show_bug.cgi?id=195342
<rdar://problem/48615720>

Unreviewed build fix for WinCairo.

  • Shared/SandboxExtension.h: Use ProcessID instead of pid_t.
4:45 PM Changeset in webkit [243053] by rmorisset@apple.com
  • 2 edits in trunk/Source/JavaScriptCore

ParserError can be shrunk by 8 bytes
https://bugs.webkit.org/show_bug.cgi?id=195496

Reviewed by Mark Lam.

  • parser/ParserError.h:
5:06 AM Changeset in webkit [243052] by Diego Pino Garcia
  • 2 edits in trunk/Source/JavaScriptCore

Fix WPE and GTK Debug builds after r243049
https://bugs.webkit.org/show_bug.cgi?id=195860

Unreviewed, build fix after r243049.

  • runtime/StringPrototype.cpp:

(JSC::normalizationAffects8Bit):

12:45 AM Changeset in webkit [243051] by ysuzuki@apple.com
  • 24 edits in trunk/Source

REGRESSION: !vm.isInitializingObject() void* JSC::tryAllocateCellHelper<JSC::Structure> JSC::Structure::create
https://bugs.webkit.org/show_bug.cgi?id=195858

Reviewed by Mark Lam.

Source/JavaScriptCore:

r243011 changed WebAssembly related structures lazily-allocated. It means that this lazy allocation must not be done in the middle of
the other object allocations. This patch changes the signature of wasm related objects' ::create functions to taking Structure*.
This prevents us from materializing lazily-allocated structures while allocating wasm related objects, and this style is used in the
other places to fix the same problem. This bug is caught by existing debug tests for wasm.

  • runtime/JSGlobalObject.h:
  • wasm/js/JSWebAssemblyCompileError.cpp:

(JSC::createJSWebAssemblyCompileError):

  • wasm/js/JSWebAssemblyInstance.cpp:

(JSC::JSWebAssemblyInstance::finalizeCreation):
(JSC::JSWebAssemblyInstance::create):

  • wasm/js/JSWebAssemblyLinkError.cpp:

(JSC::createJSWebAssemblyLinkError):

  • wasm/js/JSWebAssemblyModule.cpp:

(JSC::JSWebAssemblyModule::createStub):
(JSC::JSWebAssemblyModule::finishCreation):

  • wasm/js/WasmToJS.cpp:

(JSC::Wasm::wasmToJSException):

  • wasm/js/WebAssemblyCompileErrorConstructor.cpp:

(JSC::constructJSWebAssemblyCompileError):
(JSC::callJSWebAssemblyCompileError):

  • wasm/js/WebAssemblyFunction.cpp:

(JSC::WebAssemblyFunction::create):

  • wasm/js/WebAssemblyFunction.h:
  • wasm/js/WebAssemblyInstanceConstructor.cpp:

(JSC::constructJSWebAssemblyInstance):

  • wasm/js/WebAssemblyLinkErrorConstructor.cpp:

(JSC::constructJSWebAssemblyLinkError):
(JSC::callJSWebAssemblyLinkError):

  • 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/WebAssemblyPrototype.cpp:

(JSC::webAssemblyModuleValidateAsyncInternal):
(JSC::instantiate):
(JSC::compileAndInstantiate):
(JSC::webAssemblyModuleInstantinateAsyncInternal):

  • wasm/js/WebAssemblyRuntimeErrorConstructor.cpp:

(JSC::constructJSWebAssemblyRuntimeError):
(JSC::callJSWebAssemblyRuntimeError):

  • wasm/js/WebAssemblyTableConstructor.cpp:

(JSC::constructJSWebAssemblyTable):

  • wasm/js/WebAssemblyToJSCallee.cpp:

(JSC::WebAssemblyToJSCallee::create):

  • wasm/js/WebAssemblyToJSCallee.h:
  • wasm/js/WebAssemblyWrapperFunction.cpp:

(JSC::WebAssemblyWrapperFunction::create):

  • wasm/js/WebAssemblyWrapperFunction.h:

Source/WebCore:

Changed the accessor names.

  • bindings/js/SerializedScriptValue.cpp:

(WebCore::CloneDeserializer::readTerminal):

Mar 16, 2019:

8:50 PM Changeset in webkit [243050] by aakash_jain@apple.com
  • 2 edits in trunk/Tools

[ews-build] Don't run clean builds on EWS builders
https://bugs.webkit.org/show_bug.cgi?id=195851

Reviewed by Geoffrey Garen.

  • BuildSlaveSupport/ews-build/factories.py:
7:20 PM Changeset in webkit [243049] by Darin Adler
  • 13 edits in trunk/Source

Improve normalization code, including moving from unorm.h to unorm2.h
https://bugs.webkit.org/show_bug.cgi?id=195330

Reviewed by Michael Catanzaro.

Source/JavaScriptCore:

  • runtime/JSString.h: Move StringViewWithUnderlyingString to StringView.h.
  • runtime/StringPrototype.cpp: Include unorm2.h instead of unorm.h.

(JSC::normalizer): Added. Function to create normalizer object given
enumeration value indicating which is selected. Simplified because we
know the function will not fail and so we don't need error handling code.
(JSC::normalize): Changed this function to take a JSString* so we can
optimize the case where no normalization is needed. Added an early exit
if the string is stored as 8-bit and another if the string is already
normalized, using unorm2_isNormalized. Changed error handling to only
check cases that can actually fail in practice. Also did other small
optimizations like passing VM rather than ExecState.
(JSC::stringProtoFuncNormalize): Used smaller enumeration names that are
identical to the names used in the API and normalization parlance rather
than longer ones that expand the acronyms. Updated to pass JSString* to
the normalize function, so we can optimize 8-bit and already-normalized
cases, rather than callling the expensive String::upconvertedCharacters
function. Use throwVMRangeError.

Source/WebCore:

  • editing/TextIterator.cpp: Include unorm2.h.

(WebCore::normalizeCharacters): Rewrote to use unorm2_normalize rather than
unorm_normalize, but left the logic otherwise the same.

  • platform/graphics/SurrogatePairAwareTextIterator.cpp: Include unorm2.h.

(WebCore::SurrogatePairAwareTextIterator::normalizeVoicingMarks):
Use unorm2_composePair instead of unorm_normalize.

  • platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:

(characterSequenceIsEmoji): Changed to use existing SurrogatePairAwareTextIterator.
(FontCascade::fontForCombiningCharacterSequence): Use normalizedNFC instead of
calling unorm2_normalize directly.

  • WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp:

Removed unneeded include of <unicode/normlzr.h>.

  • platform/text/TextEncoding.cpp:

(WebCore::TextEncoding::encode const): Use normalizedNFC instead of the
code that was here. The normalizedNFC function is better in multiple ways,
but primarily it handles 8-bit strings and other already-normalized
strings much more efficiently.

Source/WTF:

  • wtf/URLHelpers.cpp: Removed unneeded include of unorm.h since the

normalization code is now in StringView.cpp.
(WTF::URLHelpers::escapeUnsafeCharacters): Renamed from
createStringWithEscapedUnsafeCharacters since it now only creates
a new string if one is needed. Use unsigned for string lengths, since
that's what WTF::String uses, not size_t. Added a first loop so that
we can return the string unmodified if no lookalike characters are
found. Removed unnecessary round trip from UTF-16 and then back in
the case where the character is not a lookalike.
(WTF::URLHelpers::toNormalizationFormC): Deleted. Moved this logic
into the WTF::normalizedNFC function in StringView.cpp.
(WTF::URLHelpers::userVisibleURL): Call escapeUnsafeCharacters and
normalizedNFC. The normalizedNFC function is better in multiple ways,
but primarily it handles 8-bit strings and other already-normalized
strings much more efficiently.

  • wtf/text/StringView.cpp:

(WTF::normalizedNFC): Added. This has two overloads. One is for when
we already have a String, and want to re-use it if no normalization
is needed, and another is when we only have a StringView, and may need
to allocate a String to hold the result. Includes a fast special case
for 8-bit and already-normalized strings, and uses the same strategy
that JSC::normalize was already using: calls unorm2_normalize twice,
first just to determine the length.

  • wtf/text/StringView.h: Added normalizedNFC, which can be called with

either a StringView or a String. Also moved StringViewWithUnderlyingString
here from JSString.h, here for use as the return value of normalizedNFC;
it is used for a similar purpose in the JavaScriptCore rope implementation.
Also removed an inaccurate comment.

3:58 PM Changeset in webkit [243048] by jer.noble@apple.com
  • 2 edits in trunk/Source/WebCore

Unreviewed unified-build fix; GPUBindGroupMetal uses symbols from the Metal.framework; it should import it.

  • platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
3:03 PM Changeset in webkit [243047] by dino@apple.com
  • 2 edits in trunk/Source/WebKit

ASSERT(gestureRecognizer == _doubleTapGestureRecognizer) in _doubleTapDidFail:
https://bugs.webkit.org/show_bug.cgi?id=195857
<rdar://problem/48954679>

Reviewed by Wenson Hsieh.

Reset an existing gesture recognizer before creating a new one.

  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView _createAndConfigureDoubleTapGestureRecognizer]):
(-[WKContentView _setDoubleTapGesturesEnabled:]):

3:00 PM Changeset in webkit [243046] by jer.noble@apple.com
  • 12 edits in trunk

Add a new MediaCapabilitiesExtensionsEnabled setting
https://bugs.webkit.org/show_bug.cgi?id=195843

Reviewed by Geoffrey Garen.

Source/WebCore:

Add a new setting, MediaCapabilitiesExtensionsEnabled, which controls whether extensions
to the Media Capabilities API are available.

Drive-by fix: make sure that the configuration is passed through to MediaCapabilitiesInfo
when no factory can support the configuration.

  • Modules/mediacapabilities/MediaCapabilitiesDecodingInfo.idl:
  • Modules/mediacapabilities/MediaCapabilitiesEncodingInfo.idl:
  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateDictionaryImplementationContent):

  • bindings/scripts/IDLAttributes.json:
  • page/Settings.yaml:
  • platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:

(WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):

Source/WebKit:

  • Shared/WebPreferences.yaml:

LayoutTests:

  • media/mediacapabilities/mock-decodingInfo-supportedConfiguration-expected.txt:
  • media/mediacapabilities/mock-decodingInfo-supportedConfiguration.html:
2:22 PM Changeset in webkit [243045] by sihui_liu@apple.com
  • 2 edits in trunk/Tools

REGRESSION (r243019): Failing API test: WebKit.WebsiteDataStoreCustomPathsWithoutPrewarming
https://bugs.webkit.org/show_bug.cgi?id=195849

Reviewed by Chris Dumez.

We should expect IDB database files to be at path IndexedDB/v1/ after r243019.

  • TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:

(runWebsiteDataStoreCustomPaths):

2:17 PM Changeset in webkit [243044] by Wenson Hsieh
  • 3 edits
    2 adds in trunk

[iOS] Software keyboard never appears when editing on some websites
https://bugs.webkit.org/show_bug.cgi?id=195824
<rdar://problem/48020610>

Reviewed by Ryosuke Niwa.

Source/WebKit:

In the scenario where an element has already been programmatically focused but the UI process isn't showing an
input view for it, there are a couple of different ways in which an input view may still be shown for that
element:

  1. If the page attempts to programmatically focus the element, we'll invoke elementDidRefocus to recompute

information about the focused element and propagate it to the UI process. By default, if programmatic focus was
triggered under the scope of user interaction, we'll allow the input view to appear.

  1. In the case where page does not attempt to programmatically focus the element but a click is dispatched,

there is logic in WebPage::completeSyntheticClick to send information about the already-focused element.

On the web page relevant to this bug, focus is programmatically moved to hidden contenteditable areas upon page
load, and touchstart is also prevented; furthermore, the page does not attempt to programmatically refocus the
hidden editable area upon receiving touchstart. This means that the user will never be able to bring up the
keyboard, since the editable area is already programmatically focused and subsequent attempts to tap in the
page do nothing, because the page has already focused the hidden editable area (with the expectation that the
software keyboard should already be present).

To fix this, we bring some of the same logic in completeSyntheticClick over to dispatchTouchEvent, by sending
focused element information to the UI process if the focused element did not change over the course of
dispatching the touch event. Similar code was introduced in r167774 to fix the same type of issue (i.e.
inability to bring up the software keyboard), but this was later reverted in r188405 due to causing bugs such as
<rdar://problem/22204108>, wherein this logic to bring up the keyboard in dispatchTouchEvent would scroll and
zoom the page, such that the click event fired after touchend would be dispatched in the wrong location and (in
the case of <rdar://problem/22204108>) caused the focused element to immediately blur again.

To mitigate this issue, we add the additional constraint that we only send focused element info in the case
where the touch won't also generate a click later down the road, by requiring that the dispatched event was
handled by the page (i.e. prevented).

Test: fast/events/touch/ios/show-keyboard-after-preventing-touchstart.html

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::dispatchTouchEvent):

LayoutTests:

Add a layout test to verify that tapping a programmatically focused textarea that prevents touchstart still
causes the keyboard to appear.

  • fast/events/touch/ios/show-keyboard-after-preventing-touchstart-expected.txt: Added.
  • fast/events/touch/ios/show-keyboard-after-preventing-touchstart.html: Added.
12:54 PM Changeset in webkit [243043] by Alan Bujtas
  • 6 edits
    2 adds in trunk

Source/WebCore:
[iOS] Unable to close trending window on naver.com.
https://bugs.webkit.org/show_bug.cgi?id=195842
<rdar://problem/48067338>

This patch issues a synthetic mouse move to the tap location after we decided to hover.
It ensures that the node under the mouse is up-to-date and when a new tap comes in we can
send the mouseout event to the correct node. It fixes the case when the hover content is positioned over
the tap target so that the tap target is no longer "under the mouse".
On desktop this "transition" happens automatically since the mouse is always present.

Reviewed by Simon Fraser.

Tests: fast/events/touch/ios/content-observation/new-content-covers-tap-target.html

fast/events/touch/ios/content-observation/prevent-default-on-touch-start.html

  • page/EventHandler.h:
  • page/ios/EventHandlerIOS.mm:

(WebCore::EventHandler::dispatchSyntheticMouseMove):

Source/WebKit:
Unable to close trending window on naver.com.
https://bugs.webkit.org/show_bug.cgi?id=195842
<rdar://problem/48067338>

Reviewed by Simon Fraser.

  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::dispatchSyntheticMouseMove):
(WebKit::WebPage::handleSyntheticClick):
(WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):

LayoutTests:
[iOS] Unable to close trending window on naver.com.
https://bugs.webkit.org/show_bug.cgi?id=195842
<rdar://problem/48067338>

Reviewed by Simon Fraser.

  • fast/events/touch/ios/content-observation/new-content-covers-tap-target-expected.txt: Added.
  • fast/events/touch/ios/content-observation/new-content-covers-tap-target.html: Added.
  • fast/events/touch/ios/content-observation/prevent-default-on-touch-start.html: Added.
11:38 AM Changeset in webkit [243042] by timothy@apple.com
  • 2 edits in trunk/Source/WebKit

REGRESSION (r242807): Unified sources build failure from missing imports.
https://bugs.webkit.org/show_bug.cgi?id=195852

Unreviewed speculative build fix.

  • UIProcess/Cocoa/WebProcessPoolCocoa.mm:

Include <wtf/SoftLinking.h> and "UIKitSPI.h" on iOS.

9:35 AM Changeset in webkit [243041] by youenn@apple.com
  • 65 edits
    1 move
    23 adds in trunk/LayoutTests

Update WPT WebRTC tests up to a22a149
https://bugs.webkit.org/show_bug.cgi?id=195831

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

  • web-platform-tests/webrtc: Resynced.

LayoutTests:

  • tests-options.json:
4:26 AM Changeset in webkit [243040] by Diego Pino Garcia
  • 2 edits in trunk/Source/WTF

[GTK] [WPE] Fix compilation errors due to undefined ALWAYS_LOG_IF
https://bugs.webkit.org/show_bug.cgi?id=195850

Unreviewed build fix after r243033.

  • wtf/LoggerHelper.h:
1:57 AM Changeset in webkit [243039] by sihui_liu@apple.com
  • 13 edits in trunk

Layout tests imported/w3c/web-platform-tests/IndexedDB/*-exception-order.html are failing
https://bugs.webkit.org/show_bug.cgi?id=195650

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Updated test expectations to PASS.

  • web-platform-tests/IndexedDB/idbdatabase-createObjectStore-exception-order-expected.txt:
  • web-platform-tests/IndexedDB/idbdatabase-transaction-exception-order-expected.txt:
  • web-platform-tests/IndexedDB/idbindex-query-exception-order-expected.txt:
  • web-platform-tests/IndexedDB/idbobjectstore-delete-exception-order-expected.txt:
  • web-platform-tests/IndexedDB/idbobjectstore-query-exception-order-expected.txt:

Source/WebCore:

Fix some exception orders in IDB.

  • Modules/indexeddb/IDBDatabase.cpp:

(WebCore::IDBDatabase::createObjectStore):
Step 6 of https://www.w3.org/TR/IndexedDB-2/#dom-idbdatabase-createobjectstore.

(WebCore::IDBDatabase::transaction):
Step 1 of https://www.w3.org/TR/IndexedDB-2/#dom-idbdatabase-transaction.

  • Modules/indexeddb/IDBIndex.cpp:

(WebCore::IDBIndex::doOpenCursor):
(WebCore::IDBIndex::openCursor):
Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-opencursor.

(WebCore::IDBIndex::doOpenKeyCursor):
(WebCore::IDBIndex::openKeyCursor):
Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-openkeycursor.

(WebCore::IDBIndex::count):
Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-count.

(WebCore::IDBIndex::doCount):
(WebCore::IDBIndex::get):
Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-get.

(WebCore::IDBIndex::doGet):
(WebCore::IDBIndex::getKey):
Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-getkey.

(WebCore::IDBIndex::doGetKey):
(WebCore::IDBIndex::doGetAll):
(WebCore::IDBIndex::getAll):
Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-getkey.
(WebCore::IDBIndex::doGetAllKeys):
(WebCore::IDBIndex::getAllKeys):
Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-getallkeys.

  • Modules/indexeddb/IDBIndex.h:
  • Modules/indexeddb/IDBObjectStore.cpp:

(WebCore::IDBObjectStore::doOpenCursor):
(WebCore::IDBObjectStore::openCursor):
Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-opencursor.

(WebCore::IDBObjectStore::doOpenKeyCursor):
(WebCore::IDBObjectStore::openKeyCursor):
Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-openkeycursor.

(WebCore::IDBObjectStore::deleteFunction):
(WebCore::IDBObjectStore::doDelete):
(WebCore::IDBObjectStore::count):
Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-count.

(WebCore::IDBObjectStore::doCount):
(WebCore::IDBObjectStore::doGetAll):
(WebCore::IDBObjectStore::getAll):
Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-getall.

(WebCore::IDBObjectStore::doGetAllKeys):
(WebCore::IDBObjectStore::getAllKeys):
Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-getallkeys.

  • Modules/indexeddb/IDBObjectStore.h:
1:31 AM Changeset in webkit [243038] by Nikita Vasilyev
  • 6 edits in trunk/Source/WebInspectorUI

Web Inspector: Changes: style attribute changes aren't being tracked
https://bugs.webkit.org/show_bug.cgi?id=193859
<rdar://problem/47568977>

Reviewed by Devin Rousso.

  • UserInterface/Controllers/CSSManager.js:

(WI.CSSManager):
(WI.CSSManager.prototype.get modifiedStyles):
(WI.CSSManager.prototype.addModifiedStyle):
(WI.CSSManager.prototype._mainResourceDidChange):
(WI.CSSManager.prototype.get modifiedCSSRules): Deleted.
(WI.CSSManager.prototype.addModifiedCSSRule): Deleted.
(WI.CSSManager.prototype.removeModifiedCSSRule): Deleted.

  • UserInterface/Models/CSSRule.js:

(WI.CSSRule.prototype.get stringId): Deleted.
(WI.CSSRule.prototype.markModified): Deleted.

  • UserInterface/Models/CSSStyleDeclaration.js:

(WI.CSSStyleDeclaration.prototype.get stringId):
(WI.CSSStyleDeclaration.prototype.markModified):
Inline styles weren't tracked because they didn't have owner rules.
Track style declarations instead of CSS rules.

  • UserInterface/Views/ChangesDetailsSidebarPanel.css:

(.sidebar > .panel.changes-panel .css-rule):
(.sidebar > .panel.changes-panel .css-rule + .css-rule):
(.changes-panel .selector.style-attribute):
(.changes-panel .selector:not(.style-attribute)):
(.changes-panel .css-property-line > .property):
(.changes-panel .css-property-line.unchanged): Deleted.
Drive-by: use text-color-secondary for unchanged properties instead of altering opacity.

  • UserInterface/Views/ChangesDetailsSidebarPanel.js:

(WI.ChangesDetailsSidebarPanel.prototype.layout):
(WI.ChangesDetailsSidebarPanel.prototype._createRuleElement):
For an inline style declaration, instead of showing a CSS source file location show an appropriate selector for its DOM node.

12:50 AM Changeset in webkit [243037] by rniwa@webkit.org
  • 5 edits in trunk/Source/WebCore

Reduce the size of Node::deref by eliminating an explicit parentNode check
https://bugs.webkit.org/show_bug.cgi?id=195776

Reviewed by Geoffrey Garen.

This patch eliminates the nullity check of m_parentNode in Node::deref as well as the store to
m_refCount in the case of invoking Node::removedLastRef() as done for RefCounted in r30042.
Together, this patch shrinks WebCore's size by 46KB or ~0.7%.

To do this, we take we take a similar approach as WTF::String by using the lowest bit of m_refCount
to indicate whether a node has a parent or not. Regular ref-counting is done on the upper 31 bits.
Node::setParentNode updates this flag, and Node::deref() would only delete this if m_refCount
is identically equal to 0.

For a Document, we set m_refCounted to 0 before in the case of non-zero m_referencingNodeCount
since decrementReferencingNodeCount needs to be able to tell if there is an outstanding Ref/RefPtr
or not when m_referencingNodeCount becomes 0.

No new tests since there should be no behavioral change.

  • dom/Document.cpp:

(WebCore::Document::removedLastRef):

  • dom/Document.h:

(WebCore::Document::decrementReferencingNodeCount):

  • dom/Node.cpp:

(WebCore::Node::Node): Moved the initialization of m_refCount to the member variable declaration.
(WebCore::Node::~Node):
(WebCore::Node::removedLastRef):

  • dom/Node.h:

(WebCore::Node): Changed the type of m_refCount from signed int to uint32_t. It was changed from
unsigned int to signed int back in r11492 but I don't think the signedness is needed.
(WebCore::Node::ref): Increment the ref count by 2 (upper 31-bit).
(WebCore::Node::deref): Implemented the optimization. This is what shrinks the WebCore binary size.
(WebCore::Node::hasOneRef const):
(WebCore::Node::refCount const): Ignore the lowest bit. Without this fix, the optimization in
replaceChildrenWithFragment to avoid replacing the text node is disabled whenever there is a parent.
(WebCore::Node::setParentNode): Sets the lowest bit to 1 if the node has a parent and 0 otherwise.

12:42 AM Changeset in webkit [243036] by commit-queue@webkit.org
  • 26 edits
    17 copies
    13 adds
    4 deletes in trunk/Source/WebCore

Remove the SVG property tear off objects for SVGAnimatedInteger
https://bugs.webkit.org/show_bug.cgi?id=195722

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-03-16
Reviewed by Simon Fraser.

Instead of saving a raw integer value in the SVGElement and then wrapping
the pointer to this raw data in a tear off object, we will represent the
integer as Ref<SVGAnimatedInteger> in SVGElement. This will make the
representation of the property in IDL file match the C++ header file.

When the DOM requests the SVGAnimatedInteger, we get return a reference
to the new animated property. When the rendering code asks for the current
value of the this animated property, we return the animVal() or the
baseVal() depending on whether the property is animating or not.

A pointer to a member in the SVGElement will be registered along with the
associated attribute name in SVGPropertyRegistry. Registering the property
creates an SVGMemberAccessor and links to the associated attribute. The
function of SVGMemberAccessor is to retrieve the value of the property
given a pointer to an SVGElement.

SVGPropertyRegistry manages all the properties of SVGElement. It takes
into account the inherited properties as well.

SVGElement will have a virtual method called propertyRegistry(). Every
superclass will override this method to return a reference to its registry
which includes all the registered properties of this class and its bases.

One important function of the SVGPropertyRegistry and SVGAccessor is they
create the appropriate SVGAttributeAnimator for this property.

SVGAttributeAnimator is just a connection between the animated property
and SVGAnimationFunction. SVGAnimationFunction calculates the values of
the animated property within a time interval. SVGAnimatedPropertyAnimator
updates animVal of the animated property and invalidates the associated
SVGElement and all the instances that references this element.

The plan is to remove all the SVG tear off objects like what this patch
does for SVGAnimatedInteger. So for a period of time the old code and the
new code will co-exist together. These things to consider when reviewing
this patch:

-- SVGAnimatedElementBase was re-factored to use SVGAttributeAnimationControllerBase
which is inherited by SVGLegacyAttributeAnimationController and
SVGAttributeAnimationController. The tear-off properties code which uses
SVGAnimatedType now lives in SVGLegacyAttributeAnimationController. The
new code was added to SVGAttributeAnimationController. The plan is to
remove the three animation controllers and to move the code of
SVGAttributeAnimationController to SVGAnimatedElementBase when all the tear
off code is removed.

-- SVGElement now keeps two registries one for the tear-off world and the
other for the new world. Eventually we need to get rid of tear-off registry.

-- SVGElement will differentiate between the type of the property by the
the method isAnimatedAttribute().

  • Sources.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateHeader):

  • svg/SVGAnimateElementBase.cpp:

(WebCore::SVGAnimateElementBase::SVGAnimateElementBase):
(WebCore::SVGAnimateElementBase::attributeAnimationController):
(WebCore::SVGAnimateElementBase::attributeAnimationControllerIfExists):
(WebCore::SVGAnimateElementBase::hasValidAttributeType const):
(WebCore::SVGAnimateElementBase::determineAnimatedPropertyType const):
(WebCore::SVGAnimateElementBase::calculateAnimatedValue):
(WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue):
(WebCore::SVGAnimateElementBase::calculateFromAndToValues):
(WebCore::SVGAnimateElementBase::calculateFromAndByValues):
(WebCore::SVGAnimateElementBase::resetAnimatedType):
(WebCore::SVGAnimateElementBase::clearAnimatedType):
(WebCore::SVGAnimateElementBase::applyResultsToTarget):
(WebCore::SVGAnimateElementBase::isAdditive const):
(WebCore::SVGAnimateElementBase::calculateDistance):
(WebCore::SVGAnimateElementBase::setTargetElement):
(WebCore::SVGAnimateElementBase::setAttributeName):
(WebCore::SVGAnimateElementBase::resetAnimation):
(WebCore::SVGAnimateElementBase::hasInvalidCSSAttributeType const):
(WebCore::SVGAnimateElementBase::hasValidAttributeType): Deleted.
(WebCore::propertyTypesAreConsistent): Deleted.
(WebCore::applyCSSPropertyToTarget): Deleted.
(WebCore::removeCSSPropertyFromTarget): Deleted.
(WebCore::applyCSSPropertyToTargetAndInstances): Deleted.
(WebCore::removeCSSPropertyFromTargetAndInstances): Deleted.
(WebCore::notifyTargetAboutAnimValChange): Deleted.
(WebCore::notifyTargetAndInstancesAboutAnimValChange): Deleted.
(WebCore::SVGAnimateElementBase::animatedPropertyTypeSupportsAddition const): Deleted.
(WebCore::SVGAnimateElementBase::resetAnimatedPropertyType): Deleted.
(WebCore::SVGAnimateElementBase::ensureAnimator): Deleted.

  • svg/SVGAnimateElementBase.h:
  • svg/SVGAnimateMotionElement.cpp:

(WebCore::SVGAnimateMotionElement::hasValidAttributeType const):
(WebCore::SVGAnimateMotionElement::hasValidAttributeName const):
(WebCore::SVGAnimateMotionElement::hasValidAttributeType): Deleted.
(WebCore::SVGAnimateMotionElement::hasValidAttributeName): Deleted.

  • svg/SVGAnimateMotionElement.h:
  • svg/SVGAnimateTransformElement.cpp:

(WebCore::SVGAnimateTransformElement::hasValidAttributeType const):
(WebCore::SVGAnimateTransformElement::hasValidAttributeType): Deleted.

  • svg/SVGAnimateTransformElement.h:
  • svg/SVGAnimatedInteger.cpp: Removed.
  • svg/SVGAnimatedInteger.h: Removed.
  • svg/SVGAnimatedIntegerOptionalInteger.cpp: Removed.
  • svg/SVGAnimatedIntegerOptionalInteger.h: Removed.
  • svg/SVGAnimatedPointList.h:
  • svg/SVGAnimationElement.cpp:

(WebCore::SVGAnimationElement::setAttributeType):
(WebCore::SVGAnimationElement::resetAnimation):
(WebCore::SVGAnimationElement::resetAnimatedPropertyType): Deleted.
(WebCore::SVGAnimationElement::setTargetElement): Deleted.
(WebCore::SVGAnimationElement::checkInvalidCSSAttributeType): Deleted.

  • svg/SVGAnimationElement.h:

(WebCore::SVGAnimationElement::attributeType const):
(WebCore::SVGAnimationElement::hasInvalidCSSAttributeType const): Deleted.

  • svg/SVGAnimatorFactory.h:

(WebCore::SVGAnimatorFactory::create):

  • svg/SVGAttributeAnimationController.cpp: Added.

(WebCore::SVGAttributeAnimationController::SVGAttributeAnimationController):
(WebCore::SVGAttributeAnimationController::animator const):
(WebCore::SVGAttributeAnimationController::isDiscreteAnimator const):
(WebCore::SVGAttributeAnimationController::isAdditive const):
(WebCore::SVGAttributeAnimationController::hasValidAttributeType const):
(WebCore::SVGAttributeAnimationController::calculateFromAndToValues):
(WebCore::SVGAttributeAnimationController::calculateFromAndByValues):
(WebCore::SVGAttributeAnimationController::calculateToAtEndOfDurationValue):
(WebCore::SVGAttributeAnimationController::resetAnimatedType):
(WebCore::SVGAttributeAnimationController::calculateAnimatedValue):
(WebCore::SVGAttributeAnimationController::applyResultsToTarget):
(WebCore::SVGAttributeAnimationController::clearAnimatedType):
(WebCore::SVGAttributeAnimationController::calculateDistance):

  • svg/SVGAttributeAnimationController.h: Added.

(WebCore::SVGAttributeAnimationController::animatorIfExists const):

  • svg/SVGAttributeAnimationControllerBase.cpp: Added.

(WebCore::SVGAttributeAnimationControllerBase::SVGAttributeAnimationControllerBase):
(WebCore::SVGAttributeAnimationControllerBase::determineAnimatedPropertyType):

  • svg/SVGAttributeAnimationControllerBase.h: Added.
  • svg/SVGElement.cpp:

(WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute):
(WebCore::SVGElement::synchronizeAnimatedSVGAttribute const):
(WebCore::SVGElement::commitPropertyChange):
(WebCore::SVGElement::isAnimatedPropertyAttribute const):
(WebCore::SVGElement::isAnimatedAttribute const):
(WebCore::SVGElement::createAnimator):

  • svg/SVGElement.h:

(WebCore::SVGElement::propertyRegistry const):

  • svg/SVGFEConvolveMatrixElement.cpp:

(WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
(WebCore::SVGFEConvolveMatrixElement::registerAttributes):
(WebCore::SVGFEConvolveMatrixElement::parseAttribute):
(WebCore::SVGFEConvolveMatrixElement::setOrder):
(WebCore::SVGFEConvolveMatrixElement::orderXIdentifier): Deleted.
(WebCore::SVGFEConvolveMatrixElement::orderYIdentifier): Deleted.

  • svg/SVGFEConvolveMatrixElement.h:
  • svg/SVGFETurbulenceElement.cpp:

(WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement):
(WebCore::SVGFETurbulenceElement::registerAttributes):
(WebCore::SVGFETurbulenceElement::parseAttribute):
(WebCore::SVGFETurbulenceElement::svgAttributeChanged):

  • svg/SVGFETurbulenceElement.h:
  • svg/SVGFilterElement.h:
  • svg/SVGLegacyAttributeAnimationController.cpp: Added.

(WebCore::SVGLegacyAttributeAnimationController::SVGLegacyAttributeAnimationController):
(WebCore::SVGLegacyAttributeAnimationController::animatedTypeAnimator):
(WebCore::SVGLegacyAttributeAnimationController::isAdditive const):
(WebCore::SVGLegacyAttributeAnimationController::hasValidAttributeType const):
(WebCore::SVGLegacyAttributeAnimationController::calculateFromAndToValues):
(WebCore::SVGLegacyAttributeAnimationController::calculateFromAndByValues):
(WebCore::SVGLegacyAttributeAnimationController::calculateToAtEndOfDurationValue):
(WebCore::propertyTypesAreConsistent):
(WebCore::SVGLegacyAttributeAnimationController::resetAnimatedType):
(WebCore::SVGLegacyAttributeAnimationController::calculateAnimatedValue):
(WebCore::applyCSSPropertyToTarget):
(WebCore::removeCSSPropertyFromTarget):
(WebCore::applyCSSPropertyToTargetAndInstances):
(WebCore::removeCSSPropertyFromTargetAndInstances):
(WebCore::notifyTargetAboutAnimValChange):
(WebCore::notifyTargetAndInstancesAboutAnimValChange):
(WebCore::SVGLegacyAttributeAnimationController::applyResultsToTarget):
(WebCore::SVGLegacyAttributeAnimationController::clearAnimatedType):
(WebCore::SVGLegacyAttributeAnimationController::calculateDistance):

  • svg/SVGLegacyAttributeAnimationController.h: Added.
  • svg/animation/SVGSMILElement.cpp:

(WebCore::SVGSMILElement::hasValidAttributeName const):
(WebCore::SVGSMILElement::hasValidAttributeName): Deleted.

  • svg/animation/SVGSMILElement.h:
  • svg/properties/SVGAnimatedPrimitiveProperty.h: Added.

(WebCore::SVGAnimatedPrimitiveProperty::create):
(WebCore::SVGAnimatedPrimitiveProperty::setBaseVal):
(WebCore::SVGAnimatedPrimitiveProperty::setBaseValInternal):
(WebCore::SVGAnimatedPrimitiveProperty::baseVal const):
(WebCore::SVGAnimatedPrimitiveProperty::setAnimVal):
(WebCore::SVGAnimatedPrimitiveProperty::animVal const):
(WebCore::SVGAnimatedPrimitiveProperty::animVal):
(WebCore::SVGAnimatedPrimitiveProperty::currentValue const):
(WebCore::SVGAnimatedPrimitiveProperty::SVGAnimatedPrimitiveProperty):

  • svg/properties/SVGAnimatedProperty.cpp: Added.

(WebCore::SVGAnimatedProperty::owner const):
(WebCore::SVGAnimatedProperty::commitPropertyChange):

  • svg/properties/SVGAnimatedProperty.h: Added.

(WebCore::SVGAnimatedProperty::isAttached const):
(WebCore::SVGAnimatedProperty::detach):
(WebCore::SVGAnimatedProperty::contextElement const):
(WebCore::SVGAnimatedProperty::baseValAsString const):
(WebCore::SVGAnimatedProperty::animValAsString const):
(WebCore::SVGAnimatedProperty::isDirty const):
(WebCore::SVGAnimatedProperty::setDirty):
(WebCore::SVGAnimatedProperty::synchronize):
(WebCore::SVGAnimatedProperty::isAnimating const):
(WebCore::SVGAnimatedProperty::startAnimation):
(WebCore::SVGAnimatedProperty::stopAnimation):
(WebCore::SVGAnimatedProperty::instanceStartAnimation):
(WebCore::SVGAnimatedProperty::instanceStopAnimation):
(WebCore::SVGAnimatedProperty::SVGAnimatedProperty):

  • svg/properties/SVGAnimatedPropertyAccessor.h: Added.
  • svg/properties/SVGAnimatedPropertyAccessorImpl.h: Added.
  • svg/properties/SVGAnimatedPropertyAnimator.h: Added.

(WebCore::SVGAnimatedPropertyAnimator::appendAnimatedInstance):
(WebCore::SVGAnimatedPropertyAnimator::SVGAnimatedPropertyAnimator):

  • svg/properties/SVGAnimatedPropertyAnimatorImpl.h: Added.
  • svg/properties/SVGAnimatedPropertyImpl.h: Added.
  • svg/properties/SVGAnimatedPropertyPairAccessor.h: Added.

(WebCore::SVGAnimatedPropertyPairAccessor::SVGAnimatedPropertyPairAccessor):
(WebCore::SVGAnimatedPropertyPairAccessor::singleton):
(WebCore::SVGAnimatedPropertyPairAccessor::property1 const):
(WebCore::SVGAnimatedPropertyPairAccessor::property2 const):

  • svg/properties/SVGAnimatedPropertyPairAccessorImpl.h: Added.
  • svg/properties/SVGAnimatedPropertyPairAnimator.h: Added.

(WebCore::SVGAnimatedPropertyPairAnimator::appendAnimatedInstance):
(WebCore::SVGAnimatedPropertyPairAnimator::SVGAnimatedPropertyPairAnimator):

  • svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h: Added.
  • svg/properties/SVGAnimationAdditiveFunction.h: Added.

(WebCore::SVGAnimationAdditiveFunction::SVGAnimationAdditiveFunction):
(WebCore::SVGAnimationAdditiveFunction::progress):

  • svg/properties/SVGAnimationAdditiveValueFunction.h: Added.

(WebCore::SVGAnimationAdditiveValueFunction::toAtEndOfDuration const):

  • svg/properties/SVGAnimationAdditiveValueFunctionImpl.h: Added.

(WebCore::SVGAnimationIntegerFunction::progress):

  • svg/properties/SVGAnimationFunction.h: Added.

(WebCore::SVGAnimationFunction::isDiscrete const):
(WebCore::SVGAnimationFunction::calculateDistance const):
(WebCore::SVGAnimationFunction::SVGAnimationFunction):
(WebCore::SVGAnimationFunction::addFromAndToValues):

  • svg/properties/SVGAttributeAnimator.cpp: Added.

(WebCore::SVGAttributeAnimator::applyAnimatedPropertyChange):

  • svg/properties/SVGAttributeAnimator.h: Added.

(WebCore::SVGAttributeAnimator::SVGAttributeAnimator):
(WebCore::SVGAttributeAnimator::isDiscrete const):
(WebCore::SVGAttributeAnimator::setFromAndToValues):
(WebCore::SVGAttributeAnimator::setFromAndByValues):
(WebCore::SVGAttributeAnimator::setToAtEndOfDurationValue):
(WebCore::SVGAttributeAnimator::calculateDistance const):

  • svg/properties/SVGAttributeOwnerProxy.cpp:
  • svg/properties/SVGAttributeOwnerProxy.h:
  • svg/properties/SVGAttributeRegistry.h:
  • svg/properties/SVGMemberAccessor.h: Added.

(WebCore::SVGMemberAccessor::detach const):
(WebCore::SVGMemberAccessor::isAnimatedProperty const):
(WebCore::SVGMemberAccessor::isAnimatedLength const):
(WebCore::SVGMemberAccessor::matches const):
(WebCore::SVGMemberAccessor::synchronize const):
(WebCore::SVGMemberAccessor::createAnimator const):
(WebCore::SVGMemberAccessor::appendAnimatedInstance const):

  • svg/properties/SVGPointerMemberAccessor.h: Added.

(WebCore::SVGPointerMemberAccessor::SVGPointerMemberAccessor):
(WebCore::SVGPointerMemberAccessor::property const):
(WebCore::SVGPointerMemberAccessor::singleton):

  • svg/properties/SVGProperty.h: Added.
  • svg/properties/SVGPropertyOwner.h: Added.

(WebCore::SVGPropertyOwner::owner const):
(WebCore::SVGPropertyOwner::attributeContextElement const):
(WebCore::SVGPropertyOwner::commitPropertyChange):

  • svg/properties/SVGPropertyOwnerRegistry.h: Added.

(WebCore::SVGPropertyOwnerRegistry::SVGPropertyOwnerRegistry):
(WebCore::SVGPropertyOwnerRegistry::registerProperty):
(WebCore::SVGPropertyOwnerRegistry::enumerateRecursively):
(WebCore::SVGPropertyOwnerRegistry::isKnownAttribute):
(WebCore::SVGPropertyOwnerRegistry::enumerateRecursivelyBaseTypes):
(WebCore::SVGPropertyOwnerRegistry::findAccessor):

  • svg/properties/SVGPropertyRegistry.h: Added.
12:37 AM Changeset in webkit [243035] by rniwa@webkit.org
  • 4 edits in trunk/Source/WebCore

Remove LayoutAssertionDisableScope after r241289
https://bugs.webkit.org/show_bug.cgi?id=195848

Reviewed by Antti Koivisto.

Remove LayoutAssertionDisableScope for good now that the underlying bug has been fixed in r241289.

  • dom/Document.cpp:

(WebCore::isSafeToUpdateStyleOrLayout):

  • dom/ScriptDisallowedScope.h:

(WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope): Deleted.

  • page/FrameViewLayoutContext.cpp:

(WebCore::FrameViewLayoutContext::layout):

Note: See TracTimeline for information about the timeline view.