1 2016-11-11 Brady Eidson <beidson@apple.com>
3 IndexedDB 2.0: "close pending flag" and firing blocked events all need fixing.
4 https://bugs.webkit.org/show_bug.cgi?id=164641
6 Reviewed by Alex Christensen.
8 No new tests (Covered by at least 3 existing tests).
10 * Modules/indexeddb/IDBDatabase.cpp:
11 (WebCore::IDBDatabase::close):
12 (WebCore::IDBDatabase::maybeCloseInServer):
14 * Modules/indexeddb/client/IDBConnectionProxy.cpp:
15 (WebCore::IDBClient::IDBConnectionProxy::databaseConnectionPendingClose):
16 * Modules/indexeddb/client/IDBConnectionProxy.h:
18 * Modules/indexeddb/client/IDBConnectionToServer.cpp:
19 (WebCore::IDBClient::IDBConnectionToServer::databaseConnectionPendingClose):
20 * Modules/indexeddb/client/IDBConnectionToServer.h:
21 * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
23 * Modules/indexeddb/server/IDBServer.cpp:
24 (WebCore::IDBServer::IDBServer::databaseConnectionPendingClose):
25 * Modules/indexeddb/server/IDBServer.h:
27 * Modules/indexeddb/server/ServerOpenDBRequest.cpp:
28 (WebCore::IDBServer::ServerOpenDBRequest::maybeNotifyRequestBlocked):
29 (WebCore::IDBServer::ServerOpenDBRequest::notifyRequestBlocked): Deleted.
30 * Modules/indexeddb/server/ServerOpenDBRequest.h:
31 (WebCore::IDBServer::ServerOpenDBRequest::hasNotifiedBlocked): Deleted.
33 * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
34 (WebCore::IDBServer::UniqueIDBDatabase::allConnectionsAreClosedOrClosing):
35 (WebCore::IDBServer::UniqueIDBDatabase::maybeNotifyConnectionsOfVersionChange):
36 (WebCore::IDBServer::UniqueIDBDatabase::notifyCurrentRequestConnectionClosedOrFiredVersionChangeEvent):
37 * Modules/indexeddb/server/UniqueIDBDatabase.h:
39 * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
40 (WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionPendingCloseFromClient):
41 (WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionClosedFromClient):
42 (WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionIsClosing):
43 * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
45 * Modules/indexeddb/shared/InProcessIDBServer.cpp:
46 (WebCore::InProcessIDBServer::databaseConnectionPendingClose):
47 * Modules/indexeddb/shared/InProcessIDBServer.h:
49 2016-11-11 Dave Hyatt <hyatt@apple.com>
51 [CSS Parser] Fix time unit parsing
52 https://bugs.webkit.org/show_bug.cgi?id=164649
54 Reviewed by Dean Jackson.
56 Make sure that a unitless value gets changed to milliseconds properly.
58 * css/parser/CSSPropertyParserHelpers.cpp:
59 (WebCore::CSSPropertyParserHelpers::consumeTime):
61 2016-11-11 Keith Rollin <krollin@apple.com>
63 Reduce number of platformMemoryUsage calls
64 https://bugs.webkit.org/show_bug.cgi?id=164375
66 Reviewed by Andreas Kling.
68 platformMemoryUsage was being called all the time while logging the
69 results of various memory-purging operations. This logging is
70 subordinate to the needs of performance and so can be removed.
71 Behavior is now as follows:
73 - If memory-pressure relief logging is enabled, logging includes
74 memory usage information. On Cocoa, this logging is disabled by
75 default but can be enabled by setting LogMemoryJetsamDetails in
77 - Otherwise, if release-logging is enabled (as it is on Cocoa),
78 abbreviated memory pressure relief logging is performed: the logging
79 lines are printed but without any memory usage information.
80 - Otherwise, no logging is performed.
82 No new tests -- no tests for logging.
84 * platform/MemoryPressureHandler.cpp:
85 (WebCore::MemoryPressureHandler::ReliefLogger::logMemoryUsageChange):
86 * platform/MemoryPressureHandler.h:
87 (WebCore::MemoryPressureHandler::ReliefLogger::ReliefLogger):
88 (WebCore::MemoryPressureHandler::ReliefLogger::~ReliefLogger):
90 2016-11-11 Eric Carlson <eric.carlson@apple.com>
92 [MediaStream] defer resolution of getUserMedia promise made in a background tab
93 https://bugs.webkit.org/show_bug.cgi?id=164643
94 <rdar://problem/29048317>
96 Reviewed by Brady Eidson.
98 Test: fast/mediastream/get-user-media-background-tab.html
100 Do not start producing data when the document does not allow media
101 to start playing. Instead, register with the document for a callback
102 when playback is allowed and start then.
103 * Modules/mediastream/MediaStream.cpp:
104 (WebCore::MediaStream::~MediaStream):
105 (WebCore::MediaStream::mediaCanStart):
106 (WebCore::MediaStream::startProducingData):
107 (WebCore::MediaStream::stopProducingData):
108 (WebCore::MediaStream::pageMutedStateDidChange):
109 * Modules/mediastream/MediaStream.h:
111 * Modules/webaudio/AudioContext.cpp:
112 (WebCore::AudioContext::mediaCanStart): Deal with API change.
113 * Modules/webaudio/AudioContext.h:
115 * html/HTMLMediaElement.cpp:
116 (WebCore::HTMLMediaElement::mediaCanStart): Ditto.
117 * html/HTMLMediaElement.h:
118 * page/MediaCanStartListener.h:
121 (WebCore::Page::takeAnyMediaCanStartListener): Return the listener and document.
122 (WebCore::Page::setCanStartMedia): Pass the document to the listener.
125 2016-11-11 Zalan Bujtas <zalan@apple.com>
127 RenderFlowThread's containing block cache should be invalidated before calling styleDidChange.
128 https://bugs.webkit.org/show_bug.cgi?id=164646
130 Reviewed by Simon Fraser.
132 We have to invalidate the containing block cache for RenderFlowThreads soon after the containing block context
133 changes. Invalidating it in RenderBlock::styleDidChange is too late since we might run some code in some
134 of the subclasses that use this stale containing block cache.
136 No known behaviour change.
138 * rendering/RenderBlock.cpp:
139 (WebCore::RenderBlock::styleDidChange): This change could trigger double invalidation.
140 However running this code twice shouldn't impact performance greatly.
141 (WebCore::RenderBlock::resetFlowThreadContainingBlockAndChildInfoIncludingDescendants):
142 (WebCore::RenderBlock::invalidateFlowThreadContainingBlockIncludingDescendants): Deleted.
143 * rendering/RenderBlock.h:
144 * rendering/RenderElement.cpp:
145 (WebCore::RenderElement::setStyle): We don't need to call the invalidation from initializeStyle(), since
146 we don't yet have cache at that point.
147 * rendering/RenderInline.cpp:
148 (WebCore::RenderInline::splitInlines):
150 2016-11-11 Darin Adler <darin@apple.com>
152 Move Node from ExceptionCode to ExceptionOr
153 https://bugs.webkit.org/show_bug.cgi?id=164515
155 Reviewed by Sam Weinig.
157 * bindings/js/JSHTMLSelectElementCustom.cpp:
158 (WebCore::selectElementIndexSetter): Call remove instead of removeByIndex.
159 Was renamed now that there is no conflict.
161 * bindings/js/JSNodeCustom.cpp:
162 (WebCore::JSNode::insertBefore): Use ExceptionOr.
163 (WebCore::JSNode::replaceChild): Ditto.
164 (WebCore::JSNode::removeChild): Ditto.
165 (WebCore::JSNode::appendChild): Ditto.
168 (WebCore::Attr::Attr): Take a reference.
169 (WebCore::Attr::create): Ditto.
170 (WebCore::Attr::createTextChild): Use a Ref.
171 (WebCore::Attr::setPrefix): Use ExceptionOr.
172 (WebCore::Attr::setNodeValue): Ditto.
173 (WebCore::Attr::attachToElement): Take a reference.
174 * dom/Attr.h: Updated for above. Also made setPrefix private.
176 * dom/CharacterData.cpp:
177 (WebCore::CharacterData::setNodeValue): Use ExceptionOr.
178 * dom/CharacterData.h: Updated for the above.
180 * dom/ContainerNode.cpp:
181 (WebCore::collectChildrenAndRemoveFromOldParent): Use ExceptionOr.
182 (WebCore::checkAcceptChild): Ditto.
183 (WebCore::checkAcceptChildGuaranteedNodeTypes): Ditto.
184 (WebCore::ContainerNode::ensurePreInsertionValidity): Ditto.
185 (WebCore::checkPreReplacementValidity): Ditto.
186 (WebCore::ContainerNode::insertBefore): Ditto.
187 (WebCore::ContainerNode::replaceChild): Ditto.
188 (WebCore::ContainerNode::removeChild): Ditto.
189 (WebCore::ContainerNode::appendChild): Ditto.
190 (WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck): Ditto.
191 (WebCore::ContainerNode::cloneChildNodes): Ditto.
192 (WebCore::ContainerNode::append): Ditto.
193 (WebCore::ContainerNode::prepend): Ditto.
194 * dom/ContainerNode.h: Updated for above changes.
197 (WebCore::Document::setTitle): Removed unneeded ASSERT_NO_EXCEPTION.
198 (WebCore::Document::setBodyOrFrameset): Removed unneeded ignored
202 (WebCore::Element::setPrefix): Use ExceptionOr.
203 (WebCore::Element::setAttributeNode): Updated for changes to Attr.
204 (WebCore::Element::setAttributeNodeNS): Ditto.
205 (WebCore::Element::setOuterHTML): Use ExceptionOr.
206 (WebCore::Element::ensureAttr): Updated for changes to Attr.
207 (WebCore::Element::insertAdjacent): Use ExceptionOr.
208 * dom/Element.h: Updated for above.
211 (WebCore::Node::setNodeValue): Use ExceptionOr.
212 (WebCore::Node::insertBefore): Ditto.
213 (WebCore::Node::replaceChild): Ditto.
214 (WebCore::Node::removeChild): Ditto.
215 (WebCore::Node::appendChild): Ditto.
216 (WebCore::Node::convertNodesOrStringsIntoNode): Ditto.
217 (WebCore::Node::before): Ditto.
218 (WebCore::Node::after): Ditto.
219 (WebCore::Node::replaceWith): Ditto.
220 (WebCore::Node::remove): Ditto.
221 (WebCore::Node::cloneNodeForBindings): Ditto.
222 (WebCore::Node::setPrefix): Ditto.
223 (WebCore::Node::checkSetPrefix): Ditto.
224 (WebCore::Node::setTextContent): Ditto.
225 * dom/Node.h: Updated for above.
226 * dom/Node.idl: Use non-legacy exceptions.
229 (WebCore::Range::processContents): Use ExceptionOr.
230 (WebCore::processContentsBetweenOffsets): Ditto.
231 (WebCore::processNodes): Ditto.
232 (WebCore::processAncestorsAndTheirSiblings): Ditto.
233 (WebCore::Range::insertNode): Ditto.
234 (WebCore::Range::surroundContents): Ditto.
237 (WebCore::Text::splitText): Use ExceptionOr.
238 (WebCore::Text::replaceWholeText): Removed unneeded IGNORE_EXCEPTION.
240 * editing/AppendNodeCommand.cpp:
241 (WebCore::AppendNodeCommand::doApply): Removed unneeded IGNORE_EXCEPTION.
242 * editing/CompositeEditCommand.cpp:
243 (WebCore::CompositeEditCommand::insertNewDefaultParagraphElementAt): Ditto.
245 * editing/EditorCommand.cpp:
246 (WebCore::executeInsertNode): Use ExceptionOr.
248 * editing/InsertNodeBeforeCommand.cpp:
249 (WebCore::InsertNodeBeforeCommand::doApply): Removed unneeded IGNORE_EXCEPTION.
250 * editing/MergeIdenticalElementsCommand.cpp:
251 (WebCore::MergeIdenticalElementsCommand::doApply): Ditto.
252 (WebCore::MergeIdenticalElementsCommand::doUnapply): Use ExceptionOr.
254 * editing/RemoveNodeCommand.cpp:
255 (WebCore::RemoveNodeCommand::doUnapply): Removed unneeded IGNORE_EXCEPTION.
256 * editing/ReplaceNodeWithSpanCommand.cpp:
257 (WebCore::swapInNodePreservingAttributesAndChildren): Removed unneeded
259 * editing/ReplaceSelectionCommand.cpp:
260 (WebCore::ReplacementFragment::removeNode): Ditto.
261 (WebCore::ReplacementFragment::insertNodeBefore): Ditto.
262 (WebCore::ReplacementFragment::insertFragmentForTestRendering): Ditto.
263 (WebCore::ReplacementFragment::restoreAndRemoveTestRenderingNodesToFragment): Ditto.
264 (WebCore::ReplaceSelectionCommand::insertAsListItems): Ditto.
266 * editing/SplitElementCommand.cpp:
267 (WebCore::SplitElementCommand::executeApply): Use ExceptionOr.
268 (WebCore::SplitElementCommand::doUnapply): Removed unneeded IGNORE_EXCEPTION.
270 * editing/SplitTextNodeCommand.cpp:
271 (WebCore::SplitTextNodeCommand::insertText1AndTrimText2): Use ExceptionOr.
273 * editing/WrapContentsInDummySpanCommand.cpp:
274 (WebCore::WrapContentsInDummySpanCommand::executeApply): Removed unneeded
276 (WebCore::WrapContentsInDummySpanCommand::doUnapply): Ditto.
278 * editing/cocoa/EditorCocoa.mm:
279 (WebCore::Editor::styleForSelectionStart): Removed unneeded ASSERT_NO_EXCEPTION
280 and IGNORE_EXCEPTION.
281 * editing/htmlediting.cpp:
282 (WebCore::createTabSpanElement): Ditto.
283 * editing/markup.cpp:
284 (WebCore::fillContainerFromString): Ditto.
285 (WebCore::createFragmentFromText): Ditto.
286 (WebCore::removeElementFromFragmentPreservingChildren): Ditto.
287 (WebCore::replaceChildrenWithFragment): Use ExceptionOr.
288 (WebCore::replaceChildrenWithText): Ditto.
290 * editing/ios/EditorIOS.mm:
291 (WebCore::Editor::WebContentReader::addFragment): Removed unneeded exception
293 (WebCore::Editor::setDictationPhrasesAsChildOfElement): Ditto.
294 (WebCore::Editor::setTextAsChildOfElement): Ditto.
296 * html/ColorInputType.cpp:
297 (WebCore::ColorInputType::createShadowSubtree): Removed unneeded
300 * html/FTPDirectoryDocument.cpp:
301 (WebCore::FTPDirectoryDocumentParser::appendEntry): Removed unneeded
303 (WebCore::FTPDirectoryDocumentParser::createTDForFilename): Ditto.
304 (WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate): Ditto.
305 (WebCore::FTPDirectoryDocumentParser::createBasicDocument): Ditto.
306 * html/FileInputType.cpp:
307 (WebCore::FileInputType::createShadowSubtree): Ditto.
309 * html/HTMLAnchorElement.cpp:
310 (WebCore::HTMLAnchorElement::setText): Removed unneeded ASSERT_NO_EXCEPTION.
311 * html/HTMLDetailsElement.cpp:
312 (WebCore::HTMLDetailsElement::didAddUserAgentShadowRoot): Ditto.
314 * html/HTMLElement.cpp:
315 (WebCore::HTMLElement::textToFragment): Use ExceptionOr.
316 (WebCore::HTMLElement::setOuterText): Ditto.
318 * html/HTMLKeygenElement.cpp:
319 (WebCore::HTMLKeygenElement::HTMLKeygenElement): Removed unneeded
320 ASSERT_NO_EXCEPTION and IGNORE_EXCEPTION.
321 * html/HTMLMediaElement.cpp:
322 (WebCore::HTMLMediaElement::createMediaControls): Ditto.
323 * html/HTMLMeterElement.cpp:
324 (WebCore::HTMLMeterElement::didAddUserAgentShadowRoot): Ditto.
325 * html/HTMLOptionElement.cpp:
326 (WebCore::HTMLOptionElement::createForJSConstructor): Use ExceptionOr.
327 (WebCore::HTMLOptionElement::setText): Removed unneeded
328 ASSERT_NO_EXCEPTION and IGNORE_EXCEPTION.
330 * html/HTMLOptionsCollection.cpp:
331 (WebCore::HTMLOptionsCollection::remove): Call remove, not removeByIndex,
332 since we were able to change the name.
334 * html/HTMLOutputElement.cpp:
335 (WebCore::HTMLOutputElement::setTextContentInternal): Removed unneeded
336 ASSERT_NO_EXCEPTION and IGNORE_EXCEPTION.
337 * html/HTMLProgressElement.cpp:
338 (WebCore::HTMLProgressElement::didAddUserAgentShadowRoot): Ditto.
339 * html/HTMLScriptElement.cpp:
340 (WebCore::HTMLScriptElement::setText): Ditto.
342 * html/HTMLSelectElement.cpp:
343 (WebCore::HTMLSelectElement::add): Use ExceptionOr.
344 (WebCore::HTMLSelectElement::remove): Renamed from removeByIndex since
345 there is no conflict with remove any more.
346 (WebCore::HTMLSelectElement::setOption): Call remove.
347 * html/HTMLSelectElement.h: Updated for above.
348 * html/HTMLSelectElement.idl: Got rid of ImplementedAs=removeByIndex.
350 * html/HTMLSummaryElement.cpp:
351 (WebCore::HTMLSummaryElement::didAddUserAgentShadowRoot): Removed unneeded
352 ASSERT_NO_EXCEPTION and IGNORE_EXCEPTION.
353 * html/HTMLTableElement.cpp:
354 (WebCore::HTMLTableElement::HTMLTableElement): Initialize data members in
355 class definition instead of here.
356 (WebCore::HTMLTableElement::caption): Simplified using childrenOfType.
357 (WebCore::HTMLTableElement::setCaption): Use ExceptionOr.
358 (WebCore::HTMLTableElement::setTHead): Ditto.
359 (WebCore::HTMLTableElement::setTFoot): Ditto.
360 (WebCore::HTMLTableElement::deleteTFoot): Removed unneeded ASSERT_NO_EXCEPTION
361 and IGNORE_EXCEPTION.
362 (WebCore::HTMLTableElement::createTBody): Ditto.
363 (WebCore::HTMLTableElement::deleteCaption): Ditto.
364 (WebCore::HTMLTableElement::insertRow): Use ExceptionOr.
365 * html/HTMLTableElement.h: Updated for above.
367 * html/HTMLTableRowElement.cpp:
368 (WebCore::HTMLTableRowElement::insertCell): Use ExceptionOr.
369 (WebCore::HTMLTableRowElement::deleteCell): Ditto.
370 * html/HTMLTableSectionElement.cpp:
371 (WebCore::HTMLTableSectionElement::insertRow): Ditto.
372 (WebCore::HTMLTableSectionElement::deleteRow): Ditto.
374 * html/HTMLTextAreaElement.cpp:
375 (WebCore::HTMLTextAreaElement::didAddUserAgentShadowRoot): Removed unneeded
376 ASSERT_NO_EXCEPTION and IGNORE_EXCEPTION.
377 (WebCore::HTMLTextAreaElement::setDefaultValue): Ditto.
378 (WebCore::HTMLTextAreaElement::updatePlaceholderText): Ditto.
379 * html/HTMLTextFormControlElement.cpp:
380 (WebCore::HTMLTextFormControlElement::setInnerTextValue): Ditto.
381 * html/HTMLTitleElement.cpp:
382 (WebCore::HTMLTitleElement::setText): Ditto.
383 * html/MediaDocument.cpp:
384 (WebCore::MediaDocumentParser::createDocumentStructure): Ditto.
385 (WebCore::MediaDocument::replaceMediaElementTimerFired): Ditto.
386 * html/PluginDocument.cpp:
387 (WebCore::PluginDocumentParser::createDocumentStructure): Ditto.
388 * html/RangeInputType.cpp:
389 (WebCore::RangeInputType::createShadowSubtree): Ditto.
390 * html/SearchInputType.cpp:
391 (WebCore::SearchInputType::createShadowSubtree): Ditto.
392 * html/TextFieldInputType.cpp:
393 (WebCore::TextFieldInputType::createShadowSubtree): Ditto.
394 (WebCore::TextFieldInputType::updatePlaceholderText): Ditto.
395 (WebCore::TextFieldInputType::createContainer): Ditto.
396 (WebCore::TextFieldInputType::createAutoFillButton): Ditto.
397 * html/ValidationMessage.cpp:
398 (WebCore::ValidationMessage::setMessageDOMAndStartTimer): Ditto.
399 (WebCore::ValidationMessage::buildBubbleTree): Ditto.
400 (WebCore::ValidationMessage::deleteBubbleTree): Ditto.
401 * html/shadow/MediaControlElements.cpp:
402 (WebCore::MediaControlTextTrackContainerElement::updateDisplay): Ditto.
403 * html/shadow/MediaControls.cpp:
404 (WebCore::MediaControls::createTextTrackDisplay): Ditto.
406 * html/shadow/MediaControlsApple.cpp:
407 (WebCore::MediaControlsApple::MediaControlsApple): Initialize data members
408 in class definition instead of here.
409 (WebCore::MediaControlsApple::tryCreateControls): Use ExceptionOr.
410 * html/shadow/MediaControlsApple.h: Updated for above.
412 * html/track/VTTCue.cpp:
413 (WebCore::VTTCue::copyWebVTTNodeToDOMTree): Removed unneeded ASSERT_NO_EXCEPTION
414 and IGNORE_EXCEPTION.
415 (WebCore::VTTCue::getDisplayTree): Ditto.
416 * html/track/VTTRegion.cpp:
417 (WebCore::VTTRegion::appendTextTrackCueBox): Ditto.
419 * inspector/DOMEditor.cpp: Use ExceptionOr in action classes.
420 (WebCore::DOMEditor::DOMEditor): Take a reference.
421 (WebCore::DOMEditor::insertBefore): Use ExceptionOr.
422 (WebCore::DOMEditor::removeChild): Ditto.
423 (WebCore::DOMEditor::setAttribute): Ditto.
424 (WebCore::DOMEditor::removeAttribute): Ditto.
425 (WebCore::DOMEditor::setOuterHTML): Ditto.
426 (WebCore::DOMEditor::replaceWholeText): Ditto.
427 (WebCore::DOMEditor::replaceChild): Ditto.
428 (WebCore::DOMEditor::setNodeValue): Ditto.
429 (WebCore::populateErrorString): Ditto.
430 * inspector/DOMEditor.h: Updated for above changes.
432 * inspector/DOMPatchSupport.cpp:
433 (WebCore::DOMPatchSupport::patchDocument): Updated to use references,
434 to use ExceptionOr, and to use a struct without a constructor for Digest.
435 (WebCore::DOMPatchSupport::DOMPatchSupport): Ditto.
436 (WebCore::DOMPatchSupport::patchNode): Ditto.
437 (WebCore::DOMPatchSupport::innerPatchNode): Ditto.
438 (WebCore::DOMPatchSupport::diff): Ditto.
439 (WebCore::DOMPatchSupport::innerPatchChildren): Ditto.
440 (WebCore::DOMPatchSupport::createDigest): Ditto.
441 (WebCore::DOMPatchSupport::insertBeforeAndMarkAsUsed): Ditto.
442 (WebCore::DOMPatchSupport::removeChildAndMoveToNew): Ditto.
443 (WebCore::DOMPatchSupport::markNodeAsUsed): Ditto.
444 * inspector/DOMPatchSupport.h: Updated for above.
446 * inspector/InspectorCSSAgent.cpp: Use ExceptionOr in the action classes.
447 (WebCore::InspectorCSSAgent::getStyleSheetText): Use ExceptionOr.
448 (WebCore::InspectorCSSAgent::setStyleSheetText): Ditto.
449 (WebCore::InspectorCSSAgent::setStyleText): Ditto.
450 (WebCore::InspectorCSSAgent::setRuleSelector): Ditto.
451 (WebCore::InspectorCSSAgent::createInspectorStyleSheetForDocument): Ditto.
452 (WebCore::InspectorCSSAgent::addRule): Ditto.
453 * inspector/InspectorDOMAgent.cpp:
454 (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend): Ditto.
455 (WebCore::InspectorDOMAgent::setAttributeValue): Ditto.
456 (WebCore::InspectorDOMAgent::setAttributesAsText): Ditto.
457 (WebCore::InspectorDOMAgent::removeAttribute): Ditto.
458 (WebCore::InspectorDOMAgent::setOuterHTML): Ditto.
459 (WebCore::InspectorDOMAgent::setNodeValue): Ditto.
460 (WebCore::InspectorDOMAgent::undo): Ditto.
461 (WebCore::InspectorDOMAgent::redo): Ditto.
463 * inspector/InspectorHistory.cpp:
464 (WebCore::InspectorHistory::Action::Action): Moved to header.
465 (WebCore::InspectorHistory::Action::~Action): Ditto.
466 (WebCore::InspectorHistory::Action::toString): Ditto.
467 (WebCore::InspectorHistory::Action::isUndoableStateMark): Ditto.
468 (WebCore::InspectorHistory::Action::mergeId): Ditto.
469 (WebCore::InspectorHistory::Action::merge): Ditto.
470 (WebCore::InspectorHistory::InspectorHistory): Deleted.
471 (WebCore::InspectorHistory::~InspectorHistory): Deleted.
472 (WebCore::InspectorHistory::perform): Updated exception handling.
473 (WebCore::InspectorHistory::markUndoableState): Ditto.
474 (WebCore::InspectorHistory::undo): Ditto.
475 (WebCore::InspectorHistory::redo): Ditto.
476 * inspector/InspectorHistory.h: Updated for above.
478 * inspector/InspectorPageAgent.cpp:
479 (WebCore::InspectorPageAgent::setDocumentContent): Use reference.
481 * inspector/InspectorStyleSheet.cpp:
482 (WebCore::InspectorStyle::text): Use ExceptionOr and renamed from
483 getText since this now has a return value.
484 (WebCore::InspectorStyle::populateAllProperties): Updated for above.
485 (WebCore::InspectorStyle::setText): Use ExceptionOr.
486 (WebCore::InspectorStyleSheet::setText): Ditto.
487 (WebCore::InspectorStyleSheet::ruleSelector): Ditto.
488 (WebCore::InspectorStyleSheet::setRuleSelector): Ditto.
489 (WebCore::InspectorStyleSheet::addRule): Ditto.
490 (WebCore::InspectorStyleSheet::deleteRule): Ditto.
491 (WebCore::InspectorStyleSheet::buildObjectForStyleSheet): Ditto.
492 (WebCore::InspectorStyleSheet::buildObjectForStyle): Ditto.
493 (WebCore::InspectorStyleSheet::setStyleText): Ditto.
494 (WebCore::InspectorStyleSheet::text): Use ExceptionOr and renamed.
495 (WebCore::InspectorStyleSheet::checkPageStyleSheet): Deleted.
496 Just wrote this code inline in each place this was called since it's
497 just a single null check.
498 (WebCore::InspectorStyleSheetForInlineStyle::text): Use ExceptionOr
500 (WebCore::InspectorStyleSheetForInlineStyle::setStyleText): Ditto.
501 (WebCore::InspectorStyle::getText): Deleted.
502 * inspector/InspectorStyleSheet.h: Updated for above changes.
504 * page/DragController.cpp:
505 (WebCore::documentFragmentFromDragData): Removed unneeded
506 ASSERT_NO_EXCEPTION and IGNORE_EXCEPTION.
507 * page/ios/FrameIOS.mm:
508 (WebCore::Frame::initWithSimpleHTMLDocument): Ditto.
509 * svg/SVGTRefElement.cpp:
510 (WebCore::SVGTRefElement::updateReferencedText): Ditto.
511 (WebCore::SVGTRefElement::detachTarget): Ditto.
512 * xml/XMLTreeViewer.cpp:
513 (WebCore::XMLTreeViewer::transformDocumentToTreeView): Ditto.
515 2016-11-10 Jiewen Tan <jiewen_tan@apple.com>
517 Rename CryptoKeyUsage to CryptoKeyUsageBitmap and CryptoKey::Usage to CryptoKeyUsage
518 https://bugs.webkit.org/show_bug.cgi?id=164624
519 <rdar://problem/29210140>
521 Reviewed by Brent Fulgham.
523 This patch allows IDLType CryptoKeyUsage to be shared among different IDLs, i.e. CryptoKey.idl,
524 SubtleCrypto.idl and JsonWebKey.idl such that it can simplify the customized binding codes.
526 Covered by existing tests.
529 * DerivedSources.make:
530 * WebCore.xcodeproj/project.pbxproj:
531 * bindings/js/JSCryptoKeySerializationJWK.cpp:
532 * bindings/js/JSCryptoKeySerializationJWK.h:
533 * bindings/js/JSSubtleCryptoCustom.cpp:
534 (WebCore::toCryptoKeyUsageBitmap):
535 (WebCore::cryptoKeyUsageBitmapFromJSValue):
536 (WebCore::toKeyData):
537 (WebCore::jsSubtleCryptoFunctionGenerateKeyPromise):
538 (WebCore::jsSubtleCryptoFunctionImportKeyPromise):
539 (WebCore::cryptoKeyUsageFromString): Deleted.
540 (WebCore::cryptoKeyUsagesFromJSValue): Deleted.
541 * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
542 * bindings/js/SerializedScriptValue.cpp:
543 * crypto/CryptoAlgorithm.cpp:
544 * crypto/CryptoAlgorithm.h:
545 * crypto/CryptoKey.cpp:
546 * crypto/CryptoKey.h:
547 * crypto/CryptoKey.idl:
548 * crypto/CryptoKeySerialization.h:
549 * crypto/CryptoKeyUsage.h:
550 * crypto/CryptoKeyUsage.idl: Added.
551 * crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
552 * crypto/JsonWebKey.h:
553 * crypto/JsonWebKey.idl:
554 * crypto/SubtleCrypto.idl:
555 * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
556 * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
557 * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
558 * crypto/algorithms/CryptoAlgorithmAES_KW.h:
559 * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
560 * crypto/algorithms/CryptoAlgorithmHMAC.h:
561 * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
562 * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
563 * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
564 * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
565 * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
566 * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
567 * crypto/keys/CryptoKeyAES.cpp:
568 * crypto/keys/CryptoKeyAES.h:
569 * crypto/keys/CryptoKeyHMAC.cpp:
570 * crypto/keys/CryptoKeyHMAC.h:
571 * crypto/keys/CryptoKeyRSA.cpp:
572 * crypto/keys/CryptoKeyRSA.h:
573 * crypto/keys/CryptoKeySerializationRaw.cpp:
574 * crypto/keys/CryptoKeySerializationRaw.h:
575 * crypto/mac/CryptoKeyRSAMac.cpp:
577 2016-11-11 Dave Hyatt <hyatt@apple.com>
579 [CSS Parser] Fix basic shape parsing
580 https://bugs.webkit.org/show_bug.cgi?id=164645
582 Reviewed by Dean Jackson.
584 * css/parser/CSSPropertyParser.cpp:
585 (WebCore::consumeBasicShape):
587 2016-11-11 Zalan Bujtas <zalan@apple.com>
589 RenderFlowThread::removeLineRegionInfo shouldn't call HashMap::contains before HashMap::remove
590 https://bugs.webkit.org/show_bug.cgi?id=164639
592 Reviewed by Simon Fraser.
594 Also instead of asserting that the incoming renderer is not nullptr, we could just pass a reference in.
596 No change in functionality.
598 * rendering/RenderBlock.cpp:
599 (WebCore::RenderBlock::invalidateFlowThreadContainingBlockIncludingDescendants):
600 (WebCore::canComputeRegionRangeForBox):
601 (WebCore::RenderBlock::computeRegionRangeForBoxChild):
602 (WebCore::RenderBlock::estimateRegionRangeForBoxChild):
603 (WebCore::RenderBlock::updateRegionRangeForBoxChild):
604 * rendering/RenderBox.cpp:
605 (WebCore::RenderBox::hasRegionRangeInFlowThread):
606 * rendering/RenderElement.cpp:
607 (WebCore::RenderElement::removeFromRenderFlowThreadIncludingDescendants):
608 * rendering/RenderFlowThread.cpp:
609 (WebCore::RenderFlowThread::removeFlowChildInfo):
610 (WebCore::RenderFlowThread::validateRegions):
611 (WebCore::RenderFlowThread::removeRenderBoxRegionInfo):
612 (WebCore::RenderFlowThread::removeLineRegionInfo):
613 (WebCore::RenderFlowThread::clearRenderBoxRegionInfoAndCustomStyle):
614 (WebCore::RenderFlowThread::setRegionRangeForBox):
615 (WebCore::RenderFlowThread::hasCachedRegionRangeForBox):
616 (WebCore::RenderFlowThread::computedRegionRangeForBox):
617 (WebCore::RenderFlowThread::checkLinesConsistency):
618 * rendering/RenderFlowThread.h:
619 * rendering/RenderMultiColumnFlowThread.cpp:
620 (WebCore::RenderMultiColumnFlowThread::setRegionRangeForBox):
621 * rendering/RenderMultiColumnFlowThread.h:
622 * rendering/RenderNamedFlowFragment.cpp:
623 (WebCore::RenderNamedFlowFragment::clearObjectStyleInRegion):
624 * rendering/RenderNamedFlowFragment.h:
625 * rendering/RenderNamedFlowThread.cpp:
626 (WebCore::RenderNamedFlowThread::clearRenderObjectCustomStyle):
627 (WebCore::RenderNamedFlowThread::removeFlowChildInfo):
628 * rendering/RenderNamedFlowThread.h:
629 * rendering/RenderRegion.cpp:
630 (WebCore::RenderRegion::removeRenderBoxRegionInfo):
631 * rendering/RenderRegion.h:
633 2016-11-11 Megan Gardner <megan_gardner@apple.com>
635 [Cocoa] Support wide gamut for Drag Image UI
636 https://bugs.webkit.org/show_bug.cgi?id=164490
638 Reviewed by Tim Horton.
640 Fixed an error in the support define for wide gamut on Mac.
642 The testing infrastructure to test this does not exist, and will be landing in another patch.
644 * platform/graphics/cg/GraphicsContextCG.cpp:
645 (WebCore::extendedSRGBColorSpaceRef):
647 2016-11-11 Beth Dakin <bdakin@apple.com>
649 Get touch bar code building for open source builds
650 https://bugs.webkit.org/show_bug.cgi?id=164610
652 Reviewed by Wenson Hsieh.
656 2016-11-11 Dave Hyatt <hyatt@apple.com>
658 [CSS Parser] Fix SVG markers and colors
659 https://bugs.webkit.org/show_bug.cgi?id=164640
661 Reviewed by Dean Jackson.
663 * css/StyleBuilderConverter.h:
664 (WebCore::StyleBuilderConverter::convertSVGColor):
665 * css/parser/CSSPropertyParser.cpp:
666 (WebCore::CSSPropertyParser::parseShorthand):
668 2016-11-11 Wenson Hsieh <wenson_hsieh@apple.com>
670 Composition state should be cleared when changing focus to a non-editable element
671 https://bugs.webkit.org/show_bug.cgi?id=164595
672 <rdar://problem/26412551>
674 Reviewed by Enrica Casucci.
676 When canceling or confirming a composition, always ensure that the composition node and composition underlines
677 being tracked are reset, even when there is no current selection. This prevents us from getting into a bad state
678 where focus has already changed from an element with a pending composition to a different element and the
679 composition is canceled, but the Editor still maintains its composition node.
681 Test: editing/input/focus-change-with-marked-text.html
683 * editing/Editor.cpp:
684 (WebCore::Editor::setComposition):
686 2016-11-11 Dave Hyatt <hyatt@apple.com>
688 [CSS Parser] Support -webkit-svg-shadow
689 https://bugs.webkit.org/show_bug.cgi?id=164637
691 Reviewed by Zalan Bujtas.
693 * css/parser/CSSPropertyParser.cpp:
694 (WebCore::CSSPropertyParser::parseSingleValue):
696 2016-11-11 Alejandro G. Castro <alex@igalia.com>
698 [WebRTC][OpenWebRTC] Implement device permissions handling solution for owr backend in the UI process
699 https://bugs.webkit.org/show_bug.cgi?id=164010
701 Reviewed by Philippe Normand.
703 Move the capture of the sources for the OWR backend to the
704 WebProcess. In the UI we continue checking if the user allows
705 access to the audio and video capture. When device handling is
706 added in the future we will need some persistent ID and API to
707 pass from the UI process to the Web process.
709 * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
710 (WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints):
711 Add the proper audio and video sources to allow the UI message to
712 be properly rendered. We are adding the specific devices, even
713 though the dialog just asks for general audio and video. There was
714 already a FIXME about improving this.
715 (WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): We are
716 capturing the devices here when the allowed message arrived from
717 the UI process. We store the completion handler to use it later
718 when the aync owr API finishes capture devices process.
719 (WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable): We
720 now call the completion handler in this callback called when the
721 owr library finishes the capture of the devices. Now this happens
722 in the WebProcess for OWR port.
723 * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
724 Add an attribute to store the completion handler.
726 2016-11-11 Manuel Rego Casasnovas <rego@igalia.com>
728 [css-grid] ASSERTION FAILED: !m_gridIsDirty in WebCore::RenderGrid::gridRowCount
729 https://bugs.webkit.org/show_bug.cgi?id=163450
731 Reviewed by Darin Adler.
733 The issue is that in the test case a simplifiedLayout() is performed.
734 So in RenderGrid::layoutBlock() we early return and the grid is not populated,
735 so the m_gridIsDirty flag is not cleared when we try to check the size of the grid
736 in RenderGrid::layoutPositionedObject().
738 We should avoid to do a simplified layout if we have to layout
739 some positioned grid items and the grid is dirty.
741 The problem was not only the ASSERT, but the current behavior was wrong too.
742 As we didn't do a proper layout of the grid container, the positioned item
743 won't be placed on the expected position. Added tests verifying this.
745 Tests: fast/css-grid-layout/grid-positioned-item-dynamic-change.html
746 fast/css-grid-layout/grid-simplified-layout-positioned.html
748 * rendering/RenderBlock.cpp:
749 (WebCore::RenderBlock::canPerformSimplifiedLayout): Check if we can perform or not
751 (WebCore::RenderBlock::simplifiedLayout): Extract initial check
752 into canPerformSimplifiedLayout().
753 * rendering/RenderBlock.h: Add new header for canPerformSimplifiedLayout().
754 * rendering/RenderGrid.cpp: Implement our own version of canPerformSimplifiedLayout()
755 to verify that the grid is not dirty if we have to layout some positioned items.
756 (WebCore::RenderGrid::canPerformSimplifiedLayout):
757 * rendering/RenderGrid.h: Add canPerformSimplifiedLayout() header.
759 2016-11-11 Antoine Quint <graouts@apple.com>
761 [Modern Media Controls] Media Controller: media tracks control support
762 https://bugs.webkit.org/show_bug.cgi?id=164618
763 <rdar://problem/27989483>
765 Reviewed by Dean Jackson.
767 We introduce the TracksSupport class to only enable the media tracks button
768 in the media controls when text tracks and/or multiple audio tracks are available.
770 Tests: media/modern-media-controls/tracks-support/tracks-support-audio-tracks.html
771 media/modern-media-controls/tracks-support/tracks-support-no-tracks.html
772 media/modern-media-controls/tracks-support/tracks-support-text-tracks.html
774 * Modules/modern-media-controls/js-files:
775 * Modules/modern-media-controls/media/media-controller.js:
776 (MediaController.prototype._updateControlsIfNeeded):
777 * Modules/modern-media-controls/media/tracks-support.js: Added.
779 (TracksSupport.prototype.destroy):
780 (TracksSupport.prototype.get control):
781 (TracksSupport.prototype.get mediaEvents):
782 (TracksSupport.prototype.buttonWasClicked):
783 (TracksSupport.prototype.syncControl):
784 * WebCore.xcodeproj/project.pbxproj:
786 2016-11-10 Yusuke Suzuki <utatane.tea@gmail.com>
788 [DOMJIT] DOMJIT accessor attribute in IDL should say like DOMJIT=Getter
789 https://bugs.webkit.org/show_bug.cgi?id=164632
791 Reviewed by Sam Weinig.
793 Currently, DOMJIT patchpoint is only allowed for getter in attributes.
794 To make it explicit, we use IDL attribute DOMJIT=Getter instead of
797 * bindings/scripts/CodeGeneratorJS.pm:
799 (GenerateImplementation):
800 * bindings/scripts/IDLAttributes.txt:
801 * bindings/scripts/test/TestDOMJIT.idl:
805 2016-11-10 Sam Weinig <sam@webkit.org>
807 [SVG] Start moving special casing of SVG out of the bindings - SVGPreserveAspectRatio
808 https://bugs.webkit.org/show_bug.cgi?id=164622
810 Reviewed by Darin Adler.
812 Part 2 of moving special casing of SVG out of the bindings.
815 * WebCore.xcodeproj/project.pbxproj:
818 * bindings/scripts/CodeGenerator.pm:
819 (GenerateCompileTimeCheckForEnumsIfNeeded):
820 * bindings/scripts/IDLAttributes.txt:
821 Allow specifying a different scope for the constants to be declared in.
822 This allows us to have only one copy of the constants in the implementation
823 of SVGAngle/SVGAngleValue and SVGPreserveAspectRatio/SVGPreserveAspectRatioValue.
825 * loader/FrameLoader.cpp:
826 * rendering/svg/RenderSVGImage.h:
827 Remove unnecessary #include.
830 Remove redundant enum declaration.
833 Specify a ConstantsScope of SVGAngleValue.
835 * rendering/svg/RenderSVGImage.cpp:
836 (WebCore::RenderSVGImage::updateImageViewport):
837 * svg/PatternAttributes.h:
838 (WebCore::PatternAttributes::preserveAspectRatio):
839 (WebCore::PatternAttributes::setPreserveAspectRatio):
840 * svg/SVGAnimatedPreserveAspectRatio.cpp:
841 (WebCore::SVGAnimatedPreserveAspectRatioAnimator::constructFromString):
842 (WebCore::SVGAnimatedPreserveAspectRatioAnimator::calculateAnimatedValue):
843 * svg/SVGAnimatedPreserveAspectRatio.h:
844 * svg/SVGAnimatedType.cpp:
845 (WebCore::SVGAnimatedType::createPreserveAspectRatio):
846 * svg/SVGAnimatedType.h:
847 (WebCore::SVGAnimatedType::preserveAspectRatio):
848 * svg/SVGFEImageElement.cpp:
849 (WebCore::SVGFEImageElement::parseAttribute):
850 * svg/SVGFitToViewBox.cpp:
851 (WebCore::SVGFitToViewBox::viewBoxToViewTransform):
852 * svg/SVGFitToViewBox.h:
853 (WebCore::SVGFitToViewBox::parseAttribute):
854 * svg/SVGImageElement.cpp:
855 (WebCore::SVGImageElement::parseAttribute):
856 * svg/SVGViewSpec.cpp:
857 (WebCore::SVGViewSpec::preserveAspectRatioString):
858 (WebCore::SVGViewSpec::lookupOrCreatePreserveAspectRatioWrapper):
859 (WebCore::SVGViewSpec::reset):
860 (WebCore::SVGViewSpec::parseViewSpec):
862 * svg/graphics/SVGImage.cpp:
863 (WebCore::SVGImage::computeIntrinsicDimensions):
864 * svg/graphics/filters/SVGFEImage.cpp:
865 (WebCore::FEImage::FEImage):
866 (WebCore::FEImage::createWithImage):
867 (WebCore::FEImage::createWithIRIReference):
868 * svg/graphics/filters/SVGFEImage.h:
869 Replace SVGPreserveAspectRatio usage with SVGPreserveAspectRatioValue.
871 * svg/SVGPreserveAspectRatio.cpp: Removed.
872 * svg/SVGPreserveAspectRatio.h: Replaced.
873 * svg/SVGPreserveAspectRatio.idl:
874 * svg/SVGPreserveAspectRatioValue.cpp: Copied from Source/WebCore/svg/SVGPreserveAspectRatio.cpp.
875 * svg/SVGPreserveAspectRatioValue.h: Copied from Source/WebCore/svg/SVGPreserveAspectRatio.h.
876 Rename SVGPreserveAspectRatio to SVGPreserveAspectRatioValue and add a new SVGPreserveAspectRatio
877 that acts as the binding object.
879 2016-11-10 Yusuke Suzuki <utatane.tea@gmail.com>
881 [DOMJIT] Document#body should have DOMJIT patchpoint
882 https://bugs.webkit.org/show_bug.cgi?id=164627
884 Reviewed by Darin Adler.
886 This patch implements document.body accessor. To implement it, we need,
888 1. DOM traversing ability from ASM.
889 2. Checking HTMLElement.
890 3. Checking HTMLElement's localName.
892 The above features are already implemented in CSSJIT.
893 We extract some of utilities from CSSJIT to share them with DOMJIT.
895 Test: js/dom/domjit-accessor-document-body.html
897 * cssjit/SelectorCompiler.cpp:
898 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToParentElement):
899 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToNextAdjacentElement):
900 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToPreviousAdjacentElement):
901 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching):
902 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching):
903 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching):
904 (WebCore::SelectorCompiler::jumpIfElementIsNotEmpty):
905 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
906 (WebCore::SelectorCompiler::testIsElementFlagOnNode): Deleted.
907 (WebCore::SelectorCompiler::testIsHTMLFlagOnNode): Deleted.
910 * dom/QualifiedName.h:
911 * domjit/DOMJITAbstractHeapRepository.yaml:
912 * domjit/DOMJITHelpers.h:
913 (WebCore::DOMJIT::branchTestIsElementFlagOnNode):
914 (WebCore::DOMJIT::branchTestIsHTMLFlagOnNode):
915 * domjit/JSDocumentDOMJIT.cpp:
916 (WebCore::DocumentBodyDOMJIT::checkDOM):
917 (WebCore::loadLocalName):
918 (WebCore::DocumentBodyDOMJIT::callDOMGetter):
920 2016-11-10 John Wilander <wilander@apple.com>
922 Remove unused parameter name to fix build error on iOS
923 https://bugs.webkit.org/show_bug.cgi?id=163468
929 * platform/ios/PasteboardIOS.mm:
930 (WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
931 Removed parameter name 'pasteboardURL' in unimplemented function.
933 2016-11-10 Chris Dumez <cdumez@apple.com>
935 Speed up HTMLInputElement validation
936 https://bugs.webkit.org/show_bug.cgi?id=164603
938 Reviewed by Ryosuke Niwa.
940 Speed up HTMLInputElement validation by doing 1 virtual function call
941 instead of 9 and calling HTMLInputElement::value() only once per
942 validation instead of 9 times. Calling value() is expensive because
945 No new tests, no Web-exposed behavior change.
947 * html/BaseCheckableInputType.cpp:
948 (WebCore::BaseCheckableInputType::fallbackValue):
949 * html/FormAssociatedElement.cpp:
950 (WebCore::FormAssociatedElement::isValid):
951 * html/FormAssociatedElement.h:
952 * html/HTMLFormControlElement.cpp:
953 (WebCore::HTMLFormControlElement::isValidFormControlElement):
954 (WebCore::HTMLFormControlElement::updateValidity):
955 * html/HTMLInputElement.cpp:
956 (WebCore::HTMLInputElement::isValid):
957 (WebCore::HTMLInputElement::value):
958 * html/HTMLInputElement.h:
959 * html/TextFieldInputType.cpp:
960 (WebCore::limitLength):
961 * html/ValidityState.idl:
963 2016-11-10 John Wilander <wilander@apple.com>
965 Add link information to data transfer pasteboard for drag and drop links
966 https://bugs.webkit.org/show_bug.cgi?id=163468
967 <rdar://problem/20634630>
969 Reviewed by Brent Fulgham.
971 Test: editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard.html
972 This test ensures data transfers still work for types 'text' and 'url', i.e. that we don't
973 regress in-page use of the drag pasteboard.
975 * page/DragController.cpp:
976 (WebCore::DragController::startDrag):
977 Now adds trustworthy link information to the drag pasteboard.
978 * platform/Pasteboard.h:
979 New function declaration Pasteboard::writeTrustworthyWebURLsPboardType.
980 * platform/efl/PasteboardEfl.cpp:
981 (WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
982 Empty, i.e. not implemented.
983 * platform/gtk/PasteboardGtk.cpp:
984 (WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
985 Empty, i.e. not implemented.
986 * platform/ios/PasteboardIOS.mm:
987 (WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
988 Calls ASSERT_NOT_REACHED() to make sure we don't use this function before we have
989 decided on a trustrworthy URL pasteboard type on iOS. Currently not used since we
990 don't support drag & drop on iOS.
991 * platform/mac/PasteboardMac.mm:
992 (WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
993 Writes the given URL to the WebURLsWithTitlesPboardType. This pasteboard type
994 serves as a trusted drop source.
995 * platform/win/PasteboardWin.cpp:
996 (WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
997 Empty, i.e. not implemented.
999 2016-11-10 Said Abou-Hallawa <sabouhallawa@apple.com>
1001 REGRESSION(r207182): [iOS] Crash because of passing freed CFDictionaryRef to CG when decoding a sub-sampled large image
1002 https://bugs.webkit.org/show_bug.cgi?id=164617
1004 Reviewed by Tim Horton.
1006 This covered by the test fast/images/image-subsampling.html but it should
1007 run with --guard-malloc --repeat-each=10 to show the bug or to verify the
1010 imageSourceOptions() returns a non static RetainPtr<CFDictionaryRef> if
1011 the subsamplingLevel is not zero. Because we are assigning the raw pointer
1012 to a local variable in ImageDecoder::createFrameImageAtIndex(), CFRelease()
1013 is called for the CFDictionaryRef immediately after this assignment. This
1014 causes its memory to be freed in this case even before calling CG.
1016 This bug does not happen if the subsamplingLevel is zero because we cache
1017 the returned value in a static NeverDestroyed<RetainPtr<CFDictionaryRef> in
1018 imageSourceOptions(). This cache prevents the CFDictionaryRef from being
1019 freed in ImageDecoder::createFrameImageAtIndex() no matter where CFRelease()
1022 The fix is hold the returned value in a RetainPtr<CFDictionaryRef>. This
1023 will ensure the CFDictionaryRef raw pointer is valid till the end of
1024 ImageDecoder::createFrameImageAtIndex().
1026 * platform/graphics/cg/ImageDecoderCG.cpp:
1027 (WebCore::ImageDecoder::createFrameImageAtIndex): Ensure the pointer is retained.
1029 2016-11-10 Brent Fulgham <bfulgham@apple.com>
1031 [Win][Direct2D] Add transparency layer support
1032 https://bugs.webkit.org/show_bug.cgi?id=164614
1034 Reviewed by Dean Jackson.
1036 Provide a stackable implementation of transparency layers so that
1037 multiple layers with opacity draw propery.
1039 Tested by fast/layers/opacity-stacking.html and others.
1041 * platform/graphics/win/GraphicsContextDirect2D.cpp:
1042 (WebCore::GraphicsContext::platformContext): Remove unneeded assertion.
1043 (WebCore::GraphicsContextPlatformPrivate::renderTarget): Return current context taking
1044 into account the presence of transparency layers.
1045 (WebCore::GraphicsContextPlatformPrivate::setAlpha): Added.
1046 (WebCore::GraphicsContextPlatformPrivate::currentGlobalAlpha): Get current global
1047 alpha for current layer.
1048 (WebCore::GraphicsContext::colorWithGlobalAlpha): Compute proper color taking into
1049 account the current layer.
1050 (WebCore::drawWithShadowHelper): Helper function to share code.
1051 (WebCore::GraphicsContext::drawWithShadow): Use new helper function.
1052 (WebCore::GraphicsContextPlatformPrivate::beginTransparencyLayer): Added.
1053 (WebCore::GraphicsContext::beginPlatformTransparencyLayer): Call new implementation.
1054 (WebCore::GraphicsContextPlatformPrivate::endTransparencyLayer): Added.
1055 (WebCore::GraphicsContext::endPlatformTransparencyLayer): Call new implementation.
1056 (WebCore::GraphicsContext::clearRect): Clear to transparent color.
1057 (WebCore::GraphicsContext::setPlatformAlpha): Pass new alpha on to any active
1059 * platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
1060 (WebCore::GraphicsContextPlatformPrivate::renderTarget): Deleted.
1062 2016-11-10 Dean Jackson <dino@apple.com>
1064 Add CSS Color Level 4 to features.
1068 2016-11-10 Zalan Bujtas <zalan@apple.com>
1070 Move update image calls to RenderElement::styleDidChange.
1071 https://bugs.webkit.org/show_bug.cgi?id=164623
1073 Reviewed by Simon Fraser.
1075 There should be no dependency on the image update between ::styleWillChange and ::styleDidChange.
1077 Covered by existing tests.
1079 * rendering/RenderElement.cpp:
1080 (WebCore::RenderElement::initializeStyle):
1081 (WebCore::RenderElement::setStyle):
1082 (WebCore::RenderElement::styleDidChange):
1084 2016-11-10 Joseph Pecoraro <pecoraro@apple.com>
1086 After r207459 ASSERT in CachedResourceLoader under InspectorPageAgent::cachedResource
1087 https://bugs.webkit.org/show_bug.cgi?id=164621
1089 Reviewed by Youenn Fablet.
1091 * inspector/InspectorPageAgent.cpp:
1092 (WebCore::InspectorPageAgent::cachedResource):
1093 CachedResourceLoader expects a sanitized URL.
1095 2016-11-10 Brady Eidson <beidson@apple.com>
1097 IndexedDB 2.0 Support the IDBDatabase.onclose event.
1098 https://bugs.webkit.org/show_bug.cgi?id=164602
1100 Reviewed by Alex Christensen.
1102 No new tests (Covered by existing tests).
1104 * Modules/indexeddb/IDBDatabase.cpp:
1105 (WebCore::IDBDatabase::connectionToServerLost): Fire "onclose" after "onerror"
1106 * Modules/indexeddb/IDBDatabase.idl:
1108 2016-11-10 Ryosuke Niwa <rniwa@webkit.org>
1110 Copied text would contain text inside CDATA sections and comments
1111 https://bugs.webkit.org/show_bug.cgi?id=164578
1112 <rdar://problem/19834542>
1114 Reviewed by Darin Adler.
1116 The bug was caused by HTMLConverter::_traverseNode always including the content of a Text node.
1117 Since Comment and CDataSection nodes are also Text nodes, we need to exclude them.
1119 In the long term, we should check the visibility of the text as done in MarkupAccumulator.
1121 Test: editing/mac/attributed-string/comment-cdata-section.html
1123 * editing/cocoa/HTMLConverter.mm:
1124 (HTMLConverter::_traverseNode):
1126 2016-11-10 Eric Carlson <eric.carlson@apple.com>
1128 [MediaStream] apply constraints passed to getUserMedia()
1129 https://bugs.webkit.org/show_bug.cgi?id=164561
1131 Reviewed by Youenn Fablet.
1132 <rdar://problem/29191384>
1134 No new tests, updated existing tests.
1136 * Modules/mediastream/UserMediaRequest.cpp:
1137 (WebCore::UserMediaRequest::allow): Pass constraints into createMediaStream instead of applying
1138 them after the stream has been created.
1140 * WebCore.xcodeproj/project.pbxproj: Remove MediaConstraintsMock.cpp/.h.
1142 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1143 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updatePausedImage): Remove a bogus assert.
1144 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState): Drive-by fix: a stream
1145 that is receiving media data is as ready as it will ever be so it's readyState should be
1146 at HAVE_ENOUGH_DATA.
1148 Simplify CaptureDeviceManager by removing all code for constraint validation because some
1149 constraints can't be validated without a live capture device. Ports that are able to resolve
1150 constraints without creating a live source can do so in a derived capture device class.
1151 * platform/mediastream/CaptureDeviceManager.cpp:
1152 (CaptureDeviceManager::bestSourcesForTypeAndConstraints): Return a list of UIDs, not a list
1153 of live sources, because that is all the caller will use. This will allows ports to avoid
1154 source creation in some cases.
1155 (CaptureDeviceManager::sourceWithUID): Add parameters for new source constraints and invalid
1157 (CaptureDeviceManager::verifyConstraintsForMediaType): Deleted.
1158 (CaptureDeviceManager::bestDeviceForFacingMode): Deleted.
1159 (facingModeFromString): Deleted.
1160 (CaptureDeviceManager::sessionSupportsConstraint): Deleted.
1161 (CaptureDeviceManager::isSupportedFrameRate): Deleted.
1162 * platform/mediastream/CaptureDeviceManager.h:
1163 (WebCore::CaptureDeviceManager::defaultCaptureSession): Deleted.
1165 * platform/mediastream/MediaConstraints.cpp:
1166 (WebCore::FlattenedConstraint::find): New, make it possible to examine resolved constraints.
1167 * platform/mediastream/MediaConstraints.h:
1168 (WebCore::NumericConstraint::fitnessDistance): Reject invalid constraints.
1169 (WebCore::NumericConstraint::valueForCapabilityRange): New, resolve a constraint for a
1171 (WebCore::MediaTrackConstraintSetMap::width): Expose constraints held in the map.
1172 (WebCore::MediaTrackConstraintSetMap::height):
1173 (WebCore::MediaTrackConstraintSetMap::sampleRate):
1174 (WebCore::MediaTrackConstraintSetMap::sampleSize):
1175 (WebCore::MediaTrackConstraintSetMap::aspectRatio):
1176 (WebCore::MediaTrackConstraintSetMap::frameRate):
1177 (WebCore::MediaTrackConstraintSetMap::volume):
1178 (WebCore::MediaTrackConstraintSetMap::echoCancellation):
1179 (WebCore::MediaTrackConstraintSetMap::facingMode):
1180 (WebCore::MediaTrackConstraintSetMap::deviceId):
1181 (WebCore::MediaTrackConstraintSetMap::groupId):
1183 Resolve and apply width, height, and frameRate all at once because the ability to support
1184 one may depend on the value of another.
1185 * platform/mediastream/RealtimeMediaSource.cpp:
1186 (WebCore::RealtimeMediaSource::supportsSizeAndFrameRate):
1187 (WebCore::applyNumericConstraint): Move the guts of the logic into valueForCapabilityRange.
1188 (WebCore::RealtimeMediaSource::applySizeAndFrameRate):
1189 (WebCore::RealtimeMediaSource::selectSettings):
1190 (WebCore::RealtimeMediaSource::supportsConstraints):
1191 (WebCore::RealtimeMediaSource::applyConstraints): Support null success/failure lambdas.
1192 * platform/mediastream/RealtimeMediaSource.h:
1194 * platform/mediastream/RealtimeMediaSourceCenter.h:
1195 * platform/mediastream/mac/AVAudioCaptureSource.h:
1196 * platform/mediastream/mac/AVAudioCaptureSource.mm:
1197 (WebCore::AVAudioCaptureSource::create): Add parameter for creation constraints.
1198 (WebCore::AVAudioCaptureSource::AVAudioCaptureSource): Ditto.
1200 Remove all constraint validation code, it is done by the audio and video capture sources. Add
1201 support for stream creation constraints.
1202 * platform/mediastream/mac/AVCaptureDeviceManager.h:
1203 * platform/mediastream/mac/AVCaptureDeviceManager.mm:
1204 (WebCore::AVCaptureDeviceManager::captureDeviceList):
1205 (WebCore::AVCaptureDeviceManager::createMediaSourceForCaptureDeviceWithConstraints):
1206 (WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints): Deleted.
1207 (WebCore::AVCaptureDeviceManager::sourceWithUID): Deleted.
1208 (WebCore::AVCaptureDeviceManager::verifyConstraintsForMediaType): Deleted.
1209 (WebCore::AVCaptureDeviceManager::defaultCaptureSession): Deleted.
1210 (WebCore::AVCaptureDeviceManager::sessionSupportsConstraint): Deleted.
1211 (WebCore::AVCaptureDeviceManager::isSupportedFrameRate): Deleted.
1212 (WebCore::AVCaptureDeviceManager::supportedConstraints): Deleted.
1214 * platform/mediastream/mac/AVMediaCaptureSource.h:
1215 (WebCore::AVMediaCaptureSource::constraints): Deleted.
1216 * platform/mediastream/mac/AVMediaCaptureSource.mm:
1217 (WebCore::AVMediaCaptureSource::AVMediaCaptureSource):
1218 (WebCore::AVMediaCaptureSource::~AVMediaCaptureSource):
1219 (WebCore::AVMediaCaptureSource::startProducingData):
1220 (WebCore::AVMediaCaptureSource::stopProducingData):
1221 (WebCore::AVMediaCaptureSource::beginConfiguration):
1222 (WebCore::AVMediaCaptureSource::commitConfiguration):
1223 (WebCore::AVMediaCaptureSource::capabilities):
1224 (WebCore::AVMediaCaptureSource::setupSession):
1225 (WebCore::AVMediaCaptureSource::reset):
1227 Validate and apply constraints, support source creation constraints, initialize capabilities
1228 and supported constraints by examining device capabilities.
1229 * platform/mediastream/mac/AVVideoCaptureSource.h:
1230 * platform/mediastream/mac/AVVideoCaptureSource.mm:
1231 (WebCore::AVVideoCaptureSource::create):
1232 (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
1233 (WebCore::updateSizeMinMax):
1234 (WebCore::updateAspectRatioMinMax):
1235 (WebCore::AVVideoCaptureSource::initializeCapabilities):
1236 (WebCore::AVVideoCaptureSource::initializeSupportedConstraints):
1237 (WebCore::AVVideoCaptureSource::applySize):
1238 (WebCore::AVVideoCaptureSource::setPreset):
1239 (WebCore::AVVideoCaptureSource::applyFrameRate):
1240 (WebCore::AVVideoCaptureSource::applySizeAndFrameRate):
1241 (WebCore::AVVideoCaptureSource::setupCaptureSession):
1242 (WebCore::AVVideoCaptureSource::currentFrameCGImage):
1243 (WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions):
1244 (WebCore::AVVideoCaptureSource::supportsSizeAndFrameRate):
1246 * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
1247 * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
1248 (WebCore::MockRealtimeVideoSource::create): Apply creation constraints, return null if they
1249 can not be applied successfully.
1250 (WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac):
1251 (WebCore::MockRealtimeVideoSource::createMuted):
1253 Update RealtimeMediaSourceCenters for API changes.
1254 * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
1255 (WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints):
1256 (WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
1257 * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
1258 * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
1259 (WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints):
1260 (WebCore::RealtimeMediaSourceCenterOwr::createMediaStream):
1261 (WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable):
1262 * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
1264 Mock media sources support constraint validation and application directly so "mock constraints"
1265 are no longer necessary.
1266 * platform/mock/MediaConstraintsMock.cpp: Removed.
1267 * platform/mock/MediaConstraintsMock.h: Removed.
1268 * platform/mock/MockRealtimeAudioSource.cpp:
1269 (WebCore::MockRealtimeAudioSource::create):
1270 (WebCore::MockRealtimeAudioSource::createMuted):
1271 (WebCore::MockRealtimeAudioSource::updateSettings):
1272 (WebCore::MockRealtimeAudioSource::initializeCapabilities):
1273 (WebCore::MockRealtimeAudioSource::initializeSupportedConstraints):
1274 * platform/mock/MockRealtimeAudioSource.h:
1275 * platform/mock/MockRealtimeMediaSourceCenter.cpp:
1276 (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints):
1277 (WebCore::MockRealtimeMediaSourceCenter::createMediaStream):
1278 * platform/mock/MockRealtimeMediaSourceCenter.h:
1279 * platform/mock/MockRealtimeVideoSource.cpp:
1280 (WebCore::MockRealtimeVideoSource::create):
1281 (WebCore::MockRealtimeVideoSource::createMuted):
1282 * platform/mock/MockRealtimeVideoSource.h:
1283 * platform/mock/RTCPeerConnectionHandlerMock.cpp:
1285 2016-11-10 Alex Christensen <achristensen@webkit.org>
1287 Move SecurityOrigin::databaseIdentifier() to SecurityOriginData
1288 https://bugs.webkit.org/show_bug.cgi?id=164573
1290 Reviewed by Brady Eidson.
1292 No change in behavior.
1294 * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
1295 (WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory):
1296 * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
1297 (WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot):
1298 * Modules/indexeddb/server/IDBServer.cpp:
1299 (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
1300 * Modules/webdatabase/DatabaseTracker.cpp:
1301 (WebCore::DatabaseTracker::hasEntryForOriginNoLock):
1302 (WebCore::DatabaseTracker::hasEntryForDatabase):
1303 (WebCore::DatabaseTracker::originPath):
1304 (WebCore::DatabaseTracker::fullPathForDatabaseNoLock):
1305 (WebCore::DatabaseTracker::databaseNamesForOriginNoLock):
1306 (WebCore::DatabaseTracker::detailsForNameAndOrigin):
1307 (WebCore::DatabaseTracker::setDatabaseDetails):
1308 (WebCore::DatabaseTracker::originLockFor):
1309 (WebCore::DatabaseTracker::deleteOriginLockFor):
1310 (WebCore::DatabaseTracker::quotaForOriginNoLock):
1311 (WebCore::DatabaseTracker::setQuota):
1312 (WebCore::DatabaseTracker::addDatabase):
1313 (WebCore::DatabaseTracker::deleteOrigin):
1314 (WebCore::DatabaseTracker::deleteDatabase):
1315 (WebCore::DatabaseTracker::removeDeletedOpenedDatabases):
1316 * Modules/webdatabase/SQLTransactionCoordinator.cpp:
1317 (WebCore::getDatabaseIdentifier):
1319 (WebCore::Document::origin):
1320 * html/HTMLMediaElement.cpp:
1321 (WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory):
1322 * loader/appcache/ApplicationCacheStorage.cpp:
1323 (WebCore::ApplicationCacheStorage::calculateQuotaForOrigin):
1324 (WebCore::ApplicationCacheStorage::calculateUsageForOrigin):
1325 (WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache):
1326 (WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin):
1327 (WebCore::ApplicationCacheStorage::store):
1328 (WebCore::ApplicationCacheStorage::ensureOriginRecord):
1329 * page/SecurityOrigin.cpp:
1330 (WebCore::SecurityOrigin::databaseIdentifier): Deleted.
1331 * page/SecurityOrigin.h:
1332 * page/SecurityOriginData.cpp:
1333 (WebCore::SecurityOriginData::databaseIdentifier):
1334 * page/SecurityOriginData.h:
1336 2016-11-10 Zalan Bujtas <zalan@apple.com>
1338 RenderElement::invalidateFlowThreadContainingBlockIncludingDescendants should be on RenderBlock.
1339 https://bugs.webkit.org/show_bug.cgi?id=164601
1341 Reviewed by Simon Fraser.
1343 FlowThread containing blocks are cached at RenderBlocks. It makes no sense to call the invalidate function on a RenderElement.
1344 Move invalidateFlowThreadContainingBlockIncludingDescendants to RenderBlock.
1346 No change in functionality.
1348 * rendering/RenderBlock.cpp:
1349 (WebCore::RenderBlock::invalidateFlowThreadContainingBlockIncludingDescendants):
1350 * rendering/RenderBlock.h:
1351 * rendering/RenderElement.cpp:
1352 (WebCore::RenderElement::invalidateFlowThreadContainingBlockIncludingDescendants): Deleted.
1353 * rendering/RenderElement.h:
1354 * rendering/RenderInline.cpp:
1355 (WebCore::RenderInline::splitInlines):
1357 2016-11-10 Brent Fulgham <bfulgham@apple.com>
1359 Local file restrictions should not block sessionStorage access.
1360 https://bugs.webkit.org/show_bug.cgi?id=155609
1361 <rdar://problem/25229461>
1363 Reviewed by Andy Estes.
1365 Re-landing this fix that was lost when the localStorage change was rolled out.
1367 Use of 'sessionStorage' is governed by SecurityOrigin with third party access
1368 set to 'ShouldAllowFromThirdParty::AlwaysAllowFromThirdParty'. We should not
1369 reject local files for this combination of arguments.
1371 Tested by storage/domstorage/sessionstorage/blocked-file-access.html.
1373 * page/SecurityOrigin.cpp:
1374 (WebCore::SecurityOrigin::canAccessStorage): For the case of sessionStorage,
1375 allow local file access.
1377 2016-11-10 Daniel Bates <dabates@apple.com>
1379 REGRESSION (r195004): Scripts and plugins blocked for subsequent loads in same WebContent
1380 process after receiving HTTP 0.9 response
1381 https://bugs.webkit.org/show_bug.cgi?id=164387
1382 <rdar://problem/28987537>
1384 Reviewed by Brent Fulgham.
1386 Fixes an issue where the HTTP 0.9 sandbox persisted across subsequent loads in the same
1389 Currently when an HTTP 0.9 response is received for a request made to a default port
1390 (e.g. 80) we apply a sandbox policy on the FrameLoader for the main resource that
1391 disallows scripts and plugins. A FrameLoader may be re-used for navigations. Therefore,
1392 the sandbox policy applied to one site may be applied to another site. Moreover the
1393 sandbox policy was applied to the FrameLoader of the main resource regardless of whether
1394 the HTTP response was for a subresource. Instead we should apply the sandbox on a per-
1395 Document basis and only if we receive an HTTP 0.9 response for the document when the
1396 corresponding HTTP request was made to a default port.
1398 As a side benefit of this change, we emit exactly one console message to Web Inspector
1399 when the HTTP 0.9 sandbox is applied to a document as opposed to three console messages.
1400 Moreover, we only emit this console message when the document load is not blocked.
1402 Test: http/tests/security/http-0.9/sandbox-should-not-persist-on-navigation.html
1405 (WebCore::Document::initSecurityContext): Disallow scripts and plugins if an HTTP 0.9
1406 response was received for this document. Note that if this function is called for a
1407 document associated with an HTTP 0.9 response then the corresponding HTTP request was
1408 made to a default port. DocumentLoader::responseReceived() blocks the load for a document
1409 with an HTTP 0.9 response corresponding to an HTTP request made to a non-default port.
1410 This invariant is covered by the tests LayoutTests/http/tests/security/http-0.9/default-port-{plugin, script}-blocked.html.
1411 (WebCore::Document::shouldEnforceHTTP0_9Sandbox): Added. Returns whether an HTTP 0.9 response
1412 was received for this document.
1414 * loader/DocumentLoader.cpp:
1415 (WebCore::DocumentLoader::responseReceived): Remove logic to apply sandbox policy to the
1416 FrameLoader associated with the main resource. We will apply the sandbox during initialization
1418 * loader/ResourceLoader.cpp:
1419 (WebCore::ResourceLoader::didReceiveResponse): Ditto.
1420 * loader/SubresourceLoader.cpp:
1421 (WebCore::SubresourceLoader::didReceiveResponse): Ditto.
1423 2016-11-04 Jiewen Tan <jiewen_tan@apple.com>
1425 Update SubtleCrypto::importKey to match the latest spec
1426 https://bugs.webkit.org/show_bug.cgi?id=164446
1427 <rdar://problem/29123621>
1429 Reviewed by Brent Fulgham.
1431 This patch does following few things:
1432 1. It updates the SubtleCrypto::importKey method to match the latest spec:
1433 https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-importKey.
1434 It also refers to the latest Editor's Draft at a certain degree:
1435 https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-importKey.
1436 2. It implements importKey operations of following algorithms: AES-CBC, AES-KW,
1437 HMAC, RSAES-PKCS1-V1_5, RSASSA-PKCS1-V1_5, and RSA-OAEP.
1438 3. It fixes some minor problems of SubtleCrypto::generateKey.
1439 4. It addes move constructors for CryptoKeyAES, CryptoKeyHMAC, CryptoKeyRSA and
1440 CryptoKeyDataRSAComponents.
1441 5. It renames HmacKeyGenParams to HmacKeyParams to serve the purpose of both
1442 HmacKeyGenParams and HmacImportParams which are essentially the same.
1443 6. It enforces the key length in bits of CryptoKeyHMAC to be multiples of 8.
1444 7. It also fixes the following bugs:
1445 https://bugs.webkit.org/show_bug.cgi?id=126033,
1446 https://bugs.webkit.org/show_bug.cgi?id=126034,
1447 https://bugs.webkit.org/show_bug.cgi?id=151308.
1448 P.S. We currently only support Raw and Jwk key format.
1450 Tests: crypto/subtle/aes-cbc-import-jwk-key-length-128.html
1451 crypto/subtle/aes-cbc-import-jwk-key-length-192.html
1452 crypto/subtle/aes-cbc-import-jwk-key-length-256.html
1453 crypto/subtle/aes-cbc-import-jwk-key-minimum.html
1454 crypto/subtle/aes-cbc-import-jwk-key-non-extractable.html
1455 crypto/subtle/aes-cbc-import-raw-key-length-128.html
1456 crypto/subtle/aes-cbc-import-raw-key-length-192.html
1457 crypto/subtle/aes-cbc-import-raw-key-length-256.html
1458 crypto/subtle/aes-import-key-malformed-parameters.html
1459 crypto/subtle/aes-kw-import-jwk-key-length-128.html
1460 crypto/subtle/aes-kw-import-jwk-key-length-192.html
1461 crypto/subtle/aes-kw-import-jwk-key-length-256.html
1462 crypto/subtle/aes-kw-import-raw-key.html
1463 crypto/subtle/generate-key-malformed-parameters.html
1464 crypto/subtle/hmac-import-jwk-key-minimum.html
1465 crypto/subtle/hmac-import-jwk-key-non-extractable.html
1466 crypto/subtle/hmac-import-jwk-key-sha1.html
1467 crypto/subtle/hmac-import-jwk-key-sha224.html
1468 crypto/subtle/hmac-import-jwk-key-sha256.html
1469 crypto/subtle/hmac-import-jwk-key-sha384.html
1470 crypto/subtle/hmac-import-jwk-key-sha512.html
1471 crypto/subtle/hmac-import-malformed-parameters.html
1472 crypto/subtle/hmac-import-raw-key-customized-length.html
1473 crypto/subtle/hmac-import-raw-key.html
1474 crypto/subtle/import-key-malformed-parameters.html
1475 crypto/subtle/rsa-import-key-malformed-parameters.html
1476 crypto/subtle/rsa-oaep-import-jwk-private-key.html
1477 crypto/subtle/rsa-oaep-import-jwk-public-key-sha1.html
1478 crypto/subtle/rsa-oaep-import-jwk-public-key-sha224.html
1479 crypto/subtle/rsa-oaep-import-jwk-public-key-sha256.html
1480 crypto/subtle/rsa-oaep-import-jwk-public-key-sha384.html
1481 crypto/subtle/rsa-oaep-import-jwk-public-key-sha512.html
1482 crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-private-key.html
1483 crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-leading-zero.html
1484 crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-minimum.html
1485 crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-non-extractable.html
1486 crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key.html
1487 crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-private-key.html
1488 crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha1.html
1489 crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha224.html
1490 crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha256.html
1491 crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha384.html
1492 crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha512.html
1493 crypto/workers/subtle/aes-import-jwk-key.html
1494 crypto/workers/subtle/aes-import-raw-key.html
1495 crypto/workers/subtle/hmac-import-jwk-key.html
1496 crypto/workers/subtle/hmac-import-raw-key.html
1497 crypto/workers/subtle/rsa-import-jwk-private-key.html
1498 crypto/workers/subtle/rsa-import-jwk-public-key.html
1501 * DerivedSources.make:
1502 * PlatformEfl.cmake:
1503 * PlatformGTK.cmake:
1504 * PlatformMac.cmake:
1505 * WebCore.xcodeproj/project.pbxproj:
1506 * bindings/js/JSSubtleCryptoCustom.cpp:
1507 (WebCore::normalizeCryptoAlgorithmParameters):
1508 (WebCore::cryptoKeyUsageFromString):
1509 (WebCore::cryptoKeyUsagesFromJSValue):
1510 (WebCore::toKeyData):
1511 (WebCore::jsSubtleCryptoFunctionGenerateKeyPromise):
1512 (WebCore::jsSubtleCryptoFunctionImportKeyPromise):
1513 (WebCore::JSSubtleCrypto::importKey):
1514 * crypto/CryptoAlgorithm.cpp:
1515 (WebCore::CryptoAlgorithm::importKey):
1516 * crypto/CryptoAlgorithm.h:
1517 * crypto/CryptoAlgorithmParameters.h:
1518 * crypto/JsonWebKey.h: Added.
1519 * crypto/JsonWebKey.idl: Added.
1520 * crypto/RsaOtherPrimesInfo.h: Added.
1521 * crypto/RsaOtherPrimesInfo.idl: Added.
1522 * crypto/SubtleCrypto.h:
1523 * crypto/SubtleCrypto.idl:
1524 * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
1525 (WebCore::CryptoAlgorithmAES_CBC::generateKey):
1526 (WebCore::CryptoAlgorithmAES_CBC::importKey):
1527 * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
1528 * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
1529 (WebCore::CryptoAlgorithmAES_KW::generateKey):
1530 (WebCore::CryptoAlgorithmAES_KW::importKey):
1531 * crypto/algorithms/CryptoAlgorithmAES_KW.h:
1532 * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
1533 (WebCore::CryptoAlgorithmHMAC::generateKey):
1534 (WebCore::CryptoAlgorithmHMAC::importKey):
1535 * crypto/algorithms/CryptoAlgorithmHMAC.h:
1536 * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
1537 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
1538 * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
1539 * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
1540 (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
1541 * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
1542 * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
1543 (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
1544 * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
1545 * crypto/keys/CryptoKeyAES.cpp:
1546 (WebCore::CryptoKeyAES::CryptoKeyAES):
1547 (WebCore::CryptoKeyAES::generate):
1548 (WebCore::CryptoKeyAES::importRaw):
1549 (WebCore::CryptoKeyAES::importJwk):
1550 * crypto/keys/CryptoKeyAES.h:
1551 * crypto/keys/CryptoKeyDataRSAComponents.cpp:
1552 (WebCore::CryptoKeyDataRSAComponents::CryptoKeyDataRSAComponents):
1553 * crypto/keys/CryptoKeyDataRSAComponents.h:
1554 * crypto/keys/CryptoKeyHMAC.cpp:
1555 (WebCore::CryptoKeyHMAC::CryptoKeyHMAC):
1556 (WebCore::CryptoKeyHMAC::generate):
1557 (WebCore::CryptoKeyHMAC::importRaw):
1558 (WebCore::CryptoKeyHMAC::importJwk):
1559 (WebCore::CryptoKeyHMAC::buildAlgorithm):
1560 * crypto/keys/CryptoKeyHMAC.h:
1561 * crypto/keys/CryptoKeyRSA.cpp: Added.
1562 (WebCore::CryptoKeyRSA::importJwk):
1563 * crypto/keys/CryptoKeyRSA.h:
1564 * crypto/parameters/CryptoAlgorithmHmacKeyParams.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyGenParams.h.
1565 * crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h: Added.
1566 * crypto/parameters/HmacKeyParams.idl: Renamed from Source/WebCore/crypto/parameters/HmacKeyGenParams.idl.
1567 * crypto/parameters/RsaHashedImportParams.idl: Added.
1569 2016-11-10 Brady Eidson <beidson@apple.com>
1571 IndexedDB 2.0: REGRESSION(r208467) Fix flaky crashes in IDB GC-related code.
1572 https://bugs.webkit.org/show_bug.cgi?id=164596
1574 Reviewed by Eric Carlson.
1576 No new tests (Covered by existing tests).
1578 We can't just WTFMove the pointers from the deleted-IDBObject maps...
1579 We need to remove the entries, too.
1581 * Modules/indexeddb/IDBObjectStore.cpp:
1582 (WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
1584 * Modules/indexeddb/IDBTransaction.cpp:
1585 (WebCore::IDBTransaction::internalAbort):
1587 2016-11-10 Youenn Fablet <youennf@gmail.com>
1589 MediaStreamTrack should use more Ref<> and less RefPtr<>
1590 https://bugs.webkit.org/show_bug.cgi?id=164560
1592 Reviewed by Eric Carlson.
1594 No change of behavior.
1596 Make MediaStreamTrack take a Ref<>& instead of a reference.
1597 Using Ref<>&& instead of RefPtr<>&& in MediaStreamTrackPrivate.
1598 Updating constness of some methods accordingly.
1600 * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1601 (WebCore::MediaEndpointPeerConnection::createReceiver):
1602 * Modules/mediastream/MediaStreamTrack.cpp:
1603 (WebCore::MediaStreamTrack::create):
1604 (WebCore::MediaStreamTrack::MediaStreamTrack):
1605 (WebCore::MediaStreamTrack::clone):
1606 * Modules/mediastream/MediaStreamTrack.h:
1607 * Modules/webaudio/MediaStreamAudioSource.cpp:
1608 (WebCore::MediaStreamAudioSource::capabilities):
1609 (WebCore::MediaStreamAudioSource::settings):
1610 * Modules/webaudio/MediaStreamAudioSource.h:
1611 * platform/mediastream/MediaEndpoint.cpp:
1612 * platform/mediastream/MediaStreamPrivate.cpp:
1613 (WebCore::MediaStreamPrivate::create):
1614 * platform/mediastream/MediaStreamTrackPrivate.cpp:
1615 (WebCore::MediaStreamTrackPrivate::create):
1616 (WebCore::MediaStreamTrackPrivate::MediaStreamTrackPrivate):
1617 (WebCore::MediaStreamTrackPrivate::clone):
1618 * platform/mediastream/MediaStreamTrackPrivate.h:
1619 (WebCore::MediaStreamTrackPrivate::setMuted):
1620 (WebCore::MediaStreamTrackPrivate::source):
1621 * platform/mediastream/RealtimeMediaSource.h:
1622 * platform/mediastream/mac/AVMediaCaptureSource.h:
1623 * platform/mediastream/mac/AVMediaCaptureSource.mm:
1624 (WebCore::AVMediaCaptureSource::initializeSettings):
1625 (WebCore::AVMediaCaptureSource::settings):
1626 (WebCore::AVMediaCaptureSource::initializeCapabilities):
1627 (WebCore::AVMediaCaptureSource::capabilities):
1628 * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
1629 (WebCore::RealtimeMediaSourceOwr::capabilities):
1630 (WebCore::RealtimeMediaSourceOwr::settings):
1631 * platform/mock/MockRealtimeMediaSource.cpp:
1632 (WebCore::MockRealtimeMediaSource::initializeCapabilities):
1633 (WebCore::MockRealtimeMediaSource::capabilities):
1634 (WebCore::MockRealtimeMediaSource::initializeSettings):
1635 (WebCore::MockRealtimeMediaSource::settings):
1636 * platform/mock/MockRealtimeMediaSource.h:
1638 2016-11-10 Per Arne Vollan <pvollan@apple.com>
1640 [Win32] Crash in layout tests.
1641 https://bugs.webkit.org/show_bug.cgi?id=164411
1643 Reviewed by Mark Lam.
1645 Use the calling convention expected by the callers of the generated functions.
1647 * bindings/scripts/CodeGeneratorJS.pm:
1648 (GenerateImplementation):
1649 * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
1650 (WebCore::unsafeJsTestDOMJITPrototypeFunctionGetAttribute):
1651 (WebCore::unsafeJsTestDOMJITPrototypeFunctionItem):
1652 (WebCore::unsafeJsTestDOMJITPrototypeFunctionHasAttribute):
1653 (WebCore::unsafeJsTestDOMJITPrototypeFunctionGetElementById):
1654 (WebCore::unsafeJsTestDOMJITPrototypeFunctionGetElementsByName):
1656 2016-11-10 Aaron Chu <aaron_chu@apple.com>
1658 Web Inspector: AXI: clarify button roles (e.g. toggle or popup button)
1659 https://bugs.webkit.org/show_bug.cgi?id=130726
1660 <rdar://problem/16420420>
1662 Reviewed by Brian Burg.
1664 Test: accessibility/ax-differentiate-button-types.html
1666 Added special case logic to make sure PopUpButtonRole and ToggleButtonRole to user ButtonRole as role.
1667 Added an "isPopUpButton" property to be exposed to the Inspector's use.
1669 * accessibility/AccessibilityObject.cpp:
1670 (WebCore::AccessibilityObject::computedRoleString):
1671 * inspector/InspectorDOMAgent.cpp:
1672 (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
1674 2016-11-10 Zan Dobersek <zdobersek@igalia.com>
1676 [EME] Add no-op Web-facing APIs
1677 https://bugs.webkit.org/show_bug.cgi?id=164028
1679 Reviewed by Jer Noble.
1681 Add no-op implementation of the Web-facing APIs as defined in
1682 the EME specification. This will be the basis for implementing
1683 the various algorithms the same specification defines, and for
1684 implementing the relevant platform abstractions.
1686 Dictionaries and enumerations defined by the specification are
1687 defined in separate headers, and not in the implementation files
1688 for the class where they are used. This will ease their use
1689 across different implementation files.
1691 BufferSource now exposes the Variant object it holds. This is
1692 needed to support the iterable property on the MediaKeyStatusMap
1695 CodeGeneratorJS is fixed to support JS-to-native conversion of
1696 sequences of dictionaries.
1699 * DerivedSources.cpp:
1700 * DerivedSources.make:
1701 * Modules/encryptedmedia/MediaKeyMessageEvent.cpp: Added.
1702 (WebCore::MediaKeyMessageEvent::MediaKeyMessageEvent):
1703 (WebCore::MediaKeyMessageEvent::eventInterface):
1704 * Modules/encryptedmedia/MediaKeyMessageEvent.h: Added.
1705 * Modules/encryptedmedia/MediaKeyMessageEvent.idl: Added.
1706 * Modules/encryptedmedia/MediaKeyMessageEventInit.h: Added.
1707 (WebCore::MediaKeyMessageEventInit::MediaKeyMessageEventInit):
1708 * Modules/encryptedmedia/MediaKeyMessageType.h: Added.
1709 * Modules/encryptedmedia/MediaKeySession.cpp: Added.
1710 (WebCore::MediaKeySession::create):
1711 (WebCore::MediaKeySession::MediaKeySession):
1712 (WebCore::MediaKeySession::sessionId):
1713 (WebCore::MediaKeySession::expiration):
1714 (WebCore::MediaKeySession::keyStatuses):
1715 (WebCore::MediaKeySession::generateRequest):
1716 (WebCore::MediaKeySession::load):
1717 (WebCore::MediaKeySession::update):
1718 (WebCore::MediaKeySession::close):
1719 (WebCore::MediaKeySession::remove):
1720 (WebCore::MediaKeySession::hasPendingActivity):
1721 (WebCore::MediaKeySession::activeDOMObjectName):
1722 (WebCore::MediaKeySession::canSuspendForDocumentSuspension):
1723 (WebCore::MediaKeySession::stop):
1724 * Modules/encryptedmedia/MediaKeySession.h: Added.
1725 * Modules/encryptedmedia/MediaKeySession.idl: Added.
1726 * Modules/encryptedmedia/MediaKeySessionType.h: Added.
1727 * Modules/encryptedmedia/MediaKeyStatus.h: Added.
1728 * Modules/encryptedmedia/MediaKeyStatusMap.cpp: Added.
1729 (WebCore::MediaKeyStatusMap::size):
1730 (WebCore::MediaKeyStatusMap::has):
1731 (WebCore::MediaKeyStatusMap::get):
1732 (WebCore::MediaKeyStatusMap::Iterator::Iterator):
1733 (WebCore::MediaKeyStatusMap::Iterator::next):
1734 * Modules/encryptedmedia/MediaKeyStatusMap.h: Added.
1735 (WebCore::MediaKeyStatusMap::create):
1736 (WebCore::MediaKeyStatusMap::createIterator):
1737 * Modules/encryptedmedia/MediaKeyStatusMap.idl: Added.
1738 * Modules/encryptedmedia/MediaKeySystemAccess.cpp: Added.
1739 (WebCore::MediaKeySystemAccess::keySystem):
1740 (WebCore::MediaKeySystemAccess::getConfiguration):
1741 (WebCore::MediaKeySystemAccess::createMediaKeys):
1742 * Modules/encryptedmedia/MediaKeySystemAccess.h: Added.
1743 (WebCore::MediaKeySystemAccess::create):
1744 * Modules/encryptedmedia/MediaKeySystemAccess.idl: Added.
1745 * Modules/encryptedmedia/MediaKeySystemConfiguration.h: Added.
1746 * Modules/encryptedmedia/MediaKeySystemConfiguration.idl: Added.
1747 * Modules/encryptedmedia/MediaKeySystemMediaCapability.h: Added.
1748 * Modules/encryptedmedia/MediaKeySystemMediaCapability.idl: Added.
1749 * Modules/encryptedmedia/MediaKeys.cpp: Added.
1750 (WebCore::MediaKeys::createSession):
1751 (WebCore::MediaKeys::setServerCertificate):
1752 * Modules/encryptedmedia/MediaKeys.h: Added.
1753 (WebCore::MediaKeys::create):
1754 * Modules/encryptedmedia/MediaKeys.idl: Added.
1755 * Modules/encryptedmedia/MediaKeysRequirement.h: Added.
1756 * Modules/encryptedmedia/NavigatorEME.cpp: Added.
1757 (WebCore::NavigatorEME::requestMediaKeySystemAccess):
1758 * Modules/encryptedmedia/NavigatorEME.h: Added.
1759 * Modules/encryptedmedia/NavigatorEME.idl: Added.
1760 * WebCore.xcodeproj/project.pbxproj:
1761 * bindings/js/BufferSource.h:
1762 (WebCore::BufferSource::BufferSource):
1763 (WebCore::BufferSource::variant):
1764 * bindings/js/JSMediaKeySessionCustom.cpp: Added.
1765 (WebCore::JSMediaKeySession::closed):
1766 * bindings/js/JSMediaKeySystemAccessCustom.cpp: Added.
1767 (WebCore::JSMediaKeySystemAccess::getConfiguration):
1768 * bindings/scripts/CodeGeneratorJS.pm:
1769 (GetNativeVectorInnerType):
1771 * dom/EventNames.in:
1772 * dom/EventTargetFactory.in:
1773 * html/HTMLMediaElement.cpp:
1774 (WebCore::HTMLMediaElement::mediaKeys):
1775 (WebCore::HTMLMediaElement::setMediaKeys):
1776 * html/HTMLMediaElement.h:
1777 * html/HTMLMediaElement.idl:
1778 * html/MediaEncryptedEvent.cpp: Added.
1779 (WebCore::MediaEncryptedEvent::MediaEncryptedEvent):
1780 (WebCore::MediaEncryptedEvent::eventInterface):
1781 (WebCore::MediaEncryptedEvent::initDataType):
1782 (WebCore::MediaEncryptedEvent::initData):
1783 * html/MediaEncryptedEvent.h: Added.
1784 * html/MediaEncryptedEvent.idl: Added.
1785 * html/MediaEncryptedEventInit.h: Added.
1786 (WebCore::MediaEncryptedEventInit::MediaEncryptedEventInit):
1788 2016-11-10 Antoine Quint <graouts@apple.com>
1790 [Modern Media Controls] Media Controller: update controls based on fullscreen playback on macOS
1791 https://bugs.webkit.org/show_bug.cgi?id=164554
1792 <rdar://problem/29183439>
1794 Reviewed by Dean Jackson.
1796 When toggling fullscreen on macOS, toggle between MacOSInlineMediaControls and MacOSFullscreenMediaControls.
1797 To facilitate this, support objects are created and destroyed when changing the controls in order for the
1798 right control objects to be hooked up to the media controller. A new destroy() method on MediaControllerSupport
1799 subclasses can be overridden to remove event listeners added by support objects in their constructor.
1801 Test: media/modern-media-controls/media-controller/media-controller-fullscreen-change.html
1803 * Modules/modern-media-controls/media/fullscreen-support.js:
1804 (FullscreenSupport.prototype.destroy):
1805 * Modules/modern-media-controls/media/media-controller-support.js:
1806 (MediaControllerSupport.prototype.destroy):
1807 * Modules/modern-media-controls/media/media-controller.js:
1809 (MediaController.prototype.get layoutTraits):
1810 (MediaController.prototype.handleEvent):
1811 (MediaController.prototype._updateControlsIfNeeded):
1812 (MediaController.prototype._controlsClass):
1814 2016-11-10 Carlos Garcia Campos <cgarcia@igalia.com>
1816 [Linux] Memory values shown by memory pressure handler logger are not useful
1817 https://bugs.webkit.org/show_bug.cgi?id=164589
1819 Reviewed by Michael Catanzaro.
1821 We are currently using the VmSize field from /proc/self/status which is the virtual memory size of the process
1822 and doesn't normally change even when the memory pressure handler manages to release memory. So, most of the
1823 time we see that there's no changes in memory usage in the logs.
1824 We should use the actual memory used by the process, memory that the process can release and then it's relevant
1825 for the memory pressure handler. Using other fields from /proc/self/status we could do something like VmRSS -
1826 (RssFile + RssShme), but there's also /proc/self/statm that provides the same information in a single. The main
1827 different is that statm provides both resident and shared memory directly, but in number of pages, so we need to
1828 multiply by the size of the page.
1829 This patch adds a method to parse /proc/self/statm in its given file, because I plan to use this for the linux
1830 memory sampler that is incorrectly parsing /proc/self/statm.
1832 * platform/Linux.cmake: Add new files to compilation.
1833 * platform/linux/CurrentProcessMemoryStatus.cpp: Added.
1834 (WebCore::systemPageSize): Return the page size.
1835 (WebCore::currentProcessMemoryStatus): Parse /proc/self/statm and fill the given ProcessMemoryStatus.
1836 * platform/linux/CurrentProcessMemoryStatus.h: Added.
1837 * platform/linux/MemoryPressureHandlerLinux.cpp:
1838 (WebCore::MemoryPressureHandler::processMemoryUsage(): Helper function to return the memory used by the process
1840 (WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage): Use processMemoryUsage().
1842 2016-10-14 Carlos Garcia Campos <cgarcia@igalia.com>
1844 MemoryPressureHandler shouldn't know how to release WebCore memory
1845 https://bugs.webkit.org/show_bug.cgi?id=160497
1847 Reviewed by Michael Catanzaro.
1849 All processes should set their own low memory handler, instead of leaving the web process using the default one
1850 that needs to access APIs that are not in platform layer. This patch fixes all the layering violations in the
1851 MemoryPressureHandler. Since the default implementation, that releases the WebCore memory, is shared by the
1852 WebProcess in WebKit2 and WebKit1 ports, it has been moved to its own file to the WebCore layer.
1854 * CMakeLists.txt: Add new files to compilation.
1855 * PlatformMac.cmake: Ditto.
1856 * WebCore.xcodeproj/project.pbxproj: Ditto.
1857 * loader/FrameLoader.cpp:
1858 (WebCore::FrameLoader::commitProvisionalLoad): Use WebCore::jettisonExpensiveObjectsOnTopLevelNavigation().
1859 * page/MemoryRelease.cpp: Added.
1860 (WebCore::releaseNoncriticalMemory):
1861 (WebCore::releaseCriticalMemory):
1862 (WebCore::releaseMemory):
1863 (WebCore::platformReleaseMemory):
1864 (WebCore::jettisonExpensiveObjectsOnTopLevelNavigation):
1865 (WebCore::registerMemoryReleaseNotifyCallbacks):
1866 * page/MemoryRelease.h: Added.
1867 * page/cocoa/MemoryReleaseCocoa.mm: Added.
1868 (WebCore::platformReleaseMemory):
1869 (WebCore::jettisonExpensiveObjectsOnTopLevelNavigation):
1870 (WebCore::registerMemoryReleaseNotifyCallbacks):
1871 * platform/MemoryPressureHandler.cpp:
1872 (WebCore::MemoryPressureHandler::MemoryPressureHandler):
1873 (WebCore::MemoryPressureHandler::beginSimulatedMemoryPressure):
1874 (WebCore::MemoryPressureHandler::releaseMemory): Use the current handler if it has been set.
1875 (WebCore::MemoryPressureHandler::platformReleaseMemory): Deleted.
1876 * platform/MemoryPressureHandler.h:
1877 (WebCore::MemoryPressureHandler::setLowMemoryHandler):
1878 (WebCore::MemoryPressureHandler::m_releaseMemoryBlock):
1879 * platform/cocoa/MemoryPressureHandlerCocoa.mm:
1880 (WebCore::MemoryPressureHandler::respondToMemoryPressure): Call releaseMemory() instead of using the handler directly.
1881 (WebCore::MemoryPressureHandler::platformReleaseMemory): Deleted.
1882 * platform/linux/MemoryPressureHandlerLinux.cpp:
1883 * platform/win/MemoryPressureHandlerWin.cpp:
1884 (WebCore::MemoryPressureHandler::respondToMemoryPressure): Call releaseMemory() instead of using the handler directly.
1886 2016-11-08 Sergio Villar Senin <svillar@igalia.com>
1888 [css-grid] Fix fr tracks sizing under min|max-size constraints
1889 https://bugs.webkit.org/show_bug.cgi?id=150674
1891 Reviewed by Darin Adler.
1893 The min|max-sizes must be used to compute the flex fraction for indefinite free
1894 spaces. According to the spec "If using this flex fraction would cause the grid to be
1895 smaller than the grid container’s min-width/height (or larger than the grid container’s
1896 max-width/height), then redo this step, treating the free space as definite and the
1897 available grid space as equal to the grid container’s content box size when it’s sized to
1898 its min-width/height (max-width/height)."
1900 This only affects indefinite heights because during layout both definite sizes and any kind
1901 of widths are properly constrained by min|max-width restrictions.
1903 Tests: fast/css-grid-layout/flex-sizing-columns-min-max-width.html
1904 fast/css-grid-layout/flex-sizing-rows-min-max-height.html
1906 * rendering/RenderGrid.cpp:
1907 (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
1908 (WebCore::RenderGrid::computeFlexSizedTracksGrowth):
1909 * rendering/RenderGrid.h:
1911 2016-11-10 Alejandro G. Castro <alex@igalia.com>
1913 [WebRTC] [OpenWebRTC] RTX default parameters broken after r207952
1914 https://bugs.webkit.org/show_bug.cgi?id=164541
1916 Reviewed by Philippe Normand.
1918 Fixed typo in refactoring.
1920 * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
1921 (WebCore::MediaEndpointOwr::getDefaultVideoPayloads):
1923 2016-11-08 Philippe Normand <pnormand@igalia.com>
1925 [WebRTC] white-list turns urls from the RTCConfiguration
1926 https://bugs.webkit.org/show_bug.cgi?id=164506
1928 Reviewed by Alejandro G. Castro.
1930 * Modules/mediastream/RTCConfiguration.cpp:
1931 (WebCore::validateIceServerURL): Add the turns URL scheme to the
1932 list of supported relay and signaling server protocols.
1934 2016-11-09 Joseph Pecoraro <pecoraro@apple.com>
1936 Web Inspector: DebuggerManager.Event.Resumed introduces test flakiness
1937 https://bugs.webkit.org/show_bug.cgi?id=161951
1938 <rdar://problem/28295767>
1940 Reviewed by Brian Burg.
1942 Covered by existing tests that would ASSERT otherwise.
1944 * inspector/InspectorClient.cpp:
1945 (WebCore::InspectorClient::doDispatchMessageOnFrontendPage):
1946 When paused on an exception in the inspected page and evaluating
1947 commands in the inspector frontend page (which evaluates JavaScript)
1948 we ASSERT when entering the Global DOM VM with an existing exception.
1949 This makes it so when we evaluate JavaScript in the frontend we
1950 suspend / ignore the state of the VM for the inspected page, and
1951 restore it when we return from the inspector.
1953 2016-11-09 Joseph Pecoraro <pecoraro@apple.com>
1955 Web Inspector: Associate Worker Resources with the Worker and not the Page
1956 https://bugs.webkit.org/show_bug.cgi?id=164342
1957 <rdar://problem/29075775>
1959 Reviewed by Timothy Hatcher.
1961 Test: inspector/worker/resources-in-worker.html
1963 Provide a way to associate an initiator identifier with a ResourceRequest.
1964 This will allow Web Inspector to identify who started particular resource
1965 loads. This is important to associate Worker(...), importScript(...), and
1966 XMLHttpRequest / Fetch loads with that specific Worker.
1968 * platform/network/ResourceRequestBase.cpp:
1969 (WebCore::ResourceRequestBase::setAsIsolatedCopy):
1970 * platform/network/ResourceRequestBase.h:
1971 (WebCore::ResourceRequestBase::initiatorIdentifier):
1972 (WebCore::ResourceRequestBase::setInitiatorIdentifier):
1973 Optional initiator identifier. Currently used only be Web Inspector.
1975 * dom/ScriptExecutionContext.h:
1976 (WebCore::ScriptExecutionContext::resourceRequestIdentifier):
1977 Non-page execution contexts, like WorkerGlobalScope, should provide
1978 a unique identifier that may be used to distinguish loads initiated
1979 from within that context.
1981 * xml/XMLHttpRequest.cpp:
1982 (WebCore::XMLHttpRequest::createRequest):
1983 * Modules/fetch/FetchLoader.cpp:
1984 (WebCore::FetchLoader::start):
1985 * Modules/fetch/FetchRequest.cpp:
1986 (WebCore::FetchRequest::initializeWith):
1987 XHR / Fetch loads should include the ScriptExecutionContext's
1988 initiator identifier.
1990 * workers/WorkerScriptLoader.cpp:
1991 (WebCore::WorkerScriptLoader::WorkerScriptLoader):
1992 (WebCore::WorkerScriptLoader::loadSynchronously):
1993 (WebCore::WorkerScriptLoader::loadAsynchronously):
1994 (WebCore::WorkerScriptLoader::createResourceRequest):
1995 * workers/WorkerScriptLoader.h:
1996 Provide a way to provide initiator identifier information for
1997 Worker script loads. Currently this is `new Worker(...)` and
1998 `importScripts(...)` resource loads.
2000 * workers/Worker.cpp:
2001 (WebCore::Worker::Worker):
2002 (WebCore::Worker::create):
2004 * workers/WorkerGlobalScope.cpp:
2005 (WebCore::WorkerGlobalScope::WorkerGlobalScope):
2006 (WebCore::WorkerGlobalScope::importScripts):
2007 * workers/WorkerGlobalScope.h:
2008 Give Worker itself the unique identifier, because `new Worker(...)`
2009 loads happen before the WorkerGlobalScript (ScriptExecutionContext)
2010 is actually created, but we want to associate it with this Worker.
2012 * workers/DedicatedWorkerGlobalScope.cpp:
2013 (WebCore::DedicatedWorkerGlobalScope::create):
2014 (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
2015 * workers/DedicatedWorkerGlobalScope.h:
2016 * workers/DedicatedWorkerThread.cpp:
2017 (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
2018 (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
2019 * workers/DedicatedWorkerThread.h:
2020 * workers/WorkerInspectorProxy.cpp:
2021 (WebCore::WorkerInspectorProxy::WorkerInspectorProxy):
2022 * workers/WorkerInspectorProxy.h:
2023 * workers/WorkerMessagingProxy.cpp:
2024 (WebCore::WorkerMessagingProxy::WorkerMessagingProxy):
2025 (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
2026 * workers/WorkerThread.cpp:
2027 (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
2028 (WebCore::WorkerThread::WorkerThread):
2029 (WebCore::WorkerThread::workerThread):
2030 * workers/WorkerThread.h:
2031 Pass the MainThread's Worker identifier through to the WorkerGlobalScope
2032 created on the WorkerThread. They should be the same identifier.
2034 * inspector/InspectorNetworkAgent.cpp:
2035 (WebCore::InspectorNetworkAgent::willSendRequest):
2036 * inspector/InspectorPageAgent.cpp:
2037 (WebCore::InspectorPageAgent::buildObjectForFrameTree):
2038 Pass the initiator identifier data to the frontend. This identifier is
2039 equivalent to a "target identifier" in the frontend. Currently the only
2040 non-Page targets are Workers.
2042 * loader/cache/CachedResourceLoader.cpp:
2043 (WebCore::CachedResourceLoader::shouldContinueAfterNotifyingLoadedFromMemoryCache):
2044 When using the memory cache we create a new resource request. Be sure
2045 to copy over useful inspector data, like the initiator identifier,
2046 from the original request.
2048 * platform/network/cf/ResourceRequestCFNet.cpp:
2049 (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
2050 When rebuilding a ResourceRequest from NSURLRequest, copy over the
2051 initiator identifier property that wouldn't otherwise have survived
2054 2016-11-09 Brady Eidson <beidson@apple.com>
2056 IndexedDB 2.0: Clean up some exception ordering.
2057 https://bugs.webkit.org/show_bug.cgi?id=164566
2059 Reviewed by Alex Christensen.
2061 No new tests (Covered by existing tests).
2063 * Modules/indexeddb/IDBCursor.cpp:
2064 (WebCore::IDBCursor::advance):
2065 (WebCore::IDBCursor::continueFunction):
2067 * Modules/indexeddb/IDBObjectStore.cpp:
2068 (WebCore::IDBObjectStore::createIndex):
2070 2016-11-09 Alex Christensen <achristensen@webkit.org>
2072 Unreviewed, rolling out r208438.
2078 "[WK2][NETWORK_SESSION] Add support for downloading file
2080 https://bugs.webkit.org/show_bug.cgi?id=164458
2081 http://trac.webkit.org/changeset/208438
2083 2016-11-09 Said Abou-Hallawa <sabouhallawa@apple.com>
2085 Change the decoding for some animated images to be asynchronous
2086 https://bugs.webkit.org/show_bug.cgi?id=161566
2088 Reviewed by Simon Fraser.
2090 Tests: fast/images/slower-animation-than-decoding-image.html
2091 fast/images/slower-decoding-than-animation-image.html
2092 fast/images/stopped-animation-deleted-image.html
2094 Request the next frame before firing the animation timer. The asynchronous
2095 image decoding work queue notifies the BitmapImage when the frame finishes
2096 decoding. If the timer fires before the frame is decoded, no repaint will
2097 be requested. Only when the image frame is ready, the animation will be
2098 advanced and the image will be repainted.
2100 * loader/cache/CachedImage.cpp:
2101 (WebCore::CachedImage::load): Cache the image settings in CachedImage.
2102 (WebCore::CachedImage::createImage): No need to pass allowSubsampling to BitmapImage. It can be retrieved through Image::imageObserver().
2103 (WebCore::CachedImage::changedInRect): Change the parameter to notifyObservers() to be a pointer.
2104 * loader/cache/CachedImage.h: Cache the settings: allowSubsampling, allowAsyncImageDecoding and showDebugBackground through m_loader.
2105 * platform/graphics/BitmapImage.cpp:
2106 (WebCore::BitmapImage::dataChanged): Fix a logging message.
2107 (WebCore::BitmapImage::draw): Store the current SubsamplingLevel to be used when requesting decoding the image of the next frame.
2108 Draw a debug rectangle if the next frame is missed because it is being decoded and the setting showDebugBackground is on.
2109 (WebCore::BitmapImage::startAnimation): Deleted. Moved to the header file.
2110 (WebCore::BitmapImage::internalStartAnimation): Added. Request asynchronous image decoding for the next frame if required. Return the
2111 result of starting the animation.
2112 (WebCore::BitmapImage::advanceAnimation): Call internalAdvanceAnimation() if the frame image is not being decoded. If it is being decoded
2113 and the setting showDebugBackground is on, force repaint so the debug rectangle is drawn.
2114 (WebCore::BitmapImage::internalAdvanceAnimation): This is the old body of advanceAnimation().
2115 (WebCore::BitmapImage::stopAnimation): Stop the asynchronous image decoding if it is started.
2116 (WebCore::BitmapImage::newFrameNativeImageAvailableAtIndex): This function is called from the async image decoding work queue when finishing decoding a native image frame.
2117 * platform/graphics/BitmapImage.h:
2118 (WebCore::BitmapImage::startAnimation): Added. It is now calls internalStartAnimation().
2119 * platform/graphics/Color.h: Define a constant for the yellow color.
2120 * platform/graphics/ImageFrameCache.cpp:
2121 (WebCore::ImageFrameCache::clearMetadata): Delete unreferenced member.
2122 (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Return true if the frame is requested for async decoding.
2123 * platform/graphics/ImageFrameCache.h:
2124 * platform/graphics/ImageObserver.h: Add virtual functions for allowSubsampling, allowAsyncImageDecoding and showDebugBackground.
2125 * platform/graphics/ImageSource.cpp:
2126 (WebCore::ImageSource::maximumSubsamplingLevel): Move checking allowSubsampling() to the caller BitmapImage::draw().
2127 * platform/graphics/ImageSource.h: Remove the setting allowSubsampling(); it can be retrieved from imageObserver().
2128 (WebCore::ImageSource::setAllowSubsampling): Deleted.
2129 * rendering/RenderImageResource.cpp:
2130 (WebCore::RenderImageResource::shutdown): Stop the animation of an image when shutting down the resource.
2131 * rendering/RenderImageResourceStyleImage.cpp:
2132 (WebCore::RenderImageResourceStyleImage::shutdown): Ditto.
2133 svg/graphics/SVGImageClients.h: Change the parameter to ImageObserver::changedInRect() to be a pointer.
2134 (WebCore::SVGImageChromeClient::invalidateContentsAndRootView):
2135 * testing/Internals.cpp:
2136 (WebCore::Internals::setImageFrameDecodingDuration): Sets a fixed frame decoding duration for testing.
2137 * testing/Internals.h:
2138 * testing/Internals.idl: Adds an internal option for ImageFrameDecodingDuration.
2140 2016-11-04 Brent Fulgham <bfulgham@apple.com>
2142 Local HTML should be blocked from localStorage access unless "Disable Local File Restrictions" is checked
2143 https://bugs.webkit.org/show_bug.cgi?id=155185
2144 <rdar://problem/11101440>
2146 Reviewed by Brady Eidson.
2148 Add a new quirk for localStorage that defaults to 'on'. When active, this quirk says that
2149 localStorage access should be granted, without needing to grant universal file access.
2151 If the quirk is turned off, then localStorage is blocked unless the WebKit client explicitly
2152 grants universal file access.
2154 Tests: storage/domstorage/localstorage/blocked-file-access-permitted-by-quirk.html
2155 storage/domstorage/localstorage/blocked-file-access.html
2158 (WebCore::Document::initSecurityContext): Set localStorage quirk mode based on settings.
2159 * page/SecurityOrigin.cpp:
2160 (WebCore::SecurityOrigin::SecurityOrigin): Use more C++11 initializers.
2161 (WebCore::SecurityOrigin::canAccessStorage): If the origin is a local file, and we are NOT in
2162 localStorage quirks mode, and we have not been granted universal file access, prevent access
2163 to DOM localStorage.
2164 (WebCore::SecurityOrigin::setNeedsLocalStorageQuirk): Added.
2165 * page/SecurityOrigin.h:
2166 (WebCore::SecurityOrigin::needsLocalStorageQuirk): Added.
2168 * workers/WorkerGlobalScope.cpp:
2169 (WebCore::WorkerGlobalScope::WorkerGlobalScope): Make sure Workers know what the
2170 localStorage quirks mode is set to.
2172 2016-11-09 Alex Christensen <achristensen@webkit.org>
2174 URLParser should not consider path of URLs with no host to start at the first slash after the colon
2175 https://bugs.webkit.org/show_bug.cgi?id=164555
2177 Reviewed by Tim Horton.
2179 When we see a url that is only scheme:// we treated the // as the path. Firefox did this with unrecognized schemes,
2180 but based on https://github.com/whatwg/url/issues/148 they seem willing to change. We had added similar behavior to
2181 URL::parse, and I added this to URLParser in r206783 which this effectively reverts.
2183 Covered by API and layout tests.
2185 * platform/URLParser.cpp:
2186 (WebCore::URLParser::parse):
2187 Don't move m_userStart to m_pathStart back by two when we see an empty host.
2189 2016-11-09 Alex Christensen <achristensen@webkit.org>
2191 Simplify logic of SecurityOrigin::databaseIdentifier
2192 https://bugs.webkit.org/show_bug.cgi?id=164565
2194 Reviewed by Brady Eidson.
2196 No change in behavior.
2198 SecurityOrigins with the file scheme need a special database identifier to be backwards-compatible with existing storage.
2199 Instead of determining whether this is a file SecurityOrigin at parsing time and only using that information when
2200 making the database identifier, just determine whether we need this quirk when making the database identifier.
2201 I'm planning to move this logic to SecurityOriginData in another patch.
2203 * page/SecurityOrigin.cpp:
2204 (WebCore::SecurityOrigin::SecurityOrigin):
2205 (WebCore::SecurityOrigin::create):
2206 (WebCore::SecurityOrigin::databaseIdentifier):
2207 * page/SecurityOrigin.h:
2209 2016-11-09 Jaehun Lim <ljaehun.lim@samsung.com>
2211 Unreviewed, build fix after r208460
2213 isValidColorString() was renamed isValidSimpleColorString().
2215 * html/ColorInputType.cpp:
2216 (WebCore::ColorInputType::suggestions):
2218 2016-11-09 Anders Carlsson <andersca@apple.com>
2224 2016-11-09 Simon Fraser <simon.fraser@apple.com>
2226 Implement visual-viewport based position:fixed handling for Mac async scrolling
2227 https://bugs.webkit.org/show_bug.cgi?id=164495
2229 Reviewed by Tim Horton.
2231 Educate the scrolling tree about visual and layout viewports. This is runtime-switchable,
2232 so we push the enable flag to via the root state node, then push the layout viewport,
2233 and the min/max scroll position that contstrain it, through frame state nodes.
2235 When a scroll happens, we compute a new layout viewport when the visual viewport hits
2236 an edge, and push that down through setScrollLayerPosition() since it's used to position
2237 fixed and sticky layers.
2239 When the main thread gets notified about an async scroll, we set the new layout viewport
2240 on the FrameView, but do so in such a way that does not trigger layout. This is OK because
2241 we do a RenderLayer update which udpates all the layoutViewport-dependent state, and is
2242 necessary to avoid repaints every main thread update.
2244 The iOS code is made to compile, but not work yet.
2246 Tests: compositing/tiling/visiblerect-accumulated-offset.html
2247 fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-then-up.html
2248 fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down.html
2249 fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolling-layers-state.html
2251 * page/FrameView.cpp:
2252 (WebCore::FrameView::setLayoutViewportOrigin):
2253 (WebCore::FrameView::updateLayoutViewport):
2254 (WebCore::FrameView::visualViewportRect):
2255 (WebCore::FrameView::unscaledMinimumScrollPosition):
2256 (WebCore::FrameView::scrollPositionChanged):
2258 * page/scrolling/AsyncScrollingCoordinator.cpp:
2259 (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
2260 (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
2261 (WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll):
2262 (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScrollTimerFired):
2263 (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
2264 (WebCore::AsyncScrollingCoordinator::visualViewportEnabled):
2265 * page/scrolling/AsyncScrollingCoordinator.h:
2266 (WebCore::AsyncScrollingCoordinator::ScheduledScrollUpdate::ScheduledScrollUpdate):
2267 * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
2268 (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
2269 (WebCore::ScrollingStateFrameScrollingNode::setLayoutViewport):
2270 (WebCore::ScrollingStateFrameScrollingNode::setMinLayoutViewportOrigin):
2271 (WebCore::ScrollingStateFrameScrollingNode::setMaxLayoutViewportOrigin):
2272 (WebCore::ScrollingStateFrameScrollingNode::setVisualViewportEnabled):
2273 (WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
2274 * page/scrolling/ScrollingStateFrameScrollingNode.h:
2275 * page/scrolling/ScrollingTree.cpp:
2276 (WebCore::ScrollingTree::viewportChangedViaDelegatedScrolling):
2277 (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
2278 (WebCore::ScrollingTree::commitTreeState):
2279 * page/scrolling/ScrollingTree.h:
2280 (WebCore::ScrollingTree::visualViewportEnabled):
2281 (WebCore::ScrollingTree::setVisualViewportEnabled):
2282 * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
2283 (WebCore::ScrollingTreeFrameScrollingNode::commitStateBeforeChildren):
2284 (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition):
2285 * page/scrolling/ScrollingTreeFrameScrollingNode.h:
2286 (WebCore::ScrollingTreeFrameScrollingNode::layoutViewport):
2287 (WebCore::ScrollingTreeFrameScrollingNode::minLayoutViewportOrigin):
2288 (WebCore::ScrollingTreeFrameScrollingNode::maxLayoutViewportOrigin):
2289 * page/scrolling/ScrollingTreeScrollingNode.cpp:
2290 (WebCore::ScrollingTreeScrollingNode::setScrollPositionWithoutContentEdgeConstraints):
2291 * page/scrolling/ScrollingTreeScrollingNode.h:
2292 * page/scrolling/ThreadedScrollingTree.cpp:
2293 (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
2294 * page/scrolling/ThreadedScrollingTree.h:
2295 * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
2296 * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
2297 (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints):
2298 (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollLayerPosition):
2299 * page/scrolling/ios/ScrollingTreeIOS.cpp:
2300 (WebCore::ScrollingTreeIOS::scrollingTreeNodeDidScroll):
2301 * page/scrolling/ios/ScrollingTreeIOS.h:
2302 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2303 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2304 (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
2305 (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
2307 2016-11-09 Brady Eidson <beidson@apple.com>
2309 IndexedDB 2.0: W3C test IndexedDB/idbtransaction_objectStoreNames.html fails.
2310 https://bugs.webkit.org/show_bug.cgi?id=164528
2312 Reviewed by Alex Christensen.
2314 No new tests (Covered by existing test).
2316 * Modules/indexeddb/IDBDatabase.cpp:
2317 (WebCore::IDBDatabase::transaction): De-dupe the input names.
2319 2016-11-09 Brady Eidson <beidson@apple.com>
2321 IndexedDB 2.0: Implement new IDBCursor.continuePrimaryKey function.
2322 https://bugs.webkit.org/show_bug.cgi?id=164404
2324 Reviewed by Alex Christensen.
2326 Tests: storage/indexeddb/modern/idbcursor-continue-primary-key-1-private.html
2327 storage/indexeddb/modern/idbcursor-continue-primary-key-1.html
2328 Also covered by existing tests.
2330 * Modules/indexeddb/IDBCursor.cpp:
2331 (WebCore::IDBCursor::continuePrimaryKey):
2332 (WebCore::IDBCursor::uncheckedIterateCursor):
2333 * Modules/indexeddb/IDBCursor.h:
2334 * Modules/indexeddb/IDBCursor.idl:
2336 * Modules/indexeddb/IDBKeyData.h:
2337 (WebCore::IDBKeyData::operator>):
2338 (WebCore::IDBKeyData::operator<=):
2339 (WebCore::IDBKeyData::operator>=):
2341 * Modules/indexeddb/server/MemoryCursor.h:
2343 * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2344 (WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
2346 * Modules/indexeddb/server/MemoryIndexCursor.cpp:
2347 (WebCore::IDBServer::MemoryIndexCursor::iterate):
2348 * Modules/indexeddb/server/MemoryIndexCursor.h:
2350 * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
2351 (WebCore::IDBServer::MemoryObjectStoreCursor::iterate):
2352 * Modules/indexeddb/server/MemoryObjectStoreCursor.h:
2354 * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2355 (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
2357 * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
2358 (WebCore::IDBServer::SQLiteIDBCursor::iterate):
2359 * Modules/indexeddb/server/SQLiteIDBCursor.h:
2361 * Modules/indexeddb/shared/IDBIterateCursorData.cpp:
2362 (WebCore::IDBIterateCursorData::isolatedCopy):
2363 * Modules/indexeddb/shared/IDBIterateCursorData.h:
2364 (WebCore::IDBIterateCursorData::encode):
2365 (WebCore::IDBIterateCursorData::decode):
2367 2016-11-09 Antoine Quint <graouts@apple.com>
2369 [Modern Media Controls] Media Controller: set status label according to media state
2370 https://bugs.webkit.org/show_bug.cgi?id=164557
2371 <rdar://problem/29184097>
2373 Reviewed by Dean Jackson.
2375 Correctly set the StatusLabel text based on the media loading and network state.
2377 Tests: http/tests/media/modern-media-controls/status-support/status-support-live-broadcast.html
2378 http/tests/media/modern-media-controls/status-support/status-support-loading.html
2379 media/modern-media-controls/status-support/status-support-error.html
2381 * Modules/modern-media-controls/js-files:
2382 * Modules/modern-media-controls/media/media-controller.js:
2384 * Modules/modern-media-controls/media/status-support.js: Added.
2385 (StatusSupport.prototype.get control):
2386 (StatusSupport.prototype.get mediaEvents):
2387 (StatusSupport.prototype.syncControl):
2389 * WebCore.xcodeproj/project.pbxproj:
2391 2016-11-09 Zalan Bujtas <zalan@apple.com>
2393 No need to set setFlowThreadState on RenderText in createTextRenderer.
2394 https://bugs.webkit.org/show_bug.cgi?id=164559
2396 Reviewed by Antti Koivisto.
2398 setFlowThreadState in create*Renderer ensures that by the time we issue the initial call to
2399 styleWillChange/styleDidChange through initializeStyle, the state is already set.
2400 However since RenderText does not have its own style, it's sufficient to have the flow state set
2401 through the normal RenderElement::insertChildInternal code path.
2403 No change in functionality.
2405 * style/RenderTreeUpdater.cpp:
2406 (WebCore::createTextRenderer):
2408 2016-11-09 Brady Eidson <beidson@apple.com>
2410 IndexedDB 2.0: Encapsulate cursor iteration parameters for easy future expansion.
2411 https://bugs.webkit.org/show_bug.cgi?id=164504
2413 Reviewed by Darin Adler.
2415 No new tests (Refactor, no behavior change).
2417 This patch literally just takes the "key" and "count" arguments and encapsulates them in a struct.
2418 That struct will then be easily expandable in the future (e.g. bug 164404).
2420 * Modules/indexeddb/IDBCursor.cpp:
2421 (WebCore::IDBCursor::uncheckedIterateCursor):
2423 * Modules/indexeddb/IDBTransaction.cpp:
2424 (WebCore::IDBTransaction::iterateCursor):
2425 (WebCore::IDBTransaction::iterateCursorOnServer):
2426 * Modules/indexeddb/IDBTransaction.h:
2428 * Modules/indexeddb/client/IDBConnectionProxy.cpp:
2429 (WebCore::IDBClient::IDBConnectionProxy::iterateCursor):
2430 * Modules/indexeddb/client/IDBConnectionProxy.h:
2432 * Modules/indexeddb/client/IDBConnectionToServer.cpp:
2433 (WebCore::IDBClient::IDBConnectionToServer::iterateCursor):
2434 * Modules/indexeddb/client/IDBConnectionToServer.h:
2435 * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
2437 * Modules/indexeddb/server/IDBBackingStore.h:
2439 * Modules/indexeddb/server/IDBServer.cpp:
2440 (WebCore::IDBServer::IDBServer::iterateCursor):
2441 * Modules/indexeddb/server/IDBServer.h:
2443 * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2444 (WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
2445 * Modules/indexeddb/server/MemoryIDBBackingStore.h:
2447 * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2448 (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
2449 * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2451 * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2452 (WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
2453 (WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor):
2454 * Modules/indexeddb/server/UniqueIDBDatabase.h:
2456 * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
2457 (WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor):
2458 * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
2460 * Modules/indexeddb/shared/IDBIterateCursorData.cpp: Added.
2461 (WebCore::IDBIterateCursorData::isolatedCopy):
2462 * Modules/indexeddb/shared/IDBIterateCursorData.h: Added.
2463 (WebCore::IDBIterateCursorData::encode):
2464 (WebCore::IDBIterateCursorData::decode):
2466 * Modules/indexeddb/shared/InProcessIDBServer.cpp:
2467 (WebCore::InProcessIDBServer::iterateCursor):
2468 * Modules/indexeddb/shared/InProcessIDBServer.h:
2471 * WebCore.xcodeproj/project.pbxproj:
2473 2016-11-09 Ryosuke Niwa <rniwa@webkit.org>
2475 StyledElement::attributeChanged shouldn't do any work when the attribute value didn't change
2476 https://bugs.webkit.org/show_bug.cgi?id=129476
2478 Reviewed by Andreas Kling.
2480 Avoid calling styleAttributeChanged and setPresentationAttributeStyleIsDirty
2481 when the attribute value didn't change as in r164856.
2483 * dom/StyledElement.cpp:
2484 (WebCore::StyledElement::attributeChanged):
2486 2016-11-09 Yusuke Suzuki <utatane.tea@gmail.com>
2488 [DOMJIT] Implement Node::ownerDocument
2489 https://bugs.webkit.org/show_bug.cgi?id=164004
2491 Reviewed by Darin Adler.
2493 Test: js/dom/domjit-accessor-owner-document.html
2495 Still I cannot reproduce this crash in x64 environment, according to the crash log, it accesses 0x8 address.
2496 This can happen if document() accidentally returns nullptr. In the C++ ownerDocument implementation,
2497 if document() returns nullptr, it just returns nullptr. But in the DOMJIT implementation, we assume that
2498 document() won't return nullptr and access the member of it.
2500 This patch aligns the DOMJIT implementation strictly to the C++ one.
2503 * domjit/JSNodeDOMJIT.cpp:
2504 (WebCore::NodeOwnerDocumentDOMJIT::checkDOM):
2505 (WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter):
2507 2016-11-09 Sam Weinig <sam@webkit.org>
2509 [SVG] Start moving special casing of SVG out of the bindings - SVGAngle
2510 https://bugs.webkit.org/show_bug.cgi?id=164496
2512 Reviewed by Darin Adler.
2514 There is quite a bit of special casing of SVG types in the bindings that adds
2515 a lot of complexity and is relatively fragile, as it is based on type naming.
2517 Instead of keeping the complexity in the bindings, I am going to move it into
2518 the implementation, where it has also longed to be.
2520 Starting small, with just SVGAngle. It has been split in two, with the existing
2521 SVGAngle being renamed SVGAngleValue, and the bound instance, which used to be name
2522 SVGPropertyTearOff<SVGAngle>, taking the name SVGAngle (and inheriting from
2523 SVGPropertyTearOff<SVGAngleValue>).
2526 * WebCore.xcodeproj/project.pbxproj:
2527 Add SVGAngleValue.cpp
2529 * bindings/scripts/CodeGenerator.pm:
2530 Remove SVGAngle as a special case.
2532 * svg/SVGAngle.cpp: Removed.
2534 Added. Implements the SVGAngle interface explicitly, getting to
2535 the SVGAngleValue through propertyReference().
2538 * svg/SVGAngleValue.cpp: Copied from Source/WebCore/svg/SVGAngle.cpp.
2539 * svg/SVGAngleValue.h: Copied from Source/WebCore/svg/SVGAngle.h.
2540 Move old SVGAngle implementation to SVGAngleValue.
2542 * svg/SVGAnimatedAngle.cpp:
2543 Replace SVGAngle usage with SVGAngleValue.
2545 * svg/SVGAnimatedAngle.h:
2546 Switch SVGAnimatedAngle to be a type alias. This remains SVGAnimatedPropertyTearOff<SVGAngle>
2547 as SVGAnimatedPropertyTearOff has been changed to take the TearOff type as its parameter.
2549 * svg/SVGAnimatedLength.h:
2550 * svg/SVGAnimatedPreserveAspectRatio.h:
2551 * svg/SVGAnimatedRect.h:
2552 Switch to using type aliases and pass the TearOff to SVGAnimatedPropertyTearOff.
2554 * svg/SVGAnimatedType.cpp:
2555 (WebCore::SVGAnimatedType::createAngleAndEnumeration):
2556 * svg/SVGAnimatedType.h:
2557 (WebCore::SVGAnimatedType::angleAndEnumeration):
2560 * svg/SVGComponentTransferFunctionElement.h:
2561 Add missing include of SVGElement.h (need because it removed from SVGPropertyTearOff).
2563 * svg/SVGMarkerElement.cpp:
2564 (WebCore::SVGMarkerElement::parseAttribute):
2565 (WebCore::SVGMarkerElement::setOrient):
2566 Switch to take an SVGAngleValue.
2568 (WebCore::SVGMarkerElement::setOrientToAngle):
2569 Update to pull the value out via propertyReference().
2571 * svg/SVGMarkerElement.h:
2572 Switch to take an SVGAngleValue.
2574 * svg/SVGLengthList.h:
2575 * svg/SVGNumberList.h:
2576 * svg/SVGPathSegList.h:
2577 * svg/SVGPointList.h:
2578 * svg/SVGStringList.h:
2579 * svg/SVGTransformList.h:
2580 Switch to using type aliases in SVGPropertyTraits and add an alias for
2583 * svg/SVGSVGElement.cpp:
2584 (WebCore::SVGSVGElement::createSVGAngle):
2585 * svg/SVGSVGElement.h:
2586 Change createSVGAngle to return a Ref<SVGAngle> and create one.
2588 * svg/SVGSVGElement.idl:
2589 Annotate IDL to indicate that a new value is being returned.
2591 * svg/SVGTransform.cpp:
2592 Remove unnecessary include of SVGAngle.h.
2594 * svg/SVGViewSpec.cpp:
2595 Add missing include of SVGElement.h (need because it removed from SVGPropertyTearOff).
2597 * svg/properties/SVGAnimatedPropertyTearOff.h:
2598 Change to be parameterized on the TearOffType, rather than the PropertyType itself. Get the
2599 Property type from the TearOffType.
2601 * svg/properties/SVGListProperty.h:
2602 * svg/properties/SVGListPropertyTearOff.h:
2603 Fix assumption that all TearOffTypes are just a SVGPropertyTearOff templatized on a property
2604 type. This is no longer true for SVGAngle. Instead, get the TearOffType for lists via SVGPropertyTraits.
2606 * svg/properties/SVGPropertyTearOff.h:
2607 Make the PropertyType available by exposing it as a type alias.
2609 2016-11-09 Darin Adler <darin@apple.com>
2611 Move Range from ExceptionCode to ExceptionOr
2612 https://bugs.webkit.org/show_bug.cgi?id=164457
2614 Reviewed by Alex Christensen.
2616 * accessibility/AXObjectCache.cpp:
2617 (WebCore::AXObjectCache::rangeForNodeContents): Update to use ExceptionOr,
2618 keeping behavior the same.
2619 (WebCore::characterOffsetsInOrder): Ditto.
2620 (WebCore::setRangeStartOrEndWithCharacterOffset): Changed argument to a
2621 reference instead of a pointer. Use a boolean return value to indicate
2622 success rather than an exception, since the callers don't need to know
2623 which exception it is.
2624 (WebCore::AXObjectCache::rangeForUnorderedCharacterOffsets): Updated for
2626 (WebCore::AXObjectCache::nextBoundary): Ditto.
2627 (WebCore::AXObjectCache::previousBoundary): Ditto.
2629 * accessibility/AccessibilityObject.cpp:
2630 (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection):
2631 Update to use ExceptionOr, keeping behavior the same.
2632 * accessibility/AccessibilityRenderObject.cpp:
2633 (WebCore::AccessibilityRenderObject::documentBasedSelectedTextRange): Ditto.
2634 * accessibility/atk/WebKitAccessibleUtil.cpp:
2635 (selectionBelongsToObject): Ditto.
2636 * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2637 (-[WebAccessibilityObjectWrapper _convertToNSRange:]): Ditto.
2639 (WebCore::Node::textRects): Ditto.
2642 (WebCore::Range::~Range): Remove old comment that no longer makes sense now
2643 that the detach function no longer does anything.
2644 (WebCore::checkForDifferentRootContainer): Updated to use ExceptionOr,
2645 keeping behavior the same.
2646 (WebCore::Range::setStart): Ditto.
2647 (WebCore::Range::setEnd): Ditto.
2648 (WebCore::Range::isPointInRange): Ditto.
2649 (WebCore::Range::comparePoint): Ditto.
2650 (WebCore::Range::compareNode): Ditto.
2651 (WebCore::top): Added helper function so that compareBoundaryPoints doesn't
2652 need to have two identical loops in it.
2653 (WebCore::Range::compareBoundaryPoints): Updated to use ExceptionOr,
2654 keeping behavior the same.
2655 (WebCore::Range::compareBoundaryPointsForBindings): Ditto. Also use a switch
2656 instead of relying on the order of the values to check for unsupported values.
2657 (WebCore::Range::boundaryPointsValid): Ditto.
2658 (WebCore::Range::deleteContents): Ditto.
2659 (WebCore::Range::intersectsNode): Ditto.
2660 (WebCore::Range::processContents): Ditto.
2661 (WebCore::deleteCharacterData): Ditto.
2662 (WebCore::processContentsBetweenOffsets): Ditto. Also changed to be a
2663 non-member function and private to this file instead of in the class.
2664 (WebCore::processNodes): Ditto. Also changed one argument to be a RefPtr
2665 since the code relies on using it after mutating the DOM.
2666 (WebCore::processAncestorsAndTheirSiblings): Ditto. Changed one argument type
2667 to use ExceptionOr so the caller doesn't have to check the exception first.
2668 (WebCore::Range::extractContents): Ditto.
2669 (WebCore::Range::cloneContents): Ditto.
2670 (WebCore::Range::insertNode): Ditto. Also fixed to only call nodeType once
2671 instead of three times.
2672 (WebCore::Range::toString): Ditto. Also fixed to call nodeType only once
2673 per node instead of twice, to use downcast instead of static_cast, and to
2674 use the word "node" instead of "n" for the local variable name.
2675 (WebCore::Range::createContextualFragment): Ditto.
2676 (WebCore::Range::checkNodeWOffset): Ditto.
2677 (WebCore::Range::setStartAfter): Ditto.
2678 (WebCore::Range::setEndBefore): Ditto.
2679 (WebCore::Range::setEndAfter): Ditto.
2680 (WebCore::Range::selectNode): Ditto.
2681 (WebCore::Range::selectNodeContents): Ditto.
2682 (WebCore::Range::surroundContents): Ditto.
2683 (WebCore::Range::setStartBefore): Ditto.
2684 (WebCore::Range::contains): Ditto. Except added code to handle exception
2685 case to return false without asserting because I saw at least one crash
2686 that seemed to imply this behavior was needed.
2687 (WebCore::rangesOverlap): Ditto.
2688 (WebCore::rangeOfContents): Ditto.
2689 (WebCore::Range::expand): Ditto.
2690 (WebCore::Range::getClientRects): Ditto.
2691 (WebCore::Range::getBoundingClientRect): Ditto.
2692 (WebCore::Range::borderAndTextQuads): Changed to use return value
2693 instead of out argument, since it's a private function used only
2694 within this class so it was easy to update all call sites.
2695 (WebCore::Range::boundingRect): Updated for above. Also renamed since
2696 there was no need for the name "internal" in this.
2697 (WebCore::Range::absoluteBoundingRect): Ditto.
2698 * dom/Range.h: Updated for above.
2699 * dom/Range.idl: Use non-legacy exceptions. Also changed the default value
2700 of the string argument to the expand function to the empty string rather
2701 than "undefined", because the function silently does nothing when passed
2702 any unrecognized string, and so this leaves behavior unchanged. I removed
2703 the comment saying that the "undefined" default is wrong.
2705 * editing/AlternativeTextController.cpp:
2706 (WebCore::AlternativeTextController::applyAlternativeTextToRange): Updated
2707 to use ExceptionOr but behave the same.
2708 * editing/Editor.cpp:
2709 (WebCore::Editor::advanceToNextMisspelling): Ditto.
2710 (WebCore::Editor::markAndReplaceFor): Ditto.
2711 (WebCore::isFrameInRange): Ditto. Also made a few style tweaks.
2712 (WebCore::Editor::countMatchesForText): Ditto.
2713 * editing/EditorCommand.cpp:
2714 (WebCore::unionDOMRanges): Ditto.
2715 * editing/FrameSelection.cpp:
2716 (WebCore::FrameSelection::respondToNodeModification): Ditto.
2717 * editing/InsertListCommand.cpp:
2718 (WebCore::InsertListCommand::doApplyForSingleParagraph): Ditto.
2719 * editing/TextCheckingHelper.cpp:
2720 (WebCore::TextCheckingParagraph::offsetTo): Ditto.
2721 * editing/TextCheckingHelper.h: Updated for above and also deleted
2722 unneeded private function checkingRange, which just churned the
2723 reference count unnecessarily; instead use m_checkingRange directly.
2724 * editing/TextIterator.cpp:
2725 (WebCore::TextIterator::getLocationAndLengthFromRange): Ditto.
2726 * editing/VisiblePosition.cpp:
2727 (WebCore::setStart): Ditto.
2728 (WebCore::setEnd): Ditto.
2729 * editing/VisibleSelection.cpp:
2730 (WebCore::makeSearchRange): Ditto.
2732 * editing/VisibleUnits.cpp:
2733 (WebCore::suffixLengthForRange): Changed argument from RefPtr to
2735 (WebCore::prefixLengthForRange): Ditto.
2736 (WebCore::previousBoundary): Updated for ExceptionOr and the change
2738 (WebCore::nextBoundary): Ditto.
2739 * editing/VisibleUnits.h: Updated for above.
2741 * editing/htmlediting.cpp:
2742 (WebCore::comparePositions): Updated to use ExceptionOr but behave
2744 (WebCore::visiblePositionForIndexUsingCharacterIterator): Ditto.
2745 (WebCore::isNodeVisiblyContainedWithin): Ditto.
2746 * editing/ios/EditorIOS.mm:
2747 (WebCore::Editor::setDictationPhrasesAsChildOfElement): Ditto.
2748 (WebCore::Editor::setTextAsChildOfElement): Ditto.
2749 * editing/mac/EditorMac.mm:
2750 (WebCore::Editor::adjustedSelectionRange): Ditto.
2751 * editing/markup.cpp:
2752 (WebCore::createMarkupInternal): Ditto.
2753 * page/ContextMenuController.cpp:
2754 (WebCore::ContextMenuController::contextMenuItemSelected): Ditto.
2755 * page/DOMSelection.cpp:
2756 (WebCore::DOMSelection::addRange): Ditto.
2757 (WebCore::DOMSelection::deleteFromDocument): Ditto.
2758 (WebCore::DOMSelection::containsNode): Ditto.
2760 * page/EventHandler.cpp:
2761 (WebCore::EventHandler::dispatchMouseEvent): Updated for change to
2762 use ExceptionOr in Ragne::compareNode. Also refactored the function
2763 to make the logic a little mroe straightforward and nest less of it
2767 (WebCore::Page::findStringMatchingRanges): Updated for ExceptionOr
2768 without changing behavior.
2769 * page/TextIndicator.cpp:
2770 (WebCore::hasNonInlineOrReplacedElements): Ditto.
2771 * rendering/RenderNamedFlowThread.cpp:
2772 (WebCore::RenderNamedFlowThread::getRanges): Ditto.
2774 2016-11-09 Dave Hyatt <hyatt@apple.com>
2776 [CSS Parser] Fix grid layout parsing
2777 https://bugs.webkit.org/show_bug.cgi?id=164489
2779 Reviewed by Dean Jackson.
2781 * css/CSSValueKeywords.in:
2782 * css/parser/CSSPropertyParser.cpp:
2783 (WebCore::consumeFitContent):
2784 (WebCore::isGridTrackFixedSized):
2785 (WebCore::consumeGridTrackSize):
2786 (WebCore::consumeGridTrackRepeatFunction):
2787 (WebCore::consumeGridTrackList):
2788 (WebCore::isCustomIdentValue):
2789 (WebCore::CSSPropertyParser::consumeGridItemPositionShorthand):
2790 (WebCore::CSSPropertyParser::consumeGridAreaShorthand):
2791 (WebCore::consumeImplicitGridAutoFlow):
2792 (WebCore::CSSPropertyParser::consumeGridShorthand):
2794 2016-11-09 Darin Adler <darin@apple.com>
2796 Move EventTarget from ExceptionCode to ExceptionOr
2797 https://bugs.webkit.org/show_bug.cgi?id=164465
2799 Reviewed by Youenn Fablet.
2801 * Modules/indexeddb/IDBRequest.h: Added now-needed forward
2803 * Modules/webaudio/AudioContext.h: Ditto.
2805 * bindings/js/JSEventListener.cpp:
2806 (WebCore::eventHandlerAttribute): Updated for name change of the
2807 attributeEventListener function.
2808 (WebCore::documentEventHandlerAttribute): Ditto.
2810 (WebCore::Document::getWindowAttributeEventListener): Ditto.
2812 * dom/EventTarget.cpp:
2813 (WebCore::EventTarget::setAttributeEventListener): Updated for
2815 (WebCore::EventTarget::attributeEventListener): Ditto.
2816 (WebCore::EventTarget::dispatchEventForBindings): Use ExceptionOr.
2817 (WebCore::legacyType): Use null instead of empty for no type, since
2818 it's more efficient to check for null.
2819 (WebCore::EventTarget::fireEventListeners): Check for null.
2820 Also streamlined logic a little bit and removed a very old comment.
2821 (WebCore::EventTarget::eventListeners): Renamed from getEventListeners.
2822 * dom/EventTarget.h: Removed lots of unneeded declarations. Renamed
2823 some functions to remove get prefix. Updated for above changes.
2824 Moved one inline function out of the class header. Made the destructor
2825 for EventTarget be inline to make the destructors for derived classes
2826 slightly more efficient.
2827 * dom/EventTarget.idl: Use non-legacy exception.
2830 (WebCore::Node::didMoveToNewDocument): Updated for name change.
2831 * editing/ReplaceSelectionCommand.cpp:
2832 (WebCore::ReplacementFragment::ReplacementFragment): Ditto.
2834 * inspector/InspectorCSSAgent.h: Added now-needed forward declaration.
2836 * inspector/InspectorDOMAgent.cpp:
2837 (WebCore::InspectorDOMAgent::getEventListeners): Updated for name change.
2839 * inspector/InspectorInstrumentation.h: Added now-needed forward declaration.
2840 * page/DOMWindow.h: Ditto.
2841 * xml/XMLHttpRequest.h: Ditto.
2843 2016-11-09 Daniel Bates <dabates@apple.com>
2845 Add test infrastructure and tests for existing HTTP 0.9 sandbox machinery
2846 https://bugs.webkit.org/show_bug.cgi?id=164389
2847 <rdar://problem/29101072>
2849 Reviewed by Alex Christensen.
2851 Add test infrastructure to support registering an arbitrary port as the default port
2852 for a protocol. The behavior of various machinery, including the HTTP 0.9 machinery,
2853 can be effected by whether the resource request was made using the default port for
2854 the protocol. We expose window.internals.registerDefaultPortForProtocol() to allow
2855 a test to override the default port associated with a protocol so as to support
2856 testing these code paths using the existing port 8000 server started by run-webkit-httpd.
2857 Without window.internals.registerDefaultPortForProtocol() we would need to teach
2858 run-webkit-httpd to run a web server on port 80, which requires superuser privileges
2859 (since it is a privileged port number) and is more likely to interfere with an
2860 existing web server setup.
2862 Tests: http/tests/security/http-0.9/default-port-plugin-blocked.html
2863 http/tests/security/http-0.9/default-port-script-blocked.html
2864 http/tests/security/http-0.9/iframe-blocked.html
2865 http/tests/security/http-0.9/image-blocked.html
2866 http/tests/security/http-0.9/image-on-HTTP-0.9-default-port-page-allowed-ref-test.html
2867 http/tests/security/http-0.9/image-on-HTTP-0.9-default-port-page-allowed.html
2868 http/tests/security/http-0.9/image-on-HTTP-0.9-page-blocked.html
2869 http/tests/security/http-0.9/worker-connect-src-blocked.html
2870 http/tests/security/http-0.9/worker-importScripts-blocked.html
2871 http/tests/security/http-0.9/xhr-asynchronous-blocked.html
2874 (WebCore::defaultPortForProtocolMapForTesting): Added.
2875 (WebCore::registerDefaultPortForProtocolForTesting): Adds the specified (protocol, port) to the
2876 mapping used for testing.
2877 (WebCore::clearDefaultPortForProtocolMapForTesting): Clears the protocol to default port testing map.
2878 We call this function from Internals::resetToConsistentState() so that the mapping is cleared between
2880 (WebCore::defaultPortForProtocol): Modified to check the protocol to default port map for testing
2881 before consulting URLParser::defaultPortForProtocol().
2883 * testing/Internals.cpp:
2884 (WebCore::Internals::resetToConsistentState): Clear the default port mapping used for testing.
2885 (WebCore::Internals::registerDefaultPortForProtocol): Added.
2886 * testing/Internals.h:
2887 * testing/Internals.idl: Added declaration for registerDefaultPortForProtocol().
2889 2016-11-09 Sam Weinig <sam@webkit.org>
2891 [WebIDL] Add proper parsing for Promises
2892 https://bugs.webkit.org/show_bug.cgi?id=164497
2894 Reviewed by Tim Horton.
2896 * bindings/scripts/IDLParser.pm:
2899 Require Promise types to declare the type they resolve to.
2901 * bindings/js/JSDOMPromise.h:
2902 Allow DOMPromise to be be parameterized on void. Add an SFINAE guarded
2903 overload of resolve that takes no arguments when in a DOMPromise<void>.
2905 * Modules/applepay/ApplePaySession.idl:
2906 * Modules/fetch/DOMWindowFetch.idl:
2907 * Modules/fetch/FetchBody.idl:
2908 * Modules/fetch/FetchResponse.idl:
2909 * Modules/fetch/WorkerGlobalScopeFetch.idl:
2910 * Modules/mediastream/MediaDevices.idl:
2911 * Modules/mediastream/MediaStreamTrack.idl:
2912 * Modules/mediastream/RTCPeerConnection.idl:
2913 * Modules/mediastream/RTCRtpSender.idl:
2914 * Modules/mediastream/RTCStatsReport.idl:
2915 * Modules/streams/ReadableStream.idl:
2916 * Modules/streams/ReadableStreamDefaultReader.idl:
2917 * Modules/streams/ReadableStreamSource.idl:
2918 * Modules/streams/WritableStream.idl:
2919 * Modules/webaudio/AudioContext.idl:
2920 * bindings/scripts/test/TestNode.idl:
2921 * bindings/scripts/test/TestObj.idl:
2922 * crypto/SubtleCrypto.idl:
2923 * crypto/WebKitSubtleCrypto.idl:
2925 * css/FontFaceSet.idl:
2926 * dom/CustomElementRegistry.idl:
2927 * html/HTMLMediaElement.idl:
2928 Update IDLs to specify the resolve type of promise types.
2930 * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2931 (WebCore::MediaEndpointPeerConnection::replaceTrack):
2932 (WebCore::MediaEndpointPeerConnection::replaceTrackTask):
2933 * Modules/mediastream/MediaStreamTrack.cpp:
2934 (WebCore::MediaStreamTrack::applyConstraints):
2935 * Modules/mediastream/MediaStreamTrack.h:
2936 * Modules/mediastream/PeerConnectionBackend.cpp:
2937 (WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
2938 (WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
2939 (WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
2940 * Modules/mediastream/PeerConnectionBackend.h:
2941 * Modules/streams/ReadableStreamSource.h:
2942 (WebCore::ReadableStreamSource::start):
2943 (WebCore::ReadableStreamSource::pull):
2944 (WebCore::ReadableStreamSource::startFinished):
2945 (WebCore::ReadableStreamSource::pullFinished):
2946 * Modules/webaudio/AudioContext.cpp:
2947 (WebCore::AudioContext::addReaction):
2948 (WebCore::AudioContext::setState):
2949 (WebCore::AudioContext::suspend):
2950 (WebCore::AudioContext::resume):
2951 (WebCore::AudioContext::close):
2952 * Modules/webaudio/AudioContext.h:
2953 * html/HTMLMediaElement.cpp:
2954 (WebCore::HTMLMediaElement::rejectPendingPlayPromises):
2955 (WebCore::HTMLMediaElement::resolvePendingPlayPromises):
2956 (WebCore::HTMLMediaElement::play):
2957 * html/HTMLMediaElement.h:
2958 Update implementations to use DOMPromise<void> rather than DOMPromise<nullptr_t>
2959 and use the new resolve() overload.
2961 2016-11-07 Brady Eidson <beidson@apple.com>
2963 Followup to https://bugs.webkit.org/show_bug.cgi?id=164466 - Make an IDBTransaction* be an IDBTransaction&
2965 Rubberstamped by Alex Christensen.
2967 No new tests (No behavior change).
2969 * Modules/indexeddb/IDBObjectStore.cpp:
2970 (WebCore::IDBObjectStore::IDBObjectStore):
2971 (WebCore::IDBObjectStore::~IDBObjectStore):
2972 (WebCore::IDBObjectStore::hasPendingActivity):
2973 (WebCore::IDBObjectStore::name):
2974 (WebCore::IDBObjectStore::setName):
2975 (WebCore::IDBObjectStore::keyPath):
2976 (WebCore::IDBObjectStore::indexNames):
2977 (WebCore::IDBObjectStore::transaction):
2978 (WebCore::IDBObjectStore::autoIncrement):
2979 (WebCore::IDBObjectStore::openCursor):
2980 (WebCore::IDBObjectStore::openKeyCursor):
2981 (WebCore::IDBObjectStore::get):
2982 (WebCore::IDBObjectStore::putOrAdd):
2983 (WebCore::IDBObjectStore::doDelete):
2984 (WebCore::IDBObjectStore::clear):
2985 (WebCore::IDBObjectStore::createIndex):
2986 (WebCore::IDBObjectStore::index):
2987 (WebCore::IDBObjectStore::deleteIndex):
2988 (WebCore::IDBObjectStore::doCount):
2989 (WebCore::IDBObjectStore::getAll):
2990 (WebCore::IDBObjectStore::getAllKeys):
2991 (WebCore::IDBObjectStore::markAsDeleted):
2992 (WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
2993 (WebCore::IDBObjectStore::ref):
2994 (WebCore::IDBObjectStore::deref):
2995 * Modules/indexeddb/IDBObjectStore.h:
2997 2016-11-09 Zalan Bujtas <zalan@apple.com>
2999 Move RenderNamedFlowThread nextRendererForElement logic to RenderTreeUpdater.
3000 https://bugs.webkit.org/show_bug.cgi?id=164503
3002 Reviewed by Antti Koivisto.
3004 When we insert a renderer into the render tree, we need to know both its parent
3005 and its next sibling. Normally the parent and the sibling are based on the DOM, but
3006 when this renderer is part of a flow thread, its insertion sibling is not necessarily the DOM sibling.
3007 To find the correct sibling, we call RenderNamedFlowThread's nextRendererForElement().
3008 RenderNamedFlowThread keeps track of its children so that it can compute the next sibling
3009 for the insertion point.
3011 This patch eliminates the need for keeping track of the child renderers of each
3012 flow by moving the 'next sibling' logic to RenderTreePosition.
3014 No change in functionality.
3016 * rendering/RenderElement.cpp:
3017 (WebCore::RenderElement::insertedIntoTree):
3018 (WebCore::RenderElement::willBeDestroyed):
3019 (WebCore::RenderElement::removeFromRenderFlowThread):
3020 (WebCore::RenderElement::renderNamedFlowThreadWrapper): Deleted.
3021 * rendering/RenderElement.h:
3022 * rendering/RenderNamedFlowThread.cpp:
3023 (WebCore::RenderNamedFlowThread::nextRendererForElement): Deleted.
3024 (WebCore::RenderNamedFlowThread::addFlowChild): Deleted.
3025 (WebCore::RenderNamedFlowThread::removeFlowChild): Deleted.
3026 * rendering/RenderNamedFlowThread.h:
3027 * style/RenderTreePosition.cpp:
3028 (WebCore::RenderTreePosition::previousSiblingRenderer):
3029 (WebCore::RenderTreePosition::flowThreadInsertionContext):
3030 * style/RenderTreePosition.h:
3031 (WebCore::RenderTreePosition::RenderTreePosition):
3032 (WebCore::RenderTreePosition::parent):
3033 * style/RenderTreeUpdater.cpp:
3034 (WebCore::registerElementForFlowThreadIfNeeded): We need to registed the element even when it does not create renderer (display: none).
3035 (WebCore::RenderTreeUpdater::createRenderer):
3036 (WebCore::moveToFlowThreadIfNeeded): Deleted.
3038 2016-11-09 Per Arne Vollan <pvollan@apple.com>
3040 [Win][Direct2D] Incomplete image decoding.
3041 https://bugs.webkit.org/show_bug.cgi?id=164511
3043 Reviewed by Darin Adler.
3045 Create native decoder when all image data has been received.
3047 * platform/graphics/win/ImageDecoderDirect2D.cpp:
3048 (WebCore::ImageDecoder::setData):
3050 2016-11-09 Beth Dakin <bdakin@apple.com>
3052 Attempted build fix.
3054 * platform/spi/cocoa/AVKitSPI.h:
3056 2016-11-09 Brady Eidson <beidson@apple.com>
3058 IndexedDB 2.0: Clean up more transaction abort behavior, including tweaks to Index/ObjectStore lifetime.
3059 https://bugs.webkit.org/show_bug.cgi?id=164466
3061 Reviewed by Alex Christensen.
3063 No new tests (Covered by existing tests that now pass).
3065 Previously, IDBIndex ref/deref didn't track a traditional ref count but instead kept the owning object store alive.
3066 Now, IDBObjectStore ref/deref do the same thing for the owning transaction.
3068 Now when a version change transaction is rolled back, some object stores and indexes get pulled out of the "deleted"
3069 set and get promoted back up into the "referenced" set.
3071 Now deleted object stores/indexes are considered opaque roots, as live objects in the deleted state *can* get back
3072 to the owning objects.
3075 * WebCore.xcodeproj/project.pbxproj:
3077 * Modules/indexeddb/IDBIndex.cpp:
3078 (WebCore::IDBIndex::rollbackInfoForVersionChangeAbort):
3080 * Modules/indexeddb/IDBObjectStore.cpp:
3081 (WebCore::IDBObjectStore::IDBObjectStore):
3082 (WebCore::IDBObjectStore::indexNames):
3083 (WebCore::IDBObjectStore::transaction):
3084 (WebCore::IDBObjectStore::openCursor):
3085 (WebCore::IDBObjectStore::openKeyCursor):
3086 (WebCore::IDBObjectStore::deleteIndex):
3087 (WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
3088 (WebCore::IDBObjectStore::visitReferencedIndexes):
3089 (WebCore::IDBObjectStore::ref):
3090 (WebCore::IDBObjectStore::deref):
3091 (WebCore::IDBObjectStore::create): Deleted.
3092 * Modules/indexeddb/IDBObjectStore.h:
3094 * Modules/indexeddb/IDBTransaction.cpp:
3095 (WebCore::IDBTransaction::objectStore):
3096 (WebCore::IDBTransaction::transitionedToFinishing):
3097 (WebCore::IDBTransaction::internalAbort):
3098 (WebCore::IDBTransaction::createObjectStore):
3099 (WebCore::IDBTransaction::deleteObjectStore):
3100 (WebCore::IDBTransaction::visitReferencedObjectStores):
3101 * Modules/indexeddb/IDBTransaction.h:
3102 * Modules/indexeddb/IDBTransaction.idl:
3104 * bindings/js/JSIDBTransactionCustom.cpp: Added.
3105 (WebCore::JSIDBTransaction::visitAdditionalChildren):
3107 2016-11-09 Simon Fraser <simon.fraser@apple.com>
3109 Allow customization of TextStream-based logging for geometry types
3110 https://bugs.webkit.org/show_bug.cgi?id=164460
3112 Reviewed by Zalan Bujtas.
3114 TextStream-based logging was constrained by the requirement to maintain compatibility
3115 with DRT-style output, which includes cumbersome rect logging ("at (5,0) size 40x40")
3116 and dumping LayoutRects as IntRects.
3118 Add some formatting flags so that other TextStream clients (e.g. logging) can have
3119 more readable output, and opt into automatic FormatNumberRespectingIntegers behavior.
3121 TextStreams whose output appears in test results are given flags to avoid behavior
3122 changes, but in the longer term test results should be updated.
3124 * html/canvas/CanvasRenderingContext2D.cpp:
3125 (WebCore::CanvasRenderingContext2D::replayDisplayListAsText):
3126 * page/scrolling/ScrollingStateNode.cpp:
3127 (WebCore::ScrollingStateNode::scrollingStateTreeAsText):
3128 * platform/graphics/FloatPoint.cpp:
3129 (WebCore::operator<<):
3130 * platform/graphics/FloatRect.cpp:
3131 (WebCore::operator<<):
3132 * platform/graphics/GraphicsLayer.cpp:
3133 (WebCore::GraphicsLayer::layerTreeAsText):
3134 * platform/graphics/IntRect.cpp:
3135 (WebCore::operator<<):
3136 * platform/graphics/LayoutPoint.cpp:
3137 (WebCore::operator<<):
3138 * platform/graphics/LayoutRect.cpp:
3139 (WebCore::operator<<):
3140 * platform/graphics/ca/GraphicsLayerCA.cpp:
3141 (WebCore::GraphicsLayerCA::replayDisplayListAsText):
3142 * platform/graphics/displaylists/DisplayList.cpp:
3143 (WebCore::DisplayList::DisplayList::asText):
3144 * platform/text/TextStream.cpp:
3145 (WebCore::TextStream::operator<<):
3146 * platform/text/TextStream.h:
3147 (WebCore::TextStream::TextStream):
3148 (WebCore::TextStream::formattingFlags):
3149 (WebCore::TextStream::setFormattingFlags):
3150 (WebCore::TextStream::hasFormattingFlag):
3151 (WebCore::TextStream::increaseIndent):
3152 (WebCore::TextStream::decreaseIndent):
3153 * rendering/RenderTreeAsText.cpp:
3154 (WebCore::externalRepresentation):
3155 (WebCore::counterValueForElement):
3157 2016-11-09 Zalan Bujtas <zalan@apple.com>
3159 RenderFlowThread::flowThreadRelativeWillBeRemoved should take RenderObject& instead of RenderObject*
3160 https://bugs.webkit.org/show_bug.cgi?id=164543
3162 Reviewed by Simon Fraser.
3164 No change in functionality.
3166 * rendering/RenderBlockFlow.cpp:
3167 (WebCore::RenderBlockFlow::removeChild):
3168 * rendering/RenderFlowThread.h:
3169 * rendering/RenderMultiColumnFlowThread.cpp:
3170 (WebCore::RenderMultiColumnFlowThread::handleSpannerRemoval):
3171 (WebCore::RenderMultiColumnFlowThread::flowThreadRelativeWillBeRemoved):
3172 * rendering/RenderMultiColumnFlowThread.h:
3174 2016-11-09 Jer Noble <jer.noble@apple.com>
3176 REGRESSION (r208149): Media scrubber is not displayed in media controls
3177 https://bugs.webkit.org/show_bug.cgi?id=164514
3179 Reviewed by Darin Adler.
3181 Fixes broken Media Controls API tests.
3183 Added a new PlatformMediaSessionType; need to add that same type to the TYPE_TRAITS section of
3184 MediaElementSession.h so that is<> and downcast<> work correctly.
3186 * html/MediaElementSession.h:
3189 2016-11-09 Wenson Hsieh <wenson_hsieh@apple.com>
3191 When editing IME, `compositionend` events should fire after input events
3192 https://bugs.webkit.org/show_bug.cgi?id=164324
3193 <rdar://problem/29050438>
3195 Reviewed by Darin Adler.
3197 Moves where we dispatch `compositionend` events to after applying editing commands that fire `beforeinput` or
3198 `input` events. Also augments existing layout tests to verify the change.
3200 * editing/Editor.cpp:
3201 (WebCore::Editor::setComposition):
3203 2016-11-09 Wenson Hsieh <wenson_hsieh@apple.com>
3205 Setting foreground color when text is selected should fire an input event with color data
3206 https://bugs.webkit.org/show_bug.cgi?id=164241
3207 <rdar://problem/29032759>
3209 Reviewed by Darin Adler.
3211 Refactors Editor::applyStyle and Editor::applyParagraphStyle to handle beforeinput and input event dispatch.
3212 Instead of going through the ApplyStyleCommand to dispatch input events, override shouldDispatchInputEvents to
3213 return false. This strategy also has the effect of unifying the way input events are dispatched in applyStyle,
3214 in both codepaths where we computeAndSetTypingStyle and where we create and then apply a style command.
3216 Test: fast/events/input-events-selection-forecolor-data.html
3218 * editing/ApplyStyleCommand.h:
3219 * editing/Editor.cpp:
3220 (WebCore::inputEventDataForEditingStyleAndAction):
3221 (WebCore::Editor::applyStyle):
3222 (WebCore::Editor::applyParagraphStyle):
3223 (WebCore::Editor::computeAndSetTypingStyle):
3225 2016-11-08 Dean Jackson <dino@apple.com>
3227 Rendering support for ExtendedColors
3228 https://bugs.webkit.org/show_bug.cgi?id=164443
3229 <rdar://problems/29123243>
3231 Reviewed by Simon Fraser and Darin Adler.
3233 Add support for rendering the new color() syntax, which
3234 ends up as an ExtendedColor.
3236 In order to make rendering code a little more readable, I
3237 changed Color::hasAlpha to Color::isOpaque (since an alpha
3238 of 100% is still an alpha), and added a Color::isVisible
3239 helper (the color isn't completely transparent). These new
3240 helpers support ExtendedColor forms.
3242 Support for painting gradients and blending between colors
3243 is still to come. I also added some FIXME comments
3244 to show other places that don't handle ExtendedColors yet.
3246 Tests: css3/color/backgrounds-and-borders.html
3247 css3/color/box-shadows.html
3248 css3/color/canvas.html
3249 css3/color/composited-solid-backgrounds.html
3250 css3/color/text.html
3252 * css/CSSGradientValue.cpp: Add some notes that this is broken.
3253 (WebCore::interpolate):
3254 (WebCore::CSSGradientValue::knownToBeOpaque):
3256 * editing/EditingStyle.cpp: Use new Color helpers.
3257 (WebCore::isTransparentColorValue):
3259 * editing/mac/EditorMac.mm: Use new Color helpers.
3260 (WebCore::Editor::fontAttributesForSelectionStart):
3262 * html/ColorInputType.cpp: No need to use the Color class at all here.
3263 (WebCore::isValidSimpleColorString): Renamed from isValidColorString.
3264 (WebCore::ColorInputType::sanitizeValue):
3265 (WebCore::ColorInputType::typeMismatchFor):
3266 (WebCore::isValidColorString): Deleted.
3268 * html/canvas/CanvasRenderingContext2D.cpp: New helpers.
3269 (WebCore::CanvasRenderingContext2D::shouldDrawShadows):
3270 (WebCore::CanvasRenderingContext2D::didDraw):
3272 * page/FrameView.cpp: Ditto.
3273 (WebCore::FrameView::recalculateScrollbarOverlayStyle):
3274 (WebCore::FrameView::hasOpaqueBackground):
3275 (WebCore::FrameView::setBaseBackgroundColor):
3277 * platform/graphics/Color.cpp:
3278 (WebCore::differenceSquared): Support ExtendedColor, but also
3279 add a note to indicate that this method and its call sites
3281 (WebCore::Color::serialized): New helper.
3282 (WebCore::Color::cssText): Ditto.
3283 (WebCore::Color::blend): Ditto.
3284 (WebCore::Color::blendWithWhite):
3285 (WebCore::Color::colorWithAlphaMultipliedBy): Implementation of new function.
3286 (WebCore::Color::colorWithAlpha): Ditto.
3287 (WebCore::Color::opaqueColor): New method to return an opaque version of the given color.
3289 * platform/graphics/Color.h:
3290 (WebCore::Color::isOpaque): New helper that is !hasAlpha().
3291 (WebCore::Color::isVisible): New helper.
3292 (WebCore::Color::alphaAsFloat): Gets the alpha value as a float. This replaces
3293 a bunch of places that were calculating it manually each time. Meanwhile, we
3294 might consider always exposing the primaries as floats... or at least
3296 (WebCore::isBlackColor): New helper - it was used in a couple of places.
3297 (WebCore::isWhiteColor): Ditto.
3298 (WebCore::Color::hasAlpha): Deleted.
3300 * platform/graphics/Gradient.cpp: Add FIXME.
3301 (WebCore::Gradient::addColorStop):
3302 * platform/graphics/Gradient.h:
3304 * platform/graphics/GraphicsContext.cpp: Use new helpers.
3305 (WebCore::GraphicsContext::computeLineBoundsAndAntialiasingModeForText):
3306 * platform/graphics/GraphicsContext.h:
3307 (WebCore::GraphicsContext::hasVisibleShadow):
3309 * platform/graphics/Image.cpp: Ditto.
3310 (WebCore::Image::fillWithSolidColor):
3312 * platform/graphics/ShadowBlur.cpp: Ditto.
3313 (WebCore::ShadowBlur::updateShadowBlurValues):
3315 * platform/graphics/ca/GraphicsLayerCA.cpp: Ditto.
3316 (WebCore::GraphicsLayerCA::setContentsToSolidColor):
3318 * platform/graphics/cg/GradientCG.cpp:
3319 (WebCore::Gradient::platformGradient): Add a FIXME to note that we can
3320 add ExtendedColor support simply by using CGColors, rather than fetching
3321 the components ourselves.
3323 * platform/graphics/cg/GraphicsContextCG.cpp: New helpers.
3324 (WebCore::calculateDrawingMode):
3326 * platform/graphics/cocoa/FontCascadeCocoa.mm: New helpers.
3327 (WebCore::FontCascade::drawGlyphs):
3329 * platform/graphics/mac/ColorMac.mm: Use the new helpers and Color::hash().
3332 * platform/graphics/texmap/TextureMapperGL.cpp: New helpers.
3333 (WebCore::TextureMapperGL::drawBorder):
3335 * rendering/BorderEdge.cpp: Ditto.
3336 (WebCore::BorderEdge::obscuresBackgroundEdge):
3337 (WebCore::BorderEdge::obscuresBackground):
3339 * rendering/RenderBox.cpp: Ditto.
3340 (WebCore::RenderBox::getBackgroundPaintedExtent):
3341 (WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect):
3342 (WebCore::RenderBox::backgroundHasOpaqueTopLayer):
3344 * rendering/RenderBoxModelObject.cpp: Ditto.
3345 (WebCore::RenderBoxModelObject::paintFillLayerExtended):
3346 (WebCore::colorNeedsAntiAliasAtCorner):
3347 (WebCore::willBeOverdrawn):
3348 (WebCore::RenderBoxModelObject::paintTranslucentBorderSides):
3349 (WebCore::RenderBoxModelObject::paintBorder):
3350 (WebCore::RenderBoxModelObject::boxShadowShouldBeAppliedToBackground):
3351 (WebCore::RenderBoxModelObject::paintBoxShadow):
3352 * rendering/RenderElement.cpp:
3353 (WebCore::RenderElement::paintOutline):
3354 * rendering/RenderInline.cpp:
3355 (WebCore::RenderInline::paintOutline):
3356 * rendering/RenderLayerBacking.cpp:
3357 (WebCore::canCreateTiledImage):
3358 * rendering/RenderLayerCompositor.cpp:
3359 (WebCore::RenderLayerCompositor::viewHasTransparentBackground):
3360 * rendering/RenderMenuList.cpp:
3361 (RenderMenuList::getItemBackgroundColor):
3362 * rendering/RenderTheme.cpp:
3363 (WebCore::RenderTheme::disabledTextColor):
3364 * rendering/RenderView.cpp:
3365 (WebCore::RenderView::paintBoxDecorations):
3366 * rendering/TextDecorationPainter.cpp:
3367 (WebCore::TextDecorationPainter::paintTextDecoration):
3368 * rendering/TextPainter.cpp:
3369 (WebCore::TextPainter::paintTextWithShadows):
3370 * rendering/style/BorderValue.h:
3371 (WebCore::BorderValue::isTransparent):
3372 * rendering/style/RenderStyle.cpp:
3373 (WebCore::RenderStyle::visitedDependentColor):
3374 * rendering/style/RenderStyle.h:
3375 (WebCore::RenderStyle::hasBackground):
3376 * rendering/svg/RenderSVGResource.cpp:
3377 (WebCore::requestPaintingResource):
3378 * rendering/svg/SVGInlineTextBox.cpp:
3379 (WebCore::SVGInlineTextBox::paintSelectionBackground):
3381 * svg/SVGAnimatedColor.cpp: Add a FIXME to note this is broken.
3382 (WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue):
3384 2016-11-09 Antoine&nb