<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[210216] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/210216">210216</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2016-12-31 01:51:29 -0800 (Sat, 31 Dec 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>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.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastdomtitletextproperty2expectedtxt">trunk/LayoutTests/fast/dom/title-text-property-2-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastregionscssomwebkitnamedflowcollectionexpectedtxt">trunk/LayoutTests/fast/regions/cssom/webkit-named-flow-collection-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastregionscssomwebkitnamedflowcollectionhtml">trunk/LayoutTests/fast/regions/cssom/webkit-named-flow-collection.html</a></li>
<li><a href="#trunkLayoutTestshttptestsglobalhistoryhistorydelegatebasictitleexpectedtxt">trunk/LayoutTests/http/tests/globalhistory/history-delegate-basic-title-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSPopStateEventCustomcpp">trunk/Source/WebCore/bindings/js/JSPopStateEventCustom.cpp</a></li>
<li><a href="#trunkSourceWebCoredomCharacterDatacpp">trunk/Source/WebCore/dom/CharacterData.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDOMAllInOnecpp">trunk/Source/WebCore/dom/DOMAllInOne.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDOMNamedFlowCollectioncpp">trunk/Source/WebCore/dom/DOMNamedFlowCollection.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDOMNamedFlowCollectionh">trunk/Source/WebCore/dom/DOMNamedFlowCollection.h</a></li>
<li><a href="#trunkSourceWebCoredomDOMNamedFlowCollectionidl">trunk/Source/WebCore/dom/DOMNamedFlowCollection.idl</a></li>
<li><a href="#trunkSourceWebCoredomDataTransferh">trunk/Source/WebCore/dom/DataTransfer.h</a></li>
<li><a href="#trunkSourceWebCoredomDataTransferItemh">trunk/Source/WebCore/dom/DataTransferItem.h</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
<li><a href="#trunkSourceWebCoredomDocumentMarkerh">trunk/Source/WebCore/dom/DocumentMarker.h</a></li>
<li><a href="#trunkSourceWebCoredomDocumentMarkerControllercpp">trunk/Source/WebCore/dom/DocumentMarkerController.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumentMarkerControllerh">trunk/Source/WebCore/dom/DocumentMarkerController.h</a></li>
<li><a href="#trunkSourceWebCoredomDocumentParserh">trunk/Source/WebCore/dom/DocumentParser.h</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkSourceWebCoredomEventcpp">trunk/Source/WebCore/dom/Event.cpp</a></li>
<li><a href="#trunkSourceWebCoredomEventh">trunk/Source/WebCore/dom/Event.h</a></li>
<li><a href="#trunkSourceWebCoredomEventContextcpp">trunk/Source/WebCore/dom/EventContext.cpp</a></li>
<li><a href="#trunkSourceWebCoredomEventContexth">trunk/Source/WebCore/dom/EventContext.h</a></li>
<li><a href="#trunkSourceWebCoredomMessageEventcpp">trunk/Source/WebCore/dom/MessageEvent.cpp</a></li>
<li><a href="#trunkSourceWebCoredomMessageEventh">trunk/Source/WebCore/dom/MessageEvent.h</a></li>
<li><a href="#trunkSourceWebCoredomMouseEventcpp">trunk/Source/WebCore/dom/MouseEvent.cpp</a></li>
<li><a href="#trunkSourceWebCoredomMouseEventh">trunk/Source/WebCore/dom/MouseEvent.h</a></li>
<li><a href="#trunkSourceWebCoredomMutationEventcpp">trunk/Source/WebCore/dom/MutationEvent.cpp</a></li>
<li><a href="#trunkSourceWebCoredomMutationEventh">trunk/Source/WebCore/dom/MutationEvent.h</a></li>
<li><a href="#trunkSourceWebCoredomMutationObservercpp">trunk/Source/WebCore/dom/MutationObserver.cpp</a></li>
<li><a href="#trunkSourceWebCoredomMutationObserverInterestGroupcpp">trunk/Source/WebCore/dom/MutationObserverInterestGroup.cpp</a></li>
<li><a href="#trunkSourceWebCoredomMutationObserverInterestGrouph">trunk/Source/WebCore/dom/MutationObserverInterestGroup.h</a></li>
<li><a href="#trunkSourceWebCoredomMutationObserverRegistrationcpp">trunk/Source/WebCore/dom/MutationObserverRegistration.cpp</a></li>
<li><a href="#trunkSourceWebCoredomMutationObserverRegistrationh">trunk/Source/WebCore/dom/MutationObserverRegistration.h</a></li>
<li><a href="#trunkSourceWebCoredomNamedFlowCollectioncpp">trunk/Source/WebCore/dom/NamedFlowCollection.cpp</a></li>
<li><a href="#trunkSourceWebCoredomNodecpp">trunk/Source/WebCore/dom/Node.cpp</a></li>
<li><a href="#trunkSourceWebCoredomNodeh">trunk/Source/WebCore/dom/Node.h</a></li>
<li><a href="#trunkSourceWebCoredomPopStateEventcpp">trunk/Source/WebCore/dom/PopStateEvent.cpp</a></li>
<li><a href="#trunkSourceWebCoredomPopStateEventh">trunk/Source/WebCore/dom/PopStateEvent.h</a></li>
<li><a href="#trunkSourceWebCoredomPositioncpp">trunk/Source/WebCore/dom/Position.cpp</a></li>
<li><a href="#trunkSourceWebCoredomPositionh">trunk/Source/WebCore/dom/Position.h</a></li>
<li><a href="#trunkSourceWebCoredomRangecpp">trunk/Source/WebCore/dom/Range.cpp</a></li>
<li><a href="#trunkSourceWebCoredomRangeh">trunk/Source/WebCore/dom/Range.h</a></li>
<li><a href="#trunkSourceWebCoredomScopedEventQueuecpp">trunk/Source/WebCore/dom/ScopedEventQueue.cpp</a></li>
<li><a href="#trunkSourceWebCoredomScriptExecutionContextcpp">trunk/Source/WebCore/dom/ScriptExecutionContext.cpp</a></li>
<li><a href="#trunkSourceWebCoredomScriptExecutionContexth">trunk/Source/WebCore/dom/ScriptExecutionContext.h</a></li>
<li><a href="#trunkSourceWebCoredomScriptedAnimationControllercpp">trunk/Source/WebCore/dom/ScriptedAnimationController.cpp</a></li>
<li><a href="#trunkSourceWebCoredomScriptedAnimationControllerh">trunk/Source/WebCore/dom/ScriptedAnimationController.h</a></li>
<li><a href="#trunkSourceWebCoredomSimulatedClickcpp">trunk/Source/WebCore/dom/SimulatedClick.cpp</a></li>
<li><a href="#trunkSourceWebCoredomWheelEventcpp">trunk/Source/WebCore/dom/WheelEvent.cpp</a></li>
<li><a href="#trunkSourceWebCoredomWheelEventh">trunk/Source/WebCore/dom/WheelEvent.h</a></li>
<li><a href="#trunkSourceWebCoredommake_event_factorypl">trunk/Source/WebCore/dom/make_event_factory.pl</a></li>
<li><a href="#trunkSourceWebCoreeditingAlternativeTextControllercpp">trunk/Source/WebCore/editing/AlternativeTextController.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingAlternativeTextControllerh">trunk/Source/WebCore/editing/AlternativeTextController.h</a></li>
<li><a href="#trunkSourceWebCoreeditingApplyBlockElementCommandcpp">trunk/Source/WebCore/editing/ApplyBlockElementCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingApplyStyleCommandcpp">trunk/Source/WebCore/editing/ApplyStyleCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingCompositeEditCommandcpp">trunk/Source/WebCore/editing/CompositeEditCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingDictationCommandcpp">trunk/Source/WebCore/editing/DictationCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorcpp">trunk/Source/WebCore/editing/Editor.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorh">trunk/Source/WebCore/editing/Editor.h</a></li>
<li><a href="#trunkSourceWebCoreeditingInsertTextCommandcpp">trunk/Source/WebCore/editing/InsertTextCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingReplaceSelectionCommandcpp">trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTitleElementcpp">trunk/Source/WebCore/html/HTMLTitleElement.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoadercpp">trunk/Source/WebCore/loader/FrameLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoaderh">trunk/Source/WebCore/loader/FrameLoader.h</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoaderClienth">trunk/Source/WebCore/loader/FrameLoaderClient.h</a></li>
<li><a href="#trunkSourceWebCoreloaderHistoryControllercpp">trunk/Source/WebCore/loader/HistoryController.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderHistoryControllerh">trunk/Source/WebCore/loader/HistoryController.h</a></li>
<li><a href="#trunkSourceWebCoreloaderPolicyCallbackcpp">trunk/Source/WebCore/loader/PolicyCallback.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderPolicyCallbackh">trunk/Source/WebCore/loader/PolicyCallback.h</a></li>
<li><a href="#trunkSourceWebCoreloaderPolicyCheckercpp">trunk/Source/WebCore/loader/PolicyChecker.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderPolicyCheckerh">trunk/Source/WebCore/loader/PolicyChecker.h</a></li>
<li><a href="#trunkSourceWebCorepageDOMTimercpp">trunk/Source/WebCore/page/DOMTimer.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowcpp">trunk/Source/WebCore/page/DOMWindow.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowh">trunk/Source/WebCore/page/DOMWindow.h</a></li>
<li><a href="#trunkSourceWebCoreplatformPlatformWheelEventh">trunk/Source/WebCore/platform/PlatformWheelEvent.h</a></li>
<li><a href="#trunkSourceWebCoreplatformtextStringWithDirectionh">trunk/Source/WebCore/platform/text/StringWithDirection.h</a></li>
<li><a href="#trunkSourceWebCorerenderingHitTestResultcpp">trunk/Source/WebCore/rendering/HitTestResult.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingInlineTextBoxcpp">trunk/Source/WebCore/rendering/InlineTextBox.cpp</a></li>
<li><a href="#trunkSourceWebKitiosChangeLog">trunk/Source/WebKit/ios/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitiosWebViewWebPDFViewIOSmm">trunk/Source/WebKit/ios/WebView/WebPDFViewIOS.mm</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebFrameLoaderClientmm">trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebFramemm">trunk/Source/WebKit/mac/WebView/WebFrame.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebHTMLRepresentationmm">trunk/Source/WebKit/mac/WebView/WebHTMLRepresentation.mm</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinWebCoreSupportWebFrameLoaderClientcpp">trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp</a></li>
<li><a href="#trunkSourceWebKitwinWebDataSourcecpp">trunk/Source/WebKit/win/WebDataSource.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoredomDocumentMarkercpp">trunk/Source/WebCore/dom/DocumentMarker.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/LayoutTests/ChangeLog        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2016-12-31 Darin Adler <darin@apple.com>
+
+ Remove PassRefPtr use from the "dom" directory, related cleanup
+ https://bugs.webkit.org/show_bug.cgi?id=166569
+
+ Reviewed by Alex Christensen.
+
+ * 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.
+
</ins><span class="cx"> 2016-12-28 Sergio Villar Senin <svillar@igalia.com>
</span><span class="cx">
</span><span class="cx"> [css-grid] Isolate instrinsic size computation from layout
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomtitletextproperty2expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/title-text-property-2-expected.txt (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/title-text-property-2-expected.txt        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/LayoutTests/fast/dom/title-text-property-2-expected.txt        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -1,4 +1,3 @@
</span><del>-TITLE CHANGED: '1. setting document.title'
</del><span class="cx"> TITLE CHANGED: ''
</span><span class="cx"> TITLE CHANGED: '1. setting document.title'
</span><span class="cx"> TITLE CHANGED: ''
</span></span></pre></div>
<a id="trunkLayoutTestsfastregionscssomwebkitnamedflowcollectionexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/regions/cssom/webkit-named-flow-collection-expected.txt (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/regions/cssom/webkit-named-flow-collection-expected.txt        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/LayoutTests/fast/regions/cssom/webkit-named-flow-collection-expected.txt        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -10,10 +10,14 @@
</span><span class="cx"> PASS region1.style.webkitFlowFrom = ''; document.webkitGetNamedFlows().length is 1
</span><span class="cx"> PASS region2.style.webkitFlowFrom = ''; document.webkitGetNamedFlows().length is 0
</span><span class="cx"> Test WebKitNamedFlowCollection index getter
</span><del>-PASS (document.webkitGetNamedFlows()[0].name == 'flow1' && document.webkitGetNamedFlows()[1].name == 'flow2') || (document.webkitGetNamedFlows()[0].name == 'flow2' && document.webkitGetNamedFlows()[1].name == 'flow1') is true
</del><ins>+PASS document.webkitGetNamedFlows()[0].name is "flow1"
+PASS document.webkitGetNamedFlows()[1].name is "flow2"
</ins><span class="cx"> Test WebKitNamedFlowCollection name getter
</span><span class="cx"> PASS document.webkitGetNamedFlows().flow1.name is "flow1"
</span><span class="cx"> PASS document.webkitGetNamedFlows().flow2.name is "flow2"
</span><ins>+Test WebKitNamedFlowCollection property names
+PASS Object.keys(document.webkitGetNamedFlows()) is ['0', '1']
+PASS Object.getOwnPropertyNames(document.webkitGetNamedFlows()) is ['0', '1', 'flow1', 'flow2']
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastregionscssomwebkitnamedflowcollectionhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/regions/cssom/webkit-named-flow-collection.html (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/regions/cssom/webkit-named-flow-collection.html        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/LayoutTests/fast/regions/cssom/webkit-named-flow-collection.html        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -32,13 +32,17 @@
</span><span class="cx"> region2.style.webkitFlowFrom = 'flow2';
</span><span class="cx">
</span><span class="cx"> debug("Test WebKitNamedFlowCollection index getter");
</span><del>- shouldBeTrue("(document.webkitGetNamedFlows()[0].name == 'flow1' && document.webkitGetNamedFlows()[1].name == 'flow2') \
- || (document.webkitGetNamedFlows()[0].name == 'flow2' && document.webkitGetNamedFlows()[1].name == 'flow1')");
</del><ins>+ shouldBeEqualToString("document.webkitGetNamedFlows()[0].name", "flow1");
+ shouldBeEqualToString("document.webkitGetNamedFlows()[1].name", "flow2");
</ins><span class="cx">
</span><span class="cx"> debug("Test WebKitNamedFlowCollection name getter");
</span><span class="cx"> shouldBeEqualToString("document.webkitGetNamedFlows().flow1.name", "flow1");
</span><span class="cx"> shouldBeEqualToString("document.webkitGetNamedFlows().flow2.name", "flow2");
</span><span class="cx">
</span><ins>+ debug("Test WebKitNamedFlowCollection property names");
+ shouldBe("Object.keys(document.webkitGetNamedFlows())", "['0', '1']");
+ shouldBe("Object.getOwnPropertyNames(document.webkitGetNamedFlows())", "['0', '1', 'flow1', 'flow2']");
+
</ins><span class="cx"> document.body.removeChild(region1);
</span><span class="cx"> document.body.removeChild(region2);
</span><span class="cx"> </script>
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsglobalhistoryhistorydelegatebasictitleexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/globalhistory/history-delegate-basic-title-expected.txt (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/globalhistory/history-delegate-basic-title-expected.txt        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/LayoutTests/http/tests/globalhistory/history-delegate-basic-title-expected.txt        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -1,6 +1,5 @@
</span><span class="cx"> WebView navigated to url "http://127.0.0.1:8000/globalhistory/history-delegate-basic-title.html" with title "" with HTTP equivalent method "GET". The navigation was successful and was not a client redirect.
</span><span class="cx"> WebView updated the title for history URL "http://127.0.0.1:8000/globalhistory/history-delegate-basic-title.html" to "Test Title 1".
</span><del>-WebView updated the title for history URL "http://127.0.0.1:8000/globalhistory/history-delegate-basic-title.html" to "Test Title 2".
</del><span class="cx"> WebView updated the title for history URL "http://127.0.0.1:8000/globalhistory/history-delegate-basic-title.html" to "".
</span><span class="cx"> WebView updated the title for history URL "http://127.0.0.1:8000/globalhistory/history-delegate-basic-title.html" to "Test Title 2".
</span><span class="cx"> This test sees if the history delegate is notified of title changes.
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -1425,7 +1425,6 @@
</span><span class="cx"> dom/Document.cpp
</span><span class="cx"> dom/DocumentEventQueue.cpp
</span><span class="cx"> dom/DocumentFragment.cpp
</span><del>- dom/DocumentMarker.cpp
</del><span class="cx"> dom/DocumentMarkerController.cpp
</span><span class="cx"> dom/DocumentOrderedMap.cpp
</span><span class="cx"> dom/DocumentParser.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/ChangeLog        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -1,5 +1,329 @@
</span><span class="cx"> 2016-12-30 Darin Adler <darin@apple.com>
</span><span class="cx">
</span><ins>+ Remove PassRefPtr use from the "dom" directory, related cleanup
+ https://bugs.webkit.org/show_bug.cgi?id=166569
+
+ Reviewed by Alex Christensen.
+
+ * 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
+
+2016-12-30 Darin Adler <darin@apple.com>
+
</ins><span class="cx"> Remove PassRefPtr use from the "css" directory, related cleanup
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=166628
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -4078,7 +4078,6 @@
</span><span class="cx">                 A77D0012133B0AEB00D6658C /* TextChecking.h in Headers */ = {isa = PBXBuildFile; fileRef = A77D0011133B0AEB00D6658C /* TextChecking.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A77E1FEF14AACB6E005B7CB6 /* TreeScopeAdopter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A77E1FED14AACB6E005B7CB6 /* TreeScopeAdopter.cpp */; };
</span><span class="cx">                 A77E1FF014AACB6E005B7CB6 /* TreeScopeAdopter.h in Headers */ = {isa = PBXBuildFile; fileRef = A77E1FEE14AACB6E005B7CB6 /* TreeScopeAdopter.h */; };
</span><del>-                A781C6A713828B5D0012A62A /* DocumentMarker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A781C6A613828B5D0012A62A /* DocumentMarker.cpp */; };
</del><span class="cx">                 A784941B0B5FE507001E237A /* DataTransfer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A784941A0B5FE507001E237A /* DataTransfer.cpp */; };
</span><span class="cx">                 A78FE13B12366B1000ACE8D0 /* SpellChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A78FE13912366B1000ACE8D0 /* SpellChecker.cpp */; };
</span><span class="cx">                 A78FE13C12366B1000ACE8D0 /* SpellChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = A78FE13A12366B1000ACE8D0 /* SpellChecker.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -11760,7 +11759,6 @@
</span><span class="cx">                 A77D0011133B0AEB00D6658C /* TextChecking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextChecking.h; sourceTree = "<group>"; };
</span><span class="cx">                 A77E1FED14AACB6E005B7CB6 /* TreeScopeAdopter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TreeScopeAdopter.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 A77E1FEE14AACB6E005B7CB6 /* TreeScopeAdopter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TreeScopeAdopter.h; sourceTree = "<group>"; };
</span><del>-                A781C6A613828B5D0012A62A /* DocumentMarker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentMarker.cpp; sourceTree = "<group>"; };
</del><span class="cx">                 A784941A0B5FE507001E237A /* DataTransfer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DataTransfer.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 A78FE13912366B1000ACE8D0 /* SpellChecker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpellChecker.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 A78FE13A12366B1000ACE8D0 /* SpellChecker.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = SpellChecker.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -24055,7 +24053,6 @@
</span><span class="cx">                                 A8185F3709765765005826D9 /* DocumentFragment.cpp */,
</span><span class="cx">                                 A8185F3509765765005826D9 /* DocumentFragment.h */,
</span><span class="cx">                                 1A494ED50A123F1A00FDAFC1 /* DocumentFragment.idl */,
</span><del>-                                A781C6A613828B5D0012A62A /* DocumentMarker.cpp */,
</del><span class="cx">                                 ED2BA83B09A24B91006C0AC4 /* DocumentMarker.h */,
</span><span class="cx">                                 CE057FA31220731100A476D5 /* DocumentMarkerController.cpp */,
</span><span class="cx">                                 CE057FA41220731100A476D5 /* DocumentMarkerController.h */,
</span><span class="lines">@@ -29246,7 +29243,6 @@
</span><span class="cx">                                 A8185F3F09765766005826D9 /* DocumentFragment.cpp in Sources */,
</span><span class="cx">                                 93E227E00AF589AD00D48324 /* DocumentLoader.cpp in Sources */,
</span><span class="cx">                                 1C26497A0D7E248A00BD10F2 /* DocumentLoaderMac.cpp in Sources */,
</span><del>-                                A781C6A713828B5D0012A62A /* DocumentMarker.cpp in Sources */,
</del><span class="cx">                                 CE057FA51220731100A476D5 /* DocumentMarkerController.cpp in Sources */,
</span><span class="cx">                                 14947FFD12F80CD200A0F631 /* DocumentOrderedMap.cpp in Sources */,
</span><span class="cx">                                 A8C2280E11D4A59700D5A7D3 /* DocumentParser.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSPopStateEventCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSPopStateEventCustom.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSPopStateEventCustom.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/bindings/js/JSPopStateEventCustom.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx"> // We need to make sure a PopStateEvent does not leak objects in its state property across isolated DOM worlds.
</span><span class="cx"> // Ideally, we would check that the worlds have different privileges but that's not possible yet.
</span><span class="cx"> if (eventState.isObject() && &worldForDOMObject(eventState.getObject()) != &currentWorld(&state)) {
</span><del>- if (auto serializedValue = event.trySerializeState(&state))
</del><ins>+ if (auto serializedValue = event.trySerializeState(state))
</ins><span class="cx"> eventState = serializedValue->deserialize(state, globalObject());
</span><span class="cx"> else
</span><span class="cx"> eventState = jsNull();
</span></span></pre></div>
<a id="trunkSourceWebCoredomCharacterDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/CharacterData.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/CharacterData.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/CharacterData.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -223,7 +223,7 @@
</span><span class="cx">
</span><span class="cx"> void CharacterData::dispatchModifiedEvent(const String& oldData)
</span><span class="cx"> {
</span><del>- if (std::unique_ptr<MutationObserverInterestGroup> mutationRecipients = MutationObserverInterestGroup::createForCharacterDataMutation(*this))
</del><ins>+ if (auto mutationRecipients = MutationObserverInterestGroup::createForCharacterDataMutation(*this))
</ins><span class="cx"> mutationRecipients->enqueueMutationRecord(MutationRecord::createCharacterData(*this, oldData));
</span><span class="cx">
</span><span class="cx"> if (!isInShadowTree()) {
</span></span></pre></div>
<a id="trunkSourceWebCoredomDOMAllInOnecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DOMAllInOne.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DOMAllInOne.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/DOMAllInOne.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -66,7 +66,6 @@
</span><span class="cx"> #include "Document.cpp"
</span><span class="cx"> #include "DocumentEventQueue.cpp"
</span><span class="cx"> #include "DocumentFragment.cpp"
</span><del>-#include "DocumentMarker.cpp"
</del><span class="cx"> #include "DocumentMarkerController.cpp"
</span><span class="cx"> #include "DocumentOrderedMap.cpp"
</span><span class="cx"> #include "DocumentParser.cpp"
</span></span></pre></div>
<a id="trunkSourceWebCoredomDOMNamedFlowCollectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DOMNamedFlowCollection.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DOMNamedFlowCollection.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/DOMNamedFlowCollection.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx"> * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
</span><ins>+ * Copyright (C) 2016 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -26,62 +27,67 @@
</span><span class="cx"> * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
</span><span class="cx"> * SUCH DAMAGE.
</span><span class="cx"> */
</span><ins>+
</ins><span class="cx"> #include "config.h"
</span><span class="cx"> #include "DOMNamedFlowCollection.h"
</span><span class="cx">
</span><del>-#include "EventNames.h"
</del><ins>+#include "WebKitNamedFlow.h"
+#include <wtf/text/AtomicStringHash.h>
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-DOMNamedFlowCollection::DOMNamedFlowCollection(const Vector<WebKitNamedFlow*>& namedFlows)
</del><ins>+inline DOMNamedFlowCollection::DOMNamedFlowCollection(Vector<Ref<WebKitNamedFlow>>&& flows)
+ : m_flows(WTFMove(flows))
</ins><span class="cx"> {
</span><del>- for (auto& flow : namedFlows)
- m_namedFlows.add(flow);
</del><span class="cx"> }
</span><span class="cx">
</span><del>-unsigned long DOMNamedFlowCollection::length() const
</del><ins>+Ref<DOMNamedFlowCollection> DOMNamedFlowCollection::create(Vector<Ref<WebKitNamedFlow>>&& flows)
</ins><span class="cx"> {
</span><del>- return m_namedFlows.size();
</del><ins>+ return adoptRef(*new DOMNamedFlowCollection(WTFMove(flows)));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<WebKitNamedFlow> DOMNamedFlowCollection::item(unsigned long index) const
</del><ins>+DOMNamedFlowCollection::~DOMNamedFlowCollection()
</ins><span class="cx"> {
</span><del>- if (index >= static_cast<unsigned long>(m_namedFlows.size()))
</del><ins>+}
+
+WebKitNamedFlow* DOMNamedFlowCollection::item(unsigned index) const
+{
+ if (index >= m_flows.size())
</ins><span class="cx"> return nullptr;
</span><del>- auto it = m_namedFlows.begin();
- for (unsigned long i = 0; i < index; ++i)
- ++it;
- return *it;
</del><ins>+ return const_cast<WebKitNamedFlow*>(m_flows[index].ptr());
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<WebKitNamedFlow> DOMNamedFlowCollection::namedItem(const AtomicString& name) const
</del><ins>+struct DOMNamedFlowCollection::HashFunctions {
+ static unsigned hash(const WebKitNamedFlow* key) { return AtomicStringHash::hash(key->name()); }
+ static bool equal(const WebKitNamedFlow* a, const WebKitNamedFlow* b) { return a->name() == b->name(); }
+ static const bool safeToCompareToEmptyOrDeleted = false;
+
+ static unsigned hash(const AtomicString& key) { return AtomicStringHash::hash(key); }
+ static bool equal(const WebKitNamedFlow* a, const AtomicString& b) { return a->name() == b; }
+};
+
+WebKitNamedFlow* DOMNamedFlowCollection::namedItem(const AtomicString& name) const
</ins><span class="cx"> {
</span><del>- auto it = m_namedFlows.find<String, DOMNamedFlowHashTranslator>(name);
- if (it != m_namedFlows.end())
- return *it;
- return nullptr;
</del><ins>+ if (m_flowsByName.isEmpty()) {
+ // No need to optimize the case where m_flows is empty; will do nothing very quickly.
+ for (auto& flow : m_flows)
+ m_flowsByName.add(const_cast<WebKitNamedFlow*>(flow.ptr()));
+ }
+ auto it = m_flowsByName.find<HashFunctions>(name);
+ if (it == m_flowsByName.end())
+ return nullptr;
+ return *it;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-Vector<AtomicString> DOMNamedFlowCollection::supportedPropertyNames()
</del><ins>+const Vector<AtomicString>& DOMNamedFlowCollection::supportedPropertyNames()
</ins><span class="cx"> {
</span><del>- // FIXME: Should be implemented.
- return Vector<AtomicString>();
</del><ins>+ if (m_flowNames.isEmpty()) {
+ // No need to optimize the case where m_flows is empty; will do nothing relatively quickly.
+ m_flowNames.reserveInitialCapacity(m_flows.size());
+ for (auto& flow : m_flows)
+ m_flowNames.uncheckedAppend(flow->name());
+ }
+ return m_flowNames;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-// The HashFunctions object used by the HashSet to compare between RefPtr<NamedFlows>.
-// It is safe to set safeToCompareToEmptyOrDeleted because the HashSet will never contain null pointers or deleted values.
-struct DOMNamedFlowCollection::DOMNamedFlowHashFunctions {
- static unsigned hash(PassRefPtr<WebKitNamedFlow> key) { return DefaultHash<String>::Hash::hash(key->name()); }
- static bool equal(PassRefPtr<WebKitNamedFlow> a, PassRefPtr<WebKitNamedFlow> b) { return a->name() == b->name(); }
- static const bool safeToCompareToEmptyOrDeleted = true;
-};
-
-// The HashTranslator is used to lookup a RefPtr<NamedFlow> in the set using a name.
-struct DOMNamedFlowCollection::DOMNamedFlowHashTranslator {
- static unsigned hash(const String& key) { return DefaultHash<String>::Hash::hash(key); }
- static bool equal(PassRefPtr<WebKitNamedFlow> a, const String& b) { return a->name() == b; }
-};
</del><span class="cx"> } // namespace WebCore
</span><del>-
-
-
</del></span></pre></div>
<a id="trunkSourceWebCoredomDOMNamedFlowCollectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DOMNamedFlowCollection.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DOMNamedFlowCollection.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/DOMNamedFlowCollection.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx"> * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
</span><ins>+ * Copyright (C) 2016 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -29,35 +30,38 @@
</span><span class="cx">
</span><span class="cx"> #pragma once
</span><span class="cx">
</span><del>-#include "NamedFlowCollection.h"
-#include <wtf/ListHashSet.h>
</del><ins>+#include <wtf/Forward.h>
+#include <wtf/HashSet.h>
</ins><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-class Document;
</del><span class="cx"> class WebKitNamedFlow;
</span><span class="cx">
</span><span class="cx"> class DOMNamedFlowCollection : public RefCounted<DOMNamedFlowCollection> {
</span><span class="cx"> public:
</span><del>- static Ref<DOMNamedFlowCollection> create(const Vector<WebKitNamedFlow*>& namedFlows)
- {
- return adoptRef(*new DOMNamedFlowCollection(namedFlows));
- }
</del><ins>+ static Ref<DOMNamedFlowCollection> create(Vector<Ref<WebKitNamedFlow>>&&);
+ ~DOMNamedFlowCollection();
</ins><span class="cx">
</span><del>- unsigned long length() const;
- RefPtr<WebKitNamedFlow> item(unsigned long index) const;
- RefPtr<WebKitNamedFlow> namedItem(const AtomicString& name) const;
- Vector<AtomicString> supportedPropertyNames();
</del><ins>+ unsigned length() const;
+ WebKitNamedFlow* item(unsigned index) const;
+ WebKitNamedFlow* namedItem(const AtomicString& name) const;
+ const Vector<AtomicString>& supportedPropertyNames();
</ins><span class="cx">
</span><span class="cx"> private:
</span><del>- struct DOMNamedFlowHashFunctions;
- struct DOMNamedFlowHashTranslator;
</del><ins>+ struct HashFunctions;
</ins><span class="cx">
</span><del>- typedef ListHashSet<RefPtr<WebKitNamedFlow>, DOMNamedFlowHashFunctions> DOMNamedFlowSet;
- explicit DOMNamedFlowCollection(const Vector<WebKitNamedFlow*>&);
- DOMNamedFlowSet m_namedFlows;
</del><ins>+ explicit DOMNamedFlowCollection(Vector<Ref<WebKitNamedFlow>>&&);
+
+ const Vector<Ref<WebKitNamedFlow>> m_flows;
+ mutable HashSet<WebKitNamedFlow*, HashFunctions> m_flowsByName;
+ mutable Vector<AtomicString> m_flowNames;
</ins><span class="cx"> };
</span><span class="cx">
</span><ins>+inline unsigned DOMNamedFlowCollection::length() const
+{
+ return m_flows.size();
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoredomDOMNamedFlowCollectionidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DOMNamedFlowCollection.idl (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DOMNamedFlowCollection.idl        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/DOMNamedFlowCollection.idl        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -35,6 +35,6 @@
</span><span class="cx"> ImplementationLacksVTable,
</span><span class="cx"> ] interface DOMNamedFlowCollection {
</span><span class="cx"> readonly attribute unsigned long length;
</span><del>- getter WebKitNamedFlow item(unsigned long index);
- getter WebKitNamedFlow namedItem(DOMString name);
</del><ins>+ getter WebKitNamedFlow? item(unsigned long index);
+ getter WebKitNamedFlow? namedItem(DOMString name);
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoredomDataTransferh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DataTransfer.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DataTransfer.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/DataTransfer.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> * Copyright (C) 2001 Peter Kelly (pmk@post.com)
</span><span class="cx"> * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de)
</span><span class="cx"> * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
</span><del>- * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2003-2016 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * This library is free software; you can redistribute it and/or
</span><span class="cx"> * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -28,98 +28,92 @@
</span><span class="cx"> #include "DragActions.h"
</span><span class="cx"> #include "DragImage.h"
</span><span class="cx"> #include "IntPoint.h"
</span><del>-#include <wtf/RefCounted.h>
</del><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>- class CachedImage;
- class DataTransferItemList;
- class DragData;
- class DragImageLoader;
- class Element;
- class FileList;
- class Pasteboard;
</del><ins>+class CachedImage;
+class DragData;
+class DragImageLoader;
+class Element;
+class FileList;
+class Pasteboard;
</ins><span class="cx">
</span><del>- class DataTransfer : public RefCounted<DataTransfer> {
- public:
- static Ref<DataTransfer> createForCopyAndPaste(DataTransferAccessPolicy);
- static Ref<DataTransfer> createForInputEvent(const String& plainText, const String& htmlText);
</del><ins>+class DataTransfer : public RefCounted<DataTransfer> {
+public:
+ static Ref<DataTransfer> createForCopyAndPaste(DataTransferAccessPolicy);
+ static Ref<DataTransfer> createForInputEvent(const String& plainText, const String& htmlText);
</ins><span class="cx">
</span><del>- WEBCORE_EXPORT ~DataTransfer();
</del><ins>+ WEBCORE_EXPORT ~DataTransfer();
</ins><span class="cx">
</span><del>- String dropEffect() const;
- void setDropEffect(const String&);
</del><ins>+ String dropEffect() const;
+ void setDropEffect(const String&);
</ins><span class="cx">
</span><del>- String effectAllowed() const;
- void setEffectAllowed(const String&);
</del><ins>+ String effectAllowed() const;
+ void setEffectAllowed(const String&);
</ins><span class="cx">
</span><del>- Vector<String> types() const;
</del><ins>+ Vector<String> types() const;
</ins><span class="cx">
</span><del>- FileList& files() const;
</del><ins>+ FileList& files() const;
</ins><span class="cx">
</span><del>- void clearData(const String& type = String());
</del><ins>+ void clearData(const String& type = String());
</ins><span class="cx">
</span><del>- String getData(const String& type) const;
</del><ins>+ String getData(const String& type) const;
</ins><span class="cx">
</span><del>- void setData(const String& type, const String& data);
</del><ins>+ void setData(const String& type, const String& data);
</ins><span class="cx">
</span><del>- void setDragImage(Element*, int x, int y);
</del><ins>+ void setDragImage(Element*, int x, int y);
</ins><span class="cx">
</span><del>-#if ENABLE(DATA_TRANSFER_ITEMS)
- PassRefPtr<DataTransferItemList> items() = 0;
-#endif
</del><ins>+ void setAccessPolicy(DataTransferAccessPolicy);
+ bool canReadTypes() const;
+ bool canReadData() const;
+ bool canWriteData() const;
</ins><span class="cx">
</span><del>- void setAccessPolicy(DataTransferAccessPolicy);
- bool canReadTypes() const;
- bool canReadData() const;
- bool canWriteData() const;
</del><ins>+ bool hasFileOfType(const String&);
+ bool hasStringOfType(const String&);
</ins><span class="cx">
</span><del>- bool hasFileOfType(const String&);
- bool hasStringOfType(const String&);
</del><ins>+ Pasteboard& pasteboard() { return *m_pasteboard; }
</ins><span class="cx">
</span><del>- Pasteboard& pasteboard() { return *m_pasteboard; }
-
</del><span class="cx"> #if ENABLE(DRAG_SUPPORT)
</span><del>- static Ref<DataTransfer> createForDragAndDrop();
- static Ref<DataTransfer> createForDragAndDrop(DataTransferAccessPolicy, const DragData&);
</del><ins>+ static Ref<DataTransfer> createForDragAndDrop();
+ static Ref<DataTransfer> createForDragAndDrop(DataTransferAccessPolicy, const DragData&);
</ins><span class="cx">
</span><del>- bool dropEffectIsUninitialized() const { return m_dropEffect == "uninitialized"; }
</del><ins>+ bool dropEffectIsUninitialized() const { return m_dropEffect == "uninitialized"; }
</ins><span class="cx">
</span><del>- DragOperation sourceOperation() const;
- DragOperation destinationOperation() const;
- void setSourceOperation(DragOperation);
- void setDestinationOperation(DragOperation);
</del><ins>+ DragOperation sourceOperation() const;
+ DragOperation destinationOperation() const;
+ void setSourceOperation(DragOperation);
+ void setDestinationOperation(DragOperation);
</ins><span class="cx">
</span><del>- void setDragHasStarted() { m_shouldUpdateDragImage = true; }
- DragImageRef createDragImage(IntPoint& dragLocation) const;
- void updateDragImage();
</del><ins>+ void setDragHasStarted() { m_shouldUpdateDragImage = true; }
+ DragImageRef createDragImage(IntPoint& dragLocation) const;
+ void updateDragImage();
</ins><span class="cx"> #endif
</span><span class="cx">
</span><del>- private:
- enum Type { CopyAndPaste, DragAndDrop, InputEvent };
- DataTransfer(DataTransferAccessPolicy, std::unique_ptr<Pasteboard>, Type = CopyAndPaste, bool forFileDrag = false);
</del><ins>+private:
+ enum Type { CopyAndPaste, DragAndDrop, InputEvent };
+ DataTransfer(DataTransferAccessPolicy, std::unique_ptr<Pasteboard>, Type = CopyAndPaste, bool forFileDrag = false);
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(DRAG_SUPPORT)
</span><del>- bool canSetDragImage() const;
</del><ins>+ bool canSetDragImage() const;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><del>- DataTransferAccessPolicy m_policy;
- std::unique_ptr<Pasteboard> m_pasteboard;
</del><ins>+ DataTransferAccessPolicy m_policy;
+ std::unique_ptr<Pasteboard> m_pasteboard;
</ins><span class="cx">
</span><del>- mutable RefPtr<FileList> m_fileList;
</del><ins>+ mutable RefPtr<FileList> m_fileList;
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(DRAG_SUPPORT)
</span><del>- bool m_forDrag;
- bool m_forFileDrag;
- String m_dropEffect;
- String m_effectAllowed;
- bool m_shouldUpdateDragImage;
- IntPoint m_dragLocation;
- CachedResourceHandle<CachedImage> m_dragImage;
- RefPtr<Element> m_dragImageElement;
- std::unique_ptr<DragImageLoader> m_dragImageLoader;
</del><ins>+ bool m_forDrag;
+ bool m_forFileDrag;
+ String m_dropEffect;
+ String m_effectAllowed;
+ bool m_shouldUpdateDragImage;
+ IntPoint m_dragLocation;
+ CachedResourceHandle<CachedImage> m_dragImage;
+ RefPtr<Element> m_dragImageElement;
+ std::unique_ptr<DragImageLoader> m_dragImageLoader;
</ins><span class="cx"> #endif
</span><del>- };
</del><ins>+};
</ins><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoredomDataTransferItemh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DataTransferItem.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DataTransferItem.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/DataTransferItem.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx"> virtual String type() const = 0;
</span><span class="cx">
</span><span class="cx"> virtual void getAsString(RefPtr<StringCallback>&&) const = 0;
</span><del>- virtual PassRefPtr<Blob> getAsFile() const = 0;
</del><ins>+ virtual RefPtr<Blob> getAsFile() const = 0;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/Document.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -114,6 +114,7 @@
</span><span class="cx"> #include "MouseEventWithHitTestResults.h"
</span><span class="cx"> #include "MutationEvent.h"
</span><span class="cx"> #include "NameNodeList.h"
</span><ins>+#include "NamedFlowCollection.h"
</ins><span class="cx"> #include "NestingLevelIncrementer.h"
</span><span class="cx"> #include "NoEventDispatchAssertion.h"
</span><span class="cx"> #include "NodeIterator.h"
</span><span class="lines">@@ -1449,64 +1450,41 @@
</span><span class="cx"> return body();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-/*
- * Performs three operations:
- * 1. Convert control characters to spaces
- * 2. Trim leading and trailing spaces
- * 3. Collapse internal whitespace.
- */
-template <typename CharacterType>
-static inline StringWithDirection canonicalizedTitle(Document* document, const StringWithDirection& titleWithDirection)
</del><ins>+template<typename CharacterType> static inline String canonicalizedTitle(Document& document, const String& title)
</ins><span class="cx"> {
</span><del>- const String& title = titleWithDirection.string();
- const CharacterType* characters = title.characters<CharacterType>();
</del><ins>+ // FIXME: Compiling a separate copy of this for each character type is likely unnecessary.
+ // FIXME: Missing an optimized case for when title is fine as-is. This unnecessarily allocates
+ // and keeps around a new copy, and it's even the less optimal type of StringImpl with a separate buffer.
+ // Could probably just use StringBuilder instead.
+
+ auto* characters = title.characters<CharacterType>();
</ins><span class="cx"> unsigned length = title.length();
</span><del>- unsigned i;
</del><span class="cx">
</span><del>- StringBuffer<CharacterType> buffer(length);
- unsigned builderIndex = 0;
</del><ins>+ StringBuffer<CharacterType> buffer { length };
+ unsigned bufferLength = 0;
</ins><span class="cx">
</span><del>- // Skip leading spaces and leading characters that would convert to spaces
- for (i = 0; i < length; ++i) {
- CharacterType c = characters[i];
- if (isNotHTMLSpace(c))
- break;
- }
-
- if (i == length)
- return StringWithDirection();
-
- // Replace control characters with spaces, and backslashes with currency symbols, and collapse whitespace.
- bool previousCharWasWS = false;
- for (; i < length; ++i) {
- CharacterType c = characters[i];
- if (isHTMLSpace(c)) {
- if (previousCharWasWS)
- continue;
- buffer[builderIndex++] = ' ';
- previousCharWasWS = true;
- } else {
- buffer[builderIndex++] = c;
- previousCharWasWS = false;
</del><ins>+ // Collapse runs of HTML spaces into single space characters; strip leading and trailing spaces.
+ bool previousCharacterWasHTMLSpace = false;
+ for (unsigned i = 0; i < length; ++i) {
+ auto character = characters[i];
+ if (isHTMLSpace(character))
+ previousCharacterWasHTMLSpace = true;
+ else {
+ if (previousCharacterWasHTMLSpace && bufferLength)
+ buffer[bufferLength++] = ' ';
+ buffer[bufferLength++] = character;
+ previousCharacterWasHTMLSpace = false;
</ins><span class="cx"> }
</span><span class="cx"> }
</span><ins>+ if (!bufferLength)
+ return { };
+ buffer.shrink(bufferLength);
</ins><span class="cx">
</span><del>- // Strip trailing spaces
- while (builderIndex > 0) {
- --builderIndex;
- if (buffer[builderIndex] != ' ')
- break;
- }
</del><ins>+ // Replace backslashes with currency symbols if the encoding requires it.
+ if (auto* decoder = document.decoder())
+ decoder->encoding().displayBuffer(buffer.characters(), bufferLength);
</ins><span class="cx">
</span><del>- if (!builderIndex && buffer[builderIndex] == ' ')
- return StringWithDirection();
-
- buffer.shrink(builderIndex + 1);
-
- // Replace the backslashes with currency symbols if the encoding requires it.
- document->displayBufferModifiedByEncoding(buffer.characters(), buffer.length());
-
- return StringWithDirection(String::adopt(WTFMove(buffer)), titleWithDirection.direction());
</del><ins>+ return String::adopt(WTFMove(buffer));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Document::updateTitle(const StringWithDirection& title)
</span><span class="lines">@@ -1515,16 +1493,16 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> m_rawTitle = title;
</span><ins>+ m_title = title;
</ins><span class="cx">
</span><del>- if (m_rawTitle.string().isEmpty())
- m_title = StringWithDirection();
- else {
- if (m_rawTitle.string().is8Bit())
- m_title = canonicalizedTitle<LChar>(this, m_rawTitle);
</del><ins>+ if (!m_title.string.isEmpty()) {
+ if (m_title.string.is8Bit())
+ m_title.string = canonicalizedTitle<LChar>(*this, m_title.string);
</ins><span class="cx"> else
</span><del>- m_title = canonicalizedTitle<UChar>(this, m_rawTitle);
</del><ins>+ m_title.string = canonicalizedTitle<UChar>(*this, m_title.string);
</ins><span class="cx"> }
</span><del>- if (DocumentLoader* loader = this->loader())
</del><ins>+
+ if (auto* loader = this->loader())
</ins><span class="cx"> loader->setTitle(m_title);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1531,7 +1509,7 @@
</span><span class="cx"> void Document::updateTitleFromTitleElement()
</span><span class="cx"> {
</span><span class="cx"> if (!m_titleElement) {
</span><del>- updateTitle(StringWithDirection());
</del><ins>+ updateTitle({ });
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1538,8 +1516,8 @@
</span><span class="cx"> if (is<HTMLTitleElement>(*m_titleElement))
</span><span class="cx"> updateTitle(downcast<HTMLTitleElement>(*m_titleElement).textWithDirection());
</span><span class="cx"> else if (is<SVGTitleElement>(*m_titleElement)) {
</span><del>- // FIXME: does SVG have a title text direction?
- updateTitle(StringWithDirection(downcast<SVGTitleElement>(*m_titleElement).textContent(), LTR));
</del><ins>+ // FIXME: Does the SVG title element have a text direction?
+ updateTitle({ downcast<SVGTitleElement>(*m_titleElement).textContent(), LTR });
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1559,16 +1537,19 @@
</span><span class="cx"> m_titleElement = SVGTitleElement::create(SVGNames::titleTag, *this);
</span><span class="cx"> element->insertBefore(*m_titleElement, element->firstChild());
</span><span class="cx"> }
</span><del>- } else if (!isHTMLDocument() && !isXHTMLDocument() && !isSVGDocument())
</del><ins>+ } else if (!isHTMLDocument() && !isXHTMLDocument() && !isSVGDocument()) {
+ // FIXME: What exactly is the point of this? This seems like a strange moment
+ // in time to demote something from being m_titleElement, when setting the
+ // value of the title attribute. Do we have test coverage for this?
</ins><span class="cx"> m_titleElement = nullptr;
</span><ins>+ }
</ins><span class="cx">
</span><del>- // The DOM API has no method of specifying direction, so assume LTR.
- updateTitle(StringWithDirection(title, LTR));
-
</del><span class="cx"> if (is<HTMLTitleElement>(m_titleElement.get()))
</span><span class="cx"> downcast<HTMLTitleElement>(*m_titleElement).setTextContent(title);
</span><span class="cx"> else if (is<SVGTitleElement>(m_titleElement.get()))
</span><span class="cx"> downcast<SVGTitleElement>(*m_titleElement).setTextContent(title);
</span><ins>+ else
+ updateTitle({ title, LTR });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Document::updateTitleElement(Element* newTitleElement)
</span><span class="lines">@@ -4044,11 +4025,11 @@
</span><span class="cx"> setAttributeEventListener(eventType, JSLazyEventListener::create(*this, attributeName, attributeValue));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void Document::setWindowAttributeEventListener(const AtomicString& eventType, PassRefPtr<EventListener> listener)
</del><ins>+void Document::setWindowAttributeEventListener(const AtomicString& eventType, RefPtr<EventListener>&& listener)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_domWindow)
</span><span class="cx"> return;
</span><del>- m_domWindow->setAttributeEventListener(eventType, listener);
</del><ins>+ m_domWindow->setAttributeEventListener(eventType, WTFMove(listener));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Document::setWindowAttributeEventListener(const AtomicString& eventType, const QualifiedName& attributeName, const AtomicString& attributeValue)
</span><span class="lines">@@ -5241,7 +5222,7 @@
</span><span class="cx"> documentLoader->replaceRequestURLForSameDocumentNavigation(url);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void Document::statePopped(PassRefPtr<SerializedScriptValue> stateObject)
</del><ins>+void Document::statePopped(Ref<SerializedScriptValue>&& stateObject)
</ins><span class="cx"> {
</span><span class="cx"> if (!frame())
</span><span class="cx"> return;
</span><span class="lines">@@ -5249,9 +5230,9 @@
</span><span class="cx"> // Per step 11 of section 6.5.9 (history traversal) of the HTML5 spec, we
</span><span class="cx"> // defer firing of popstate until we're in the complete state.
</span><span class="cx"> if (m_readyState == Complete)
</span><del>- enqueuePopstateEvent(stateObject);
</del><ins>+ enqueuePopstateEvent(WTFMove(stateObject));
</ins><span class="cx"> else
</span><del>- m_pendingStateObject = stateObject;
</del><ins>+ m_pendingStateObject = WTFMove(stateObject);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Document::updateFocusAppearanceSoon(SelectionRestorationMode mode)
</span><span class="lines">@@ -5499,24 +5480,6 @@
</span><span class="cx"> return str;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<StringImpl> Document::displayStringModifiedByEncoding(PassRefPtr<StringImpl> str) const
-{
- if (m_decoder)
- return m_decoder->encoding().displayString(str);
- return str;
-}
-
-template <typename CharacterType>
-void Document::displayBufferModifiedByEncodingInternal(CharacterType* buffer, unsigned len) const
-{
- if (m_decoder)
- m_decoder->encoding().displayBuffer(buffer, len);
-}
-
-// Generate definitions for both character types
-template void Document::displayBufferModifiedByEncodingInternal<LChar>(LChar*, unsigned) const;
-template void Document::displayBufferModifiedByEncodingInternal<UChar>(UChar*, unsigned) const;
-
</del><span class="cx"> void Document::enqueuePageshowEvent(PageshowEventPersistence persisted)
</span><span class="cx"> {
</span><span class="cx"> // FIXME: https://bugs.webkit.org/show_bug.cgi?id=36334 Pageshow event needs to fire asynchronously.
</span><span class="lines">@@ -6060,7 +6023,7 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(REQUEST_ANIMATION_FRAME)
</span><span class="cx">
</span><del>-int Document::requestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback> callback)
</del><ins>+int Document::requestAnimationFrame(Ref<RequestAnimationFrameCallback>&& callback)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_scriptedAnimationController) {
</span><span class="cx"> #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
</span><span class="lines">@@ -6075,7 +6038,7 @@
</span><span class="cx"> m_scriptedAnimationController->suspend();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- return m_scriptedAnimationController->registerCallback(callback);
</del><ins>+ return m_scriptedAnimationController->registerCallback(WTFMove(callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Document::cancelAnimationFrame(int id)
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/Document.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -57,7 +57,6 @@
</span><span class="cx"> #include <wtf/Deque.h>
</span><span class="cx"> #include <wtf/HashCountedSet.h>
</span><span class="cx"> #include <wtf/HashSet.h>
</span><del>-#include <wtf/PassRefPtr.h>
</del><span class="cx"> #include <wtf/WeakPtr.h>
</span><span class="cx"> #include <wtf/text/AtomicStringHash.h>
</span><span class="cx">
</span><span class="lines">@@ -768,7 +767,7 @@
</span><span class="cx">
</span><span class="cx"> // Helper functions for forwarding DOMWindow event related tasks to the DOMWindow if it exists.
</span><span class="cx"> void setWindowAttributeEventListener(const AtomicString& eventType, const QualifiedName& attributeName, const AtomicString& value);
</span><del>- void setWindowAttributeEventListener(const AtomicString& eventType, PassRefPtr<EventListener>);
</del><ins>+ void setWindowAttributeEventListener(const AtomicString& eventType, RefPtr<EventListener>&&);
</ins><span class="cx"> EventListener* getWindowAttributeEventListener(const AtomicString& eventType);
</span><span class="cx"> WEBCORE_EXPORT void dispatchWindowEvent(Event&, EventTarget* = nullptr);
</span><span class="cx"> void dispatchWindowLoadEvent();
</span><span class="lines">@@ -832,7 +831,7 @@
</span><span class="cx"> HTMLFrameOwnerElement* ownerElement() const;
</span><span class="cx">
</span><span class="cx"> // Used by DOM bindings; no direction known.
</span><del>- String title() const { return m_title.string(); }
</del><ins>+ const String& title() const { return m_title.string; }
</ins><span class="cx"> WEBCORE_EXPORT void setTitle(const String&);
</span><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT const AtomicString& dir() const;
</span><span class="lines">@@ -1034,15 +1033,6 @@
</span><span class="cx"> TextResourceDecoder* decoder() const { return m_decoder.get(); }
</span><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT String displayStringModifiedByEncoding(const String&) const;
</span><del>- RefPtr<StringImpl> displayStringModifiedByEncoding(PassRefPtr<StringImpl>) const;
- void displayBufferModifiedByEncoding(LChar* buffer, unsigned len) const
- {
- displayBufferModifiedByEncodingInternal(buffer, len);
- }
- void displayBufferModifiedByEncoding(UChar* buffer, unsigned len) const
- {
- displayBufferModifiedByEncodingInternal(buffer, len);
- }
</del><span class="cx">
</span><span class="cx"> // Quirk for the benefit of Apple's Dictionary application.
</span><span class="cx"> void setFrameElementsShouldIgnoreScrolling(bool ignore) { m_frameElementsShouldIgnoreScrolling = ignore; }
</span><span class="lines">@@ -1066,7 +1056,7 @@
</span><span class="cx"> void initContentSecurityPolicy();
</span><span class="cx">
</span><span class="cx"> void updateURLForPushOrReplaceState(const URL&);
</span><del>- void statePopped(PassRefPtr<SerializedScriptValue>);
</del><ins>+ void statePopped(Ref<SerializedScriptValue>&&);
</ins><span class="cx">
</span><span class="cx"> bool processingLoadEvent() const { return m_processingLoadEvent; }
</span><span class="cx"> bool loadEventFinished() const { return m_loadEventFinished; }
</span><span class="lines">@@ -1149,7 +1139,7 @@
</span><span class="cx"> double monotonicTimestamp() const;
</span><span class="cx">
</span><span class="cx"> #if ENABLE(REQUEST_ANIMATION_FRAME)
</span><del>- int requestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback>);
</del><ins>+ int requestAnimationFrame(Ref<RequestAnimationFrameCallback>&&);
</ins><span class="cx"> void cancelAnimationFrame(int id);
</span><span class="cx"> void serviceScriptedAnimations(double timestamp);
</span><span class="cx"> #endif
</span><span class="lines">@@ -1356,12 +1346,8 @@
</span><span class="cx">
</span><span class="cx"> void pendingTasksTimerFired();
</span><span class="cx">
</span><del>- template <typename CharacterType>
- void displayBufferModifiedByEncodingInternal(CharacterType*, unsigned) const;
</del><ins>+ template<CollectionType> Ref<HTMLCollection> ensureCachedCollection();
</ins><span class="cx">
</span><del>- template <CollectionType collectionType>
- Ref<HTMLCollection> ensureCachedCollection();
-
</del><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><span class="cx"> void dispatchFullScreenChangeOrErrorEvent(Deque<RefPtr<Node>>&, const AtomicString& eventName, bool shouldNotifyMediaElement);
</span><span class="cx"> void clearFullscreenElementStack();
</span><span class="lines">@@ -1769,6 +1755,8 @@
</span><span class="cx"> static bool hasEverCreatedAnAXObjectCache;
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+Element* eventTargetElementForDocument(Document*);
+
</ins><span class="cx"> inline void Document::notifyRemovePendingSheetIfNeeded()
</span><span class="cx"> {
</span><span class="cx"> if (m_needsNotifyRemoveAllPendingStylesheet)
</span><span class="lines">@@ -1794,7 +1782,7 @@
</span><span class="cx"> return existingAXObjectCacheSlow();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-// Put these methods here, because they require the Document definition, but we really want to inline them.
</del><ins>+// These functions are here because they require the Document class definition and we want to inline them.
</ins><span class="cx">
</span><span class="cx"> inline bool Node::isDocumentNode() const
</span><span class="cx"> {
</span><span class="lines">@@ -1806,8 +1794,6 @@
</span><span class="cx"> return &document().contextDocument();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Element* eventTargetElementForDocument(Document*);
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::Document)
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentMarkercpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/dom/DocumentMarker.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DocumentMarker.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/DocumentMarker.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -1,162 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "DocumentMarker.h"
-
-namespace WebCore {
-
-DocumentMarkerDetails::~DocumentMarkerDetails()
-{
-}
-
-class DocumentMarkerDescription final : public DocumentMarkerDetails {
-public:
- static Ref<DocumentMarkerDescription> create(const String&);
-
- const String& description() const { return m_description; }
- bool isDescription() const override { return true; }
-
-private:
- DocumentMarkerDescription(const String& description)
- : m_description(description)
- {
- }
-
- String m_description;
-};
-
-Ref<DocumentMarkerDescription> DocumentMarkerDescription::create(const String& description)
-{
- return adoptRef(*new DocumentMarkerDescription(description));
-}
-
-inline DocumentMarkerDescription* toDocumentMarkerDescription(DocumentMarkerDetails* details)
-{
- if (details && details->isDescription())
- return static_cast<DocumentMarkerDescription*>(details);
- return 0;
-}
-
-
-class DocumentMarkerTextMatch : public DocumentMarkerDetails {
-public:
- static PassRefPtr<DocumentMarkerTextMatch> instanceFor(bool);
-
- bool activeMatch() const { return m_match; }
- bool isTextMatch() const override { return true; }
-
-private:
- explicit DocumentMarkerTextMatch(bool match)
- : m_match(match)
- {
- }
-
- bool m_match;
-};
-
-PassRefPtr<DocumentMarkerTextMatch> DocumentMarkerTextMatch::instanceFor(bool match)
-{
- static DocumentMarkerTextMatch* trueInstance = adoptRef(new DocumentMarkerTextMatch(true)).leakRef();
- static DocumentMarkerTextMatch* falseInstance = adoptRef(new DocumentMarkerTextMatch(false)).leakRef();
- return match ? trueInstance : falseInstance;
-}
-
-inline DocumentMarkerTextMatch* toDocumentMarkerTextMatch(DocumentMarkerDetails* details)
-{
- if (details && details->isTextMatch())
- return static_cast<DocumentMarkerTextMatch*>(details);
- return 0;
-}
-
-
-DocumentMarker::DocumentMarker()
- : m_type(Spelling), m_startOffset(0), m_endOffset(0)
-{
-}
-
-DocumentMarker::DocumentMarker(MarkerType type, unsigned startOffset, unsigned endOffset)
- : m_type(type), m_startOffset(startOffset), m_endOffset(endOffset)
-{
-}
-
-DocumentMarker::DocumentMarker(MarkerType type, unsigned startOffset, unsigned endOffset, const String& description)
- : m_type(type)
- , m_startOffset(startOffset)
- , m_endOffset(endOffset)
- , m_details(DocumentMarkerDescription::create(description))
-{
- ASSERT(m_details);
-}
-
-DocumentMarker::DocumentMarker(unsigned startOffset, unsigned endOffset, bool activeMatch)
- : m_type(DocumentMarker::TextMatch)
- , m_startOffset(startOffset)
- , m_endOffset(endOffset)
- , m_details(DocumentMarkerTextMatch::instanceFor(activeMatch))
-{
- ASSERT(m_details);
-}
-
-DocumentMarker::DocumentMarker(MarkerType type, unsigned startOffset, unsigned endOffset, RefPtr<DocumentMarkerDetails>&& details)
- : m_type(type)
- , m_startOffset(startOffset)
- , m_endOffset(endOffset)
- , m_details(details)
-{
- ASSERT(m_details);
-}
-
-void DocumentMarker::shiftOffsets(int delta)
-{
- m_startOffset += delta;
- m_endOffset += delta;
-}
-
-void DocumentMarker::setActiveMatch(bool active)
-{
- m_details = DocumentMarkerTextMatch::instanceFor(active);
-}
-
-const String& DocumentMarker::description() const
-{
- if (DocumentMarkerDescription* details = toDocumentMarkerDescription(m_details.get()))
- return details->description();
- return emptyString();
-}
-
-bool DocumentMarker::activeMatch() const
-{
- if (DocumentMarkerTextMatch* details = toDocumentMarkerTextMatch(m_details.get()))
- return details->activeMatch();
- return false;
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoredomDocumentMarkerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DocumentMarker.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DocumentMarker.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/DocumentMarker.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -1,8 +1,6 @@
</span><span class="cx"> /*
</span><del>- * This file is part of the DOM implementation for WebCore.
</del><ins>+ * Copyright (C) 2006-2016 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><del>- * Copyright (C) 2006 Apple Inc.
- *
</del><span class="cx"> * This library is free software; you can redistribute it and/or
</span><span class="cx"> * modify it under the terms of the GNU Library General Public
</span><span class="cx"> * License as published by the Free Software Foundation; either
</span><span class="lines">@@ -23,8 +21,7 @@
</span><span class="cx"> #pragma once
</span><span class="cx">
</span><span class="cx"> #include <wtf/Forward.h>
</span><del>-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
</del><ins>+#include <wtf/Variant.h>
</ins><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="lines">@@ -34,8 +31,6 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-class DocumentMarkerDetails;
-
</del><span class="cx"> // A range of a node within a document that is "marked", such as the range of a misspelled word.
</span><span class="cx"> // It optionally includes a description that could be displayed in the user interface.
</span><span class="cx"> // It also optionally includes a flag specifying whether the match is active, which is ignored
</span><span class="lines">@@ -74,7 +69,7 @@
</span><span class="cx"> TelephoneNumber = 1 << 10,
</span><span class="cx"> #endif
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>- // FIXME: iOS should share the same Dictation marks as everyone else.
</del><ins>+ // FIXME: iOS should share the same dictation mark system with the other platforms <rdar://problem/9431249>.
</ins><span class="cx"> DictationPhraseWithAlternatives = 1 << 11,
</span><span class="cx"> DictationResult = 1 << 12,
</span><span class="cx"> #endif
</span><span class="lines">@@ -84,15 +79,15 @@
</span><span class="cx">
</span><span class="cx"> class MarkerTypes {
</span><span class="cx"> public:
</span><del>- // The constructor is intentionally implicit to allow conversion from the bit-wise sum of above types
</del><ins>+ // This constructor is left implicit to allow conversion from result of a bit-wise or of enumeration values.
</ins><span class="cx"> MarkerTypes(unsigned mask) : m_mask(mask) { }
</span><span class="cx">
</span><span class="cx"> bool contains(MarkerType type) const { return m_mask & type; }
</span><del>- bool intersects(const MarkerTypes& types) const { return (m_mask & types.m_mask); }
- bool operator==(const MarkerTypes& other) const { return m_mask == other.m_mask; }
</del><ins>+ bool intersects(MarkerTypes types) const { return m_mask & types.m_mask; }
+ bool operator==(MarkerTypes other) const { return m_mask == other.m_mask; }
</ins><span class="cx">
</span><del>- void add(const MarkerTypes& types) { m_mask |= types.m_mask; }
- void remove(const MarkerTypes& types) { m_mask &= ~types.m_mask; }
</del><ins>+ void add(MarkerTypes types) { m_mask |= types.m_mask; }
+ void remove(MarkerTypes types) { m_mask &= ~types.m_mask; }
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> unsigned m_mask;
</span><span class="lines">@@ -101,39 +96,63 @@
</span><span class="cx"> class AllMarkers : public MarkerTypes {
</span><span class="cx"> public:
</span><span class="cx"> AllMarkers()
</span><del>-#if !PLATFORM(IOS)
-#if !ENABLE(TELEPHONE_NUMBER_DETECTION)
- : MarkerTypes(Spelling | Grammar | TextMatch | Replacement | CorrectionIndicator | RejectedCorrection | Autocorrected | SpellCheckingExemption | DeletedAutocorrection | DictationAlternatives | AcceptedCandidate)
-#else
- : MarkerTypes(Spelling | Grammar | TextMatch | Replacement | CorrectionIndicator | RejectedCorrection | Autocorrected | SpellCheckingExemption | DeletedAutocorrection | DictationAlternatives | TelephoneNumber | AcceptedCandidate)
-#endif // !ENABLE(TELEPHONE_NUMBER_DETECTION)
-#else
- : MarkerTypes(Spelling | Grammar | TextMatch | Replacement | CorrectionIndicator | RejectedCorrection | Autocorrected | SpellCheckingExemption | DeletedAutocorrection | DictationAlternatives | TelephoneNumber | DictationPhraseWithAlternatives | DictationResult | AcceptedCandidate)
-#endif // !PLATFORM(IOS)
</del><ins>+ : MarkerTypes(0
+ | AcceptedCandidate
+ | Autocorrected
+ | CorrectionIndicator
+ | DeletedAutocorrection
+ | DictationAlternatives
+ | Grammar
+ | RejectedCorrection
+ | Replacement
+ | SpellCheckingExemption
+ | Spelling
+ | TextMatch
+#if ENABLE(TELEPHONE_NUMBER_DETECTION)
+ | TelephoneNumber
+#endif
+#if PLATFORM(IOS)
+ | DictationPhraseWithAlternatives
+ | DictationResult
+#endif
+ )
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><del>- DocumentMarker();
- DocumentMarker(MarkerType, unsigned startOffset, unsigned endOffset);
- DocumentMarker(MarkerType, unsigned startOffset, unsigned endOffset, const String& description);
</del><ins>+ using IsActiveMatchData = bool;
+ using DescriptionData = String;
+ struct DictationData {
+ uint64_t context;
+ String originalText;
+ };
+ struct DictationAlternativesData {
</ins><span class="cx"> #if PLATFORM(IOS)
</span><ins>+ Vector<String> alternatives;
+ RetainPtr<id> metadata;
+#endif
+ };
+ using Data = Variant<IsActiveMatchData, DescriptionData, DictationData, DictationAlternativesData>;
+
+ DocumentMarker(unsigned startOffset, unsigned endOffset, bool isActiveMatch);
+ DocumentMarker(MarkerType, unsigned startOffset, unsigned endOffset, const String& description = String());
+ DocumentMarker(MarkerType, unsigned startOffset, unsigned endOffset, Data&&);
+#if PLATFORM(IOS)
</ins><span class="cx"> DocumentMarker(MarkerType, unsigned startOffset, unsigned endOffset, const String& description, const Vector<String>& alternatives, RetainPtr<id> metadata);
</span><span class="cx"> #endif
</span><del>- DocumentMarker(unsigned startOffset, unsigned endOffset, bool activeMatch);
- DocumentMarker(MarkerType, unsigned startOffset, unsigned endOffset, RefPtr<DocumentMarkerDetails>&&);
</del><span class="cx">
</span><span class="cx"> MarkerType type() const { return m_type; }
</span><span class="cx"> unsigned startOffset() const { return m_startOffset; }
</span><span class="cx"> unsigned endOffset() const { return m_endOffset; }
</span><span class="cx">
</span><del>- WEBCORE_EXPORT const String& description() const;
- bool activeMatch() const;
- DocumentMarkerDetails* details() const;
</del><ins>+ const String& description() const;
</ins><span class="cx">
</span><ins>+ bool isActiveMatch() const;
</ins><span class="cx"> void setActiveMatch(bool);
</span><del>- void clearDetails() { m_details = nullptr; }
</del><span class="cx">
</span><ins>+ const Data& data() const { return m_data; }
+ void clearData() { m_data = false; }
+
</ins><span class="cx"> // Offset modifications are done by DocumentMarkerController.
</span><span class="cx"> // Other classes should not call following setters.
</span><span class="cx"> void setStartOffset(unsigned offset) { m_startOffset = offset; }
</span><span class="lines">@@ -147,76 +166,92 @@
</span><span class="cx"> void setMetadata(id);
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- bool operator==(const DocumentMarker& o) const
- {
- return type() == o.type() && startOffset() == o.startOffset() && endOffset() == o.endOffset();
- }
-
- bool operator!=(const DocumentMarker& o) const
- {
- return !(*this == o);
- }
-
</del><span class="cx"> private:
</span><span class="cx"> MarkerType m_type;
</span><span class="cx"> unsigned m_startOffset;
</span><span class="cx"> unsigned m_endOffset;
</span><del>-#if PLATFORM(IOS)
- // FIXME: See <rdar://problem/9431249>.
- Vector<String> m_alternatives;
- RetainPtr<id> m_metadata;
-#endif
- RefPtr<DocumentMarkerDetails> m_details;
</del><ins>+ Data m_data;
</ins><span class="cx"> };
</span><span class="cx">
</span><del>-inline DocumentMarkerDetails* DocumentMarker::details() const
</del><ins>+inline DocumentMarker::DocumentMarker(unsigned startOffset, unsigned endOffset, bool isActiveMatch)
+ : m_type(TextMatch)
+ , m_startOffset(startOffset)
+ , m_endOffset(endOffset)
+ , m_data(isActiveMatch)
</ins><span class="cx"> {
</span><del>- return m_details.get();
</del><span class="cx"> }
</span><span class="cx">
</span><ins>+inline DocumentMarker::DocumentMarker(MarkerType type, unsigned startOffset, unsigned endOffset, const String& description)
+ : m_type(type)
+ , m_startOffset(startOffset)
+ , m_endOffset(endOffset)
+ , m_data(description)
+{
+}
+
+inline DocumentMarker::DocumentMarker(MarkerType type, unsigned startOffset, unsigned endOffset, Data&& data)
+ : m_type(type)
+ , m_startOffset(startOffset)
+ , m_endOffset(endOffset)
+ , m_data(WTFMove(data))
+{
+}
+
+inline void DocumentMarker::shiftOffsets(int delta)
+{
+ m_startOffset += delta;
+ m_endOffset += delta;
+}
+
+inline const String& DocumentMarker::description() const
+{
+ return WTF::holds_alternative<String>(m_data) ? WTF::get<String>(m_data) : emptyString();
+}
+
+inline bool DocumentMarker::isActiveMatch() const
+{
+ return WTF::holds_alternative<bool>(m_data) && WTF::get<bool>(m_data);
+}
+
+inline void DocumentMarker::setActiveMatch(bool isActiveMatch)
+{
+ ASSERT(m_type == TextMatch);
+ m_data = isActiveMatch;
+}
+
</ins><span class="cx"> #if PLATFORM(IOS)
</span><ins>+
+// FIXME: iOS should share the same dictation mark system with the other platforms <rdar://problem/9431249>.
+
</ins><span class="cx"> inline DocumentMarker::DocumentMarker(MarkerType type, unsigned startOffset, unsigned endOffset, const String&, const Vector<String>& alternatives, RetainPtr<id> metadata)
</span><span class="cx"> : m_type(type)
</span><span class="cx"> , m_startOffset(startOffset)
</span><span class="cx"> , m_endOffset(endOffset)
</span><del>- , m_alternatives(alternatives)
- , m_metadata(metadata)
</del><ins>+ , m_data(DictationAlternativesData { alternatives, metadata })
</ins><span class="cx"> {
</span><del>- // FIXME: <rdar://problem/11306422> iOS should investigate cleaner merge with ToT Dictation support
</del><span class="cx"> ASSERT(type == DictationPhraseWithAlternatives || type == DictationResult);
</span><span class="cx"> }
</span><del>-#endif
</del><span class="cx">
</span><del>-#if PLATFORM(IOS)
</del><span class="cx"> inline const Vector<String>& DocumentMarker::alternatives() const
</span><span class="cx"> {
</span><del>- ASSERT(m_type == DocumentMarker::DictationPhraseWithAlternatives);
- return m_alternatives;
</del><ins>+ return WTF::get<DictationAlternativesData>(m_data).alternatives;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline void DocumentMarker::setAlternative(const String& alternative, size_t index)
</span><span class="cx"> {
</span><del>- ASSERT(m_type == DocumentMarker::DictationPhraseWithAlternatives);
- m_alternatives[index] = alternative;
</del><ins>+ WTF::get<DictationAlternativesData>(m_data).alternatives[index] = alternative;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline id DocumentMarker::metadata() const
</span><span class="cx"> {
</span><del>- return m_metadata.get();
</del><ins>+ return WTF::get<DictationAlternativesData>(m_data).metadata.get();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline void DocumentMarker::setMetadata(id metadata)
</span><span class="cx"> {
</span><del>- m_metadata = metadata;
</del><ins>+ WTF::get<DictationAlternativesData>(m_data).metadata = metadata;
</ins><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><del>-class DocumentMarkerDetails : public RefCounted<DocumentMarkerDetails> {
-public:
- DocumentMarkerDetails() { }
- virtual ~DocumentMarkerDetails();
- virtual bool isDescription() const { return false; }
- virtual bool isTextMatch() const { return false; }
-};
-
</del><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentMarkerControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DocumentMarkerController.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DocumentMarkerController.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/DocumentMarkerController.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -84,12 +84,11 @@
</span><span class="cx"> addMarker(node, DocumentMarker(type, startOffset, startOffset + length));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void DocumentMarkerController::addMarkerToNode(Node* node, unsigned startOffset, unsigned length, DocumentMarker::MarkerType type, RefPtr<DocumentMarkerDetails>&& details)
</del><ins>+void DocumentMarkerController::addMarkerToNode(Node* node, unsigned startOffset, unsigned length, DocumentMarker::MarkerType type, DocumentMarker::Data&& data)
</ins><span class="cx"> {
</span><del>- addMarker(node, DocumentMarker(type, startOffset, startOffset + length, WTFMove(details)));
</del><ins>+ addMarker(node, DocumentMarker(type, startOffset, startOffset + length, WTFMove(data)));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-
</del><span class="cx"> void DocumentMarkerController::addTextMatchMarker(const Range* range, bool activeMatch)
</span><span class="cx"> {
</span><span class="cx"> for (TextIterator markedText(range); !markedText.atEnd(); markedText.advance()) {
</span><span class="lines">@@ -101,6 +100,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><ins>+
</ins><span class="cx"> void DocumentMarkerController::addMarker(Range* range, DocumentMarker::MarkerType type, const String& description, const Vector<String>& interpretations, const RetainPtr<id>& metadata)
</span><span class="cx"> {
</span><span class="cx"> for (TextIterator markedText(range); !markedText.atEnd(); markedText.advance()) {
</span><span class="lines">@@ -132,6 +132,7 @@
</span><span class="cx"> addMarker(&textPiece->startContainer(), DocumentMarker(DocumentMarker::DictationResult, textPiece->startOffset(), textPiece->endOffset(), String(), Vector<String>(), metadata));
</span><span class="cx"> }
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> void DocumentMarkerController::removeMarkers(Range* range, DocumentMarker::MarkerTypes markerTypes, RemovePartiallyOverlappingMarkerOrNot shouldRemovePartiallyOverlappingMarker)
</span><span class="lines">@@ -785,7 +786,7 @@
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- marker.clearDetails();
</del><ins>+ marker.clearData();
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -798,7 +799,7 @@
</span><span class="cx"> Node* node = marker.key.get();
</span><span class="cx"> fprintf(stderr, "%p", node);
</span><span class="cx"> for (auto& documentMarker : *marker.value)
</span><del>- fprintf(stderr, " %d:[%d:%d](%d)", documentMarker.type(), documentMarker.startOffset(), documentMarker.endOffset(), documentMarker.activeMatch());
</del><ins>+ fprintf(stderr, " %d:[%d:%d](%d)", documentMarker.type(), documentMarker.startOffset(), documentMarker.endOffset(), documentMarker.isActiveMatch());
</ins><span class="cx">
</span><span class="cx"> fprintf(stderr, "\n");
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentMarkerControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DocumentMarkerController.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DocumentMarkerController.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/DocumentMarkerController.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx"> void addMarker(Range*, DocumentMarker::MarkerType);
</span><span class="cx"> void addMarker(Range*, DocumentMarker::MarkerType, const String& description);
</span><span class="cx"> void addMarkerToNode(Node*, unsigned startOffset, unsigned length, DocumentMarker::MarkerType);
</span><del>- void addMarkerToNode(Node*, unsigned startOffset, unsigned length, DocumentMarker::MarkerType, RefPtr<DocumentMarkerDetails>&&);
</del><ins>+ void addMarkerToNode(Node*, unsigned startOffset, unsigned length, DocumentMarker::MarkerType, DocumentMarker::Data&&);
</ins><span class="cx"> WEBCORE_EXPORT void addTextMatchMarker(const Range*, bool activeMatch);
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> void addMarker(Range*, DocumentMarker::MarkerType, const String& description, const Vector<String>& interpretations, const RetainPtr<id>& metadata);
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DocumentParser.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DocumentParser.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/DocumentParser.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx">
</span><span class="cx"> // FIXME: append() should be private, but DocumentWriter::replaceDocument uses it for now.
</span><span class="cx"> // FIXME: This really should take a std::unique_ptr to signify that it expects to take
</span><del>- // ownership of the buffer. The parser expects the PassRefPtr to hold the only ref of the StringImpl.
</del><ins>+ // ownership of the buffer. The parser expects the RefPtr to hold the only ref of the StringImpl.
</ins><span class="cx"> virtual void append(RefPtr<StringImpl>&&) = 0;
</span><span class="cx">
</span><span class="cx"> virtual void finish() = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/Element.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -3316,7 +3316,7 @@
</span><span class="cx"> updateLabel(treeScope(), oldValue, newValue);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (std::unique_ptr<MutationObserverInterestGroup> recipients = MutationObserverInterestGroup::createForAttributesMutation(*this, name))
</del><ins>+ if (auto recipients = MutationObserverInterestGroup::createForAttributesMutation(*this, name))
</ins><span class="cx"> recipients->enqueueMutationRecord(MutationRecord::createAttributes(*this, name, oldValue));
</span><span class="cx">
</span><span class="cx"> InspectorInstrumentation::willModifyDOMAttr(document(), *this, oldValue, newValue);
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Event.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Event.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/Event.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -150,11 +150,6 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool Event::isDragEvent() const
-{
- return false;
-}
-
</del><span class="cx"> bool Event::isClipboardEvent() const
</span><span class="cx"> {
</span><span class="cx"> return false;
</span><span class="lines">@@ -185,11 +180,6 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Ref<Event> Event::cloneFor(HTMLIFrameElement*) const
-{
- return Event::create(type(), bubbles(), cancelable());
-}
-
</del><span class="cx"> void Event::setTarget(RefPtr<EventTarget>&& target)
</span><span class="cx"> {
</span><span class="cx"> if (m_target == target)
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Event.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Event.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/Event.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -144,9 +144,6 @@
</span><span class="cx"> virtual bool isCompositionEvent() const;
</span><span class="cx"> virtual bool isTouchEvent() const;
</span><span class="cx">
</span><del>- // Drag events are a subset of mouse events.
- virtual bool isDragEvent() const;
-
</del><span class="cx"> // These events lack a DOM interface.
</span><span class="cx"> virtual bool isClipboardEvent() const;
</span><span class="cx"> virtual bool isBeforeTextInsertedEvent() const;
</span><span class="lines">@@ -187,8 +184,6 @@
</span><span class="cx">
</span><span class="cx"> bool isBeingDispatched() const { return eventPhase(); }
</span><span class="cx">
</span><del>- virtual Ref<Event> cloneFor(HTMLIFrameElement*) const;
-
</del><span class="cx"> virtual EventTarget* relatedTarget() const { return nullptr; }
</span><span class="cx">
</span><span class="cx"> protected:
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/EventContext.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/EventContext.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/EventContext.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -91,6 +91,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span><ins>+
</ins><span class="cx"> TouchEventContext::TouchEventContext(Node* node, EventTarget* currentTarget, EventTarget* target)
</span><span class="cx"> : EventContext(node, currentTarget, target)
</span><span class="cx"> , m_touches(TouchList::create())
</span><span class="lines">@@ -124,6 +125,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if !ASSERT_DISABLED
</span><ins>+
</ins><span class="cx"> void TouchEventContext::checkReachability(TouchList* touchList) const
</span><span class="cx"> {
</span><span class="cx"> size_t length = touchList->length();
</span><span class="lines">@@ -130,6 +132,7 @@
</span><span class="cx"> for (size_t i = 0; i < length; ++i)
</span><span class="cx"> ASSERT(!isUnreachableNode(touchList->item(i)->target()->toNode()));
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(TOUCH_EVENTS) && !PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/EventContext.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/EventContext.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/EventContext.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -26,17 +26,12 @@
</span><span class="cx">
</span><span class="cx"> #pragma once
</span><span class="cx">
</span><del>-#include "EventTarget.h"
</del><span class="cx"> #include "Node.h"
</span><span class="cx"> #include "TreeScope.h"
</span><del>-#include <wtf/RefPtr.h>
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-class Event;
-#if ENABLE(TOUCH_EVENTS)
</del><span class="cx"> class TouchList;
</span><del>-#endif
</del><span class="cx">
</span><span class="cx"> class EventContext {
</span><span class="cx"> WTF_MAKE_FAST_ALLOCATED;
</span><span class="lines">@@ -57,6 +52,7 @@
</span><span class="cx"> #if !ASSERT_DISABLED
</span><span class="cx"> bool isUnreachableNode(EventTarget*) const;
</span><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> RefPtr<Node> m_node;
</span><span class="cx"> RefPtr<EventTarget> m_currentTarget;
</span><span class="cx"> RefPtr<EventTarget> m_target;
</span><span class="lines">@@ -66,17 +62,19 @@
</span><span class="cx"> public:
</span><span class="cx"> MouseOrFocusEventContext(Node*, EventTarget* currentTarget, EventTarget*);
</span><span class="cx"> virtual ~MouseOrFocusEventContext();
</span><del>- EventTarget* relatedTarget() const { return m_relatedTarget.get(); }
- void setRelatedTarget(PassRefPtr<EventTarget>);
- void handleLocalEvents(Event&) const override;
- bool isMouseOrFocusEventContext() const override;
</del><span class="cx">
</span><ins>+ Node* relatedTarget() const { return m_relatedTarget.get(); }
+ void setRelatedTarget(Node*);
+
</ins><span class="cx"> private:
</span><del>- RefPtr<EventTarget> m_relatedTarget;
</del><ins>+ void handleLocalEvents(Event&) const final;
+ bool isMouseOrFocusEventContext() const final;
+
+ RefPtr<Node> m_relatedTarget;
</ins><span class="cx"> };
</span><span class="cx">
</span><ins>+#if ENABLE(TOUCH_EVENTS)
</ins><span class="cx">
</span><del>-#if ENABLE(TOUCH_EVENTS)
</del><span class="cx"> class TouchEventContext final : public EventContext {
</span><span class="cx"> public:
</span><span class="cx"> TouchEventContext(Node*, EventTarget* currentTarget, EventTarget*);
</span><span class="lines">@@ -86,21 +84,7 @@
</span><span class="cx"> bool isTouchEventContext() const override;
</span><span class="cx">
</span><span class="cx"> enum TouchListType { Touches, TargetTouches, ChangedTouches, NotTouchList };
</span><del>- TouchList* touchList(TouchListType type)
- {
- switch (type) {
- case Touches:
- return m_touches.get();
- case TargetTouches:
- return m_targetTouches.get();
- case ChangedTouches:
- return m_changedTouches.get();
- case NotTouchList:
- break;
- }
- ASSERT_NOT_REACHED();
- return nullptr;
- }
</del><ins>+ TouchList* touchList(TouchListType);
</ins><span class="cx">
</span><span class="cx"> TouchList* touches() { return m_touches.get(); }
</span><span class="cx"> TouchList* targetTouches() { return m_targetTouches.get(); }
</span><span class="lines">@@ -107,41 +91,53 @@
</span><span class="cx"> TouchList* changedTouches() { return m_changedTouches.get(); }
</span><span class="cx">
</span><span class="cx"> private:
</span><ins>+#if !ASSERT_DISABLED
+ void checkReachability(TouchList*) const;
+#endif
+
</ins><span class="cx"> RefPtr<TouchList> m_touches;
</span><span class="cx"> RefPtr<TouchList> m_targetTouches;
</span><span class="cx"> RefPtr<TouchList> m_changedTouches;
</span><del>-#if !ASSERT_DISABLED
- void checkReachability(TouchList*) const;
-#endif
</del><span class="cx"> };
</span><span class="cx">
</span><del>-inline TouchEventContext& toTouchEventContext(EventContext& eventContext)
-{
- ASSERT_WITH_SECURITY_IMPLICATION(eventContext.isTouchEventContext());
- return static_cast<TouchEventContext&>(eventContext);
-}
</del><ins>+#endif // ENABLE(TOUCH_EVENTS)
</ins><span class="cx">
</span><del>-inline TouchEventContext* toTouchEventContext(EventContext* eventContext)
-{
- ASSERT_WITH_SECURITY_IMPLICATION(!eventContext || eventContext->isTouchEventContext());
- return static_cast<TouchEventContext*>(eventContext);
-}
-#endif // ENABLE(TOUCH_EVENTS) && !PLATFORM(IOS)
</del><ins>+#if !ASSERT_DISABLED
</ins><span class="cx">
</span><del>-#if !ASSERT_DISABLED
</del><span class="cx"> inline bool EventContext::isUnreachableNode(EventTarget* target) const
</span><span class="cx"> {
</span><span class="cx"> // FIXME: Checks also for SVG elements.
</span><span class="cx"> return target && target->toNode() && !target->toNode()->isSVGElement() && m_node->isClosedShadowHidden(*target->toNode());
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><del>-inline void MouseOrFocusEventContext::setRelatedTarget(PassRefPtr<EventTarget> relatedTarget)
</del><ins>+inline void MouseOrFocusEventContext::setRelatedTarget(Node* relatedTarget)
</ins><span class="cx"> {
</span><del>- ASSERT(!isUnreachableNode(relatedTarget.get()));
</del><ins>+ ASSERT(!isUnreachableNode(relatedTarget));
</ins><span class="cx"> m_relatedTarget = relatedTarget;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#if ENABLE(TOUCH_EVENTS)
+
+inline TouchList* TouchEventContext::touchList(TouchListType type)
+{
+ switch (type) {
+ case Touches:
+ return m_touches.get();
+ case TargetTouches:
+ return m_targetTouches.get();
+ case ChangedTouches:
+ return m_changedTouches.get();
+ case NotTouchList:
+ break;
+ }
+ ASSERT_NOT_REACHED();
+ return nullptr;
+}
+
+#endif
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::MouseOrFocusEventContext)
</span></span></pre></div>
<a id="trunkSourceWebCoredomMessageEventcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/MessageEvent.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/MessageEvent.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/MessageEvent.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -152,21 +152,6 @@
</span><span class="cx"> m_ports = WTFMove(ports);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId, std::optional<MessageEventSource>&& source, Vector<RefPtr<MessagePort>>&& ports)
-{
- if (dispatched())
- return;
-
- initEvent(type, canBubble, cancelable);
-
- m_dataType = DataTypeSerializedScriptValue;
- m_dataAsSerializedScriptValue = data;
- m_origin = origin;
- m_lastEventId = lastEventId;
- m_source = WTFMove(source);
- m_ports = WTFMove(ports);
-}
-
</del><span class="cx"> EventTarget* MessageEvent::source() const
</span><span class="cx"> {
</span><span class="cx"> if (!m_source)
</span></span></pre></div>
<a id="trunkSourceWebCoredomMessageEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/MessageEvent.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/MessageEvent.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/MessageEvent.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -61,7 +61,6 @@
</span><span class="cx"> virtual ~MessageEvent();
</span><span class="cx">
</span><span class="cx"> void initMessageEvent(JSC::ExecState&, const AtomicString& type, bool canBubble, bool cancelable, JSC::JSValue data, const String& origin, const String& lastEventId, std::optional<MessageEventSource>&&, Vector<RefPtr<MessagePort>>&&);
</span><del>- void initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId, std::optional<MessageEventSource>&&, Vector<RefPtr<MessagePort>>&&);
</del><span class="cx">
</span><span class="cx"> const String& origin() const { return m_origin; }
</span><span class="cx"> const String& lastEventId() const { return m_lastEventId; }
</span><span class="lines">@@ -71,8 +70,6 @@
</span><span class="cx"> // FIXME: Remove this when we have custom ObjC binding support.
</span><span class="cx"> SerializedScriptValue* data() const;
</span><span class="cx">
</span><del>- EventInterface eventInterface() const override;
-
</del><span class="cx"> enum DataType {
</span><span class="cx"> DataTypeScriptValue,
</span><span class="cx"> DataTypeSerializedScriptValue,
</span><span class="lines">@@ -82,13 +79,13 @@
</span><span class="cx"> };
</span><span class="cx"> DataType dataType() const { return m_dataType; }
</span><span class="cx"> JSC::JSValue dataAsScriptValue() const { ASSERT(m_dataType == DataTypeScriptValue); return m_dataAsScriptValue; }
</span><del>- PassRefPtr<SerializedScriptValue> dataAsSerializedScriptValue() const { ASSERT(m_dataType == DataTypeSerializedScriptValue); return m_dataAsSerializedScriptValue; }
</del><ins>+ SerializedScriptValue* dataAsSerializedScriptValue() const { ASSERT(m_dataType == DataTypeSerializedScriptValue); return m_dataAsSerializedScriptValue.get(); }
</ins><span class="cx"> String dataAsString() const { ASSERT(m_dataType == DataTypeString); return m_dataAsString; }
</span><span class="cx"> Blob* dataAsBlob() const { ASSERT(m_dataType == DataTypeBlob); return m_dataAsBlob.get(); }
</span><span class="cx"> ArrayBuffer* dataAsArrayBuffer() const { ASSERT(m_dataType == DataTypeArrayBuffer); return m_dataAsArrayBuffer.get(); }
</span><span class="cx">
</span><span class="cx"> RefPtr<SerializedScriptValue> trySerializeData(JSC::ExecState*);
</span><del>-
</del><ins>+
</ins><span class="cx"> private:
</span><span class="cx"> MessageEvent();
</span><span class="cx"> MessageEvent(JSC::ExecState&, const AtomicString&, Init&&, IsTrusted);
</span><span class="lines">@@ -98,6 +95,8 @@
</span><span class="cx"> MessageEvent(Ref<Blob>&& data, const String& origin);
</span><span class="cx"> MessageEvent(Ref<ArrayBuffer>&& data, const String& origin);
</span><span class="cx">
</span><ins>+ EventInterface eventInterface() const final;
+
</ins><span class="cx"> DataType m_dataType;
</span><span class="cx"> Deprecated::ScriptValue m_dataAsScriptValue;
</span><span class="cx"> RefPtr<SerializedScriptValue> m_dataAsSerializedScriptValue;
</span></span></pre></div>
<a id="trunkSourceWebCoredomMouseEventcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/MouseEvent.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/MouseEvent.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/MouseEvent.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> * Copyright (C) 2001 Peter Kelly (pmk@post.com)
</span><span class="cx"> * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de)
</span><span class="cx"> * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
</span><del>- * Copyright (C) 2003, 2005, 2006, 2008, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2003-2016 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * This library is free software; you can redistribute it and/or
</span><span class="cx"> * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -38,7 +38,7 @@
</span><span class="cx"> return adoptRef(*new MouseEvent(type, initializer, isTrusted));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Ref<MouseEvent> MouseEvent::create(const AtomicString& eventType, DOMWindow* view, const PlatformMouseEvent& event, int detail, PassRefPtr<Node> relatedTarget)
</del><ins>+Ref<MouseEvent> MouseEvent::create(const AtomicString& eventType, DOMWindow* view, const PlatformMouseEvent& event, int detail, Node* relatedTarget)
</ins><span class="cx"> {
</span><span class="cx"> bool isMouseEnterOrLeave = eventType == eventNames().mouseenterEvent || eventType == eventNames().mouseleaveEvent;
</span><span class="cx"> bool isCancelable = eventType != eventNames().mousemoveEvent && !isMouseEnterOrLeave;
</span><span class="lines">@@ -57,56 +57,35 @@
</span><span class="cx"> #if ENABLE(POINTER_LOCK)
</span><span class="cx"> int movementX, int movementY,
</span><span class="cx"> #endif
</span><del>- bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, PassRefPtr<EventTarget> relatedTarget, double force, unsigned short syntheticClickType)
-
</del><ins>+ bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, EventTarget* relatedTarget, double force, unsigned short syntheticClickType, DataTransfer* dataTransfer, bool isSimulated)
</ins><span class="cx"> {
</span><del>- return MouseEvent::create(type, canBubble, cancelable, timestamp, view,
- detail, screenX, screenY, pageX, pageY,
-#if ENABLE(POINTER_LOCK)
- movementX, movementY,
-#endif
- ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, force, syntheticClickType, 0, false);
-}
-
-Ref<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, DOMWindow* view, int detail, int screenX, int screenY, int pageX, int pageY,
-#if ENABLE(POINTER_LOCK)
- int movementX, int movementY,
-#endif
- bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, PassRefPtr<EventTarget> relatedTarget, double force, unsigned short syntheticClickType, PassRefPtr<DataTransfer> dataTransfer, bool isSimulated)
-{
</del><span class="cx"> return adoptRef(*new MouseEvent(type, canBubble, cancelable, timestamp, view,
</span><del>- detail, screenX, screenY, pageX, pageY,
</del><ins>+ detail, { screenX, screenY }, { pageX, pageY },
</ins><span class="cx"> #if ENABLE(POINTER_LOCK)
</span><del>- movementX, movementY,
</del><ins>+ { movementX, movementY },
</ins><span class="cx"> #endif
</span><span class="cx"> ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, force, syntheticClickType, dataTransfer, isSimulated));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Ref<MouseEvent> MouseEvent::create(const AtomicString& eventType, bool canBubble, bool cancelable, DOMWindow* view, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, unsigned short syntheticClickType, PassRefPtr<EventTarget> relatedTarget)
</del><ins>+Ref<MouseEvent> MouseEvent::create(const AtomicString& eventType, bool canBubble, bool cancelable, DOMWindow* view, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, unsigned short syntheticClickType, EventTarget* relatedTarget)
</ins><span class="cx"> {
</span><del>- return adoptRef(*new MouseEvent(eventType, canBubble, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, syntheticClickType, relatedTarget));
</del><ins>+ return adoptRef(*new MouseEvent(eventType, canBubble, cancelable, view, detail, { screenX, screenY }, { clientX, clientY }, ctrlKey, altKey, shiftKey, metaKey, button, syntheticClickType, relatedTarget));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> MouseEvent::MouseEvent()
</span><del>- : m_button(0)
- , m_buttonDown(false)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-MouseEvent::MouseEvent(const AtomicString& eventType, bool canBubble, bool cancelable, double timestamp, DOMWindow* view,
- int detail, int screenX, int screenY, int pageX, int pageY,
</del><ins>+MouseEvent::MouseEvent(const AtomicString& eventType, bool canBubble, bool cancelable, double timestamp, DOMWindow* view, int detail, const IntPoint& screenLocation, const IntPoint& windowLocation,
</ins><span class="cx"> #if ENABLE(POINTER_LOCK)
</span><del>- int movementX, int movementY,
</del><ins>+ const IntPoint& movementDelta,
</ins><span class="cx"> #endif
</span><del>- bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
- unsigned short button, PassRefPtr<EventTarget> relatedTarget, double force, unsigned short syntheticClickType,
- PassRefPtr<DataTransfer> dataTransfer, bool isSimulated)
- : MouseRelatedEvent(eventType, canBubble, cancelable, timestamp, view, detail, IntPoint(screenX, screenY),
- IntPoint(pageX, pageY),
</del><ins>+ bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, EventTarget* relatedTarget, double force, unsigned short syntheticClickType, DataTransfer* dataTransfer, bool isSimulated)
+ : MouseRelatedEvent(eventType, canBubble, cancelable, timestamp, view, detail, screenLocation, windowLocation,
</ins><span class="cx"> #if ENABLE(POINTER_LOCK)
</span><del>- IntPoint(movementX, movementY),
</del><ins>+ movementDelta,
</ins><span class="cx"> #endif
</span><del>- ctrlKey, altKey, shiftKey, metaKey, isSimulated)
</del><ins>+ ctrlKey, altKey, shiftKey, metaKey, isSimulated)
</ins><span class="cx"> , m_button(button == (unsigned short)-1 ? 0 : button)
</span><span class="cx"> , m_syntheticClickType(button == (unsigned short)-1 ? 0 : syntheticClickType)
</span><span class="cx"> , m_buttonDown(button != (unsigned short)-1)
</span><span class="lines">@@ -116,10 +95,10 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-MouseEvent::MouseEvent(const AtomicString& eventType, bool canBubble, bool cancelable, DOMWindow* view, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, unsigned short syntheticClickType, PassRefPtr<EventTarget> relatedTarget)
- : MouseRelatedEvent(eventType, canBubble, cancelable, WTF::currentTime(), view, detail, IntPoint(screenX, screenY), IntPoint(0, 0),
</del><ins>+MouseEvent::MouseEvent(const AtomicString& eventType, bool canBubble, bool cancelable, DOMWindow* view, int detail, const IntPoint& screenLocation, const IntPoint& clientLocation, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, unsigned short syntheticClickType, EventTarget* relatedTarget)
+ : MouseRelatedEvent(eventType, canBubble, cancelable, WTF::currentTime(), view, detail, screenLocation, { },
</ins><span class="cx"> #if ENABLE(POINTER_LOCK)
</span><del>- IntPoint(0, 0),
</del><ins>+ { },
</ins><span class="cx"> #endif
</span><span class="cx"> ctrlKey, altKey, shiftKey, metaKey, false)
</span><span class="cx"> , m_button(button == (unsigned short)-1 ? 0 : button)
</span><span class="lines">@@ -127,7 +106,7 @@
</span><span class="cx"> , m_buttonDown(button != (unsigned short)-1)
</span><span class="cx"> , m_relatedTarget(relatedTarget)
</span><span class="cx"> {
</span><del>- initCoordinates(IntPoint(clientX, clientY));
</del><ins>+ initCoordinates(clientLocation);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> MouseEvent::MouseEvent(const AtomicString& eventType, const MouseEventInit& initializer, IsTrusted isTrusted)
</span><span class="lines">@@ -135,9 +114,8 @@
</span><span class="cx"> , m_button(initializer.button == (unsigned short)-1 ? 0 : initializer.button)
</span><span class="cx"> , m_buttonDown(initializer.button != (unsigned short)-1)
</span><span class="cx"> , m_relatedTarget(initializer.relatedTarget)
</span><del>- , m_dataTransfer(0 /* dataTransfer */)
</del><span class="cx"> {
</span><del>- initCoordinates(IntPoint(initializer.clientX, initializer.clientY));
</del><ins>+ initCoordinates({ initializer.clientX, initializer.clientY });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> MouseEvent::~MouseEvent()
</span><span class="lines">@@ -144,10 +122,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MouseEvent::initMouseEvent(const AtomicString& type, bool canBubble, bool cancelable, DOMWindow* view,
- int detail, int screenX, int screenY, int clientX, int clientY,
- bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
- unsigned short button, PassRefPtr<EventTarget> relatedTarget)
</del><ins>+void MouseEvent::initMouseEvent(const AtomicString& type, bool canBubble, bool cancelable, DOMWindow* view, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, EventTarget* relatedTarget)
</ins><span class="cx"> {
</span><span class="cx"> if (dispatched())
</span><span class="cx"> return;
</span><span class="lines">@@ -182,9 +157,17 @@
</span><span class="cx">
</span><span class="cx"> bool MouseEvent::isDragEvent() const
</span><span class="cx"> {
</span><del>- const AtomicString& t = type();
- return t == eventNames().dragenterEvent || t == eventNames().dragoverEvent || t == eventNames().dragleaveEvent || t == eventNames().dropEvent
- || t == eventNames().dragstartEvent|| t == eventNames().dragEvent || t == eventNames().dragendEvent;
</del><ins>+ // This function is only used to decide to return nullptr for dataTransfer even when m_dataTransfer is non-null.
+ // FIXME: Is that really valuable? Why will m_dataTransfer be non-null but we need to return null for dataTransfer?
+ // Quite peculiar to decide based on the type string; may have been be provided by call to JavaScript constructor.
+ auto& type = this->type();
+ return type == eventNames().dragEvent
+ || type == eventNames().dragendEvent
+ || type == eventNames().dragenterEvent
+ || type == eventNames().dragleaveEvent
+ || type == eventNames().dragoverEvent
+ || type == eventNames().dragstartEvent
+ || type == eventNames().dropEvent;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool MouseEvent::canTriggerActivationBehavior(const Event& event)
</span><span class="lines">@@ -224,35 +207,4 @@
</span><span class="cx"> return target() ? target()->toNode() : nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-// FIXME: Fix positioning. e.g. We need to consider border/padding.
-// https://bugs.webkit.org/show_bug.cgi?id=93696
-inline static int adjustedClientX(int innerClientX, HTMLIFrameElement* iframe, FrameView* frameView)
-{
- return iframe->offsetLeft() - frameView->scrollX() + innerClientX;
-}
-
-inline static int adjustedClientY(int innerClientY, HTMLIFrameElement* iframe, FrameView* frameView)
-{
- return iframe->offsetTop() - frameView->scrollY() + innerClientY;
-}
-
-Ref<Event> MouseEvent::cloneFor(HTMLIFrameElement* iframe) const
-{
- ASSERT(iframe);
- Frame* frame = iframe->document().frame();
- FrameView* frameView = frame ? frame->view() : nullptr;
- Ref<MouseEvent> clonedMouseEvent = MouseEvent::create(type(), bubbles(), cancelable(),
- iframe->document().defaultView(),
- detail(), screenX(), screenY(),
- frameView ? adjustedClientX(clientX(), iframe, frameView) : 0,
- frameView ? adjustedClientY(clientY(), iframe, frameView) : 0,
- ctrlKey(), altKey(), shiftKey(), metaKey(),
- button(),
- syntheticClickType(),
- // Nullifies relatedTarget.
- 0);
- clonedMouseEvent->setForce(force());
- return WTFMove(clonedMouseEvent);
-}
-
</del><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoredomMouseEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/MouseEvent.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/MouseEvent.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/MouseEvent.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -33,42 +33,23 @@
</span><span class="cx">
</span><span class="cx"> class MouseEvent : public MouseRelatedEvent {
</span><span class="cx"> public:
</span><del>- static Ref<MouseEvent> create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, DOMWindow*,
- int detail, int screenX, int screenY, int pageX, int pageY,
</del><ins>+ WEBCORE_EXPORT static Ref<MouseEvent> create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, DOMWindow*, int detail, int screenX, int screenY, int pageX, int pageY,
</ins><span class="cx"> #if ENABLE(POINTER_LOCK)
</span><span class="cx"> int movementX, int movementY,
</span><span class="cx"> #endif
</span><del>- bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
- PassRefPtr<EventTarget> relatedTarget, double force, unsigned short syntheticClickType);
</del><ins>+ bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, EventTarget* relatedTarget, double force, unsigned short syntheticClickType, DataTransfer* = nullptr, bool isSimulated = false);
</ins><span class="cx">
</span><del>- WEBCORE_EXPORT static Ref<MouseEvent> create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, DOMWindow*,
- int detail, int screenX, int screenY, int pageX, int pageY,
-#if ENABLE(POINTER_LOCK)
- int movementX, int movementY,
-#endif
- bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
- PassRefPtr<EventTarget> relatedTarget, double force, unsigned short syntheticClickType, PassRefPtr<DataTransfer>, bool isSimulated = false);
</del><ins>+ WEBCORE_EXPORT static Ref<MouseEvent> create(const AtomicString& eventType, DOMWindow*, const PlatformMouseEvent&, int detail, Node* relatedTarget);
</ins><span class="cx">
</span><del>- WEBCORE_EXPORT static Ref<MouseEvent> create(const AtomicString& eventType, DOMWindow*, const PlatformMouseEvent&, int detail, PassRefPtr<Node> relatedTarget);
</del><ins>+ static Ref<MouseEvent> create(const AtomicString& eventType, bool canBubble, bool cancelable, DOMWindow*, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, unsigned short syntheticClickType, EventTarget* relatedTarget);
</ins><span class="cx">
</span><del>- static Ref<MouseEvent> create(const AtomicString& eventType, bool canBubble, bool cancelable, DOMWindow*,
- int detail, int screenX, int screenY, int clientX, int clientY,
- bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
- unsigned short button, unsigned short syntheticClickType, PassRefPtr<EventTarget> relatedTarget);
</del><ins>+ static Ref<MouseEvent> createForBindings() { return adoptRef(*new MouseEvent); }
</ins><span class="cx">
</span><del>- static Ref<MouseEvent> createForBindings()
- {
- return adoptRef(*new MouseEvent);
- }
-
</del><span class="cx"> static Ref<MouseEvent> create(const AtomicString& eventType, const MouseEventInit&, IsTrusted = IsTrusted::No);
</span><span class="cx">
</span><span class="cx"> virtual ~MouseEvent();
</span><span class="cx">
</span><del>- WEBCORE_EXPORT void initMouseEvent(const AtomicString& type, bool canBubble, bool cancelable, DOMWindow*,
- int detail, int screenX, int screenY, int clientX, int clientY,
- bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
- unsigned short button, PassRefPtr<EventTarget> relatedTarget);
</del><ins>+ WEBCORE_EXPORT void initMouseEvent(const AtomicString& type, bool canBubble, bool cancelable, DOMWindow*, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, EventTarget* relatedTarget);
</ins><span class="cx">
</span><span class="cx"> // WinIE uses 1,4,2 for left/middle/right but not for click (just for mousedown/up, maybe others),
</span><span class="cx"> // but we will match the standard DOM.
</span><span class="lines">@@ -76,7 +57,7 @@
</span><span class="cx"> unsigned short syntheticClickType() const { return m_syntheticClickType; }
</span><span class="cx"> bool buttonDown() const { return m_buttonDown; }
</span><span class="cx"> EventTarget* relatedTarget() const final { return m_relatedTarget.get(); }
</span><del>- void setRelatedTarget(PassRefPtr<EventTarget> relatedTarget) { m_relatedTarget = relatedTarget; }
</del><ins>+ void setRelatedTarget(EventTarget* relatedTarget) { m_relatedTarget = relatedTarget; }
</ins><span class="cx"> double force() const { return m_force; }
</span><span class="cx"> void setForce(double force) { m_force = force; }
</span><span class="cx">
</span><span class="lines">@@ -85,29 +66,23 @@
</span><span class="cx">
</span><span class="cx"> DataTransfer* dataTransfer() const { return isDragEvent() ? m_dataTransfer.get() : nullptr; }
</span><span class="cx">
</span><del>- EventInterface eventInterface() const override;
</del><ins>+ static bool canTriggerActivationBehavior(const Event&);
</ins><span class="cx">
</span><del>- bool isMouseEvent() const override;
- bool isDragEvent() const override;
- static bool canTriggerActivationBehavior(const Event&);
</del><ins>+ int which() const final;
</ins><span class="cx">
</span><del>- int which() const override;
-
- Ref<Event> cloneFor(HTMLIFrameElement*) const override;
-
</del><span class="cx"> protected:
</span><span class="cx"> MouseEvent(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, DOMWindow*,
</span><del>- int detail, int screenX, int screenY, int pageX, int pageY,
</del><ins>+ int detail, const IntPoint& screenLocation, const IntPoint& windowLocation,
</ins><span class="cx"> #if ENABLE(POINTER_LOCK)
</span><del>- int movementX, int movementY,
</del><ins>+ const IntPoint& movementDelta,
</ins><span class="cx"> #endif
</span><span class="cx"> bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
</span><del>- PassRefPtr<EventTarget> relatedTarget, double force, unsigned short syntheticClickType, PassRefPtr<DataTransfer>, bool isSimulated);
</del><ins>+ EventTarget* relatedTarget, double force, unsigned short syntheticClickType, DataTransfer*, bool isSimulated);
</ins><span class="cx">
</span><span class="cx"> MouseEvent(const AtomicString& type, bool canBubble, bool cancelable, DOMWindow*,
</span><del>- int detail, int screenX, int screenY, int clientX, int clientY,
</del><ins>+ int detail, const IntPoint& screenLocation, const IntPoint& clientLocation,
</ins><span class="cx"> bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
</span><del>- unsigned short button, unsigned short syntheticClickType, PassRefPtr<EventTarget> relatedTarget);
</del><ins>+ unsigned short button, unsigned short syntheticClickType, EventTarget* relatedTarget);
</ins><span class="cx">
</span><span class="cx"> MouseEvent(const AtomicString& type, const MouseEventInit&, IsTrusted);
</span><span class="cx">
</span><span class="lines">@@ -114,9 +89,14 @@
</span><span class="cx"> MouseEvent();
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- unsigned short m_button;
- unsigned short m_syntheticClickType;
- bool m_buttonDown;
</del><ins>+ bool isMouseEvent() const final;
+ EventInterface eventInterface() const override;
+
+ bool isDragEvent() const;
+
+ unsigned short m_button { 0 };
+ unsigned short m_syntheticClickType { 0 };
+ bool m_buttonDown { false };
</ins><span class="cx"> RefPtr<EventTarget> m_relatedTarget;
</span><span class="cx"> double m_force { 0 };
</span><span class="cx"> RefPtr<DataTransfer> m_dataTransfer;
</span></span></pre></div>
<a id="trunkSourceWebCoredomMutationEventcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/MutationEvent.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/MutationEvent.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/MutationEvent.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -23,34 +23,18 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "MutationEvent.h"
</span><span class="cx">
</span><del>-
</del><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-MutationEvent::MutationEvent()
- : m_attrChange(0)
-{
-}
-
-MutationEvent::MutationEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<Node> relatedNode,
- const String& prevValue, const String& newValue,
- const String& attrName, unsigned short attrChange)
</del><ins>+MutationEvent::MutationEvent(const AtomicString& type, bool canBubble, bool cancelable, Node* relatedNode, const String& prevValue, const String& newValue)
</ins><span class="cx"> : Event(type, canBubble, cancelable)
</span><span class="cx"> , m_relatedNode(relatedNode)
</span><span class="cx"> , m_prevValue(prevValue)
</span><span class="cx"> , m_newValue(newValue)
</span><del>- , m_attrName(attrName)
- , m_attrChange(attrChange)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-MutationEvent::~MutationEvent()
</del><ins>+void MutationEvent::initMutationEvent(const AtomicString& type, bool canBubble, bool cancelable, Node* relatedNode, const String& prevValue, const String& newValue, const String& attrName, unsigned short attrChange)
</ins><span class="cx"> {
</span><del>-}
-
-void MutationEvent::initMutationEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<Node> relatedNode,
- const String& prevValue, const String& newValue,
- const String& attrName, unsigned short attrChange)
-{
</del><span class="cx"> if (isBeingDispatched())
</span><span class="cx"> return;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomMutationEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/MutationEvent.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/MutationEvent.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/MutationEvent.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -28,50 +28,43 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>- class MutationEvent final : public Event {
- public:
- virtual ~MutationEvent();
</del><ins>+class MutationEvent final : public Event {
+public:
+ enum {
+ MODIFICATION = 1,
+ ADDITION = 2,
+ REMOVAL = 3
+ };
</ins><span class="cx">
</span><del>- enum attrChangeType {
- MODIFICATION = 1,
- ADDITION = 2,
- REMOVAL = 3
- };
</del><ins>+ static Ref<MutationEvent> create(const AtomicString& type, bool canBubble, Node* relatedNode = nullptr, const String& prevValue = String(), const String& newValue = String())
+ {
+ return adoptRef(*new MutationEvent(type, canBubble, false, relatedNode, prevValue, newValue));
+ }
</ins><span class="cx">
</span><del>- static Ref<MutationEvent> create(const AtomicString& type, bool canBubble, PassRefPtr<Node> relatedNode = nullptr,
- const String& prevValue = String(), const String& newValue = String(), const String& attrName = String(), unsigned short attrChange = 0)
- {
- return adoptRef(*new MutationEvent(type, canBubble, false, relatedNode, prevValue, newValue, attrName, attrChange));
- }
</del><ins>+ static Ref<MutationEvent> createForBindings()
+ {
+ return adoptRef(*new MutationEvent);
+ }
</ins><span class="cx">
</span><del>- static Ref<MutationEvent> createForBindings()
- {
- return adoptRef(*new MutationEvent);
- }
</del><ins>+ WEBCORE_EXPORT void initMutationEvent(const AtomicString& type, bool canBubble, bool cancelable, Node* relatedNode, const String& prevValue, const String& newValue, const String& attrName, unsigned short attrChange);
</ins><span class="cx">
</span><del>- WEBCORE_EXPORT void initMutationEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<Node> relatedNode,
- const String& prevValue, const String& newValue,
- const String& attrName, unsigned short attrChange);
</del><ins>+ Node* relatedNode() const { return m_relatedNode.get(); }
+ String prevValue() const { return m_prevValue; }
+ String newValue() const { return m_newValue; }
+ String attrName() const { return m_attrName; }
+ unsigned short attrChange() const { return m_attrChange; }
</ins><span class="cx">
</span><del>- Node* relatedNode() const { return m_relatedNode.get(); }
- String prevValue() const { return m_prevValue; }
- String newValue() const { return m_newValue; }
- String attrName() const { return m_attrName; }
- unsigned short attrChange() const { return m_attrChange; }
</del><ins>+private:
+ MutationEvent() = default;
+ MutationEvent(const AtomicString& type, bool canBubble, bool cancelable, Node* relatedNode, const String& prevValue, const String& newValue);
</ins><span class="cx">
</span><del>- EventInterface eventInterface() const override;
</del><ins>+ EventInterface eventInterface() const final;
</ins><span class="cx">
</span><del>- private:
- MutationEvent();
- MutationEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<Node> relatedNode,
- const String& prevValue, const String& newValue,
- const String& attrName, unsigned short attrChange);
</del><ins>+ RefPtr<Node> m_relatedNode;
+ String m_prevValue;
+ String m_newValue;
+ String m_attrName;
+ unsigned short m_attrChange { 0 };
+};
</ins><span class="cx">
</span><del>- RefPtr<Node> m_relatedNode;
- String m_prevValue;
- String m_newValue;
- String m_attrName;
- unsigned short m_attrChange;
- };
-
</del><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoredomMutationObservercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/MutationObserver.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/MutationObserver.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/MutationObserver.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -100,7 +100,7 @@
</span><span class="cx"> if (!validateOptions(options))
</span><span class="cx"> return Exception { TypeError };
</span><span class="cx">
</span><del>- node.registerMutationObserver(this, options, attributeFilter);
</del><ins>+ node.registerMutationObserver(*this, options, attributeFilter);
</ins><span class="cx">
</span><span class="cx"> return { };
</span><span class="cx"> }
</span><span class="lines">@@ -117,7 +117,7 @@
</span><span class="cx"> m_records.clear();
</span><span class="cx"> HashSet<MutationObserverRegistration*> registrations(m_registrations);
</span><span class="cx"> for (auto* registration : registrations)
</span><del>- MutationObserverRegistration::unregisterAndDelete(registration);
</del><ins>+ registration->node().unregisterMutationObserver(*registration);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MutationObserver::observationStarted(MutationObserverRegistration& registration)
</span></span></pre></div>
<a id="trunkSourceWebCoredomMutationObserverInterestGroupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/MutationObserverInterestGroup.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/MutationObserverInterestGroup.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/MutationObserverInterestGroup.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -37,26 +37,25 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><ins>+inline MutationObserverInterestGroup::MutationObserverInterestGroup(HashMap<MutationObserver*, MutationRecordDeliveryOptions>&& observers, MutationRecordDeliveryOptions oldValueFlag)
+ : m_observers(WTFMove(observers))
+ , m_oldValueFlag(oldValueFlag)
+{
+ ASSERT(!m_observers.isEmpty());
+}
+
</ins><span class="cx"> std::unique_ptr<MutationObserverInterestGroup> MutationObserverInterestGroup::createIfNeeded(Node& target, MutationObserver::MutationType type, MutationRecordDeliveryOptions oldValueFlag, const QualifiedName* attributeName)
</span><span class="cx"> {
</span><span class="cx"> ASSERT((type == MutationObserver::Attributes && attributeName) || !attributeName);
</span><del>- HashMap<MutationObserver*, MutationRecordDeliveryOptions> observers;
- target.getRegisteredMutationObserversOfType(observers, type, attributeName);
</del><ins>+ auto observers = target.registeredMutationObservers(type, attributeName);
</ins><span class="cx"> if (observers.isEmpty())
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span><del>- return std::make_unique<MutationObserverInterestGroup>(observers, oldValueFlag);
</del><ins>+ return std::make_unique<MutationObserverInterestGroup>(WTFMove(observers), oldValueFlag);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-MutationObserverInterestGroup::MutationObserverInterestGroup(HashMap<MutationObserver*, MutationRecordDeliveryOptions>& observers, MutationRecordDeliveryOptions oldValueFlag)
- : m_oldValueFlag(oldValueFlag)
</del><ins>+bool MutationObserverInterestGroup::isOldValueRequested() const
</ins><span class="cx"> {
</span><del>- ASSERT(!observers.isEmpty());
- m_observers.swap(observers);
-}
-
-bool MutationObserverInterestGroup::isOldValueRequested()
-{
</del><span class="cx"> for (auto options : m_observers.values()) {
</span><span class="cx"> if (hasOldValue(options))
</span><span class="cx"> return true;
</span></span></pre></div>
<a id="trunkSourceWebCoredomMutationObserverInterestGrouph"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/MutationObserverInterestGroup.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/MutationObserverInterestGroup.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/MutationObserverInterestGroup.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -32,16 +32,17 @@
</span><span class="cx">
</span><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "MutationObserver.h"
</span><del>-#include "QualifiedName.h"
</del><span class="cx"> #include <memory>
</span><span class="cx"> #include <wtf/HashMap.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><ins>+class QualifiedName;
+
</ins><span class="cx"> class MutationObserverInterestGroup {
</span><span class="cx"> WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>- MutationObserverInterestGroup(HashMap<MutationObserver*, MutationRecordDeliveryOptions>& observers, MutationRecordDeliveryOptions oldValueFlag);
</del><ins>+ MutationObserverInterestGroup(HashMap<MutationObserver*, MutationRecordDeliveryOptions>&&, MutationRecordDeliveryOptions);
</ins><span class="cx">
</span><span class="cx"> static std::unique_ptr<MutationObserverInterestGroup> createForChildListMutation(Node& target)
</span><span class="cx"> {
</span><span class="lines">@@ -68,13 +69,13 @@
</span><span class="cx"> return createIfNeeded(target, MutationObserver::Attributes, MutationObserver::AttributeOldValue, &attributeName);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- bool isOldValueRequested();
</del><ins>+ bool isOldValueRequested() const;
</ins><span class="cx"> void enqueueMutationRecord(Ref<MutationRecord>&&);
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> static std::unique_ptr<MutationObserverInterestGroup> createIfNeeded(Node& target, MutationObserver::MutationType, MutationRecordDeliveryOptions oldValueFlag, const QualifiedName* attributeName = nullptr);
</span><span class="cx">
</span><del>- bool hasOldValue(MutationRecordDeliveryOptions options) { return options & m_oldValueFlag; }
</del><ins>+ bool hasOldValue(MutationRecordDeliveryOptions options) const { return options & m_oldValueFlag; }
</ins><span class="cx">
</span><span class="cx"> HashMap<MutationObserver*, MutationRecordDeliveryOptions> m_observers;
</span><span class="cx"> MutationRecordDeliveryOptions m_oldValueFlag;
</span></span></pre></div>
<a id="trunkSourceWebCoredomMutationObserverRegistrationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/MutationObserverRegistration.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/MutationObserverRegistration.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/MutationObserverRegistration.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -37,9 +37,9 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-MutationObserverRegistration::MutationObserverRegistration(PassRefPtr<MutationObserver> observer, Node* registrationNode, MutationObserverOptions options, const HashSet<AtomicString>& attributeFilter)
</del><ins>+MutationObserverRegistration::MutationObserverRegistration(MutationObserver& observer, Node& node, MutationObserverOptions options, const HashSet<AtomicString>& attributeFilter)
</ins><span class="cx"> : m_observer(observer)
</span><del>- , m_registrationNode(registrationNode)
</del><ins>+ , m_node(node)
</ins><span class="cx"> , m_options(options)
</span><span class="cx"> , m_attributeFilter(attributeFilter)
</span><span class="cx"> {
</span><span class="lines">@@ -59,53 +59,46 @@
</span><span class="cx"> m_attributeFilter = attributeFilter;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MutationObserverRegistration::observedSubtreeNodeWillDetach(Node* node)
</del><ins>+void MutationObserverRegistration::observedSubtreeNodeWillDetach(Node& node)
</ins><span class="cx"> {
</span><span class="cx"> if (!isSubtree())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- node->registerTransientMutationObserver(this);
</del><ins>+ node.registerTransientMutationObserver(*this);
</ins><span class="cx"> m_observer->setHasTransientRegistration();
</span><span class="cx">
</span><span class="cx"> if (!m_transientRegistrationNodes) {
</span><del>- m_transientRegistrationNodes = std::make_unique<NodeHashSet>();
</del><ins>+ m_transientRegistrationNodes = std::make_unique<HashSet<RefPtr<Node>>>();
</ins><span class="cx">
</span><del>- ASSERT(!m_registrationNodeKeepAlive);
- m_registrationNodeKeepAlive = m_registrationNode; // Balanced in clearTransientRegistrations.
</del><ins>+ ASSERT(!m_nodeKeptAlive);
+ m_nodeKeptAlive = &m_node; // Balanced in clearTransientRegistrations.
</ins><span class="cx"> }
</span><del>- m_transientRegistrationNodes->add(node);
</del><ins>+ m_transientRegistrationNodes->add(&node);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MutationObserverRegistration::clearTransientRegistrations()
</span><span class="cx"> {
</span><span class="cx"> if (!m_transientRegistrationNodes) {
</span><del>- ASSERT(!m_registrationNodeKeepAlive);
</del><ins>+ ASSERT(!m_nodeKeptAlive);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> for (auto& node : *m_transientRegistrationNodes)
</span><del>- node->unregisterTransientMutationObserver(this);
</del><ins>+ node->unregisterTransientMutationObserver(*this);
</ins><span class="cx">
</span><span class="cx"> m_transientRegistrationNodes = nullptr;
</span><span class="cx">
</span><del>- ASSERT(m_registrationNodeKeepAlive);
- m_registrationNodeKeepAlive = nullptr; // Balanced in observeSubtreeNodeWillDetach.
</del><ins>+ ASSERT(m_nodeKeptAlive);
+ m_nodeKeptAlive = nullptr; // Balanced in observeSubtreeNodeWillDetach.
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void MutationObserverRegistration::unregisterAndDelete(MutationObserverRegistration* registry)
</del><ins>+bool MutationObserverRegistration::shouldReceiveMutationFrom(Node& node, MutationObserver::MutationType type, const QualifiedName* attributeName) const
</ins><span class="cx"> {
</span><del>- RefPtr<Node> registrationNode(registry->m_registrationNode);
- registrationNode->unregisterMutationObserver(registry);
- // The above line will cause registry to be deleted, so don't do any more in this function.
-}
-
-bool MutationObserverRegistration::shouldReceiveMutationFrom(Node* node, MutationObserver::MutationType type, const QualifiedName* attributeName) const
-{
</del><span class="cx"> ASSERT((type == MutationObserver::Attributes && attributeName) || !attributeName);
</span><span class="cx"> if (!(m_options & type))
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- if (m_registrationNode != node && !isSubtree())
</del><ins>+ if (&m_node != &node && !isSubtree())
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> if (type != MutationObserver::Attributes || !(m_options & MutationObserver::AttributeFilter))
</span><span class="lines">@@ -119,7 +112,7 @@
</span><span class="cx">
</span><span class="cx"> void MutationObserverRegistration::addRegistrationNodesToSet(HashSet<Node*>& nodes) const
</span><span class="cx"> {
</span><del>- nodes.add(m_registrationNode);
</del><ins>+ nodes.add(&m_node);
</ins><span class="cx"> if (!m_transientRegistrationNodes)
</span><span class="cx"> return;
</span><span class="cx"> for (auto& node : *m_transientRegistrationNodes)
</span></span></pre></div>
<a id="trunkSourceWebCoredomMutationObserverRegistrationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/MutationObserverRegistration.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/MutationObserverRegistration.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/MutationObserverRegistration.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -42,19 +42,19 @@
</span><span class="cx"> class MutationObserverRegistration {
</span><span class="cx"> WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>- MutationObserverRegistration(PassRefPtr<MutationObserver>, Node*, MutationObserverOptions, const HashSet<AtomicString>& attributeFilter);
</del><ins>+ MutationObserverRegistration(MutationObserver&, Node&, MutationObserverOptions, const HashSet<AtomicString>& attributeFilter);
</ins><span class="cx"> ~MutationObserverRegistration();
</span><span class="cx">
</span><span class="cx"> void resetObservation(MutationObserverOptions, const HashSet<AtomicString>& attributeFilter);
</span><del>- void observedSubtreeNodeWillDetach(Node*);
</del><ins>+ void observedSubtreeNodeWillDetach(Node&);
</ins><span class="cx"> void clearTransientRegistrations();
</span><span class="cx"> bool hasTransientRegistrations() const { return m_transientRegistrationNodes && !m_transientRegistrationNodes->isEmpty(); }
</span><del>- static void unregisterAndDelete(MutationObserverRegistration*);
</del><span class="cx">
</span><del>- bool shouldReceiveMutationFrom(Node*, MutationObserver::MutationType, const QualifiedName* attributeName) const;
</del><ins>+ bool shouldReceiveMutationFrom(Node&, MutationObserver::MutationType, const QualifiedName* attributeName) const;
</ins><span class="cx"> bool isSubtree() const { return m_options & MutationObserver::Subtree; }
</span><span class="cx">
</span><del>- MutationObserver* observer() const { return m_observer.get(); }
</del><ins>+ MutationObserver& observer() { return m_observer.get(); }
+ Node& node() { return m_node; }
</ins><span class="cx"> MutationRecordDeliveryOptions deliveryOptions() const { return m_options & (MutationObserver::AttributeOldValue | MutationObserver::CharacterDataOldValue); }
</span><span class="cx"> MutationObserverOptions mutationTypes() const { return m_options & MutationObserver::AllMutationTypes; }
</span><span class="cx">
</span><span class="lines">@@ -61,12 +61,10 @@
</span><span class="cx"> void addRegistrationNodesToSet(HashSet<Node*>&) const;
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- RefPtr<MutationObserver> m_observer;
- Node* m_registrationNode;
- RefPtr<Node> m_registrationNodeKeepAlive;
- typedef HashSet<RefPtr<Node>> NodeHashSet;
- std::unique_ptr<NodeHashSet> m_transientRegistrationNodes;
-
</del><ins>+ Ref<MutationObserver> m_observer;
+ Node& m_node;
+ RefPtr<Node> m_nodeKeptAlive;
+ std::unique_ptr<HashSet<RefPtr<Node>>> m_transientRegistrationNodes;
</ins><span class="cx"> MutationObserverOptions m_options;
</span><span class="cx"> HashSet<AtomicString> m_attributeFilter;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoredomNamedFlowCollectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/NamedFlowCollection.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/NamedFlowCollection.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/NamedFlowCollection.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -106,12 +106,12 @@
</span><span class="cx">
</span><span class="cx"> Ref<DOMNamedFlowCollection> NamedFlowCollection::createCSSOMSnapshot()
</span><span class="cx"> {
</span><del>- Vector<WebKitNamedFlow*> createdFlows;
</del><ins>+ Vector<Ref<WebKitNamedFlow>> createdFlows;
</ins><span class="cx"> for (auto& namedFlow : m_namedFlows) {
</span><span class="cx"> if (namedFlow->flowState() == WebKitNamedFlow::FlowStateCreated)
</span><del>- createdFlows.append(namedFlow);
</del><ins>+ createdFlows.append(*namedFlow);
</ins><span class="cx"> }
</span><del>- return DOMNamedFlowCollection::create(createdFlows);
</del><ins>+ return DOMNamedFlowCollection::create(WTFMove(createdFlows));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // The HashFunctions object used by the HashSet to compare between NamedFlows.
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/Node.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -2041,10 +2041,10 @@
</span><span class="cx"> Vector<std::unique_ptr<MutationObserverRegistration>>* Node::mutationObserverRegistry()
</span><span class="cx"> {
</span><span class="cx"> if (!hasRareData())
</span><del>- return 0;
- NodeMutationObserverData* data = rareData()->mutationObserverData();
</del><ins>+ return nullptr;
+ auto* data = rareData()->mutationObserverData();
</ins><span class="cx"> if (!data)
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> return &data->registry;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2051,15 +2051,14 @@
</span><span class="cx"> HashSet<MutationObserverRegistration*>* Node::transientMutationObserverRegistry()
</span><span class="cx"> {
</span><span class="cx"> if (!hasRareData())
</span><del>- return 0;
- NodeMutationObserverData* data = rareData()->mutationObserverData();
</del><ins>+ return nullptr;
+ auto* data = rareData()->mutationObserverData();
</ins><span class="cx"> if (!data)
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> return &data->transientRegistry;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template<typename Registry>
-static inline void collectMatchingObserversForMutation(HashMap<MutationObserver*, MutationRecordDeliveryOptions>& observers, Registry* registry, Node* target, MutationObserver::MutationType type, const QualifiedName* attributeName)
</del><ins>+template<typename Registry> static inline void collectMatchingObserversForMutation(HashMap<MutationObserver*, MutationRecordDeliveryOptions>& observers, Registry* registry, Node& target, MutationObserver::MutationType type, const QualifiedName* attributeName)
</ins><span class="cx"> {
</span><span class="cx"> if (!registry)
</span><span class="cx"> return;
</span><span class="lines">@@ -2066,8 +2065,8 @@
</span><span class="cx">
</span><span class="cx"> for (auto& registration : *registry) {
</span><span class="cx"> if (registration->shouldReceiveMutationFrom(target, type, attributeName)) {
</span><del>- MutationRecordDeliveryOptions deliveryOptions = registration->deliveryOptions();
- auto result = observers.add(registration->observer(), deliveryOptions);
</del><ins>+ auto deliveryOptions = registration->deliveryOptions();
+ auto result = observers.add(&registration->observer(), deliveryOptions);
</ins><span class="cx"> if (!result.isNewEntry)
</span><span class="cx"> result.iterator->value |= deliveryOptions;
</span><span class="cx"> }
</span><span class="lines">@@ -2074,31 +2073,33 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void Node::getRegisteredMutationObserversOfType(HashMap<MutationObserver*, MutationRecordDeliveryOptions>& observers, MutationObserver::MutationType type, const QualifiedName* attributeName)
</del><ins>+HashMap<MutationObserver*, MutationRecordDeliveryOptions> Node::registeredMutationObservers(MutationObserver::MutationType type, const QualifiedName* attributeName)
</ins><span class="cx"> {
</span><ins>+ HashMap<MutationObserver*, MutationRecordDeliveryOptions> result;
</ins><span class="cx"> ASSERT((type == MutationObserver::Attributes && attributeName) || !attributeName);
</span><del>- collectMatchingObserversForMutation(observers, mutationObserverRegistry(), this, type, attributeName);
- collectMatchingObserversForMutation(observers, transientMutationObserverRegistry(), this, type, attributeName);
</del><ins>+ collectMatchingObserversForMutation(result, mutationObserverRegistry(), *this, type, attributeName);
+ collectMatchingObserversForMutation(result, transientMutationObserverRegistry(), *this, type, attributeName);
</ins><span class="cx"> for (Node* node = parentNode(); node; node = node->parentNode()) {
</span><del>- collectMatchingObserversForMutation(observers, node->mutationObserverRegistry(), this, type, attributeName);
- collectMatchingObserversForMutation(observers, node->transientMutationObserverRegistry(), this, type, attributeName);
</del><ins>+ collectMatchingObserversForMutation(result, node->mutationObserverRegistry(), *this, type, attributeName);
+ collectMatchingObserversForMutation(result, node->transientMutationObserverRegistry(), *this, type, attributeName);
</ins><span class="cx"> }
</span><ins>+ return result;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void Node::registerMutationObserver(MutationObserver* observer, MutationObserverOptions options, const HashSet<AtomicString>& attributeFilter)
</del><ins>+void Node::registerMutationObserver(MutationObserver& observer, MutationObserverOptions options, const HashSet<AtomicString>& attributeFilter)
</ins><span class="cx"> {
</span><span class="cx"> MutationObserverRegistration* registration = nullptr;
</span><span class="cx"> auto& registry = ensureRareData().ensureMutationObserverData().registry;
</span><span class="cx">
</span><del>- for (size_t i = 0; i < registry.size(); ++i) {
- if (registry[i]->observer() == observer) {
- registration = registry[i].get();
</del><ins>+ for (auto& candidateRegistration : registry) {
+ if (&candidateRegistration->observer() == &observer) {
+ registration = candidateRegistration.get();
</ins><span class="cx"> registration->resetObservation(options, attributeFilter);
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!registration) {
</span><del>- registry.append(std::make_unique<MutationObserverRegistration>(observer, this, options, attributeFilter));
</del><ins>+ registry.append(std::make_unique<MutationObserverRegistration>(observer, *this, options, attributeFilter));
</ins><span class="cx"> registration = registry.last().get();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2105,7 +2106,7 @@
</span><span class="cx"> document().addMutationObserverTypes(registration->mutationTypes());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void Node::unregisterMutationObserver(MutationObserverRegistration* registration)
</del><ins>+void Node::unregisterMutationObserver(MutationObserverRegistration& registration)
</ins><span class="cx"> {
</span><span class="cx"> auto* registry = mutationObserverRegistry();
</span><span class="cx"> ASSERT(registry);
</span><span class="lines">@@ -2112,25 +2113,25 @@
</span><span class="cx"> if (!registry)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- registry->removeFirstMatching([registration](auto& current) {
- return current.get() == registration;
</del><ins>+ registry->removeFirstMatching([&registration] (auto& current) {
+ return current.get() == &registration;
</ins><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void Node::registerTransientMutationObserver(MutationObserverRegistration* registration)
</del><ins>+void Node::registerTransientMutationObserver(MutationObserverRegistration& registration)
</ins><span class="cx"> {
</span><del>- ensureRareData().ensureMutationObserverData().transientRegistry.add(registration);
</del><ins>+ ensureRareData().ensureMutationObserverData().transientRegistry.add(&registration);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void Node::unregisterTransientMutationObserver(MutationObserverRegistration* registration)
</del><ins>+void Node::unregisterTransientMutationObserver(MutationObserverRegistration& registration)
</ins><span class="cx"> {
</span><del>- HashSet<MutationObserverRegistration*>* transientRegistry = transientMutationObserverRegistry();
</del><ins>+ auto* transientRegistry = transientMutationObserverRegistry();
</ins><span class="cx"> ASSERT(transientRegistry);
</span><span class="cx"> if (!transientRegistry)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- ASSERT(transientRegistry->contains(registration));
- transientRegistry->remove(registration);
</del><ins>+ ASSERT(transientRegistry->contains(&registration));
+ transientRegistry->remove(&registration);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Node::notifyMutationObserversNodeWillDetach()
</span><span class="lines">@@ -2141,12 +2142,11 @@
</span><span class="cx"> for (Node* node = parentNode(); node; node = node->parentNode()) {
</span><span class="cx"> if (auto* registry = node->mutationObserverRegistry()) {
</span><span class="cx"> for (auto& registration : *registry)
</span><del>- registration->observedSubtreeNodeWillDetach(this);
</del><ins>+ registration->observedSubtreeNodeWillDetach(*this);
</ins><span class="cx"> }
</span><del>-
</del><span class="cx"> if (auto* transientRegistry = node->transientMutationObserverRegistry()) {
</span><span class="cx"> for (auto* registration : *transientRegistry)
</span><del>- registration->observedSubtreeNodeWillDetach(this);
</del><ins>+ registration->observedSubtreeNodeWillDetach(*this);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/Node.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -530,11 +530,11 @@
</span><span class="cx"> EventTargetData* eventTargetDataConcurrently() final;
</span><span class="cx"> EventTargetData& ensureEventTargetData() final;
</span><span class="cx">
</span><del>- void getRegisteredMutationObserversOfType(HashMap<MutationObserver*, MutationRecordDeliveryOptions>&, MutationObserver::MutationType, const QualifiedName* attributeName);
- void registerMutationObserver(MutationObserver*, MutationObserverOptions, const HashSet<AtomicString>& attributeFilter);
- void unregisterMutationObserver(MutationObserverRegistration*);
- void registerTransientMutationObserver(MutationObserverRegistration*);
- void unregisterTransientMutationObserver(MutationObserverRegistration*);
</del><ins>+ HashMap<MutationObserver*, MutationRecordDeliveryOptions> registeredMutationObservers(MutationObserver::MutationType, const QualifiedName* attributeName);
+ void registerMutationObserver(MutationObserver&, MutationObserverOptions, const HashSet<AtomicString>& attributeFilter);
+ void unregisterMutationObserver(MutationObserverRegistration&);
+ void registerTransientMutationObserver(MutationObserverRegistration&);
+ void unregisterTransientMutationObserver(MutationObserverRegistration&);
</ins><span class="cx"> void notifyMutationObserversNodeWillDetach();
</span><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT void textRects(Vector<IntRect>&) const;
</span></span></pre></div>
<a id="trunkSourceWebCoredomPopStateEventcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/PopStateEvent.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/PopStateEvent.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/PopStateEvent.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -39,9 +39,9 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PopStateEvent::PopStateEvent(PassRefPtr<SerializedScriptValue> serializedState, PassRefPtr<History> history)
</del><ins>+PopStateEvent::PopStateEvent(RefPtr<SerializedScriptValue>&& serializedState, History* history)
</ins><span class="cx"> : Event(eventNames().popstateEvent, false, true)
</span><del>- , m_serializedState(serializedState)
</del><ins>+ , m_serializedState(WTFMove(serializedState))
</ins><span class="cx"> , m_history(history)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Ref<PopStateEvent> PopStateEvent::create(RefPtr<SerializedScriptValue>&& serializedState, PassRefPtr<History> history)
</del><ins>+Ref<PopStateEvent> PopStateEvent::create(RefPtr<SerializedScriptValue>&& serializedState, History* history)
</ins><span class="cx"> {
</span><span class="cx"> return adoptRef(*new PopStateEvent(WTFMove(serializedState), history));
</span><span class="cx"> }
</span><span class="lines">@@ -65,12 +65,12 @@
</span><span class="cx"> return adoptRef(*new PopStateEvent);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<SerializedScriptValue> PopStateEvent::trySerializeState(JSC::ExecState* exec)
</del><ins>+RefPtr<SerializedScriptValue> PopStateEvent::trySerializeState(JSC::ExecState& executionState)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(!m_state.hasNoValue());
</span><span class="cx">
</span><span class="cx"> if (!m_serializedState && !m_triedToSerialize) {
</span><del>- m_serializedState = SerializedScriptValue::create(*exec, m_state.jsValue(), NonThrowing);
</del><ins>+ m_serializedState = SerializedScriptValue::create(executionState, m_state.jsValue(), NonThrowing);
</ins><span class="cx"> m_triedToSerialize = true;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomPopStateEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/PopStateEvent.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/PopStateEvent.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/PopStateEvent.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> class PopStateEvent final : public Event {
</span><span class="cx"> public:
</span><span class="cx"> virtual ~PopStateEvent();
</span><del>- static Ref<PopStateEvent> create(RefPtr<SerializedScriptValue>&&, PassRefPtr<History>);
</del><ins>+ static Ref<PopStateEvent> create(RefPtr<SerializedScriptValue>&&, History*);
</ins><span class="cx">
</span><span class="cx"> struct Init : EventInit {
</span><span class="cx"> JSC::JSValue state;
</span><span class="lines">@@ -49,17 +49,17 @@
</span><span class="cx"> JSC::JSValue state() const { return m_state; }
</span><span class="cx"> SerializedScriptValue* serializedState() const { return m_serializedState.get(); }
</span><span class="cx">
</span><del>- RefPtr<SerializedScriptValue> trySerializeState(JSC::ExecState*);
</del><ins>+ RefPtr<SerializedScriptValue> trySerializeState(JSC::ExecState&);
</ins><span class="cx">
</span><span class="cx"> History* history() const { return m_history.get(); }
</span><span class="cx">
</span><del>- EventInterface eventInterface() const override;
-
</del><span class="cx"> private:
</span><span class="cx"> PopStateEvent() = default;
</span><span class="cx"> PopStateEvent(JSC::ExecState&, const AtomicString&, const Init&, IsTrusted);
</span><del>- explicit PopStateEvent(PassRefPtr<SerializedScriptValue>, PassRefPtr<History>);
</del><ins>+ PopStateEvent(RefPtr<SerializedScriptValue>&&, History*);
</ins><span class="cx">
</span><ins>+ EventInterface eventInterface() const final;
+
</ins><span class="cx"> Deprecated::ScriptValue m_state;
</span><span class="cx"> RefPtr<SerializedScriptValue> m_serializedState;
</span><span class="cx"> bool m_triedToSerialize { false };
</span></span></pre></div>
<a id="trunkSourceWebCoredomPositioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Position.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Position.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/Position.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -98,9 +98,9 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Position::Position(PassRefPtr<Node> anchorNode, LegacyEditingOffset offset)
</del><ins>+Position::Position(Node* anchorNode, unsigned offset, LegacyEditingPositionFlag)
</ins><span class="cx"> : m_anchorNode(anchorNode)
</span><del>- , m_offset(offset.value())
</del><ins>+ , m_offset(offset)
</ins><span class="cx"> , m_anchorType(anchorTypeForLegacyEditingPosition(m_anchorNode.get(), m_offset))
</span><span class="cx"> , m_isLegacyEditingPosition(true)
</span><span class="cx"> {
</span><span class="lines">@@ -108,7 +108,7 @@
</span><span class="cx"> ASSERT(!m_anchorNode || !m_anchorNode->isPseudoElement());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Position::Position(PassRefPtr<Node> anchorNode, AnchorType anchorType)
</del><ins>+Position::Position(Node* anchorNode, AnchorType anchorType)
</ins><span class="cx"> : m_anchorNode(anchorNode)
</span><span class="cx"> , m_offset(0)
</span><span class="cx"> , m_anchorType(anchorType)
</span><span class="lines">@@ -121,7 +121,7 @@
</span><span class="cx"> && (is<Text>(*m_anchorNode) || editingIgnoresContent(*m_anchorNode))));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Position::Position(PassRefPtr<Node> anchorNode, int offset, AnchorType anchorType)
</del><ins>+Position::Position(Node* anchorNode, int offset, AnchorType anchorType)
</ins><span class="cx"> : m_anchorNode(anchorNode)
</span><span class="cx"> , m_offset(offset)
</span><span class="cx"> , m_anchorType(anchorType)
</span><span class="lines">@@ -132,9 +132,9 @@
</span><span class="cx"> ASSERT(anchorType == PositionIsOffsetInAnchor);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Position::Position(PassRefPtr<Text> textNode, unsigned offset)
</del><ins>+Position::Position(Text* textNode, unsigned offset)
</ins><span class="cx"> : m_anchorNode(textNode)
</span><del>- , m_offset(static_cast<int>(offset))
</del><ins>+ , m_offset(offset)
</ins><span class="cx"> , m_anchorType(PositionIsOffsetInAnchor)
</span><span class="cx"> , m_isLegacyEditingPosition(false)
</span><span class="cx"> {
</span><span class="lines">@@ -141,7 +141,7 @@
</span><span class="cx"> ASSERT(m_anchorNode);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void Position::moveToPosition(PassRefPtr<Node> node, int offset)
</del><ins>+void Position::moveToPosition(Node* node, int offset)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(!editingIgnoresContent(*node));
</span><span class="cx"> ASSERT(anchorType() == PositionIsOffsetInAnchor || m_isLegacyEditingPosition);
</span></span></pre></div>
<a id="trunkSourceWebCoredomPositionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Position.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Position.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/Position.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx"> #include "TextAffinity.h"
</span><span class="cx"> #include "TextFlags.h"
</span><span class="cx"> #include <wtf/Assertions.h>
</span><del>-#include <wtf/PassRefPtr.h>
</del><span class="cx"> #include <wtf/RefPtr.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -62,35 +61,18 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> Position()
</span><del>- : m_offset(0)
- , m_anchorType(PositionIsOffsetInAnchor)
</del><ins>+ : m_anchorType(PositionIsOffsetInAnchor)
</ins><span class="cx"> , m_isLegacyEditingPosition(false)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>- // For creating legacy editing positions: (Anchor type will be determined from editingIgnoresContent(node))
- class LegacyEditingOffset {
- public:
- unsigned value() const { return m_offset; }
-
- private:
- explicit LegacyEditingOffset(unsigned offset)
- : m_offset(offset)
- { }
-
- friend Position createLegacyEditingPosition(PassRefPtr<Node>, unsigned offset);
-
- unsigned m_offset;
- };
- WEBCORE_EXPORT Position(PassRefPtr<Node> anchorNode, LegacyEditingOffset);
-
</del><span class="cx"> // For creating before/after positions:
</span><del>- WEBCORE_EXPORT Position(PassRefPtr<Node> anchorNode, AnchorType);
- Position(PassRefPtr<Text> textNode, unsigned offset);
</del><ins>+ WEBCORE_EXPORT Position(Node* anchorNode, AnchorType);
+ Position(Text* textNode, unsigned offset);
</ins><span class="cx">
</span><span class="cx"> // For creating offset positions:
</span><span class="cx"> // FIXME: This constructor should eventually go away. See bug 63040.
</span><del>- WEBCORE_EXPORT Position(PassRefPtr<Node> anchorNode, int offset, AnchorType);
</del><ins>+ WEBCORE_EXPORT Position(Node* anchorNode, int offset, AnchorType);
</ins><span class="cx">
</span><span class="cx"> AnchorType anchorType() const { return static_cast<AnchorType>(m_anchorType); }
</span><span class="cx">
</span><span class="lines">@@ -139,7 +121,7 @@
</span><span class="cx">
</span><span class="cx"> // These should only be used for PositionIsOffsetInAnchor positions, unless
</span><span class="cx"> // the position is a legacy editing position.
</span><del>- void moveToPosition(PassRefPtr<Node> anchorNode, int offset);
</del><ins>+ void moveToPosition(Node* anchorNode, int offset);
</ins><span class="cx"> void moveToOffset(int offset);
</span><span class="cx">
</span><span class="cx"> bool isNull() const { return !m_anchorNode; }
</span><span class="lines">@@ -212,7 +194,13 @@
</span><span class="cx"> // This is a tentative enhancement of operator== to account for different position types.
</span><span class="cx"> // FIXME: Combine this function with operator==
</span><span class="cx"> bool equals(const Position&) const;
</span><ins>+
</ins><span class="cx"> private:
</span><ins>+ // For creating legacy editing positions: (Anchor type will be determined from editingIgnoresContent(node))
+ enum class LegacyEditingPositionFlag { On };
+ WEBCORE_EXPORT Position(Node* anchorNode, unsigned offset, LegacyEditingPositionFlag);
+ friend Position createLegacyEditingPosition(Node*, unsigned offset);
+
</ins><span class="cx"> WEBCORE_EXPORT int offsetForPositionAfterAnchor() const;
</span><span class="cx">
</span><span class="cx"> Position previousCharacterPosition(EAffinity) const;
</span><span class="lines">@@ -224,14 +212,14 @@
</span><span class="cx"> // m_offset can be the offset inside m_anchorNode, or if editingIgnoresContent(m_anchorNode)
</span><span class="cx"> // returns true, then other places in editing will treat m_offset == 0 as "before the anchor"
</span><span class="cx"> // and m_offset > 0 as "after the anchor node". See parentAnchoredEquivalent for more info.
</span><del>- int m_offset;
</del><ins>+ int m_offset { 0 };
</ins><span class="cx"> unsigned m_anchorType : 3;
</span><span class="cx"> bool m_isLegacyEditingPosition : 1;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-inline Position createLegacyEditingPosition(PassRefPtr<Node> node, unsigned offset)
</del><ins>+inline Position createLegacyEditingPosition(Node* node, unsigned offset)
</ins><span class="cx"> {
</span><del>- return Position(node, Position::LegacyEditingOffset(offset));
</del><ins>+ return { node, offset, Position::LegacyEditingPositionFlag::On };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline bool operator==(const Position& a, const Position& b)
</span><span class="lines">@@ -270,10 +258,6 @@
</span><span class="cx"> return !a.isNull() && !b.isNull() && (a == b || a < b);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-// We define position creation functions to make callsites more readable.
-// These are inline to prevent ref-churn when returning a Position object.
-// If we ever add a PassPosition we can make these non-inline.
-
</del><span class="cx"> inline Position positionInParentBeforeNode(const Node* node)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(node->parentNode());
</span></span></pre></div>
<a id="trunkSourceWebCoredomRangecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Range.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Range.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/Range.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -89,8 +89,7 @@
</span><span class="cx"> return adoptRef(*new Range(ownerDocument));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-// FIXME: startContainer and endContainer should probably be Ref<Node>&&.
-inline Range::Range(Document& ownerDocument, PassRefPtr<Node> startContainer, int startOffset, PassRefPtr<Node> endContainer, int endOffset)
</del><ins>+inline Range::Range(Document& ownerDocument, Node* startContainer, int startOffset, Node* endContainer, int endOffset)
</ins><span class="cx"> : m_ownerDocument(ownerDocument)
</span><span class="cx"> , m_start(&ownerDocument)
</span><span class="cx"> , m_end(&ownerDocument)
</span><span class="lines">@@ -109,9 +108,9 @@
</span><span class="cx"> setEnd(*endContainer, endOffset);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Ref<Range> Range::create(Document& ownerDocument, PassRefPtr<Node> startContainer, int startOffset, PassRefPtr<Node> endContainer, int endOffset)
</del><ins>+Ref<Range> Range::create(Document& ownerDocument, RefPtr<Node>&& startContainer, int startOffset, RefPtr<Node>&& endContainer, int endOffset)
</ins><span class="cx"> {
</span><del>- return adoptRef(*new Range(ownerDocument, startContainer, startOffset, endContainer, endOffset));
</del><ins>+ return adoptRef(*new Range(ownerDocument, startContainer.get(), startOffset, endContainer.get(), endOffset));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Ref<Range> Range::create(Document& ownerDocument, const Position& start, const Position& end)
</span></span></pre></div>
<a id="trunkSourceWebCoredomRangeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Range.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Range.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/Range.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx"> class Range : public RefCounted<Range> {
</span><span class="cx"> public:
</span><span class="cx"> WEBCORE_EXPORT static Ref<Range> create(Document&);
</span><del>- WEBCORE_EXPORT static Ref<Range> create(Document&, PassRefPtr<Node> startContainer, int startOffset, PassRefPtr<Node> endContainer, int endOffset);
</del><ins>+ WEBCORE_EXPORT static Ref<Range> create(Document&, RefPtr<Node>&& startContainer, int startOffset, RefPtr<Node>&& endContainer, int endOffset);
</ins><span class="cx"> WEBCORE_EXPORT static Ref<Range> create(Document&, const Position&, const Position&);
</span><span class="cx"> WEBCORE_EXPORT static Ref<Range> create(Document&, const VisiblePosition&, const VisiblePosition&);
</span><span class="cx"> WEBCORE_EXPORT ~Range();
</span><span class="lines">@@ -155,7 +155,7 @@
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> explicit Range(Document&);
</span><del>- Range(Document&, PassRefPtr<Node> startContainer, int startOffset, PassRefPtr<Node> endContainer, int endOffset);
</del><ins>+ Range(Document&, Node* startContainer, int startOffset, Node* endContainer, int endOffset);
</ins><span class="cx">
</span><span class="cx"> void setDocument(Document&);
</span><span class="cx"> ExceptionOr<Node*> checkNodeWOffset(Node&, unsigned offset) const;
</span></span></pre></div>
<a id="trunkSourceWebCoredomScopedEventQueuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ScopedEventQueue.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ScopedEventQueue.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/ScopedEventQueue.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -54,9 +54,8 @@
</span><span class="cx"> void ScopedEventQueue::dispatchEvent(Event& event) const
</span><span class="cx"> {
</span><span class="cx"> ASSERT(event.target());
</span><del>- // Store the target in a local variable to avoid possibly dereferencing a nullified PassRefPtr after it's passed on.
- Node* node = event.target()->toNode();
- EventDispatcher::dispatchEvent(*node, event);
</del><ins>+ ASSERT(event.target()->toNode());
+ EventDispatcher::dispatchEvent(*event.target()->toNode(), event);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void ScopedEventQueue::dispatchAllEvents()
</span></span></pre></div>
<a id="trunkSourceWebCoredomScriptExecutionContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ScriptExecutionContext.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -54,9 +54,9 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> struct ScriptExecutionContext::PendingException {
</span><del>- WTF_MAKE_NONCOPYABLE(PendingException); WTF_MAKE_FAST_ALLOCATED;
</del><ins>+ WTF_MAKE_FAST_ALLOCATED;
</ins><span class="cx"> public:
</span><del>- PendingException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, PassRefPtr<ScriptCallStack> callStack)
</del><ins>+ PendingException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, RefPtr<ScriptCallStack>&& callStack)
</ins><span class="cx"> : m_errorMessage(errorMessage)
</span><span class="cx"> , m_lineNumber(lineNumber)
</span><span class="cx"> , m_columnNumber(columnNumber)
</span><span class="lines">@@ -72,19 +72,6 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> ScriptExecutionContext::ScriptExecutionContext()
</span><del>- : m_circularSequentialID(0)
- , m_inDispatchErrorEvent(false)
- , m_activeDOMObjectsAreSuspended(false)
- , m_reasonForSuspendingActiveDOMObjects(static_cast<ActiveDOMObject::ReasonForSuspension>(-1))
- , m_activeDOMObjectsAreStopped(false)
- , m_activeDOMObjectAdditionForbidden(false)
- , m_timerNestingLevel(0)
-#if !ASSERT_DISABLED
- , m_inScriptExecutionContextDestructor(false)
-#endif
-#if !ASSERT_DISABLED || ENABLE(SECURITY_ASSERTIONS)
- , m_activeDOMObjectRemovalForbidden(false)
-#endif
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -363,7 +350,7 @@
</span><span class="cx"> } else if (securityOrigin()->canRequest(completeURL(sourceURL)))
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- errorMessage = "Script error.";
</del><ins>+ errorMessage = ASCIILiteral { "Script error." };
</ins><span class="cx"> sourceURL = { };
</span><span class="cx"> lineNumber = 0;
</span><span class="cx"> columnNumber = 0;
</span><span class="lines">@@ -376,7 +363,7 @@
</span><span class="cx"> if (m_inDispatchErrorEvent) {
</span><span class="cx"> if (!m_pendingExceptions)
</span><span class="cx"> m_pendingExceptions = std::make_unique<Vector<std::unique_ptr<PendingException>>>();
</span><del>- m_pendingExceptions->append(std::make_unique<PendingException>(errorMessage, lineNumber, columnNumber, sourceURL, callStack.copyRef()));
</del><ins>+ m_pendingExceptions->append(std::make_unique<PendingException>(errorMessage, lineNumber, columnNumber, sourceURL, WTFMove(callStack)));
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -387,9 +374,9 @@
</span><span class="cx"> if (!m_pendingExceptions)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- std::unique_ptr<Vector<std::unique_ptr<PendingException>>> pendingExceptions = WTFMove(m_pendingExceptions);
</del><ins>+ auto pendingExceptions = WTFMove(m_pendingExceptions);
</ins><span class="cx"> for (auto& exception : *pendingExceptions)
</span><del>- logExceptionToConsole(exception->m_errorMessage, exception->m_sourceURL, exception->m_lineNumber, exception->m_columnNumber, exception->m_callStack.copyRef());
</del><ins>+ logExceptionToConsole(exception->m_errorMessage, exception->m_sourceURL, exception->m_lineNumber, exception->m_columnNumber, WTFMove(exception->m_callStack));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void ScriptExecutionContext::addConsoleMessage(MessageSource source, MessageLevel level, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, JSC::ExecState* state, unsigned long requestIdentifier)
</span></span></pre></div>
<a id="trunkSourceWebCoredomScriptExecutionContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ScriptExecutionContext.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx"> class Exception;
</span><span class="cx"> class ExecState;
</span><span class="cx"> class VM;
</span><del>-template <typename T> class Strong;
</del><ins>+template<typename> class Strong;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> namespace Inspector {
</span><span class="lines">@@ -183,7 +183,7 @@
</span><span class="cx"> // Gets the next id in a circular sequence from 1 to 2^31-1.
</span><span class="cx"> int circularSequentialID();
</span><span class="cx">
</span><del>- bool addTimeout(int timeoutId, PassRefPtr<DOMTimer> timer) { return m_timeouts.add(timeoutId, timer).isNewEntry; }
</del><ins>+ bool addTimeout(int timeoutId, DOMTimer& timer) { return m_timeouts.add(timeoutId, &timer).isNewEntry; }
</ins><span class="cx"> void removeTimeout(int timeoutId) { m_timeouts.remove(timeoutId); }
</span><span class="cx"> DOMTimer* findTimeout(int timeoutId) { return m_timeouts.get(timeoutId); }
</span><span class="cx">
</span><span class="lines">@@ -241,30 +241,30 @@
</span><span class="cx"> HashSet<ContextDestructionObserver*> m_destructionObservers;
</span><span class="cx"> HashSet<ActiveDOMObject*> m_activeDOMObjects;
</span><span class="cx">
</span><del>- int m_circularSequentialID;
</del><ins>+ int m_circularSequentialID { 0 };
</ins><span class="cx"> HashMap<int, RefPtr<DOMTimer>> m_timeouts;
</span><span class="cx">
</span><del>- bool m_inDispatchErrorEvent;
</del><ins>+ bool m_inDispatchErrorEvent { false };
</ins><span class="cx"> struct PendingException;
</span><span class="cx"> std::unique_ptr<Vector<std::unique_ptr<PendingException>>> m_pendingExceptions;
</span><span class="cx">
</span><del>- bool m_activeDOMObjectsAreSuspended;
- ActiveDOMObject::ReasonForSuspension m_reasonForSuspendingActiveDOMObjects;
- bool m_activeDOMObjectsAreStopped;
</del><ins>+ bool m_activeDOMObjectsAreSuspended { false };
+ ActiveDOMObject::ReasonForSuspension m_reasonForSuspendingActiveDOMObjects { static_cast<ActiveDOMObject::ReasonForSuspension>(-1) };
+ bool m_activeDOMObjectsAreStopped { false };
</ins><span class="cx">
</span><span class="cx"> std::unique_ptr<PublicURLManager> m_publicURLManager;
</span><span class="cx">
</span><span class="cx"> RefPtr<DatabaseContext> m_databaseContext;
</span><span class="cx">
</span><del>- bool m_activeDOMObjectAdditionForbidden;
</del><ins>+ bool m_activeDOMObjectAdditionForbidden { false };
</ins><span class="cx"> bool m_willProcessMessagePortMessagesSoon { false };
</span><del>- int m_timerNestingLevel;
</del><ins>+ int m_timerNestingLevel { 0 };
</ins><span class="cx">
</span><span class="cx"> #if !ASSERT_DISABLED
</span><del>- bool m_inScriptExecutionContextDestructor;
</del><ins>+ bool m_inScriptExecutionContextDestructor { false };
</ins><span class="cx"> #endif
</span><span class="cx"> #if !ASSERT_DISABLED || ENABLE(SECURITY_ASSERTIONS)
</span><del>- bool m_activeDOMObjectRemovalForbidden;
</del><ins>+ bool m_activeDOMObjectRemovalForbidden { false };
</ins><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomScriptedAnimationControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ScriptedAnimationController.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ScriptedAnimationController.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/ScriptedAnimationController.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -115,12 +115,12 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><del>-ScriptedAnimationController::CallbackId ScriptedAnimationController::registerCallback(PassRefPtr<RequestAnimationFrameCallback> callback)
</del><ins>+ScriptedAnimationController::CallbackId ScriptedAnimationController::registerCallback(Ref<RequestAnimationFrameCallback>&& callback)
</ins><span class="cx"> {
</span><span class="cx"> ScriptedAnimationController::CallbackId id = ++m_nextCallbackId;
</span><span class="cx"> callback->m_firedOrCancelled = false;
</span><span class="cx"> callback->m_id = id;
</span><del>- m_callbacks.append(callback);
</del><ins>+ m_callbacks.append(WTFMove(callback));
</ins><span class="cx">
</span><span class="cx"> InspectorInstrumentation::didRequestAnimationFrame(m_document, id);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomScriptedAnimationControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ScriptedAnimationController.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ScriptedAnimationController.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/ScriptedAnimationController.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -28,18 +28,20 @@
</span><span class="cx"> #if ENABLE(REQUEST_ANIMATION_FRAME)
</span><span class="cx">
</span><span class="cx"> #include "DOMTimeStamp.h"
</span><ins>+#include "PlatformScreen.h"
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
+
</ins><span class="cx"> #if USE(REQUEST_ANIMATION_FRAME_TIMER)
</span><del>-#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
</del><ins>+#include "Timer.h"
+#endif
+
+#if USE(REQUEST_ANIMATION_FRAME_TIMER) && USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
</ins><span class="cx"> #include "Chrome.h"
</span><span class="cx"> #include "ChromeClient.h"
</span><span class="cx"> #include "DisplayRefreshMonitorClient.h"
</span><span class="cx"> #endif
</span><del>-#include "Timer.h"
-#endif
-#include "PlatformScreen.h"
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-#include <wtf/Vector.h>
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -62,7 +64,7 @@
</span><span class="cx">
</span><span class="cx"> typedef int CallbackId;
</span><span class="cx">
</span><del>- CallbackId registerCallback(PassRefPtr<RequestAnimationFrameCallback>);
</del><ins>+ CallbackId registerCallback(Ref<RequestAnimationFrameCallback>&&);
</ins><span class="cx"> void cancelCallback(CallbackId);
</span><span class="cx"> void serviceScriptedAnimations(double timestamp);
</span><span class="cx">
</span><span class="lines">@@ -89,8 +91,9 @@
</span><span class="cx"> void animationTimerFired();
</span><span class="cx"> Timer m_animationTimer;
</span><span class="cx"> double m_lastAnimationFrameTimestamp { 0 };
</span><ins>+#endif
</ins><span class="cx">
</span><del>-#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
</del><ins>+#if USE(REQUEST_ANIMATION_FRAME_TIMER) && USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
</ins><span class="cx"> // Override for DisplayRefreshMonitorClient
</span><span class="cx"> void displayRefreshFired() override;
</span><span class="cx"> RefPtr<DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const override;
</span><span class="lines">@@ -98,7 +101,6 @@
</span><span class="cx"> bool m_isUsingTimer { false };
</span><span class="cx"> bool m_isThrottled { false };
</span><span class="cx"> #endif
</span><del>-#endif
</del><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoredomSimulatedClickcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/SimulatedClick.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/SimulatedClick.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/SimulatedClick.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -45,11 +45,11 @@
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> SimulatedMouseEvent(const AtomicString& eventType, DOMWindow* view, RefPtr<Event>&& underlyingEvent, Element& target, SimulatedClickSource source)
</span><del>- : MouseEvent(eventType, true, true, underlyingEvent ? underlyingEvent->timeStamp() : currentTime(), view, 0, 0, 0, 0, 0,
</del><ins>+ : MouseEvent(eventType, true, true, underlyingEvent ? underlyingEvent->timeStamp() : currentTime(), view, 0, { }, { },
</ins><span class="cx"> #if ENABLE(POINTER_LOCK)
</span><del>- 0, 0,
</del><ins>+ { },
</ins><span class="cx"> #endif
</span><del>- false, false, false, false, 0, 0, 0, 0, 0, true)
</del><ins>+ false, false, false, false, 0, 0, 0, 0, 0, true)
</ins><span class="cx"> {
</span><span class="cx"> if (source == SimulatedClickSource::Bindings)
</span><span class="cx"> setUntrusted();
</span></span></pre></div>
<a id="trunkSourceWebCoredomWheelEventcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/WheelEvent.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/WheelEvent.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/WheelEvent.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -36,11 +36,6 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> WheelEvent::WheelEvent()
</span><del>- : m_deltaX(0)
- , m_deltaY(0)
- , m_deltaZ(0)
- , m_deltaMode(DOM_DELTA_PIXEL)
- , m_initializedWithPlatformWheelEvent(false)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -51,20 +46,18 @@
</span><span class="cx"> , m_deltaY(initializer.deltaY ? initializer.deltaY : -initializer.wheelDeltaY)
</span><span class="cx"> , m_deltaZ(initializer.deltaZ)
</span><span class="cx"> , m_deltaMode(initializer.deltaMode)
</span><del>- , m_initializedWithPlatformWheelEvent(false)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> WheelEvent::WheelEvent(const PlatformWheelEvent& event, DOMWindow* view)
</span><del>- : MouseEvent(eventNames().wheelEvent, true, true, event.timestamp(), view, 0, event.globalPosition().x(), event.globalPosition().y(), event.position().x(), event.position().y()
</del><ins>+ : MouseEvent(eventNames().wheelEvent, true, true, event.timestamp(), view, 0, event.globalPosition(), event.position()
</ins><span class="cx"> #if ENABLE(POINTER_LOCK)
</span><del>- , 0, 0
</del><ins>+ , { }
</ins><span class="cx"> #endif
</span><del>- , event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), 0, 0, 0, 0, 0, false)
</del><ins>+ , event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), 0, 0, 0, 0, 0, false)
</ins><span class="cx"> , m_wheelDelta(event.wheelTicksX() * TickMultiplier, event.wheelTicksY() * TickMultiplier)
</span><span class="cx"> , m_deltaX(-event.deltaX())
</span><span class="cx"> , m_deltaY(-event.deltaY())
</span><del>- , m_deltaZ(0)
</del><span class="cx"> , m_deltaMode(determineDeltaMode(event))
</span><span class="cx"> , m_wheelEvent(event)
</span><span class="cx"> , m_initializedWithPlatformWheelEvent(true)
</span><span class="lines">@@ -78,7 +71,7 @@
</span><span class="cx">
</span><span class="cx"> initUIEvent(eventNames().wheelEvent, true, true, view, 0);
</span><span class="cx">
</span><del>- m_screenLocation = IntPoint(screenX, screenY);
</del><ins>+ m_screenLocation = { screenX, screenY };
</ins><span class="cx"> m_ctrlKey = ctrlKey;
</span><span class="cx"> m_altKey = altKey;
</span><span class="cx"> m_shiftKey = shiftKey;
</span><span class="lines">@@ -85,20 +78,15 @@
</span><span class="cx"> m_metaKey = metaKey;
</span><span class="cx">
</span><span class="cx"> // Normalize to 120 multiple for compatibility with IE.
</span><del>- m_wheelDelta = IntPoint(rawDeltaX * TickMultiplier, rawDeltaY * TickMultiplier);
</del><ins>+ m_wheelDelta = { rawDeltaX * TickMultiplier, rawDeltaY * TickMultiplier };
</ins><span class="cx"> m_deltaX = -rawDeltaX;
</span><span class="cx"> m_deltaY = -rawDeltaY;
</span><span class="cx">
</span><span class="cx"> m_deltaMode = DOM_DELTA_PIXEL;
</span><span class="cx">
</span><del>- initCoordinates(IntPoint(pageX, pageY));
</del><ins>+ initCoordinates({ pageX, pageY });
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void WheelEvent::initWebKitWheelEvent(int rawDeltaX, int rawDeltaY, DOMWindow* view, int screenX, int screenY, int pageX, int pageY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
-{
- initWheelEvent(rawDeltaX, rawDeltaY, view, screenX, screenY, pageX, pageY, ctrlKey, altKey, shiftKey, metaKey);
-}
-
</del><span class="cx"> EventInterface WheelEvent::eventInterface() const
</span><span class="cx"> {
</span><span class="cx"> return WheelEventInterfaceType;
</span></span></pre></div>
<a id="trunkSourceWebCoredomWheelEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/WheelEvent.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/WheelEvent.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/WheelEvent.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -24,19 +24,16 @@
</span><span class="cx">
</span><span class="cx"> #pragma once
</span><span class="cx">
</span><del>-#include "FloatPoint.h"
</del><span class="cx"> #include "MouseEvent.h"
</span><span class="cx"> #include "PlatformWheelEvent.h"
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-class PlatformWheelEvent;
-
</del><span class="cx"> class WheelEvent final : public MouseEvent {
</span><span class="cx"> public:
</span><span class="cx"> enum { TickMultiplier = 120 };
</span><span class="cx">
</span><del>- enum DeltaMode {
</del><ins>+ enum {
</ins><span class="cx"> DOM_DELTA_PIXEL = 0,
</span><span class="cx"> DOM_DELTA_LINE,
</span><span class="cx"> DOM_DELTA_PAGE
</span><span class="lines">@@ -66,13 +63,9 @@
</span><span class="cx"> return adoptRef(*new WheelEvent(type, initializer, isTrusted));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- WEBCORE_EXPORT void initWheelEvent(int rawDeltaX, int rawDeltaY, DOMWindow*,
- int screenX, int screenY, int pageX, int pageY,
- bool ctrlKey, bool altKey, bool shiftKey, bool metaKey);
</del><ins>+ WEBCORE_EXPORT void initWheelEvent(int rawDeltaX, int rawDeltaY, DOMWindow*, int screenX, int screenY, int pageX, int pageY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey);
</ins><span class="cx">
</span><del>- void initWebKitWheelEvent(int rawDeltaX, int rawDeltaY, DOMWindow*,
- int screenX, int screenY, int pageX, int pageY,
- bool ctrlKey, bool altKey, bool shiftKey, bool metaKey);
</del><ins>+ void initWebKitWheelEvent(int rawDeltaX, int rawDeltaY, DOMWindow*, int screenX, int screenY, int pageX, int pageY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey);
</ins><span class="cx">
</span><span class="cx"> const PlatformWheelEvent* wheelEvent() const { return m_initializedWithPlatformWheelEvent ? &m_wheelEvent : nullptr; }
</span><span class="cx"> double deltaX() const { return m_deltaX; } // Positive when scrolling right.
</span><span class="lines">@@ -85,8 +78,6 @@
</span><span class="cx">
</span><span class="cx"> bool webkitDirectionInvertedFromDevice() const { return m_wheelEvent.directionInvertedFromDevice(); }
</span><span class="cx">
</span><del>- EventInterface eventInterface() const override;
-
</del><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> PlatformWheelEventPhase phase() const { return m_wheelEvent.phase(); }
</span><span class="cx"> PlatformWheelEventPhase momentumPhase() const { return m_wheelEvent.momentumPhase(); }
</span><span class="lines">@@ -97,17 +88,24 @@
</span><span class="cx"> WheelEvent(const AtomicString&, const Init&, IsTrusted);
</span><span class="cx"> WheelEvent(const PlatformWheelEvent&, DOMWindow*);
</span><span class="cx">
</span><del>- bool isWheelEvent() const override;
</del><ins>+ EventInterface eventInterface() const final;
</ins><span class="cx">
</span><ins>+ bool isWheelEvent() const final;
+
</ins><span class="cx"> IntPoint m_wheelDelta;
</span><del>- double m_deltaX;
- double m_deltaY;
- double m_deltaZ;
- unsigned m_deltaMode;
</del><ins>+ double m_deltaX { 0 };
+ double m_deltaY { 0 };
+ double m_deltaZ { 0 };
+ unsigned m_deltaMode { DOM_DELTA_PIXEL };
</ins><span class="cx"> PlatformWheelEvent m_wheelEvent;
</span><del>- bool m_initializedWithPlatformWheelEvent;
</del><ins>+ bool m_initializedWithPlatformWheelEvent { false };
</ins><span class="cx"> };
</span><span class="cx">
</span><ins>+inline void WheelEvent::initWebKitWheelEvent(int rawDeltaX, int rawDeltaY, DOMWindow* view, int screenX, int screenY, int pageX, int pageY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
+{
+ initWheelEvent(rawDeltaX, rawDeltaY, view, screenX, screenY, pageX, pageY, ctrlKey, altKey, shiftKey, metaKey);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_EVENT(WheelEvent)
</span></span></pre></div>
<a id="trunkSourceWebCoredommake_event_factorypl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/make_event_factory.pl (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/make_event_factory.pl        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/dom/make_event_factory.pl        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -69,7 +69,6 @@
</span><span class="cx"> my $parsedParametersRef = shift;
</span><span class="cx"> my $parsedItemsRef = shift;
</span><span class="cx">
</span><del>- my $F;
</del><span class="cx"> my %parsedEvents = %{ $parsedItemsRef };
</span><span class="cx"> my %parsedParameters = %{ $parsedParametersRef };
</span><span class="cx">
</span><span class="lines">@@ -78,10 +77,9 @@
</span><span class="cx"> # Currently, only Events have factory files.
</span><span class="cx"> return if $namespace ne "Event";
</span><span class="cx">
</span><del>- my $outputFile = "$outputDir/${namespace}Factory.cpp";
</del><ins>+ my $F;
+ open F, ">", "$outputDir/${namespace}Factory.cpp" or die "Failed to open file: $!";
</ins><span class="cx">
</span><del>- open F, ">$outputFile" or die "Failed to open file: $!";
-
</del><span class="cx"> print F $InCompiler->license();
</span><span class="cx">
</span><span class="cx"> print F "#include \"config.h\"\n";
</span><span class="lines">@@ -92,7 +90,7 @@
</span><span class="cx"> print F "\n";
</span><span class="cx"> print F "namespace WebCore {\n";
</span><span class="cx"> print F "\n";
</span><del>- print F "PassRefPtr<$namespace> ${namespace}Factory::create(const String& type)\n";
</del><ins>+ print F "RefPtr<$namespace> ${namespace}Factory::create(const String& type)\n";
</ins><span class="cx"> print F "{\n";
</span><span class="cx">
</span><span class="cx"> for my $eventName (sort keys %parsedEvents) {
</span><span class="lines">@@ -100,17 +98,18 @@
</span><span class="cx"> my $runtimeConditional = $parsedEvents{$eventName}{"runtimeConditional"};
</span><span class="cx"> my $interfaceName = $InCompiler->interfaceForItem($eventName);
</span><span class="cx">
</span><ins>+ # FIXME: This should pay attention to $runtimeConditional so it can support RuntimeEnabledFeatures.
+
</ins><span class="cx"> if ($conditional) {
</span><span class="cx"> my $conditionals = "#if ENABLE(" . join(") || ENABLE(", split("\\|", $conditional)) . ")";
</span><span class="cx"> print F "$conditionals\n";
</span><span class="cx"> }
</span><del>- # FIXME: JSC should support RuntimeEnabledFeatures.
</del><span class="cx"> print F " if (equalIgnoringASCIICase(type, \"$eventName\"))\n";
</span><span class="cx"> print F " return ${interfaceName}::create();\n";
</span><span class="cx"> print F "#endif\n" if $conditional;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- print F " return 0;\n";
</del><ins>+ print F " return nullptr;\n";
</ins><span class="cx"> print F "}\n";
</span><span class="cx"> print F "\n";
</span><span class="cx"> print F "} // namespace WebCore\n";
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingAlternativeTextControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/AlternativeTextController.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/AlternativeTextController.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/editing/AlternativeTextController.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -649,13 +649,13 @@
</span><span class="cx"> startAlternativeTextUITimer(AlternativeTextTypeReversion);
</span><span class="cx"> break;
</span><span class="cx"> case DocumentMarker::DictationAlternatives: {
</span><del>- const DictationMarkerDetails* markerDetails = static_cast<const DictationMarkerDetails*>(marker.details());
- if (!markerDetails)
</del><ins>+ if (!WTF::holds_alternative<DocumentMarker::DictationData>(marker.data()))
</ins><span class="cx"> return false;
</span><del>- if (currentWord != markerDetails->originalText())
</del><ins>+ auto& markerData = WTF::get<DocumentMarker::DictationData>(marker.data());
+ if (currentWord != markerData.originalText)
</ins><span class="cx"> return false;
</span><span class="cx"> m_alternativeTextInfo.rangeWithAlternative = wordRange;
</span><del>- m_alternativeTextInfo.details = DictationAlternativeDetails::create(markerDetails->dictationContext());
</del><ins>+ m_alternativeTextInfo.details = DictationAlternativeDetails::create(markerData.context);
</ins><span class="cx"> startAlternativeTextUITimer(AlternativeTextTypeDictationAlternatives);
</span><span class="cx"> }
</span><span class="cx"> break;
</span><span class="lines">@@ -696,27 +696,23 @@
</span><span class="cx"> return event->defaultHandled();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void AlternativeTextController::removeDictationAlternativesForMarker(const DocumentMarker* marker)
</del><ins>+void AlternativeTextController::removeDictationAlternativesForMarker(const DocumentMarker& marker)
</ins><span class="cx"> {
</span><span class="cx"> #if USE(DICTATION_ALTERNATIVES)
</span><del>- ASSERT(marker->details());
- if (DictationMarkerDetails* details = static_cast<DictationMarkerDetails*>(marker->details())) {
- if (AlternativeTextClient* client = alternativeTextClient())
- client->removeDictationAlternatives(details->dictationContext());
- }
</del><ins>+ ASSERT(WTF::holds_alternative<DocumentMarker::DictationData>(marker.data()));
+ if (auto* client = alternativeTextClient())
+ client->removeDictationAlternatives(WTF::get<DocumentMarker::DictationData>(marker.data()).context);
</ins><span class="cx"> #else
</span><span class="cx"> UNUSED_PARAM(marker);
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Vector<String> AlternativeTextController::dictationAlternativesForMarker(const DocumentMarker* marker)
</del><ins>+Vector<String> AlternativeTextController::dictationAlternativesForMarker(const DocumentMarker& marker)
</ins><span class="cx"> {
</span><span class="cx"> #if USE(DICTATION_ALTERNATIVES)
</span><del>- ASSERT(marker->type() == DocumentMarker::DictationAlternatives);
- if (AlternativeTextClient* client = alternativeTextClient()) {
- DictationMarkerDetails* details = static_cast<DictationMarkerDetails*>(marker->details());
- return client->dictationAlternatives(details->dictationContext());
- }
</del><ins>+ ASSERT(marker.type() == DocumentMarker::DictationAlternatives);
+ if (auto* client = alternativeTextClient())
+ return client->dictationAlternatives(WTF::get<DocumentMarker::DictationData>(marker.data()).context);
</ins><span class="cx"> return Vector<String>();
</span><span class="cx"> #else
</span><span class="cx"> UNUSED_PARAM(marker);
</span><span class="lines">@@ -734,7 +730,7 @@
</span><span class="cx"> DocumentMarkerController& markers = selection->startContainer().document().markers();
</span><span class="cx"> Vector<RenderedDocumentMarker*> dictationAlternativesMarkers = markers.markersInRange(selection.get(), DocumentMarker::DictationAlternatives);
</span><span class="cx"> for (auto* marker : dictationAlternativesMarkers)
</span><del>- removeDictationAlternativesForMarker(marker);
</del><ins>+ removeDictationAlternativesForMarker(*marker);
</ins><span class="cx">
</span><span class="cx"> applyAlternativeTextToRange(selection.get(), alternativeString, AlternativeTextTypeDictationAlternatives, markerTypesForAppliedDictationAlternative());
</span><span class="cx"> #else
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingAlternativeTextControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/AlternativeTextController.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/AlternativeTextController.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/editing/AlternativeTextController.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -47,7 +47,6 @@
</span><span class="cx">
</span><span class="cx"> class AlternativeTextDetails : public RefCounted<AlternativeTextDetails> {
</span><span class="cx"> public:
</span><del>- AlternativeTextDetails() { }
</del><span class="cx"> virtual ~AlternativeTextDetails() { }
</span><span class="cx"> };
</span><span class="cx">
</span><span class="lines">@@ -59,24 +58,6 @@
</span><span class="cx"> RefPtr<AlternativeTextDetails> details;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-class DictationMarkerDetails : public DocumentMarkerDetails {
-public:
- static Ref<DictationMarkerDetails> create(const String& originalText, uint64_t dictationContext)
- {
- return adoptRef(*new DictationMarkerDetails(originalText, dictationContext));
- }
- const String& originalText() const { return m_originalText; }
- uint64_t dictationContext() const { return m_dictationContext; }
-private:
- DictationMarkerDetails(const String& originalText, uint64_t dictationContext)
- : m_dictationContext(dictationContext)
- , m_originalText(originalText)
- { }
-
- uint64_t m_dictationContext;
- String m_originalText;
-};
-
</del><span class="cx"> struct TextCheckingResult;
</span><span class="cx">
</span><span class="cx"> #if USE(AUTOCORRECTION_PANEL)
</span><span class="lines">@@ -129,8 +110,8 @@
</span><span class="cx"> void deletedAutocorrectionAtPosition(const Position&, const String& originalString) UNLESS_ENABLED({ UNUSED_PARAM(originalString); })
</span><span class="cx">
</span><span class="cx"> bool insertDictatedText(const String&, const Vector<DictationAlternative>&, Event*);
</span><del>- void removeDictationAlternativesForMarker(const DocumentMarker*);
- Vector<String> dictationAlternativesForMarker(const DocumentMarker*);
</del><ins>+ void removeDictationAlternativesForMarker(const DocumentMarker&);
+ Vector<String> dictationAlternativesForMarker(const DocumentMarker&);
</ins><span class="cx"> void applyDictationAlternative(const String& alternativeString);
</span><span class="cx">
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingApplyBlockElementCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ApplyBlockElementCommand.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ApplyBlockElementCommand.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/editing/ApplyBlockElementCommand.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -246,7 +246,7 @@
</span><span class="cx"> if (m_endOfLastParagraph.offsetInContainerNode() == end.offsetInContainerNode())
</span><span class="cx"> m_endOfLastParagraph = lastPositionInOrAfterNode(endContainer->previousSibling());
</span><span class="cx"> else
</span><del>- m_endOfLastParagraph = Position(endContainer, m_endOfLastParagraph.offsetInContainerNode() - end.offsetInContainerNode());
</del><ins>+ m_endOfLastParagraph = Position(endContainer.get(), m_endOfLastParagraph.offsetInContainerNode() - end.offsetInContainerNode());
</ins><span class="cx"> }
</span><span class="cx"> end = lastPositionInNode(endContainer->previousSibling());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingApplyStyleCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ApplyStyleCommand.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ApplyStyleCommand.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/editing/ApplyStyleCommand.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -1536,9 +1536,9 @@
</span><span class="cx">
</span><span class="cx"> Text& nextText = downcast<Text>(*next);
</span><span class="cx"> if (start.anchorType() == Position::PositionIsOffsetInAnchor && next == start.containerNode())
</span><del>- newStart = Position(childText, childText->length() + start.offsetInContainerNode());
</del><ins>+ newStart = Position(childText.get(), childText->length() + start.offsetInContainerNode());
</ins><span class="cx"> if (end.anchorType() == Position::PositionIsOffsetInAnchor && next == end.containerNode())
</span><del>- newEnd = Position(childText, childText->length() + end.offsetInContainerNode());
</del><ins>+ newEnd = Position(childText.get(), childText->length() + end.offsetInContainerNode());
</ins><span class="cx"> String textToMove = nextText.data();
</span><span class="cx"> insertTextIntoNode(childText, childText->length(), textToMove);
</span><span class="cx"> removeNode(next);
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingCompositeEditCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/CompositeEditCommand.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/CompositeEditCommand.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/editing/CompositeEditCommand.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -760,7 +760,7 @@
</span><span class="cx"> RefPtr<Text> textNode = start.containerText();
</span><span class="cx"> replaceTextInNode(textNode, start.offsetInContainerNode(), end.offsetInContainerNode() - start.offsetInContainerNode(), text);
</span><span class="cx">
</span><del>- return Position(WTFMove(textNode), start.offsetInContainerNode() + text.length());
</del><ins>+ return Position(textNode.get(), start.offsetInContainerNode() + text.length());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static Vector<RenderedDocumentMarker> copyMarkers(const Vector<RenderedDocumentMarker*>& markerPointers)
</span><span class="lines">@@ -933,8 +933,8 @@
</span><span class="cx"> if (!length)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- VisiblePosition visibleUpstreamPos(Position(textNode, upstream));
- VisiblePosition visibleDownstreamPos(Position(textNode, downstream));
</del><ins>+ VisiblePosition visibleUpstreamPos(Position(textNode.get(), upstream));
+ VisiblePosition visibleDownstreamPos(Position(textNode.get(), downstream));
</ins><span class="cx">
</span><span class="cx"> String string = text.substring(upstream, length);
</span><span class="cx"> String rebalancedString = stringWithRebalancedWhitespace(string,
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingDictationCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/DictationCommand.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/DictationCommand.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/editing/DictationCommand.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -62,9 +62,10 @@
</span><span class="cx">
</span><span class="cx"> void addMarkersToTextNode(Text* textNode, unsigned offsetOfInsertion, const String& textToBeInserted) override
</span><span class="cx"> {
</span><del>- DocumentMarkerController& markerController = textNode->document().markers();
</del><ins>+ auto& markerController = textNode->document().markers();
</ins><span class="cx"> for (auto& alternative : m_alternatives) {
</span><del>- markerController.addMarkerToNode(textNode, alternative.rangeStart + offsetOfInsertion, alternative.rangeLength, DocumentMarker::DictationAlternatives, DictationMarkerDetails::create(textToBeInserted.substring(alternative.rangeStart, alternative.rangeLength), alternative.dictationContext));
</del><ins>+ DocumentMarker::DictationData data { alternative.dictationContext, textToBeInserted.substring(alternative.rangeStart, alternative.rangeLength) };
+ markerController.addMarkerToNode(textNode, alternative.rangeStart + offsetOfInsertion, alternative.rangeLength, DocumentMarker::DictationAlternatives, WTFMove(data));
</ins><span class="cx"> markerController.addMarkerToNode(textNode, alternative.rangeStart + offsetOfInsertion, alternative.rangeLength, DocumentMarker::SpellCheckingExemption);
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/Editor.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editor.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/editing/Editor.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -2721,7 +2721,7 @@
</span><span class="cx">
</span><span class="cx"> Vector<RenderedDocumentMarker*> markers = document().markers().markersInRange(wordRange.get(), DocumentMarker::DictationAlternatives);
</span><span class="cx"> for (auto* marker : markers)
</span><del>- m_alternativeTextController->removeDictationAlternativesForMarker(marker);
</del><ins>+ m_alternativeTextController->removeDictationAlternativesForMarker(*marker);
</ins><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> document().markers().removeMarkers(wordRange.get(), DocumentMarker::Spelling | DocumentMarker::CorrectionIndicator | DocumentMarker::SpellCheckingExemption | DocumentMarker::DictationAlternatives | DocumentMarker::DictationPhraseWithAlternatives, DocumentMarkerController::RemovePartiallyOverlappingMarker);
</span><span class="lines">@@ -3620,7 +3620,7 @@
</span><span class="cx"> return WebCore::unifiedTextCheckerEnabled(&m_frame);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Vector<String> Editor::dictationAlternativesForMarker(const DocumentMarker* marker)
</del><ins>+Vector<String> Editor::dictationAlternativesForMarker(const DocumentMarker& marker)
</ins><span class="cx"> {
</span><span class="cx"> return m_alternativeTextController->dictationAlternativesForMarker(marker);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/Editor.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editor.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/editing/Editor.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -416,7 +416,7 @@
</span><span class="cx">
</span><span class="cx"> EditorParagraphSeparator defaultParagraphSeparator() const { return m_defaultParagraphSeparator; }
</span><span class="cx"> void setDefaultParagraphSeparator(EditorParagraphSeparator separator) { m_defaultParagraphSeparator = separator; }
</span><del>- Vector<String> dictationAlternativesForMarker(const DocumentMarker*);
</del><ins>+ Vector<String> dictationAlternativesForMarker(const DocumentMarker&);
</ins><span class="cx"> void applyDictationAlternativelternative(const String& alternativeString);
</span><span class="cx">
</span><span class="cx"> #if USE(APPKIT)
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertTextCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertTextCommand.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertTextCommand.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/editing/InsertTextCommand.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -120,7 +120,7 @@
</span><span class="cx">
</span><span class="cx"> replaceTextInNode(textNode, start.offsetInContainerNode(), count, text);
</span><span class="cx">
</span><del>- Position endPosition = Position(WTFMove(textNode), start.offsetInContainerNode() + text.length());
</del><ins>+ Position endPosition = Position(textNode.get(), start.offsetInContainerNode() + text.length());
</ins><span class="cx"> setEndingSelectionWithoutValidation(start, endPosition);
</span><span class="cx"> if (!selectInsertedText)
</span><span class="cx"> setEndingSelection(VisibleSelection(endingSelection().visibleEnd(), endingSelection().isDirectional()));
</span><span class="lines">@@ -202,7 +202,7 @@
</span><span class="cx"> const unsigned offset = startPosition.offsetInContainerNode();
</span><span class="cx">
</span><span class="cx"> insertTextIntoNode(textNode, offset, m_text);
</span><del>- endPosition = Position(textNode, offset + m_text.length());
</del><ins>+ endPosition = Position(textNode.get(), offset + m_text.length());
</ins><span class="cx"> if (m_markerSupplier)
</span><span class="cx"> m_markerSupplier->addMarkersToTextNode(textNode.get(), offset, m_text);
</span><span class="cx">
</span><span class="lines">@@ -245,7 +245,7 @@
</span><span class="cx"> if (isTabSpanTextNode(node)) {
</span><span class="cx"> RefPtr<Text> textNode = downcast<Text>(node);
</span><span class="cx"> insertTextIntoNode(textNode, offset, "\t");
</span><del>- return Position(WTFMove(textNode), offset + 1);
</del><ins>+ return Position(textNode.get(), offset + 1);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // create new tab span
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingReplaceSelectionCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -1436,7 +1436,7 @@
</span><span class="cx"> if (positionOnlyToBeUpdated.containerNode() == text)
</span><span class="cx"> positionOnlyToBeUpdated.moveToOffset(previous->length() + positionOnlyToBeUpdated.offsetInContainerNode());
</span><span class="cx"> else if (positionOnlyToBeUpdated.containerNode() == previous.ptr())
</span><del>- positionOnlyToBeUpdated.moveToPosition(text, positionOnlyToBeUpdated.offsetInContainerNode());
</del><ins>+ positionOnlyToBeUpdated.moveToPosition(text.get(), positionOnlyToBeUpdated.offsetInContainerNode());
</ins><span class="cx"> } else
</span><span class="cx"> updatePositionForNodeRemoval(positionOnlyToBeUpdated, previous.get());
</span><span class="cx">
</span><span class="lines">@@ -1451,7 +1451,7 @@
</span><span class="cx"> updatePositionForNodeRemoval(position, next.get());
</span><span class="cx">
</span><span class="cx"> if (positionOnlyToBeUpdatedIsOffsetInAnchor && positionOnlyToBeUpdated.containerNode() == next.ptr())
</span><del>- positionOnlyToBeUpdated.moveToPosition(text, originalLength + positionOnlyToBeUpdated.offsetInContainerNode());
</del><ins>+ positionOnlyToBeUpdated.moveToPosition(text.get(), originalLength + positionOnlyToBeUpdated.offsetInContainerNode());
</ins><span class="cx"> else
</span><span class="cx"> updatePositionForNodeRemoval(positionOnlyToBeUpdated, next.get());
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTitleElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTitleElement.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTitleElement.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/html/HTMLTitleElement.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -85,11 +85,9 @@
</span><span class="cx"> TextDirection direction = LTR;
</span><span class="cx"> if (auto* computedStyle = this->computedStyle())
</span><span class="cx"> direction = computedStyle->direction();
</span><del>- else {
- auto style = styleResolver().styleForElement(*this, parentElement() ? parentElement()->renderStyle() : nullptr).renderStyle;
- direction = style->direction();
- }
- return StringWithDirection(text(), direction);
</del><ins>+ else
+ direction = styleResolver().styleForElement(*this, parentElement() ? parentElement()->renderStyle() : nullptr).renderStyle->direction();
+ return { text(), direction };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void HTMLTitleElement::setText(const String& value)
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoader.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -361,7 +361,7 @@
</span><span class="cx"> loadFrameRequest(frameRequest, triggeringEvent, nullptr);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void FrameLoader::submitForm(PassRefPtr<FormSubmission> submission)
</del><ins>+void FrameLoader::submitForm(Ref<FormSubmission>&& submission)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(submission->method() == FormSubmission::PostMethod || submission->method() == FormSubmission::GetMethod);
</span><span class="cx">
</span><span class="lines">@@ -432,7 +432,7 @@
</span><span class="cx"> submission->setReferrer(outgoingReferrer());
</span><span class="cx"> submission->setOrigin(outgoingOrigin());
</span><span class="cx">
</span><del>- targetFrame->navigationScheduler().scheduleFormSubmission(submission);
</del><ins>+ targetFrame->navigationScheduler().scheduleFormSubmission(WTFMove(submission));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void FrameLoader::stopLoading(UnloadEventPolicy unloadEventPolicy)
</span><span class="lines">@@ -643,10 +643,9 @@
</span><span class="cx"> dispatchGlobalObjectAvailableInAllWorlds();
</span><span class="cx">
</span><span class="cx"> if (m_documentLoader) {
</span><del>- StringWithDirection ptitle = m_documentLoader->title();
- // If we have a title let the WebView know about it.
- if (!ptitle.isNull())
- m_client.dispatchDidReceiveTitle(ptitle);
</del><ins>+ auto& title = m_documentLoader->title();
+ if (!title.string.isNull())
+ m_client.dispatchDidReceiveTitle(title);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!m_documentLoader)
</span><span class="lines">@@ -683,7 +682,7 @@
</span><span class="cx"> m_frame.document()->setReadyState(Document::Loading);
</span><span class="cx">
</span><span class="cx"> if (m_pendingStateObject) {
</span><del>- m_frame.document()->statePopped(m_pendingStateObject.get());
</del><ins>+ m_frame.document()->statePopped(*m_pendingStateObject);
</ins><span class="cx"> m_pendingStateObject = nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -874,21 +873,19 @@
</span><span class="cx"> ASSERT(childFrame);
</span><span class="cx">
</span><span class="cx"> #if ENABLE(WEB_ARCHIVE) || ENABLE(MHTML)
</span><del>- auto activeLoader = activeDocumentLoader();
- auto subframeArchive = activeLoader ? activeLoader->popArchiveForSubframe(childFrame->tree().uniqueName(), url) : nullptr;
- if (subframeArchive) {
- childFrame->loader().loadArchive(WTFMove(subframeArchive));
- return;
</del><ins>+ if (auto activeLoader = activeDocumentLoader()) {
+ if (auto subframeArchive = activeLoader->popArchiveForSubframe(childFrame->tree().uniqueName(), url)) {
+ childFrame->loader().loadArchive(RefPtr<Archive> { subframeArchive }.releaseNonNull());
+ return;
+ }
</ins><span class="cx"> }
</span><del>-#endif // ENABLE(WEB_ARCHIVE)
</del><ins>+#endif
</ins><span class="cx">
</span><del>- HistoryItem* parentItem = history().currentItem();
</del><span class="cx"> // If we're moving in the back/forward list, we might want to replace the content
</span><span class="cx"> // of this child frame with whatever was there at that point.
</span><del>- if (parentItem && parentItem->children().size() && isBackForwardLoadType(loadType())
- && !m_frame.document()->loadEventFinished()) {
- HistoryItem* childItem = parentItem->childItemWithTarget(childFrame->tree().uniqueName());
- if (childItem) {
</del><ins>+ auto* parentItem = history().currentItem();
+ if (parentItem && parentItem->children().size() && isBackForwardLoadType(loadType()) && !m_frame.document()->loadEventFinished()) {
+ if (auto* childItem = parentItem->childItemWithTarget(childFrame->tree().uniqueName())) {
</ins><span class="cx"> childFrame->loader().m_requestedHistoryItem = childItem;
</span><span class="cx"> childFrame->loader().loadDifferentDocumentItem(*childItem, loadType(), MayAttemptCacheOnlyLoadForFormSubmissionItem);
</span><span class="cx"> return;
</span><span class="lines">@@ -900,7 +897,8 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(WEB_ARCHIVE) || ENABLE(MHTML)
</span><del>-void FrameLoader::loadArchive(PassRefPtr<Archive> archive)
</del><ins>+
+void FrameLoader::loadArchive(Ref<Archive>&& archive)
</ins><span class="cx"> {
</span><span class="cx"> ArchiveResource* mainResource = archive->mainResource();
</span><span class="cx"> ASSERT(mainResource);
</span><span class="lines">@@ -912,10 +910,11 @@
</span><span class="cx">
</span><span class="cx"> ResourceRequest request(mainResource->url());
</span><span class="cx">
</span><del>- RefPtr<DocumentLoader> documentLoader = m_client.createDocumentLoader(request, substituteData);
- documentLoader->setArchive(archive.get());
- load(documentLoader.get());
</del><ins>+ auto documentLoader = m_client.createDocumentLoader(request, substituteData);
+ documentLoader->setArchive(WTFMove(archive));
+ load(documentLoader.ptr());
</ins><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif // ENABLE(WEB_ARCHIVE) || ENABLE(MHTML)
</span><span class="cx">
</span><span class="cx"> String FrameLoader::outgoingReferrer() const
</span><span class="lines">@@ -1006,7 +1005,7 @@
</span><span class="cx">
</span><span class="cx"> // This does the same kind of work that didOpenURL does, except it relies on the fact
</span><span class="cx"> // that a higher level already checked that the URLs match and the scrolling is the right thing to do.
</span><del>-void FrameLoader::loadInSameDocument(const URL& url, PassRefPtr<SerializedScriptValue> stateObject, bool isNewNavigation)
</del><ins>+void FrameLoader::loadInSameDocument(const URL& url, SerializedScriptValue* stateObject, bool isNewNavigation)
</ins><span class="cx"> {
</span><span class="cx"> // If we have a state object, we cannot also be a new navigation.
</span><span class="cx"> ASSERT(!stateObject || (stateObject && !isNewNavigation));
</span><span class="lines">@@ -1059,7 +1058,7 @@
</span><span class="cx">
</span><span class="cx"> m_client.dispatchDidNavigateWithinPage();
</span><span class="cx">
</span><del>- m_frame.document()->statePopped(stateObject ? stateObject : SerializedScriptValue::nullValue());
</del><ins>+ m_frame.document()->statePopped(stateObject ? Ref<SerializedScriptValue> { *stateObject } : SerializedScriptValue::nullValue());
</ins><span class="cx"> m_client.dispatchDidPopStateWithinPage();
</span><span class="cx">
</span><span class="cx"> if (hashChange) {
</span><span class="lines">@@ -1120,7 +1119,7 @@
</span><span class="cx"> detachChildren();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void FrameLoader::loadFrameRequest(const FrameLoadRequest& request, Event* event, PassRefPtr<FormState> formState)
</del><ins>+void FrameLoader::loadFrameRequest(const FrameLoadRequest& request, Event* event, FormState* formState)
</ins><span class="cx"> {
</span><span class="cx"> // Protect frame from getting blown away inside dispatchBeforeLoadEvent in loadWithDocumentLoader.
</span><span class="cx"> Ref<Frame> protect(m_frame);
</span><span class="lines">@@ -1150,9 +1149,9 @@
</span><span class="cx"> loadType = FrameLoadType::Standard;
</span><span class="cx">
</span><span class="cx"> if (request.resourceRequest().httpMethod() == "POST")
</span><del>- loadPostRequest(request, referrer, loadType, event, formState.get());
</del><ins>+ loadPostRequest(request, referrer, loadType, event, formState);
</ins><span class="cx"> else
</span><del>- loadURL(request, referrer, loadType, event, formState.get());
</del><ins>+ loadURL(request, referrer, loadType, event, formState);
</ins><span class="cx">
</span><span class="cx"> // FIXME: It's possible this targetFrame will not be the same frame that was targeted by the actual
</span><span class="cx"> // load if frame names have changed.
</span><span class="lines">@@ -1175,7 +1174,7 @@
</span><span class="cx"> return propagatedPolicy;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void FrameLoader::loadURL(const FrameLoadRequest& frameLoadRequest, const String& referrer, FrameLoadType newLoadType, Event* event, PassRefPtr<FormState> prpFormState)
</del><ins>+void FrameLoader::loadURL(const FrameLoadRequest& frameLoadRequest, const String& referrer, FrameLoadType newLoadType, Event* event, FormState* formState)
</ins><span class="cx"> {
</span><span class="cx"> if (m_inStopAllLoaders)
</span><span class="cx"> return;
</span><span class="lines">@@ -1186,7 +1185,6 @@
</span><span class="cx"> AllowNavigationToInvalidURL allowNavigationToInvalidURL = frameLoadRequest.allowNavigationToInvalidURL();
</span><span class="cx"> NewFrameOpenerPolicy openerPolicy = frameLoadRequest.newFrameOpenerPolicy();
</span><span class="cx"> LockHistory lockHistory = frameLoadRequest.lockHistory();
</span><del>- RefPtr<FormState> formState = prpFormState;
</del><span class="cx"> bool isFormSubmission = formState;
</span><span class="cx">
</span><span class="cx"> const URL& newURL = frameLoadRequest.resourceRequest().url();
</span><span class="lines">@@ -1211,7 +1209,7 @@
</span><span class="cx"> if (targetFrame && targetFrame != &m_frame) {
</span><span class="cx"> FrameLoadRequest newFrameLoadRequest(frameLoadRequest);
</span><span class="cx"> newFrameLoadRequest.setFrameName("_self");
</span><del>- targetFrame->loader().loadURL(newFrameLoadRequest, referrer, newLoadType, event, WTFMove(formState));
</del><ins>+ targetFrame->loader().loadURL(newFrameLoadRequest, referrer, newLoadType, event, formState);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1222,7 +1220,7 @@
</span><span class="cx">
</span><span class="cx"> if (!targetFrame && !frameName.isEmpty()) {
</span><span class="cx"> action = action.copyWithShouldOpenExternalURLsPolicy(shouldOpenExternalURLsPolicyToApply(m_frame, frameLoadRequest.shouldOpenExternalURLsPolicy()));
</span><del>- policyChecker().checkNewWindowPolicy(action, request, WTFMove(formState), frameName, [this, allowNavigationToInvalidURL, openerPolicy](const ResourceRequest& request, PassRefPtr<FormState> formState, const String& frameName, const NavigationAction& action, bool shouldContinue) {
</del><ins>+ policyChecker().checkNewWindowPolicy(action, request, formState, frameName, [this, allowNavigationToInvalidURL, openerPolicy] (const ResourceRequest& request, FormState* formState, const String& frameName, const NavigationAction& action, bool shouldContinue) {
</ins><span class="cx"> continueLoadAfterNewWindowPolicy(request, formState, frameName, action, shouldContinue, allowNavigationToInvalidURL, openerPolicy);
</span><span class="cx"> });
</span><span class="cx"> return;
</span><span class="lines">@@ -1241,7 +1239,7 @@
</span><span class="cx"> oldDocumentLoader->setLastCheckedRequest(ResourceRequest());
</span><span class="cx"> policyChecker().stopCheck();
</span><span class="cx"> policyChecker().setLoadType(newLoadType);
</span><del>- policyChecker().checkNavigationPolicy(request, false /* didReceiveRedirectResponse */, oldDocumentLoader.get(), WTFMove(formState), [this](const ResourceRequest& request, PassRefPtr<FormState>, bool shouldContinue) {
</del><ins>+ policyChecker().checkNavigationPolicy(request, false /* didReceiveRedirectResponse */, oldDocumentLoader.get(), formState, [this](const ResourceRequest& request, FormState*, bool shouldContinue) {
</ins><span class="cx"> continueFragmentScrollAfterNavigationPolicy(request, shouldContinue);
</span><span class="cx"> });
</span><span class="cx"> return;
</span><span class="lines">@@ -1249,7 +1247,7 @@
</span><span class="cx">
</span><span class="cx"> // must grab this now, since this load may stop the previous load and clear this flag
</span><span class="cx"> bool isRedirect = m_quickRedirectComing;
</span><del>- loadWithNavigationAction(request, action, lockHistory, newLoadType, WTFMove(formState), allowNavigationToInvalidURL);
</del><ins>+ loadWithNavigationAction(request, action, lockHistory, newLoadType, formState, allowNavigationToInvalidURL);
</ins><span class="cx"> if (isRedirect) {
</span><span class="cx"> m_quickRedirectComing = false;
</span><span class="cx"> if (m_provisionalDocumentLoader)
</span><span class="lines">@@ -1294,7 +1292,7 @@
</span><span class="cx">
</span><span class="cx"> if (request.shouldCheckNewWindowPolicy()) {
</span><span class="cx"> NavigationAction action(request.resourceRequest(), NavigationType::Other, passedRequest.shouldOpenExternalURLsPolicy());
</span><del>- policyChecker().checkNewWindowPolicy(action, request.resourceRequest(), nullptr, request.frameName(), [this](const ResourceRequest& request, PassRefPtr<FormState> formState, const String& frameName, const NavigationAction& action, bool shouldContinue) {
</del><ins>+ policyChecker().checkNewWindowPolicy(action, request.resourceRequest(), nullptr, request.frameName(), [this] (const ResourceRequest& request, FormState* formState, const String& frameName, const NavigationAction& action, bool shouldContinue) {
</ins><span class="cx"> continueLoadAfterNewWindowPolicy(request, formState, frameName, action, shouldContinue, AllowNavigationToInvalidURL::Yes, NewFrameOpenerPolicy::Suppress);
</span><span class="cx"> });
</span><span class="cx">
</span><span class="lines">@@ -1310,7 +1308,7 @@
</span><span class="cx"> load(loader.ptr());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void FrameLoader::loadWithNavigationAction(const ResourceRequest& request, const NavigationAction& action, LockHistory lockHistory, FrameLoadType type, PassRefPtr<FormState> formState, AllowNavigationToInvalidURL allowNavigationToInvalidURL)
</del><ins>+void FrameLoader::loadWithNavigationAction(const ResourceRequest& request, const NavigationAction& action, LockHistory lockHistory, FrameLoadType type, FormState* formState, AllowNavigationToInvalidURL allowNavigationToInvalidURL)
</ins><span class="cx"> {
</span><span class="cx"> Ref<DocumentLoader> loader = m_client.createDocumentLoader(request, defaultSubstituteDataForURL(request.url()));
</span><span class="cx"> applyShouldOpenExternalURLsPolicyToNewDocumentLoader(loader, action.shouldOpenExternalURLsPolicy());
</span><span class="lines">@@ -1400,7 +1398,7 @@
</span><span class="cx"> frame.page()->diagnosticLoggingClient().logDiagnosticMessage(DiagnosticLoggingKeys::navigationKey(), navigationDescription, ShouldSample::No);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType type, PassRefPtr<FormState> prpFormState, AllowNavigationToInvalidURL allowNavigationToInvalidURL)
</del><ins>+void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType type, FormState* formState, AllowNavigationToInvalidURL allowNavigationToInvalidURL)
</ins><span class="cx"> {
</span><span class="cx"> // Retain because dispatchBeforeLoadEvent may release the last reference to it.
</span><span class="cx"> Ref<Frame> protect(m_frame);
</span><span class="lines">@@ -1425,7 +1423,6 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> policyChecker().setLoadType(type);
</span><del>- RefPtr<FormState> formState = prpFormState;
</del><span class="cx"> bool isFormSubmission = formState;
</span><span class="cx">
</span><span class="cx"> const URL& newURL = loader->request().url();
</span><span class="lines">@@ -1438,7 +1435,7 @@
</span><span class="cx"> oldDocumentLoader->setTriggeringAction(action);
</span><span class="cx"> oldDocumentLoader->setLastCheckedRequest(ResourceRequest());
</span><span class="cx"> policyChecker().stopCheck();
</span><del>- policyChecker().checkNavigationPolicy(loader->request(), false /* didReceiveRedirectResponse */, oldDocumentLoader.get(), formState, [this](const ResourceRequest& request, PassRefPtr<FormState>, bool shouldContinue) {
</del><ins>+ policyChecker().checkNavigationPolicy(loader->request(), false /* didReceiveRedirectResponse */, oldDocumentLoader.get(), formState, [this](const ResourceRequest& request, FormState*, bool shouldContinue) {
</ins><span class="cx"> continueFragmentScrollAfterNavigationPolicy(request, shouldContinue);
</span><span class="cx"> });
</span><span class="cx"> return;
</span><span class="lines">@@ -1465,7 +1462,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- policyChecker().checkNavigationPolicy(loader->request(), false /* didReceiveRedirectResponse */, loader, formState, [this, allowNavigationToInvalidURL](const ResourceRequest& request, PassRefPtr<FormState> formState, bool shouldContinue) {
</del><ins>+ policyChecker().checkNavigationPolicy(loader->request(), false /* didReceiveRedirectResponse */, loader, formState, [this, allowNavigationToInvalidURL](const ResourceRequest& request, FormState* formState, bool shouldContinue) {
</ins><span class="cx"> continueLoadAfterNavigationPolicy(request, formState, shouldContinue, allowNavigationToInvalidURL);
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="lines">@@ -1820,9 +1817,9 @@
</span><span class="cx"> m_frame.page()->chrome().setDispatchViewportDataDidChangeSuppressed(false);
</span><span class="cx"> m_frame.page()->chrome().dispatchViewportPropertiesDidChange(m_frame.page()->viewportArguments());
</span><span class="cx"> #endif
</span><del>- // If we have a title let the WebView know about it.
- StringWithDirection title = m_documentLoader->title();
- if (!title.isNull())
</del><ins>+
+ auto& title = m_documentLoader->title();
+ if (!title.string.isNull())
</ins><span class="cx"> m_client.dispatchDidReceiveTitle(title);
</span><span class="cx">
</span><span class="cx"> // Send remaining notifications for the main resource.
</span><span class="lines">@@ -2668,10 +2665,8 @@
</span><span class="cx"> request.setHTTPHeaderField(HTTPHeaderName::UpgradeInsecureRequests, ASCIILiteral("1"));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void FrameLoader::loadPostRequest(const FrameLoadRequest& request, const String& referrer, FrameLoadType loadType, Event* event, PassRefPtr<FormState> prpFormState)
</del><ins>+void FrameLoader::loadPostRequest(const FrameLoadRequest& request, const String& referrer, FrameLoadType loadType, Event* event, FormState* formState)
</ins><span class="cx"> {
</span><del>- RefPtr<FormState> formState = prpFormState;
-
</del><span class="cx"> String frameName = request.frameName();
</span><span class="cx"> LockHistory lockHistory = request.lockHistory();
</span><span class="cx"> AllowNavigationToInvalidURL allowNavigationToInvalidURL = request.allowNavigationToInvalidURL();
</span><span class="lines">@@ -2704,7 +2699,7 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- policyChecker().checkNewWindowPolicy(action, workingResourceRequest, WTFMove(formState), frameName, [this, allowNavigationToInvalidURL, openerPolicy](const ResourceRequest& request, PassRefPtr<FormState> formState, const String& frameName, const NavigationAction& action, bool shouldContinue) {
</del><ins>+ policyChecker().checkNewWindowPolicy(action, workingResourceRequest, WTFMove(formState), frameName, [this, allowNavigationToInvalidURL, openerPolicy](const ResourceRequest& request, FormState* formState, const String& frameName, const NavigationAction& action, bool shouldContinue) {
</ins><span class="cx"> continueLoadAfterNewWindowPolicy(request, formState, frameName, action, shouldContinue, allowNavigationToInvalidURL, openerPolicy);
</span><span class="cx"> });
</span><span class="cx"> return;
</span><span class="lines">@@ -3030,7 +3025,7 @@
</span><span class="cx"> return chrome.runBeforeUnloadConfirmPanel(text, &m_frame);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void FrameLoader::continueLoadAfterNavigationPolicy(const ResourceRequest& request, PassRefPtr<FormState> formState, bool shouldContinue, AllowNavigationToInvalidURL allowNavigationToInvalidURL)
</del><ins>+void FrameLoader::continueLoadAfterNavigationPolicy(const ResourceRequest& request, FormState* formState, bool shouldContinue, AllowNavigationToInvalidURL allowNavigationToInvalidURL)
</ins><span class="cx"> {
</span><span class="cx"> // If we loaded an alternate page to replace an unreachableURL, we'll get in here with a
</span><span class="cx"> // nil policyDataSource because loading the alternate page will have passed
</span><span class="lines">@@ -3107,7 +3102,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void FrameLoader::continueLoadAfterNewWindowPolicy(const ResourceRequest& request,
</span><del>- PassRefPtr<FormState> formState, const String& frameName, const NavigationAction& action, bool shouldContinue, AllowNavigationToInvalidURL allowNavigationToInvalidURL, NewFrameOpenerPolicy openerPolicy)
</del><ins>+ FormState* formState, const String& frameName, const NavigationAction& action, bool shouldContinue, AllowNavigationToInvalidURL allowNavigationToInvalidURL, NewFrameOpenerPolicy openerPolicy)
</ins><span class="cx"> {
</span><span class="cx"> if (!shouldContinue)
</span><span class="cx"> return;
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoader.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoader.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/loader/FrameLoader.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -75,7 +75,6 @@
</span><span class="cx"> class SecurityOrigin;
</span><span class="cx"> class SerializedScriptValue;
</span><span class="cx"> class SharedBuffer;
</span><del>-class StringWithDirection;
</del><span class="cx"> class SubframeLoader;
</span><span class="cx"> class SubstituteData;
</span><span class="cx">
</span><span class="lines">@@ -108,18 +107,18 @@
</span><span class="cx">
</span><span class="cx"> // FIXME: These are all functions which start loads. We have too many.
</span><span class="cx"> WEBCORE_EXPORT void loadURLIntoChildFrame(const URL&, const String& referer, Frame*);
</span><del>- WEBCORE_EXPORT void loadFrameRequest(const FrameLoadRequest&, Event*, PassRefPtr<FormState>); // Called by submitForm, calls loadPostRequest and loadURL.
</del><ins>+ WEBCORE_EXPORT void loadFrameRequest(const FrameLoadRequest&, Event*, FormState*); // Called by submitForm, calls loadPostRequest and loadURL.
</ins><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT void load(const FrameLoadRequest&);
</span><span class="cx">
</span><span class="cx"> #if ENABLE(WEB_ARCHIVE) || ENABLE(MHTML)
</span><del>- WEBCORE_EXPORT void loadArchive(PassRefPtr<Archive>);
</del><ins>+ WEBCORE_EXPORT void loadArchive(Ref<Archive>&&);
</ins><span class="cx"> #endif
</span><span class="cx"> unsigned long loadResourceSynchronously(const ResourceRequest&, StoredCredentials, ClientCredentialPolicy, ResourceError&, ResourceResponse&, RefPtr<SharedBuffer>& data);
</span><span class="cx">
</span><span class="cx"> void changeLocation(const FrameLoadRequest&);
</span><span class="cx"> WEBCORE_EXPORT void urlSelected(const URL&, const String& target, Event*, LockHistory, LockBackForwardList, ShouldSendReferrer, ShouldOpenExternalURLsPolicy, std::optional<NewFrameOpenerPolicy> = std::nullopt, const AtomicString& downloadAttribute = nullAtom);
</span><del>- void submitForm(PassRefPtr<FormSubmission>);
</del><ins>+ void submitForm(Ref<FormSubmission>&&);
</ins><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT void reload(bool endToEndReload = false, bool contentBlockersEnabled = true);
</span><span class="cx"> WEBCORE_EXPORT void reloadWithOverrideEncoding(const String& overrideEncoding);
</span><span class="lines">@@ -331,8 +330,8 @@
</span><span class="cx"> bool dispatchBeforeUnloadEvent(Chrome&, FrameLoader* frameLoaderBeingNavigated);
</span><span class="cx"> void dispatchUnloadEvents(UnloadEventPolicy);
</span><span class="cx">
</span><del>- void continueLoadAfterNavigationPolicy(const ResourceRequest&, PassRefPtr<FormState>, bool shouldContinue, AllowNavigationToInvalidURL);
- void continueLoadAfterNewWindowPolicy(const ResourceRequest&, PassRefPtr<FormState>, const String& frameName, const NavigationAction&, bool shouldContinue, AllowNavigationToInvalidURL, NewFrameOpenerPolicy);
</del><ins>+ void continueLoadAfterNavigationPolicy(const ResourceRequest&, FormState*, bool shouldContinue, AllowNavigationToInvalidURL);
+ void continueLoadAfterNewWindowPolicy(const ResourceRequest&, FormState*, const String& frameName, const NavigationAction&, bool shouldContinue, AllowNavigationToInvalidURL, NewFrameOpenerPolicy);
</ins><span class="cx"> void continueFragmentScrollAfterNavigationPolicy(const ResourceRequest&, bool shouldContinue);
</span><span class="cx">
</span><span class="cx"> bool shouldPerformFragmentNavigation(bool isFormSubmission, const String& httpMethod, FrameLoadType, const URL&);
</span><span class="lines">@@ -355,14 +354,13 @@
</span><span class="cx">
</span><span class="cx"> void urlSelected(const FrameLoadRequest&, Event*);
</span><span class="cx">
</span><del>- void loadWithDocumentLoader(DocumentLoader*, FrameLoadType, PassRefPtr<FormState>, AllowNavigationToInvalidURL); // Calls continueLoadAfterNavigationPolicy
- void load(DocumentLoader*); // Calls loadWithDocumentLoader
</del><ins>+ void loadWithDocumentLoader(DocumentLoader*, FrameLoadType, FormState*, AllowNavigationToInvalidURL); // Calls continueLoadAfterNavigationPolicy
+ void load(DocumentLoader*); // Calls loadWithDocumentLoader
</ins><span class="cx">
</span><del>- void loadWithNavigationAction(const ResourceRequest&, const NavigationAction&, // Calls loadWithDocumentLoader
- LockHistory, FrameLoadType, PassRefPtr<FormState>, AllowNavigationToInvalidURL);
</del><ins>+ void loadWithNavigationAction(const ResourceRequest&, const NavigationAction&, LockHistory, FrameLoadType, FormState*, AllowNavigationToInvalidURL); // Calls loadWithDocumentLoader
</ins><span class="cx">
</span><del>- void loadPostRequest(const FrameLoadRequest&, const String& referrer, FrameLoadType, Event*, PassRefPtr<FormState>);
- void loadURL(const FrameLoadRequest&, const String& referrer, FrameLoadType, Event*, PassRefPtr<FormState>);
</del><ins>+ void loadPostRequest(const FrameLoadRequest&, const String& referrer, FrameLoadType, Event*, FormState*);
+ void loadURL(const FrameLoadRequest&, const String& referrer, FrameLoadType, Event*, FormState*);
</ins><span class="cx">
</span><span class="cx"> bool shouldReload(const URL& currentURL, const URL& destinationURL);
</span><span class="cx">
</span><span class="lines">@@ -371,7 +369,7 @@
</span><span class="cx"> WEBCORE_EXPORT void detachChildren();
</span><span class="cx"> void closeAndRemoveChild(Frame*);
</span><span class="cx">
</span><del>- void loadInSameDocument(const URL&, PassRefPtr<SerializedScriptValue> stateObject, bool isNewNavigation);
</del><ins>+ void loadInSameDocument(const URL&, SerializedScriptValue* stateObject, bool isNewNavigation);
</ins><span class="cx">
</span><span class="cx"> void prepareForLoadStart();
</span><span class="cx"> void provisionalLoadStarted();
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoaderClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoaderClient.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoaderClient.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/loader/FrameLoaderClient.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -72,36 +72,32 @@
</span><span class="cx"> class Frame;
</span><span class="cx"> class FrameLoader;
</span><span class="cx"> class FrameNetworkingContext;
</span><del>-class HistoryItem;
</del><span class="cx"> class HTMLAppletElement;
</span><span class="cx"> class HTMLFormElement;
</span><span class="cx"> class HTMLFrameOwnerElement;
</span><span class="cx"> class HTMLPlugInElement;
</span><ins>+class HistoryItem;
</ins><span class="cx"> class IntSize;
</span><del>-class URL;
</del><span class="cx"> class MessageEvent;
</span><span class="cx"> class NavigationAction;
</span><span class="cx"> class Page;
</span><del>-class ProtectionSpace;
</del><span class="cx"> class PluginViewBase;
</span><span class="cx"> class PolicyChecker;
</span><ins>+class ProtectionSpace;
+class QuickLookHandle;
+class RTCPeerConnectionHandler;
</ins><span class="cx"> class ResourceError;
</span><span class="cx"> class ResourceHandle;
</span><span class="cx"> class ResourceRequest;
</span><span class="cx"> class ResourceResponse;
</span><del>-#if ENABLE(WEB_RTC)
-class RTCPeerConnectionHandler;
-#endif
</del><span class="cx"> class SecurityOrigin;
</span><span class="cx"> class SessionID;
</span><span class="cx"> class SharedBuffer;
</span><del>-class StringWithDirection;
</del><span class="cx"> class SubstituteData;
</span><ins>+class URL;
</ins><span class="cx"> class Widget;
</span><span class="cx">
</span><del>-#if USE(QUICK_LOOK)
-class QuickLookHandle;
-#endif
</del><ins>+struct StringWithDirection;
</ins><span class="cx">
</span><span class="cx"> typedef std::function<void (PolicyAction)> FramePolicyFunction;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderHistoryControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/HistoryController.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/HistoryController.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/loader/HistoryController.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -601,9 +601,9 @@
</span><span class="cx">
</span><span class="cx"> void HistoryController::setCurrentItemTitle(const StringWithDirection& title)
</span><span class="cx"> {
</span><ins>+ // FIXME: This ignores the title's direction.
</ins><span class="cx"> if (m_currentItem)
</span><del>- // FIXME: make use of title.direction() as well.
- m_currentItem->setTitle(title.string());
</del><ins>+ m_currentItem->setTitle(title.string);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool HistoryController::currentItemShouldBeReplaced() const
</span><span class="lines">@@ -659,8 +659,8 @@
</span><span class="cx">
</span><span class="cx"> item.setURL(url);
</span><span class="cx"> item.setTarget(m_frame.tree().uniqueName());
</span><del>- // FIXME: should store title directionality in history as well.
- item.setTitle(title.string());
</del><ins>+ // FIXME: Should store the title direction as well.
+ item.setTitle(title.string);
</ins><span class="cx"> item.setOriginalURLString(originalURL.string());
</span><span class="cx">
</span><span class="cx"> if (!unreachableURL.isEmpty() || documentLoader->response().httpStatusCode() >= 400)
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderHistoryControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/HistoryController.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/HistoryController.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/loader/HistoryController.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -39,8 +39,9 @@
</span><span class="cx"> class Frame;
</span><span class="cx"> class HistoryItem;
</span><span class="cx"> class SerializedScriptValue;
</span><del>-class StringWithDirection;
</del><span class="cx">
</span><ins>+struct StringWithDirection;
+
</ins><span class="cx"> class HistoryController {
</span><span class="cx"> WTF_MAKE_NONCOPYABLE(HistoryController);
</span><span class="cx"> WTF_MAKE_FAST_ALLOCATED;
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderPolicyCallbackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/PolicyCallback.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/PolicyCallback.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/loader/PolicyCallback.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -38,14 +38,6 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-PolicyCallback::PolicyCallback()
-{
-}
-
-PolicyCallback::~PolicyCallback()
-{
-}
-
</del><span class="cx"> void PolicyCallback::clear()
</span><span class="cx"> {
</span><span class="cx"> clearRequest();
</span><span class="lines">@@ -54,7 +46,7 @@
</span><span class="cx"> m_contentFunction = nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void PolicyCallback::set(const ResourceRequest& request, PassRefPtr<FormState> formState,
</del><ins>+void PolicyCallback::set(const ResourceRequest& request, FormState* formState,
</ins><span class="cx"> NavigationPolicyDecisionFunction function)
</span><span class="cx"> {
</span><span class="cx"> m_request = request;
</span><span class="lines">@@ -66,7 +58,7 @@
</span><span class="cx"> m_contentFunction = nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void PolicyCallback::set(const ResourceRequest& request, PassRefPtr<FormState> formState, const String& frameName, const NavigationAction& navigationAction, NewWindowPolicyDecisionFunction function)
</del><ins>+void PolicyCallback::set(const ResourceRequest& request, FormState* formState, const String& frameName, const NavigationAction& navigationAction, NewWindowPolicyDecisionFunction function)
</ins><span class="cx"> {
</span><span class="cx"> m_request = request;
</span><span class="cx"> m_formState = formState;
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderPolicyCallbackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/PolicyCallback.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/PolicyCallback.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/loader/PolicyCallback.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -40,18 +40,15 @@
</span><span class="cx">
</span><span class="cx"> class FormState;
</span><span class="cx">
</span><del>-typedef std::function<void (const ResourceRequest&, PassRefPtr<FormState>, bool shouldContinue)> NavigationPolicyDecisionFunction;
-typedef std::function<void (const ResourceRequest&, PassRefPtr<FormState>, const String& frameName, const NavigationAction&, bool shouldContinue)> NewWindowPolicyDecisionFunction;
-typedef std::function<void (PolicyAction)> ContentPolicyDecisionFunction;
</del><ins>+using ContentPolicyDecisionFunction = std::function<void(PolicyAction)>;
+using NavigationPolicyDecisionFunction = std::function<void(const ResourceRequest&, FormState*, bool shouldContinue)>;
+using NewWindowPolicyDecisionFunction = std::function<void(const ResourceRequest&, FormState*, const String& frameName, const NavigationAction&, bool shouldContinue)>;
</ins><span class="cx">
</span><span class="cx"> class PolicyCallback {
</span><span class="cx"> public:
</span><del>- PolicyCallback();
- ~PolicyCallback();
-
</del><span class="cx"> void clear();
</span><del>- void set(const ResourceRequest&, PassRefPtr<FormState>, NavigationPolicyDecisionFunction);
- void set(const ResourceRequest&, PassRefPtr<FormState>, const String& frameName, const NavigationAction&, NewWindowPolicyDecisionFunction);
</del><ins>+ void set(const ResourceRequest&, FormState*, NavigationPolicyDecisionFunction);
+ void set(const ResourceRequest&, FormState*, const String& frameName, const NavigationAction&, NewWindowPolicyDecisionFunction);
</ins><span class="cx"> void set(ContentPolicyDecisionFunction);
</span><span class="cx">
</span><span class="cx"> const ResourceRequest& request() const { return m_request; }
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderPolicyCheckercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/PolicyChecker.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/PolicyChecker.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/loader/PolicyChecker.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -80,7 +80,7 @@
</span><span class="cx"> checkNavigationPolicy(newRequest, didReceiveRedirectResponse, m_frame.loader().activeDocumentLoader(), nullptr, WTFMove(function));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void PolicyChecker::checkNavigationPolicy(const ResourceRequest& request, bool didReceiveRedirectResponse, DocumentLoader* loader, PassRefPtr<FormState> formState, NavigationPolicyDecisionFunction function)
</del><ins>+void PolicyChecker::checkNavigationPolicy(const ResourceRequest& request, bool didReceiveRedirectResponse, DocumentLoader* loader, FormState* formState, NavigationPolicyDecisionFunction function)
</ins><span class="cx"> {
</span><span class="cx"> NavigationAction action = loader->triggeringAction();
</span><span class="cx"> if (action.isEmpty()) {
</span><span class="lines">@@ -122,7 +122,7 @@
</span><span class="cx">
</span><span class="cx"> loader->setLastCheckedRequest(request);
</span><span class="cx">
</span><del>- m_callback.set(request, formState.get(), WTFMove(function));
</del><ins>+ m_callback.set(request, formState, WTFMove(function));
</ins><span class="cx">
</span><span class="cx"> #if USE(QUICK_LOOK)
</span><span class="cx"> // Always allow QuickLook-generated URLs based on the protocol scheme.
</span><span class="lines">@@ -153,7 +153,7 @@
</span><span class="cx"> m_delegateIsDecidingNavigationPolicy = false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void PolicyChecker::checkNewWindowPolicy(const NavigationAction& action, const ResourceRequest& request, PassRefPtr<FormState> formState, const String& frameName, NewWindowPolicyDecisionFunction function)
</del><ins>+void PolicyChecker::checkNewWindowPolicy(const NavigationAction& action, const ResourceRequest& request, FormState* formState, const String& frameName, NewWindowPolicyDecisionFunction function)
</ins><span class="cx"> {
</span><span class="cx"> if (m_frame.document() && m_frame.document()->isSandboxed(SandboxPopups))
</span><span class="cx"> return continueAfterNavigationPolicy(PolicyIgnore);
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderPolicyCheckerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/PolicyChecker.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/PolicyChecker.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/loader/PolicyChecker.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx"> #include "FrameLoaderTypes.h"
</span><span class="cx"> #include "PolicyCallback.h"
</span><span class="cx"> #include "ResourceRequest.h"
</span><del>-#include <wtf/PassRefPtr.h>
</del><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CONTENT_FILTERING)
</span><span class="lines">@@ -54,9 +53,9 @@
</span><span class="cx"> public:
</span><span class="cx"> explicit PolicyChecker(Frame&);
</span><span class="cx">
</span><del>- void checkNavigationPolicy(const ResourceRequest&, bool didReceiveRedirectResponse, DocumentLoader*, PassRefPtr<FormState>, NavigationPolicyDecisionFunction);
</del><ins>+ void checkNavigationPolicy(const ResourceRequest&, bool didReceiveRedirectResponse, DocumentLoader*, FormState*, NavigationPolicyDecisionFunction);
</ins><span class="cx"> void checkNavigationPolicy(const ResourceRequest&, bool didReceiveRedirectResponse, NavigationPolicyDecisionFunction);
</span><del>- void checkNewWindowPolicy(const NavigationAction&, const ResourceRequest&, PassRefPtr<FormState>, const String& frameName, NewWindowPolicyDecisionFunction);
</del><ins>+ void checkNewWindowPolicy(const NavigationAction&, const ResourceRequest&, FormState*, const String& frameName, NewWindowPolicyDecisionFunction);
</ins><span class="cx"> void checkContentPolicy(const ResourceResponse&, ContentPolicyDecisionFunction);
</span><span class="cx">
</span><span class="cx"> // FIXME: These are different. They could use better names.
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMTimercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMTimer.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMTimer.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/page/DOMTimer.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -189,7 +189,7 @@
</span><span class="cx"> // Keep asking for the next id until we're given one that we don't already have.
</span><span class="cx"> do {
</span><span class="cx"> m_timeoutId = context.circularSequentialID();
</span><del>- } while (!context.addTimeout(m_timeoutId, reference));
</del><ins>+ } while (!context.addTimeout(m_timeoutId, *this));
</ins><span class="cx">
</span><span class="cx"> if (singleShot)
</span><span class="cx"> startOneShot(m_currentTimerInterval);
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/page/DOMWindow.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -1712,26 +1712,30 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(REQUEST_ANIMATION_FRAME)
</span><span class="cx">
</span><del>-int DOMWindow::requestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback> callback)
</del><ins>+int DOMWindow::requestAnimationFrame(Ref<RequestAnimationFrameCallback>&& callback)
</ins><span class="cx"> {
</span><span class="cx"> callback->m_useLegacyTimeBase = false;
</span><del>- if (Document* d = document())
- return d->requestAnimationFrame(callback);
- return 0;
</del><ins>+ auto* document = this->document();
+ if (!document)
+ return 0;
+ return document->requestAnimationFrame(WTFMove(callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-int DOMWindow::webkitRequestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback> callback)
</del><ins>+int DOMWindow::webkitRequestAnimationFrame(Ref<RequestAnimationFrameCallback>&& callback)
</ins><span class="cx"> {
</span><span class="cx"> callback->m_useLegacyTimeBase = true;
</span><del>- if (Document* d = document())
- return d->requestAnimationFrame(callback);
- return 0;
</del><ins>+ auto* document = this->document();
+ if (!document)
+ return 0;
+ return document->requestAnimationFrame(WTFMove(callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void DOMWindow::cancelAnimationFrame(int id)
</span><span class="cx"> {
</span><del>- if (Document* d = document())
- d->cancelAnimationFrame(id);
</del><ins>+ auto* document = this->document();
+ if (!document)
+ return;
+ document->cancelAnimationFrame(id);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/page/DOMWindow.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -266,10 +266,9 @@
</span><span class="cx"> ExceptionOr<int> setInterval(std::unique_ptr<ScheduledAction>, int timeout);
</span><span class="cx"> void clearInterval(int timeoutId);
</span><span class="cx">
</span><del>- // WebKit animation extensions
</del><span class="cx"> #if ENABLE(REQUEST_ANIMATION_FRAME)
</span><del>- int requestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback>);
- int webkitRequestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback>);
</del><ins>+ int requestAnimationFrame(Ref<RequestAnimationFrameCallback>&&);
+ int webkitRequestAnimationFrame(Ref<RequestAnimationFrameCallback>&&);
</ins><span class="cx"> void cancelAnimationFrame(int id);
</span><span class="cx"> #endif
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformPlatformWheelEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/PlatformWheelEvent.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/PlatformWheelEvent.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/platform/PlatformWheelEvent.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2016 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef PlatformWheelEvent_h
-#define PlatformWheelEvent_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "FloatPoint.h"
</span><span class="cx"> #include "IntPoint.h"
</span><span class="lines">@@ -41,196 +40,175 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>- class FloatPoint;
- class FloatSize;
</del><ins>+// The ScrollByPixelWheelEvent is a fine-grained event that specifies the precise number of pixels to scroll.
+// It is sent directly by touch pads on macOS, or synthesized when platforms generate line-by-line scrolling events.
+//
+// The ScrollByPageWheelEvent indicates that the wheel event should scroll an entire page.
+// In this case, WebKit built in paging behavior is used to page up and down.
+// This yields the same behavior as clicking in a scrollbar track to page up and down.
</ins><span class="cx">
</span><del>- // Wheel events come in two flavors:
- // The ScrollByPixelWheelEvent is a fine-grained event that specifies the precise number of pixels to scroll. It is sent directly by MacBook touchpads on OS X,
- // and synthesized in other cases where platforms generate line-by-line scrolling events.
- // The ScrollByPageWheelEvent indicates that the wheel event should scroll an entire page. In this case WebCore's built in paging behavior is used to page
- // up and down (you get the same behavior as if the user was clicking in a scrollbar track to page up or page down).
- enum PlatformWheelEventGranularity : uint8_t {
- ScrollByPageWheelEvent,
- ScrollByPixelWheelEvent,
- };
</del><ins>+enum PlatformWheelEventGranularity : uint8_t {
+ ScrollByPageWheelEvent,
+ ScrollByPixelWheelEvent,
+};
</ins><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span><del>- enum PlatformWheelEventPhase : uint8_t {
- PlatformWheelEventPhaseNone = 0,
- PlatformWheelEventPhaseBegan = 1 << 0,
- PlatformWheelEventPhaseStationary = 1 << 1,
- PlatformWheelEventPhaseChanged = 1 << 2,
- PlatformWheelEventPhaseEnded = 1 << 3,
- PlatformWheelEventPhaseCancelled = 1 << 4,
- PlatformWheelEventPhaseMayBegin = 1 << 5,
- };
-#endif
</del><span class="cx">
</span><del>- class PlatformWheelEvent : public PlatformEvent {
- public:
- PlatformWheelEvent()
- : PlatformEvent(PlatformEvent::Wheel)
- , m_deltaX(0)
- , m_deltaY(0)
- , m_wheelTicksX(0)
- , m_wheelTicksY(0)
- , m_granularity(ScrollByPixelWheelEvent)
- , m_directionInvertedFromDevice(false)
-#if PLATFORM(COCOA)
- , m_hasPreciseScrollingDeltas(false)
- , m_phase(PlatformWheelEventPhaseNone)
- , m_momentumPhase(PlatformWheelEventPhaseNone)
- , m_scrollCount(0)
- , m_unacceleratedScrollingDeltaX(0)
- , m_unacceleratedScrollingDeltaY(0)
-#endif
- {
- }
</del><ins>+enum PlatformWheelEventPhase : uint8_t {
+ PlatformWheelEventPhaseNone = 0,
+ PlatformWheelEventPhaseBegan = 1 << 0,
+ PlatformWheelEventPhaseStationary = 1 << 1,
+ PlatformWheelEventPhaseChanged = 1 << 2,
+ PlatformWheelEventPhaseEnded = 1 << 3,
+ PlatformWheelEventPhaseCancelled = 1 << 4,
+ PlatformWheelEventPhaseMayBegin = 1 << 5,
+};
</ins><span class="cx">
</span><del>- PlatformWheelEvent(IntPoint position, IntPoint globalPosition, float deltaX, float deltaY, float wheelTicksX, float wheelTicksY, PlatformWheelEventGranularity granularity, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey)
- : PlatformEvent(PlatformEvent::Wheel, shiftKey, ctrlKey, altKey, metaKey, 0)
- , m_position(position)
- , m_globalPosition(globalPosition)
- , m_deltaX(deltaX)
- , m_deltaY(deltaY)
- , m_wheelTicksX(wheelTicksX)
- , m_wheelTicksY(wheelTicksY)
- , m_granularity(granularity)
- , m_directionInvertedFromDevice(false)
-#if PLATFORM(COCOA)
- , m_hasPreciseScrollingDeltas(false)
- , m_phase(PlatformWheelEventPhaseNone)
- , m_momentumPhase(PlatformWheelEventPhaseNone)
- , m_scrollCount(0)
- , m_unacceleratedScrollingDeltaX(0)
- , m_unacceleratedScrollingDeltaY(0)
</del><span class="cx"> #endif
</span><del>- {
- }
</del><span class="cx">
</span><del>- PlatformWheelEvent copyTurningVerticalTicksIntoHorizontalTicks() const
- {
- PlatformWheelEvent copy = *this;
</del><ins>+class PlatformWheelEvent : public PlatformEvent {
+public:
+ PlatformWheelEvent()
+ : PlatformEvent(PlatformEvent::Wheel)
+ {
+ }
</ins><span class="cx">
</span><del>- copy.m_deltaX = copy.m_deltaY;
- copy.m_deltaY = 0;
- copy.m_wheelTicksX = copy.m_wheelTicksY;
- copy.m_wheelTicksY = 0;
</del><ins>+ PlatformWheelEvent(IntPoint position, IntPoint globalPosition, float deltaX, float deltaY, float wheelTicksX, float wheelTicksY, PlatformWheelEventGranularity granularity, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey)
+ : PlatformEvent(PlatformEvent::Wheel, shiftKey, ctrlKey, altKey, metaKey, 0)
+ , m_position(position)
+ , m_globalPosition(globalPosition)
+ , m_deltaX(deltaX)
+ , m_deltaY(deltaY)
+ , m_wheelTicksX(wheelTicksX)
+ , m_wheelTicksY(wheelTicksY)
+ , m_granularity(granularity)
+ {
+ }
</ins><span class="cx">
</span><del>- return copy;
- }
</del><ins>+ PlatformWheelEvent copyTurningVerticalTicksIntoHorizontalTicks() const
+ {
+ PlatformWheelEvent copy = *this;
+ copy.m_deltaX = copy.m_deltaY;
+ copy.m_deltaY = 0;
+ copy.m_wheelTicksX = copy.m_wheelTicksY;
+ copy.m_wheelTicksY = 0;
+ return copy;
+ }
</ins><span class="cx">
</span><del>- PlatformWheelEvent copyWithDeltasAndVelocity(float deltaX, float deltaY, const FloatSize& velocity) const
- {
- PlatformWheelEvent copy = *this;
- copy.m_deltaX = deltaX;
- copy.m_deltaY = deltaY;
- copy.m_scrollingVelocity = velocity;
- return copy;
- }
</del><ins>+ PlatformWheelEvent copyWithDeltasAndVelocity(float deltaX, float deltaY, const FloatSize& velocity) const
+ {
+ PlatformWheelEvent copy = *this;
+ copy.m_deltaX = deltaX;
+ copy.m_deltaY = deltaY;
+ copy.m_scrollingVelocity = velocity;
+ return copy;
+ }
</ins><span class="cx">
</span><del>- const IntPoint& position() const { return m_position; } // PlatformWindow coordinates.
- const IntPoint& globalPosition() const { return m_globalPosition; } // Screen coordinates.
</del><ins>+ const IntPoint& position() const { return m_position; } // PlatformWindow coordinates.
+ const IntPoint& globalPosition() const { return m_globalPosition; } // Screen coordinates.
</ins><span class="cx">
</span><del>- float deltaX() const { return m_deltaX; }
- float deltaY() const { return m_deltaY; }
</del><ins>+ float deltaX() const { return m_deltaX; }
+ float deltaY() const { return m_deltaY; }
</ins><span class="cx">
</span><del>- float wheelTicksX() const { return m_wheelTicksX; }
- float wheelTicksY() const { return m_wheelTicksY; }
</del><ins>+ float wheelTicksX() const { return m_wheelTicksX; }
+ float wheelTicksY() const { return m_wheelTicksY; }
</ins><span class="cx">
</span><del>- PlatformWheelEventGranularity granularity() const { return m_granularity; }
</del><ins>+ PlatformWheelEventGranularity granularity() const { return m_granularity; }
</ins><span class="cx">
</span><del>- bool directionInvertedFromDevice() const { return m_directionInvertedFromDevice; }
</del><ins>+ bool directionInvertedFromDevice() const { return m_directionInvertedFromDevice; }
</ins><span class="cx">
</span><ins>+ const FloatSize& scrollingVelocity() const { return m_scrollingVelocity; }
+
</ins><span class="cx"> #if PLATFORM(GTK)
</span><del>- explicit PlatformWheelEvent(GdkEventScroll*);
</del><ins>+ explicit PlatformWheelEvent(GdkEventScroll*);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(EFL)
</span><del>- explicit PlatformWheelEvent(const Evas_Event_Mouse_Wheel*);
</del><ins>+ explicit PlatformWheelEvent(const Evas_Event_Mouse_Wheel*);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span><del>- bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas; }
- void setHasPreciseScrollingDeltas(bool b) { m_hasPreciseScrollingDeltas = b; }
- PlatformWheelEventPhase phase() const { return m_phase; }
- PlatformWheelEventPhase momentumPhase() const { return m_momentumPhase; }
- unsigned scrollCount() const { return m_scrollCount; }
- float unacceleratedScrollingDeltaX() const { return m_unacceleratedScrollingDeltaX; }
- float unacceleratedScrollingDeltaY() const { return m_unacceleratedScrollingDeltaY; }
- bool useLatchedEventElement() const;
- bool shouldConsiderLatching() const;
- bool shouldResetLatching() const;
- bool isEndOfMomentumScroll() const;
- bool isEndOfNonMomentumScroll() const;
- bool isTransitioningToMomentumScroll() const;
</del><ins>+ bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas; }
+ void setHasPreciseScrollingDeltas(bool hasPreciseScrollingDeltas) { m_hasPreciseScrollingDeltas = hasPreciseScrollingDeltas; }
+ PlatformWheelEventPhase phase() const { return m_phase; }
+ PlatformWheelEventPhase momentumPhase() const { return m_momentumPhase; }
+ unsigned scrollCount() const { return m_scrollCount; }
+ float unacceleratedScrollingDeltaX() const { return m_unacceleratedScrollingDeltaX; }
+ float unacceleratedScrollingDeltaY() const { return m_unacceleratedScrollingDeltaY; }
+ bool useLatchedEventElement() const;
+ bool shouldConsiderLatching() const;
+ bool shouldResetLatching() const;
+ bool isEndOfMomentumScroll() const;
+ bool isEndOfNonMomentumScroll() const;
+ bool isTransitioningToMomentumScroll() const;
</ins><span class="cx"> #else
</span><del>- bool useLatchedEventElement() const { return false; }
</del><ins>+ bool useLatchedEventElement() const { return false; }
</ins><span class="cx"> #endif
</span><span class="cx">
</span><del>- FloatSize scrollingVelocity() const { return m_scrollingVelocity; }
-
</del><span class="cx"> #if PLATFORM(WIN)
</span><del>- PlatformWheelEvent(HWND, WPARAM, LPARAM, bool isMouseHWheel);
- PlatformWheelEvent(HWND, const FloatSize& delta, const FloatPoint& location);
</del><ins>+ PlatformWheelEvent(HWND, WPARAM, LPARAM, bool isMouseHWheel);
+ PlatformWheelEvent(HWND, const FloatSize& delta, const FloatPoint& location);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><del>- protected:
- IntPoint m_position;
- IntPoint m_globalPosition;
- float m_deltaX;
- float m_deltaY;
- float m_wheelTicksX;
- float m_wheelTicksY;
- PlatformWheelEventGranularity m_granularity;
- bool m_directionInvertedFromDevice;
</del><ins>+protected:
+ IntPoint m_position;
+ IntPoint m_globalPosition;
+ float m_deltaX { 0 };
+ float m_deltaY { 0 };
+ float m_wheelTicksX { 0 };
+ float m_wheelTicksY { 0 };
+ PlatformWheelEventGranularity m_granularity { ScrollByPixelWheelEvent };
+ bool m_directionInvertedFromDevice { false };
</ins><span class="cx">
</span><del>- // Scrolling velocity in pixels per second.
- FloatSize m_scrollingVelocity;
</del><ins>+ // Scrolling velocity in pixels per second.
+ FloatSize m_scrollingVelocity;
+
</ins><span class="cx"> #if PLATFORM(COCOA)
</span><del>- bool m_hasPreciseScrollingDeltas;
- PlatformWheelEventPhase m_phase;
- PlatformWheelEventPhase m_momentumPhase;
- unsigned m_scrollCount;
- float m_unacceleratedScrollingDeltaX;
- float m_unacceleratedScrollingDeltaY;
</del><ins>+ bool m_hasPreciseScrollingDeltas { false };
+ PlatformWheelEventPhase m_phase { PlatformWheelEventPhaseNone };
+ PlatformWheelEventPhase m_momentumPhase { PlatformWheelEventPhaseNone };
+ unsigned m_scrollCount { 0 };
+ float m_unacceleratedScrollingDeltaX { 0 };
+ float m_unacceleratedScrollingDeltaY { 0 };
</ins><span class="cx"> #endif
</span><del>- };
</del><ins>+};
</ins><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span><del>- inline bool PlatformWheelEvent::useLatchedEventElement() const
- {
- return m_phase == PlatformWheelEventPhaseBegan || m_phase == PlatformWheelEventPhaseChanged
- || m_momentumPhase == PlatformWheelEventPhaseBegan || m_momentumPhase == PlatformWheelEventPhaseChanged
</del><ins>+
+inline bool PlatformWheelEvent::useLatchedEventElement() const
+{
+ return m_phase == PlatformWheelEventPhaseBegan
+ || m_phase == PlatformWheelEventPhaseChanged
+ || m_momentumPhase == PlatformWheelEventPhaseBegan
+ || m_momentumPhase == PlatformWheelEventPhaseChanged
</ins><span class="cx"> || (m_phase == PlatformWheelEventPhaseEnded && m_momentumPhase == PlatformWheelEventPhaseNone);
</span><del>- }
-
- inline bool PlatformWheelEvent::shouldConsiderLatching() const
- {
- return m_phase == PlatformWheelEventPhaseBegan || m_phase == PlatformWheelEventPhaseMayBegin;
- }
-
- inline bool PlatformWheelEvent::shouldResetLatching() const
- {
- return m_phase == PlatformWheelEventPhaseCancelled || m_phase == PlatformWheelEventPhaseMayBegin || isEndOfMomentumScroll();
- }
</del><ins>+}
</ins><span class="cx">
</span><del>- inline bool PlatformWheelEvent::isEndOfMomentumScroll() const
- {
- return m_phase == PlatformWheelEventPhaseNone && m_momentumPhase == PlatformWheelEventPhaseEnded;
- }
</del><ins>+inline bool PlatformWheelEvent::shouldConsiderLatching() const
+{
+ return m_phase == PlatformWheelEventPhaseBegan || m_phase == PlatformWheelEventPhaseMayBegin;
+}
</ins><span class="cx">
</span><del>- inline bool PlatformWheelEvent::isEndOfNonMomentumScroll() const
- {
- return m_phase == PlatformWheelEventPhaseEnded && m_momentumPhase == PlatformWheelEventPhaseNone;
- }
</del><ins>+inline bool PlatformWheelEvent::shouldResetLatching() const
+{
+ return m_phase == PlatformWheelEventPhaseCancelled || m_phase == PlatformWheelEventPhaseMayBegin || isEndOfMomentumScroll();
+}
</ins><span class="cx">
</span><del>- inline bool PlatformWheelEvent::isTransitioningToMomentumScroll() const
- {
- return m_phase == PlatformWheelEventPhaseNone && m_momentumPhase == PlatformWheelEventPhaseBegan;
- }
</del><ins>+inline bool PlatformWheelEvent::isEndOfMomentumScroll() const
+{
+ return m_phase == PlatformWheelEventPhaseNone && m_momentumPhase == PlatformWheelEventPhaseEnded;
+}
+
+inline bool PlatformWheelEvent::isEndOfNonMomentumScroll() const
+{
+ return m_phase == PlatformWheelEventPhaseEnded && m_momentumPhase == PlatformWheelEventPhaseNone;
+}
+
+inline bool PlatformWheelEvent::isTransitioningToMomentumScroll() const
+{
+ return m_phase == PlatformWheelEventPhaseNone && m_momentumPhase == PlatformWheelEventPhaseBegan;
+}
+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif // PlatformWheelEvent_h
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformtextStringWithDirectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/StringWithDirection.h (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/StringWithDirection.h        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/platform/text/StringWithDirection.h        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -28,8 +28,7 @@
</span><span class="cx"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef StringWithDirection_h
-#define StringWithDirection_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "WritingMode.h"
</span><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="lines">@@ -44,36 +43,23 @@
</span><span class="cx"> // Note that is explicitly *not* the direction of the string as learned
</span><span class="cx"> // from the characters of the string; it's extra metadata we have external
</span><span class="cx"> // to the string.
</span><del>-class StringWithDirection {
-public:
- StringWithDirection()
- : m_direction(LTR)
- {
- }
</del><span class="cx">
</span><del>- StringWithDirection(const String& string, TextDirection dir)
- : m_string(string)
- , m_direction(dir)
- {
- }
</del><ins>+struct StringWithDirection {
+ StringWithDirection() = default;
+ StringWithDirection(const String& string, TextDirection direction) : string { string }, direction { direction } { }
+ StringWithDirection(String&& string, TextDirection direction) : string { WTFMove(string) }, direction { direction } { }
+ String string;
+ TextDirection direction { LTR };
+};
</ins><span class="cx">
</span><del>- const String& string() const { return m_string; }
- TextDirection direction() const { return m_direction; }
</del><ins>+inline bool operator==(const StringWithDirection& a, const StringWithDirection& b)
+{
+ return a.string == b.string && a.direction == b.direction;
+}
</ins><span class="cx">
</span><del>- bool isEmpty() const { return m_string.isEmpty(); }
- bool isNull() const { return m_string.isNull(); }
</del><ins>+inline bool operator!=(const StringWithDirection& a, const StringWithDirection& b)
+{
+ return !(a == b);
+}
</ins><span class="cx">
</span><del>- bool operator==(const StringWithDirection& other) const
- {
- return other.m_string == m_string && other.m_direction == m_direction;
- }
- bool operator!=(const StringWithDirection& other) const { return !((*this) == other); }
-
-private:
- String m_string;
- TextDirection m_direction;
-};
-
</del><span class="cx"> }
</span><del>-
-#endif // StringWithDirection_h
</del></span></pre></div>
<a id="trunkSourceWebCorerenderingHitTestResultcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/HitTestResult.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/HitTestResult.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/rendering/HitTestResult.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -748,7 +748,7 @@
</span><span class="cx"> if (!frame)
</span><span class="cx"> return Vector<String>();
</span><span class="cx">
</span><del>- return frame->editor().dictationAlternativesForMarker(marker);
</del><ins>+ return frame->editor().dictationAlternativesForMarker(*marker);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Node* HitTestResult::targetNode() const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingInlineTextBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/InlineTextBox.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/InlineTextBox.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebCore/rendering/InlineTextBox.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -820,7 +820,7 @@
</span><span class="cx"> if (!renderer().frame().editor().markedTextMatchesAreHighlighted())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- Color color = marker.activeMatch() ? renderer().theme().platformActiveTextSearchHighlightColor() : renderer().theme().platformInactiveTextSearchHighlightColor();
</del><ins>+ Color color = marker.isActiveMatch() ? renderer().theme().platformActiveTextSearchHighlightColor() : renderer().theme().platformInactiveTextSearchHighlightColor();
</ins><span class="cx"> GraphicsContextStateSaver stateSaver(context);
</span><span class="cx"> updateGraphicsContext(context, TextPaintStyle(color)); // Don't draw text at all!
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKitiosChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ios/ChangeLog (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ios/ChangeLog        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebKit/ios/ChangeLog        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-12-30 Darin Adler <darin@apple.com>
+
+ Remove PassRefPtr use from the "dom" directory, related cleanup
+ https://bugs.webkit.org/show_bug.cgi?id=166569
+
+ Reviewed by Alex Christensen.
+
+ * 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.
+
</ins><span class="cx"> 2016-12-15 Myles C. Maxfield <mmaxfield@apple.com>
</span><span class="cx">
</span><span class="cx"> Stop reinterpret_casting UBreakIterators to the undefined type TextBreakIterator
</span></span></pre></div>
<a id="trunkSourceWebKitiosWebViewWebPDFViewIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ios/WebView/WebPDFViewIOS.mm (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ios/WebView/WebPDFViewIOS.mm        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebKit/ios/WebView/WebPDFViewIOS.mm        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -295,7 +295,7 @@
</span><span class="cx"> if ([title length]) {
</span><span class="cx"> [_title release];
</span><span class="cx"> _title = [title copy];
</span><del>- core([self _frame])->loader().client().dispatchDidReceiveTitle(StringWithDirection(title, LTR));
</del><ins>+ core([self _frame])->loader().client().dispatchDidReceiveTitle({ title, LTR });
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebKit/mac/ChangeLog        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2016-12-30 Darin Adler <darin@apple.com>
+
+ Remove PassRefPtr use from the "dom" directory, related cleanup
+ https://bugs.webkit.org/show_bug.cgi?id=166569
+
+ Reviewed by Alex Christensen.
+
+ * 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.
+
</ins><span class="cx"> 2016-12-25 Yusuke Suzuki <utatane.tea@gmail.com>
</span><span class="cx">
</span><span class="cx"> Propagate the source origin as much as possible
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebFrameLoaderClientmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -685,9 +685,10 @@
</span><span class="cx"> {
</span><span class="cx"> WebView *webView = getWebView(m_webFrame.get());
</span><span class="cx"> WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView);
</span><del>- if (implementations->didReceiveTitleForFrameFunc)
- // FIXME: use direction of title.
- CallFrameLoadDelegate(implementations->didReceiveTitleForFrameFunc, webView, @selector(webView:didReceiveTitle:forFrame:), (NSString *)title.string(), m_webFrame.get());
</del><ins>+ if (implementations->didReceiveTitleForFrameFunc) {
+ // FIXME: Use direction of title.
+ CallFrameLoadDelegate(implementations->didReceiveTitleForFrameFunc, webView, @selector(webView:didReceiveTitle:forFrame:), (NSString *)title.string, m_webFrame.get());
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebFrameLoaderClient::dispatchDidCommitLoad(std::optional<HasInsecureContent>)
</span><span class="lines">@@ -1030,7 +1031,7 @@
</span><span class="cx"> WebHistoryDelegateImplementationCache* implementations = WebViewGetHistoryDelegateImplementations(view);
</span><span class="cx"> if (implementations->navigatedFunc) {
</span><span class="cx"> WebNavigationData *data = [[WebNavigationData alloc] initWithURLString:loader->url()
</span><del>- title:nilOrNSString(loader->title().string())
</del><ins>+ title:nilOrNSString(loader->title().string)
</ins><span class="cx"> originalRequest:loader->originalRequestCopy().nsURLRequest(UpdateHTTPBody)
</span><span class="cx"> response:loader->response().nsURLResponse()
</span><span class="cx"> hasSubstituteData:loader->substituteData().isValid()
</span><span class="lines">@@ -1043,7 +1044,7 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- [[WebHistory optionalSharedHistory] _visitedURL:loader->urlForHistory() withTitle:loader->title().string() method:loader->originalRequestCopy().httpMethod() wasFailure:loader->urlForHistoryReflectsFailure()];
</del><ins>+ [[WebHistory optionalSharedHistory] _visitedURL:loader->urlForHistory() withTitle:loader->title().string method:loader->originalRequestCopy().httpMethod() wasFailure:loader->urlForHistoryReflectsFailure()];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static void addRedirectURL(WebHistoryItem *item, const String& url)
</span><span class="lines">@@ -1351,15 +1352,14 @@
</span><span class="cx">
</span><span class="cx"> if ([view historyDelegate]) {
</span><span class="cx"> WebHistoryDelegateImplementationCache* implementations = WebViewGetHistoryDelegateImplementations(view);
</span><del>- // FIXME: use direction of title.
</del><ins>+ // FIXME: Use direction of title.
</ins><span class="cx"> if (implementations->setTitleFunc)
</span><del>- CallHistoryDelegate(implementations->setTitleFunc, view, @selector(webView:updateHistoryTitle:forURL:inFrame:), (NSString *)title.string(), (NSString *)url, m_webFrame.get());
</del><ins>+ CallHistoryDelegate(implementations->setTitleFunc, view, @selector(webView:updateHistoryTitle:forURL:inFrame:), (NSString *)title.string, (NSString *)url, m_webFrame.get());
</ins><span class="cx"> else if (implementations->deprecatedSetTitleFunc)
</span><del>- CallHistoryDelegate(implementations->deprecatedSetTitleFunc, view, @selector(webView:updateHistoryTitle:forURL:), (NSString *)title.string(), (NSString *)url);
-
</del><ins>+ CallHistoryDelegate(implementations->deprecatedSetTitleFunc, view, @selector(webView:updateHistoryTitle:forURL:), (NSString *)title.string, (NSString *)url);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> NSURL* nsURL = url;
</span><span class="cx"> nsURL = [nsURL _webkit_canonicalize];
</span><span class="cx"> if(!nsURL)
</span><span class="lines">@@ -1368,9 +1368,7 @@
</span><span class="cx"> if ([[nsURL absoluteString] isEqualToString:@"about:blank"])
</span><span class="cx"> return;
</span><span class="cx"> #endif
</span><del>- NSString *titleNSString = title.string();
-
- [[[WebHistory optionalSharedHistory] itemForURL:nsURL] setTitle:titleNSString];
</del><ins>+ [[[WebHistory optionalSharedHistory] itemForURL:nsURL] setTitle:title.string];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebFrameLoaderClient::savePlatformDataToCachedFrame(CachedFrame* cachedFrame)
</span><span class="lines">@@ -1486,12 +1484,12 @@
</span><span class="cx"> // The following is a no-op for WebHTMLRepresentation, but for custom document types
</span><span class="cx"> // like the ones that Safari uses for bookmarks it is the only way the DocumentLoader
</span><span class="cx"> // will get the proper title.
</span><del>- if (DocumentLoader* documentLoader = [dataSource _documentLoader])
- documentLoader->setTitle(StringWithDirection([dataSource pageTitle], LTR));
</del><ins>+ if (auto* documentLoader = [dataSource _documentLoader])
+ documentLoader->setTitle({ [dataSource pageTitle], LTR });
</ins><span class="cx">
</span><del>- if (HTMLFrameOwnerElement* owner = coreFrame->ownerElement())
- coreFrame->view()->setCanHaveScrollbars(owner->scrollingMode() != ScrollbarAlwaysOff);
-
</del><ins>+ if (auto* ownerElement = coreFrame->ownerElement())
+ coreFrame->view()->setCanHaveScrollbars(ownerElement->scrollingMode() != ScrollbarAlwaysOff);
+
</ins><span class="cx"> // If the document view implicitly became first responder, make sure to set the focused frame properly.
</span><span class="cx"> if ([[documentView window] firstResponder] == documentView) {
</span><span class="cx"> page->focusController().setFocusedFrame(coreFrame);
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebFramemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebFrame.mm (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebFrame.mm        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebKit/mac/WebView/WebFrame.mm        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -2254,6 +2254,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><ins>+
</ins><span class="cx"> - (DOMDocumentFragment *)_documentFragmentForText:(NSString *)text
</span><span class="cx"> {
</span><span class="cx"> return kit(createFragmentFromText(*_private->coreFrame->selection().toNormalizedRange().get(), text).ptr());
</span><span class="lines">@@ -2303,8 +2304,9 @@
</span><span class="cx"> Frame* coreFrame = _private->coreFrame;
</span><span class="cx"> if (!coreFrame)
</span><span class="cx"> return;
</span><del>- coreFrame->loader().client().dispatchDidReceiveTitle(StringWithDirection(title, LTR));
</del><ins>+ coreFrame->loader().client().dispatchDidReceiveTitle({ title, LTR });
</ins><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif // PLATFORM(IOS)
</span><span class="cx">
</span><span class="cx"> - (JSValueRef)jsWrapperForNode:(DOMNode *)node inScriptWorld:(WebScriptWorld *)world
</span><span class="lines">@@ -2528,8 +2530,8 @@
</span><span class="cx">
</span><span class="cx"> - (void)loadArchive:(WebArchive *)archive
</span><span class="cx"> {
</span><del>- if (LegacyWebArchive* coreArchive = [archive _coreLegacyWebArchive])
- _private->coreFrame->loader().loadArchive(coreArchive);
</del><ins>+ if (auto* coreArchive = [archive _coreLegacyWebArchive])
+ _private->coreFrame->loader().loadArchive(*coreArchive);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)stopLoading
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebHTMLRepresentationmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebHTMLRepresentation.mm (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebHTMLRepresentation.mm        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebKit/mac/WebView/WebHTMLRepresentation.mm        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -250,7 +250,7 @@
</span><span class="cx">
</span><span class="cx"> - (NSString *)title
</span><span class="cx"> {
</span><del>- return nsStringNilIfEmpty([_private->dataSource _documentLoader]->title().string());
</del><ins>+ return nsStringNilIfEmpty([_private->dataSource _documentLoader]->title().string);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (DOMDocument *)DOMDocument
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebKit/win/ChangeLog        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-12-30 Darin Adler <darin@apple.com>
+
+ Remove PassRefPtr use from the "dom" directory, related cleanup
+ https://bugs.webkit.org/show_bug.cgi?id=166569
+
+ Reviewed by Alex Christensen.
+
+ * 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.
+
</ins><span class="cx"> 2016-12-25 Yusuke Suzuki <utatane.tea@gmail.com>
</span><span class="cx">
</span><span class="cx"> Propagate the source origin as much as possible
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebCoreSupportWebFrameLoaderClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -420,7 +420,7 @@
</span><span class="cx"> COMPtr<IWebFrameLoadDelegate> frameLoadDelegate;
</span><span class="cx"> if (SUCCEEDED(webView->frameLoadDelegate(&frameLoadDelegate)))
</span><span class="cx"> // FIXME: use direction of title.
</span><del>- frameLoadDelegate->didReceiveTitle(webView, BString(title.string()), m_webFrame);
</del><ins>+ frameLoadDelegate->didReceiveTitle(webView, BString(title.string), m_webFrame);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebFrameLoaderClient::dispatchDidCommitLoad(std::optional<HasInsecureContent>)
</span><span class="lines">@@ -711,7 +711,7 @@
</span><span class="cx"> COMPtr<IWebURLRequest> urlRequest(AdoptCOM, WebMutableURLRequest::createInstance(loader->originalRequestCopy()));
</span><span class="cx">
</span><span class="cx"> COMPtr<IWebNavigationData> navigationData(AdoptCOM, WebNavigationData::createInstance(
</span><del>- loader->urlForHistory(), loader->title().string(), urlRequest.get(), urlResponse.get(), loader->substituteData().isValid(), loader->clientRedirectSourceForHistory()));
</del><ins>+ loader->urlForHistory(), loader->title().string, urlRequest.get(), urlResponse.get(), loader->substituteData().isValid(), loader->clientRedirectSourceForHistory()));
</ins><span class="cx">
</span><span class="cx"> historyDelegate->didNavigateWithNavigationData(webView, navigationData.get(), m_webFrame);
</span><span class="cx"> return;
</span><span class="lines">@@ -721,7 +721,7 @@
</span><span class="cx"> if (!history)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- history->visitedURL(loader->urlForHistory(), loader->title().string(), loader->originalRequestCopy().httpMethod(), loader->urlForHistoryReflectsFailure(), !loader->clientRedirectSourceForHistory());
</del><ins>+ history->visitedURL(loader->urlForHistory(), loader->title().string, loader->originalRequestCopy().httpMethod(), loader->urlForHistoryReflectsFailure(), !loader->clientRedirectSourceForHistory());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebFrameLoaderClient::updateGlobalHistoryRedirectLinks()
</span><span class="lines">@@ -929,7 +929,7 @@
</span><span class="cx"> COMPtr<IWebHistoryDelegate> historyDelegate;
</span><span class="cx"> webView->historyDelegate(&historyDelegate);
</span><span class="cx"> if (historyDelegate) {
</span><del>- BString titleBSTR(title.string());
</del><ins>+ BString titleBSTR(title.string);
</ins><span class="cx"> BString urlBSTR(url.string());
</span><span class="cx"> historyDelegate->updateHistoryTitle(webView, titleBSTR, urlBSTR);
</span><span class="cx"> return;
</span><span class="lines">@@ -955,7 +955,7 @@
</span><span class="cx"> if (!itemPrivate)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- itemPrivate->setTitle(BString(title.string()));
</del><ins>+ itemPrivate->setTitle(BString(title.string));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebFrameLoaderClient::savePlatformDataToCachedFrame(CachedFrame* cachedFrame)
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebDataSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebDataSource.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebDataSource.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebKit/win/WebDataSource.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -282,7 +282,7 @@
</span><span class="cx"> if (!m_loader)
</span><span class="cx"> return E_UNEXPECTED;
</span><span class="cx">
</span><del>- *title = BString(m_loader->title().string()).release();
</del><ins>+ *title = BString(m_loader->title().string).release();
</ins><span class="cx"> return S_OK;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebKit2/ChangeLog        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-12-30 Darin Adler <darin@apple.com>
+
+ Remove PassRefPtr use from the "dom" directory, related cleanup
+ https://bugs.webkit.org/show_bug.cgi?id=166569
+
+ Reviewed by Alex Christensen.
+
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::dispatchDidReceiveTitle): Updated to use struct.
+ (WebKit::WebFrameLoaderClient::updateGlobalHistory): Ditto.
+ (WebKit::WebFrameLoaderClient::setTitle): Ditto.
+
</ins><span class="cx"> 2016-12-27 Alex Christensen <achristensen@webkit.org>
</span><span class="cx">
</span><span class="cx"> reduce PassRefPtr use in WebKit2
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (210215 => 210216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2016-12-31 09:17:36 UTC (rev 210215)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2016-12-31 09:51:29 UTC (rev 210216)
</span><span class="lines">@@ -433,11 +433,11 @@
</span><span class="cx"> RefPtr<API::Object> userData;
</span><span class="cx">
</span><span class="cx"> // Notify the bundle client.
</span><del>- // FIXME: use direction of title.
- webPage->injectedBundleLoaderClient().didReceiveTitleForFrame(webPage, title.string(), m_frame, userData);
</del><ins>+ // FIXME: Use direction of title.
+ webPage->injectedBundleLoaderClient().didReceiveTitleForFrame(webPage, title.string, m_frame, userData);
</ins><span class="cx">
</span><span class="cx"> // Notify the UIProcess.
</span><del>- webPage->send(Messages::WebPageProxy::DidReceiveTitleForFrame(m_frame->frameID(), title.string(), UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
</del><ins>+ webPage->send(Messages::WebPageProxy::DidReceiveTitleForFrame(m_frame->frameID(), title.string, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebFrameLoaderClient::dispatchDidCommitLoad(std::optional<HasInsecureContent> hasInsecureContent)
</span><span class="lines">@@ -1001,8 +1001,8 @@
</span><span class="cx">
</span><span class="cx"> WebNavigationDataStore data;
</span><span class="cx"> data.url = loader->url().string();
</span><del>- // FIXME: use direction of title.
- data.title = loader->title().string();
</del><ins>+ // FIXME: Use direction of title.
+ data.title = loader->title().string;
</ins><span class="cx"> data.originalRequest = loader->originalRequestCopy();
</span><span class="cx"> data.response = loader->response();
</span><span class="cx">
</span><span class="lines">@@ -1274,8 +1274,8 @@
</span><span class="cx"> if (!webPage || !webPage->pageGroup()->isVisibleToHistoryClient())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- // FIXME: use direction of title.
- webPage->send(Messages::WebPageProxy::DidUpdateHistoryTitle(title.string(), url.string(), m_frame->frameID()));
</del><ins>+ // FIXME: Use direction of title.
+ webPage->send(Messages::WebPageProxy::DidUpdateHistoryTitle(title.string, url.string(), m_frame->frameID()));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> String WebFrameLoaderClient::userAgent(const URL& url)
</span></span></pre>
</div>
</div>
</body>
</html>