ee808e13460b800ad5fa19af9a07e8eeed55e672
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-10-30  Joseph Pecoraro  <pecoraro@apple.com>
2
3         Minor CGColor leaks seen on bots allocated in WebSystemBackdropLayer.mm
4         https://bugs.webkit.org/show_bug.cgi?id=150722
5
6         Reviewed by Andreas Kling.
7
8         * platform/graphics/ca/cocoa/WebSystemBackdropLayer.mm:
9         (-[WebLightSystemBackdropLayer init]):
10         (-[WebDarkSystemBackdropLayer init]):
11
12 2015-10-30  Csaba Osztrogonác  <ossy@webkit.org>
13
14         [EFL] Fix the debug build after r191758
15         https://bugs.webkit.org/show_bug.cgi?id=150719
16
17         Reviewed by Alex Christensen.
18
19         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
20         (WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
21
22 2015-10-30  Dan Bernstein  <mitz@apple.com>
23
24         Fixed the build.
25
26         * platform/graphics/Image.cpp:
27         (WebCore::Image::draw): Deleted an infinitely-recursive implementation that caused the
28           compiler to emit an error.
29         * platform/graphics/Image.h:
30         (WebCore::Image::draw): Made this pure virtual.
31
32 2015-10-30  Brady Eidson  <beidson@apple.com>
33
34         Modern IDB: IDBObjectStore.add() support.
35         https://bugs.webkit.org/show_bug.cgi?id=150711
36
37         Reviewed by Alex Christensen.
38
39         Test: storage/indexeddb/modern/basic-add.html
40
41         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
42         (WebCore::IDBClient::IDBObjectStore::add):
43
44         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
45         (WebCore::IDBClient::IDBTransaction::requestGetRecord):
46
47 2015-10-30  Hunseop Jeong  <hs85.jeong@samsung.com>
48
49         Use modern for-loops in WebCore/dom.
50         https://bugs.webkit.org/show_bug.cgi?id=150664
51
52         Reviewed by Darin Adler.
53
54         No new tests because there is no behavior change.
55
56         * dom/AuthorStyleSheets.cpp:
57         (WebCore::AuthorStyleSheets::analyzeStyleSheetChange):
58         (WebCore::filterEnabledNonemptyCSSStyleSheets):
59         (WebCore::AuthorStyleSheets::activeStyleSheetsContains):
60         * dom/CheckedRadioButtons.cpp:
61         (WebCore::RadioButtonGroup::updateValidityForAllButtons):
62         * dom/ClientRectList.cpp:
63         (WebCore::ClientRectList::ClientRectList):
64         (WebCore::ClientRectList::~ClientRectList):
65         * dom/ContainerNode.cpp:
66         (WebCore::ContainerNode::insertBefore):
67         * dom/DOMNamedFlowCollection.cpp:
68         (WebCore::DOMNamedFlowCollection::DOMNamedFlowCollection):
69         (WebCore::DOMNamedFlowCollection::length):
70         (WebCore::DOMNamedFlowCollection::item):
71         (WebCore::DOMNamedFlowCollection::namedItem):
72         * dom/DOMStringList.cpp:
73         (WebCore::DOMStringList::contains):
74         * dom/Document.cpp:
75         (WebCore::Document::Document):
76         (WebCore::Document::~Document):
77         (WebCore::Document::removedLastRef):
78         (WebCore::Document::adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale):
79         (WebCore::Document::updateHoverActiveState):
80         * dom/DocumentMarkerController.cpp:
81         (WebCore::DocumentMarkerController::copyMarkers):
82         (WebCore::DocumentMarkerController::removeMarkers):
83         (WebCore::DocumentMarkerController::repaintMarkers):
84         (DocumentMarkerController::showMarkers):
85         * dom/ElementData.cpp:
86         (WebCore::UniqueElementData::findAttributeByName):
87         * dom/EventDispatcher.cpp:
88         (WebCore::EventPath::updateTouchLists):
89         (WebCore::EventPath::hasEventListeners):
90         * dom/EventListenerMap.cpp:
91         (WebCore::EventListenerMap::contains):
92         (WebCore::EventListenerMap::containsCapturing):
93         (WebCore::EventListenerMap::eventTypes):
94         (WebCore::EventListenerMap::add):
95         (WebCore::EventListenerMap::find):
96         (WebCore::copyListenersNotCreatedFromMarkupToTarget):
97         (WebCore::EventListenerMap::copyEventListenersNotCreatedFromMarkupToTarget):
98         (WebCore::EventListenerIterator::EventListenerIterator):
99         * dom/EventTarget.cpp:
100         (WebCore::EventTarget::removeEventListener):
101         (WebCore::EventTarget::getAttributeEventListener):
102         (WebCore::EventTarget::removeAllEventListeners):
103         * dom/IdTargetObserverRegistry.cpp:
104         (WebCore::IdTargetObserverRegistry::notifyObserversInternal):
105         * dom/MessagePort.cpp:
106         (WebCore::MessagePort::postMessage):
107         (WebCore::MessagePort::disentanglePorts):
108         * dom/MutationObserver.cpp:
109         (WebCore::MutationObserver::observe):
110         (WebCore::MutationObserver::deliver):
111         (WebCore::MutationObserver::deliverAllMutations):
112         * dom/NamedFlowCollection.cpp:
113         (WebCore::NamedFlowCollection::namedFlows):
114         (WebCore::NamedFlowCollection::createCSSOMSnapshot):
115         * dom/Node.cpp:
116         (WebCore::Node::notifyMutationObserversNodeWillDetach):
117         * dom/Range.cpp:
118         (WebCore::Range::processNodes):
119         (WebCore::Range::processAncestorsAndTheirSiblings):
120         (WebCore::Range::absoluteBoundingBox):
121         (WebCore::Range::collectSelectionRects):
122         * dom/ScriptRunner.cpp:
123         (WebCore::ScriptRunner::timerFired):
124         * dom/ScriptedAnimationController.cpp:
125         (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
126         * dom/SelectorQuery.cpp:
127         (WebCore::SelectorDataList::matches):
128         (WebCore::SelectorDataList::executeFastPathForIdSelector):
129         (WebCore::SelectorDataList::executeSingleMultiSelectorData):
130         (WebCore::SelectorDataList::executeCompiledSingleMultiSelectorData):
131         (WebCore::SelectorDataList::execute):
132         * dom/TreeScopeAdopter.cpp:
133         (WebCore::TreeScopeAdopter::moveTreeToNewScope):
134
135 2015-10-30  Carlos Garcia Campos  <cgarcia@igalia.com>
136
137         Make every port implement MainThreadSharedTimer instead of using global functions
138         https://bugs.webkit.org/show_bug.cgi?id=150498
139
140         Reviewed by Darin Adler.
141
142         Move MainThreadSharedTimer to its own files and add the common
143         implementation there.
144
145         * CMakeLists.txt: Add MainThreadSharedTimer.cpp.
146         * PlatformEfl.cmake: Update filenames.
147         * PlatformGTK.cmake: Ditto.
148         * PlatformMac.cmake: Ditto.
149         * PlatformWin.cmake: Ditto.
150         * platform/MainThreadSharedTimer.cpp: Copied from Source/WebCore/platform/efl/SharedTimerEfl.cpp.
151         (WebCore::MainThreadSharedTimer::singleton):
152         (WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
153         (WebCore::MainThreadSharedTimer::setFiredFunction):
154         (WebCore::MainThreadSharedTimer::fired):
155         * platform/MainThreadSharedTimer.h: Copied from Source/WebCore/platform/gtk/SharedTimerGtk.cpp.
156         * platform/SharedTimer.h: Remove MainThreadSharedTimer
157         implementation and reindent the code.
158         (WebCore::SharedTimer::SharedTimer):
159         (WebCore::SharedTimer::~SharedTimer):
160         (WebCore::SharedTimer::invalidate):
161         * platform/ThreadTimers.cpp:
162         (WebCore::ThreadTimers::ThreadTimers): Use MainThreadSharedTimer::singleton().
163         (WebCore::ThreadTimers::setSharedTimer): Use a lambda function
164         instead of a pointer to a static method.
165         (WebCore::ThreadTimers::sharedTimerFired): Deleted.
166         * platform/ThreadTimers.h: Removed unsused static method sharedTimerFired.
167         * platform/cf/MainThreadSharedTimerCF.cpp: Renamed from Source/WebCore/platform/cf/SharedTimerCF.cpp.
168         (WebCore::applicationDidBecomeActive):
169         (WebCore::setupPowerObserver):
170         (WebCore::timerFired):
171         (WebCore::restartSharedTimer):
172         (WebCore::MainThreadSharedTimer::invalidate):
173         (WebCore::MainThreadSharedTimer::setFireInterval):
174         (WebCore::MainThreadSharedTimer::stop):
175         * platform/efl/MainThreadSharedTimerEfl.cpp: Renamed from Source/WebCore/platform/efl/SharedTimerEfl.cpp.
176         (WebCore::timerEvent):
177         (WebCore::MainThreadSharedTimer::stop):
178         (WebCore::MainThreadSharedTimer::setFireInterval):
179         (WebCore::MainThreadSharedTimer::invalidate):
180         * platform/gtk/MainThreadSharedTimerGtk.cpp: Renamed from Source/WebCore/platform/gtk/SharedTimerGtk.cpp.
181         (WebCore::MainThreadSharedTimer::setFireInterval):
182         (WebCore::MainThreadSharedTimer::stop):
183         (WebCore::MainThreadSharedTimer::invalidate):
184         * platform/win/MainThreadSharedTimerWin.cpp: Renamed from Source/WebCore/platform/win/SharedTimerWin.cpp.
185         (WebCore::TimerWindowWndProc):
186         (WebCore::initializeOffScreenTimerWindow):
187         (WebCore::queueTimerProc):
188         (WebCore::MainThreadSharedTimer::setFireInterval):
189         (WebCore::MainThreadSharedTimer::stop):
190         (WebCore::MainThreadSharedTimer::invalidate):
191         * workers/WorkerRunLoop.cpp: Update WorkerSharedTimer
192         implementation to use std::function instead of a pointer. Also
193         mark the class as final and the virtual implementations as override.
194
195 2015-10-30  Carlos Garcia Campos  <cgarcia@igalia.com>
196
197         [GTK] Use RunLoop::Timer instead of GMainLoopSource
198         https://bugs.webkit.org/show_bug.cgi?id=150592
199
200         Reviewed by Žan Doberšek.
201
202         * platform/network/ResourceHandle.h:
203         * platform/network/ResourceHandleInternal.h:
204         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
205         * platform/network/soup/ResourceHandleSoup.cpp:
206         (WebCore::cleanupSoupRequestOperation):
207         (WebCore::ResourceHandle::timeoutFired):
208         (WebCore::ResourceHandle::sendPendingRequest):
209         (WebCore::ResourceHandle::platformSetDefersLoading):
210
211 2015-10-30  Hunseop Jeong  <hs85.jeong@samsung.com>
212
213         REGRESSION(r191776): EFL build broken.
214         https://bugs.webkit.org/show_bug.cgi?id=150713
215
216         Reviewed by Csaba Osztrogonác.
217
218         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
219         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
220
221 2015-10-29  Brady Eidson  <beidson@apple.com>
222
223         Modern IDB: autoIncrement support.
224         https://bugs.webkit.org/show_bug.cgi?id=150695
225
226         Reviewed by Alex Christensen.
227
228         Test: storage/indexeddb/modern/autoincrement-abort.html
229
230         * Modules/indexeddb/server/IDBBackingStore.h:
231         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
232         (WebCore::IDBServer::MemoryBackingStoreTransaction::addNewObjectStore):
233         (WebCore::IDBServer::MemoryBackingStoreTransaction::addExistingObjectStore):
234         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
235         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
236         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
237         (WebCore::IDBServer::MemoryIDBBackingStore::putRecord):
238         (WebCore::IDBServer::MemoryIDBBackingStore::generateKeyNumber):
239         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
240         * Modules/indexeddb/server/MemoryObjectStore.h:
241         (WebCore::IDBServer::MemoryObjectStore::currentKeyGeneratorValue):
242         (WebCore::IDBServer::MemoryObjectStore::setKeyGeneratorValue):
243         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
244         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
245
246 2015-10-29  Alex Christensen  <achristensen@webkit.org>
247
248         Make WebCore a framework in Mac CMake build
249         https://bugs.webkit.org/show_bug.cgi?id=150702
250
251         Reviewed by Geoffrey Garen.
252
253         * CMakeLists.txt:
254         * PlatformEfl.cmake:
255         * PlatformGTK.cmake:
256         * PlatformMac.cmake:
257
258 2015-10-29  Alex Christensen  <achristensen@webkit.org>
259
260         CMake build fix.
261
262         * editing/mac/EditorMac.mm:
263         (WebCore::Editor::WebContentReader::readFilenames):
264         Before r191553, text was a local variable and could be changed.
265         This restores the same behavior and compiles correctly when ATTACHMENT_ELEMENT is disabled.
266         * platform/mac/CursorMac.mm:
267         (WebCore::Cursor::Cursor):
268         (WebCore::Cursor::operator=):
269         Added preprocessor macros.
270
271 2015-10-29  Brady Eidson  <beidson@apple.com>
272
273         Modern IDB: deleteObjectStore support.
274         https://bugs.webkit.org/show_bug.cgi?id=150673
275
276         Reviewed by Alex Christensen.
277
278         Tests: storage/indexeddb/modern/deleteobjectstore-1.html
279                storage/indexeddb/modern/idbdatabase-deleteobjectstore-failures.html
280                storage/indexeddb/modern/idbobjectstore-get-failures.html
281
282         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
283         (WebCore::IDBClient::IDBConnectionToServer::deleteObjectStore):
284         (WebCore::IDBClient::IDBConnectionToServer::didDeleteObjectStore):
285         * Modules/indexeddb/client/IDBConnectionToServer.h:
286         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
287
288         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
289         (WebCore::IDBClient::IDBDatabase::deleteObjectStore):
290         (WebCore::IDBClient::IDBDatabase::willCommitTransaction):
291         (WebCore::IDBClient::IDBDatabase::willAbortTransaction):
292         (WebCore::IDBClient::IDBDatabase::commitTransaction): Deleted.
293         (WebCore::IDBClient::IDBDatabase::abortTransaction): Deleted.
294         * Modules/indexeddb/client/IDBDatabaseImpl.h:
295
296         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
297         (WebCore::IDBClient::IDBObjectStore::markAsDeleted):
298         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
299
300         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
301         (WebCore::IDBClient::IDBTransaction::IDBTransaction):
302         (WebCore::IDBClient::IDBTransaction::abort):
303         (WebCore::IDBClient::IDBTransaction::abortOnServer):
304         (WebCore::IDBClient::IDBTransaction::commit):
305         (WebCore::IDBClient::IDBTransaction::commitOnServer):
306         (WebCore::IDBClient::IDBTransaction::deleteObjectStore):
307         (WebCore::IDBClient::IDBTransaction::deleteObjectStoreOnServer):
308         (WebCore::IDBClient::IDBTransaction::didDeleteObjectStoreOnServer):
309         (WebCore::IDBClient::IDBTransaction::activate):
310         (WebCore::IDBClient::IDBTransaction::activationTimerFired): Deleted.
311         (WebCore::IDBClient::IDBTransaction::createObjectStoreOnServer): Deleted.
312         (WebCore::IDBClient::IDBTransaction::didCreateObjectStoreOnServer): Deleted.
313         (WebCore::IDBClient::IDBTransaction::getRecordOnServer): Deleted.
314         (WebCore::IDBClient::IDBTransaction::putOrAddOnServer): Deleted.
315         * Modules/indexeddb/client/IDBTransactionImpl.h:
316         
317         * Modules/indexeddb/client/TransactionOperation.h:
318         (WebCore::IDBClient::TransactionOperation::completed):
319         (WebCore::IDBClient::createTransactionOperation):
320         
321         * Modules/indexeddb/server/IDBBackingStore.h:
322         
323         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
324         (WebCore::IDBServer::IDBConnectionToClient::didDeleteObjectStore):
325         * Modules/indexeddb/server/IDBConnectionToClient.h:
326         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
327         
328         * Modules/indexeddb/server/IDBServer.cpp:
329         (WebCore::IDBServer::IDBServer::deleteObjectStore):
330         * Modules/indexeddb/server/IDBServer.h:
331         
332         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
333         (WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreDeleted):
334         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
335         (WebCore::IDBServer::MemoryBackingStoreTransaction::finish):
336         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
337         
338         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
339         (WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
340         (WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore):
341         (WebCore::IDBServer::MemoryIDBBackingStore::restoreObjectStoreForVersionChangeAbort):
342         (WebCore::IDBServer::MemoryIDBBackingStore::takeObjectStoreByName):
343         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
344         
345         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
346         (WebCore::IDBServer::UniqueIDBDatabase::performCreateObjectStore):
347         (WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
348         (WebCore::IDBServer::UniqueIDBDatabase::performDeleteObjectStore):
349         (WebCore::IDBServer::UniqueIDBDatabase::didPerformDeleteObjectStore):
350         (WebCore::IDBServer::UniqueIDBDatabase::createObjectStore): Deleted.
351         * Modules/indexeddb/server/UniqueIDBDatabase.h:
352         
353         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
354         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didDeleteObjectStore):
355         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
356         
357         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
358         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteObjectStore):
359         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
360         
361         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
362         (WebCore::IDBDatabaseInfo::deleteObjectStore):
363         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
364         
365         * Modules/indexeddb/shared/IDBResultData.cpp:
366         (WebCore::IDBResultData::deleteObjectStoreSuccess):
367         * Modules/indexeddb/shared/IDBResultData.h:
368         
369         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
370         (WebCore::InProcessIDBServer::didDeleteObjectStore):
371         (WebCore::InProcessIDBServer::deleteObjectStore):
372         * Modules/indexeddb/shared/InProcessIDBServer.h:
373
374 2015-10-29  Simon Fraser  <simon.fraser@apple.com>
375
376         Very slow typing on pages with wheel event handlers on the body, and deep content
377         https://bugs.webkit.org/show_bug.cgi?id=150692
378         rdar://problem/23242631
379
380         Reviewed by Zalan Bujtas.
381         
382         On a large page with a wheel event handler on the body, we would call
383         Element::absoluteEventHandlerBounds() for every element under the body,
384         and compute an absolute bounds for each one. This is very slow.
385         
386         For now, optimize computing a region for the <body> by just using the document
387         bounds, which will always be as big or larger. It's OK for this region to
388         be an overestimate.
389
390         * dom/Document.cpp:
391         (WebCore::Document::absoluteRegionForEventTargets):
392
393 2015-10-29  Wenson Hsieh  <wenson_hsieh@apple.com>
394
395         Date input values should not overlap with menu list dropdown button on iOS
396         https://bugs.webkit.org/show_bug.cgi?id=150681
397         <rdar://problem/19965078>
398
399         Reviewed by Zalan Bujtas.
400
401         Adds a right margin on iOS date and time inputs so that the inner div does
402         not render the value of the date on top of the dropdown button on the right
403         of the menu list.
404
405         Tests: fast/forms/date/date-input-rendering-basic.html
406                fast/forms/time/time-input-rendering-basic.html
407
408         * css/html.css:
409         (input::-webkit-date-and-time-value):
410
411 2015-10-29  Alex Christensen  <achristensen@webkit.org>
412
413         Fix Mac CMake build
414         https://bugs.webkit.org/show_bug.cgi?id=150686
415
416         Reviewed by Filip Pizlo.
417
418         * PlatformMac.cmake:
419
420 2015-10-29  Csaba Osztrogonác  <ossy@webkit.org>
421
422         One more URTBF after r191731.
423
424         * rendering/svg/RenderSVGResourcePattern.cpp:
425
426 2015-10-29  Csaba Osztrogonác  <ossy@webkit.org>
427
428         URTBF after r191731.
429
430         * rendering/svg/RenderSVGResourcePattern.cpp:
431
432 2015-10-29  Zalan Bujtas  <zalan@apple.com>
433
434         Fix ENABLE(TREE_DEBUGGING) release build.
435
436         Unreviewed build fix.
437
438         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
439         * dom/Position.cpp:
440
441 2015-10-29  Beth Dakin  <bdakin@apple.com>
442
443         Overlay scrollbars disappear during manual drag-scroll
444         https://bugs.webkit.org/show_bug.cgi?id=150646
445         -and corresponding-
446         rdar://problem/23145734
447
448         Reviewed by Tim Horton.
449
450         New ScrollAnimator function so that we can tell the ScrollbarPainter whether 
451         or not the mouse is tracking the scrollbar.
452         * platform/ScrollAnimator.h:
453         (WebCore::ScrollAnimator::ScrollAnimator::mouseIsDownInScrollbar):
454         * platform/ScrollableArea.cpp:
455         (WebCore::ScrollableArea::mouseIsDownInScrollbar):
456         * platform/ScrollableArea.h:
457
458         Call into the new ScrollAnimator function of mouseDown and mouseUp.
459         * platform/Scrollbar.cpp:
460         (WebCore::Scrollbar::mouseUp):
461         (WebCore::Scrollbar::mouseDown):
462
463         Add setTracking to the ScrollbarPainter.
464         * platform/mac/NSScrollerImpDetails.h:
465
466         Implement mouseIsDownInScrollbar to call setTracking appropriately and to set 
467         begin/endScrollGesture since drag scrolling does not normally trigger that 
468         state change.
469         * platform/mac/ScrollAnimatorMac.h:
470         * platform/mac/ScrollAnimatorMac.mm:
471         (WebCore::ScrollAnimatorMac::mouseIsDownInScrollbar):
472
473 2015-10-29  Eric Carlson  <eric.carlson@apple.com>
474
475         MediaPlayer::getSupportedTypes only returns types from the last engine registered
476         https://bugs.webkit.org/show_bug.cgi?id=150669
477
478         Reviewed by Jer Noble.
479
480         No new tests, fixes existing tests.
481
482         * platform/graphics/MediaPlayer.cpp:
483         (WebCore::MediaPlayer::getSupportedTypes):
484         (WebCore::MediaPlayer::isAvailable):
485
486 2015-10-29  Joseph Pecoraro  <pecoraro@apple.com>
487
488         Web Inspector: Clean up and audit TimelineRecordFactory records
489         https://bugs.webkit.org/show_bug.cgi?id=150660
490
491         Reviewed by Brian Burg.
492
493         Cleanup included removing unused methods and payload data that the
494         frontend wasn't likely to use. Also added ASCIILiteral and removed
495         unnecessary includes.
496
497         * inspector/InspectorNetworkAgent.cpp:
498         * inspector/InspectorPageAgent.cpp:
499         * inspector/InspectorTimelineAgent.cpp:
500         (WebCore::InspectorTimelineAgent::willLayout):
501         * inspector/InspectorTimelineAgent.h:
502         * inspector/TimelineRecordFactory.cpp:
503         (WebCore::TimelineRecordFactory::createGenericRecord):
504         (WebCore::TimelineRecordFactory::createFunctionCallData):
505         (WebCore::TimelineRecordFactory::createConsoleProfileData):
506         (WebCore::TimelineRecordFactory::createEventDispatchData):
507         (WebCore::TimelineRecordFactory::createGenericTimerData):
508         (WebCore::TimelineRecordFactory::createTimerInstallData):
509         (WebCore::TimelineRecordFactory::createEvaluateScriptData):
510         (WebCore::TimelineRecordFactory::createTimeStampData):
511         (WebCore::TimelineRecordFactory::createParseHTMLData):
512         (WebCore::TimelineRecordFactory::createAnimationFrameData):
513         (WebCore::TimelineRecordFactory::createPaintData):
514         (WebCore::TimelineRecordFactory::appendLayoutRoot):
515         (WebCore::TimelineRecordFactory::createBackgroundRecord): Deleted.
516         (WebCore::TimelineRecordFactory::createLayoutData): Deleted.
517         * inspector/TimelineRecordFactory.h:
518         (WebCore::TimelineRecordFactory::TimelineRecordFactory):
519
520 2015-10-29  Said Abou-Hallawa  <sabouhallawa@apple.com>
521
522         Exploitable crash happens when an SVG contains an indirect resource inheritance cycle
523         https://bugs.webkit.org/show_bug.cgi?id=150203
524
525         Reviewed by Brent Fulgham.
526
527         Detecting cycles in SVG resource references happens in two places.
528         1. In SVGResourcesCycleSolver::resolveCycles() which it is called from 
529            SVGResourcesCache::addResourcesFromRenderer(). When a cycle is deleted,
530            SVGResourcesCycleSolver::breakCycle() is called to break the link. In
531            the case of a cyclic resource inheritance, SVGResources::resetLinkedResource()
532            is called to break this cycle.
533         2. SVGPatternElement::collectPatternAttributes() which is called from
534            RenderSVGResourcePattern::buildPattern(). The purpose is to resolve
535            the pattern attributes and to build a tile image which can be used to
536            fill the SVG element renderer. Detecting the cyclic resource reference
537            in this function is not sufficient and can detect simple cycles like
538             <pattern id="a" xlink:href="#b"/>
539             <pattern id="b" xlink:href="#a"/>.
540            But it does not detect cycles like:
541             <pattern id="a">
542                 <rect fill="url(#b)"/>
543             </pattern>
544             <pattern id="b" xlink:href="#a"/>.
545    
546         The fix is to get rid of SVGPatternElement::collectPatternAttributes() which
547         uses SVGURIReference::targetElementFromIRIString() to navigates through the
548         referenced resource elements and tries to detect cycles. Instead we can
549         implement RenderSVGResourcePattern::collectPatternAttributes() which calls
550         SVGResourcesCache::cachedResourcesForRenderer() to get the SVGResources
551         of the pattern. Then we use SVGResources::linkedResource() to navigate the
552         resource inheritance tree. The cached SVGResources is guaranteed to be free
553         of cycles.
554
555         Tests: svg/custom/pattern-content-inheritance-cycle.svg
556
557         * rendering/svg/RenderSVGResourcePattern.cpp:
558         (WebCore::RenderSVGResourcePattern::collectPatternAttributes):
559         Collect the pattern attributes through the cachedResourcesForRenderer().
560         
561         (WebCore::RenderSVGResourcePattern::buildPattern):
562         Direct the call to the renderer function.
563         
564         * rendering/svg/RenderSVGResourcePattern.h:
565         
566         * rendering/svg/RenderSVGRoot.cpp:
567         (WebCore::RenderSVGRoot::layout):
568         RenderSVGRoot needs to call SVGResourcesCache::clientStyleChanged() for all
569         the invalidated resources. If an attribute of an SVG resource was updated
570         dynamically, the cached SVGResources associated with the renderer of this
571         resource was stale.
572         
573         * rendering/svg/SVGRenderTreeAsText.cpp:
574         (WebCore::writeSVGResourceContainer):
575         Direct the call to the renderer function.        
576         
577         * svg/SVGPatternElement.cpp:
578         (WebCore::SVGPatternElement::collectPatternAttributes):
579         (WebCore::setPatternAttributes): Deleted.
580         collectPatternAttributes() is a replacement of setPatternAttributes().
581         
582 2015-10-29  Xabier Rodriguez Calvar  <calvaris@igalia.com>
583
584         [Streams API] Turn WS states into integers and fix state initialization
585         https://bugs.webkit.org/show_bug.cgi?id=150667
586
587         Reviewed by Youenn Fablet.
588
589         The goal of this patch is turning the writable stream states into integers instead of strings.
590
591         First readable stream states were reworked to be shared with writable stream too, they are now just @stream*.
592
593         Next step was having writable stream using integers instead of strings and translating those integers back to
594         strings to be able to return them correctly with the writable stream state attribute.
595
596         The state initialization was fixed and now it is not needed to check for the state to be undefined.
597
598         Rework, no new tests needed.
599
600         * Modules/streams/ReadableStream.js:
601         (initializeReadableStream):
602         * Modules/streams/ReadableStreamController.js:
603         (enqueue):
604         (error):
605         (close):
606         * Modules/streams/ReadableStreamInternals.js:
607         (privateInitializeReadableStreamReader):
608         (errorReadableStream):
609         (cancelReadableStream):
610         (finishClosingReadableStream):
611         (closeReadableStream):
612         (closeReadableStreamReader):
613         (enqueueInReadableStream):
614         (readFromReadableStreamReader):
615         * Modules/streams/ReadableStreamReader.js:
616         (cancel):
617         * Modules/streams/WritableStream.js:
618         (initializeWritableStream):
619         (abort):
620         (close):
621         (write):
622         (state):
623         * Modules/streams/WritableStreamInternals.js:
624         (syncWritableStreamStateWithQueue):
625         (errorWritableStream):
626         * bindings/js/JSDOMWindowBase.cpp:
627         (WebCore::JSDOMWindowBase::finishCreation):
628         * bindings/js/WebCoreBuiltinNames.h:
629
630 2015-10-28  Brady Eidson  <beidson@apple.com>
631
632         Modern IDB: Support IDBDatabase.transaction() (and transaction scheduling in general).
633         https://bugs.webkit.org/show_bug.cgi?id=150614
634
635         Reviewed by Alex Christensen.
636
637         Tests: storage/indexeddb/modern/idbdatabase-transaction-failures.html
638                storage/indexeddb/modern/transaction-scheduler-1.html
639                storage/indexeddb/modern/transaction-scheduler-2.html
640                storage/indexeddb/modern/transaction-scheduler-3.html
641                storage/indexeddb/modern/transaction-scheduler-4.html
642                storage/indexeddb/modern/transaction-scheduler-5.html
643                storage/indexeddb/modern/transaction-scheduler-6.html
644
645         * Modules/indexeddb/IDBDatabase.idl:
646
647         * Modules/indexeddb/IndexedDB.h:
648
649         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
650         (WebCore::IDBClient::IDBConnectionToServer::establishTransaction):
651         (WebCore::IDBClient::IDBConnectionToServer::didStartTransaction):
652         (WebCore::IDBClient::IDBConnectionToServer::hasRecordOfTransaction):
653         * Modules/indexeddb/client/IDBConnectionToServer.h:
654         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
655
656         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
657         (WebCore::IDBClient::IDBDatabase::transaction):
658         (WebCore::IDBClient::IDBDatabase::didStartTransaction):
659         * Modules/indexeddb/client/IDBDatabaseImpl.h:
660
661         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
662         (WebCore::IDBClient::IDBTransaction::IDBTransaction):
663         (WebCore::IDBClient::IDBTransaction::operationTimerFired):
664         (WebCore::IDBClient::IDBTransaction::didStart):
665         (WebCore::IDBClient::IDBTransaction::establishOnServer):
666         (WebCore::IDBClient::IDBTransaction::activate):
667         (WebCore::IDBClient::IDBTransaction::deactivate):
668         * Modules/indexeddb/client/IDBTransactionImpl.h:
669
670         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
671         (WebCore::IDBServer::IDBConnectionToClient::didStartTransaction):
672         * Modules/indexeddb/server/IDBConnectionToClient.h:
673         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
674
675         * Modules/indexeddb/server/IDBServer.cpp:
676         (WebCore::IDBServer::IDBServer::establishTransaction):
677         * Modules/indexeddb/server/IDBServer.h:
678
679         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
680         (WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction):
681         (WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
682         (WebCore::IDBServer::MemoryIDBBackingStore::removeObjectStoreForVersionChangeAbort):
683         (WebCore::IDBServer::MemoryIDBBackingStore::keyExistsInObjectStore):
684         (WebCore::IDBServer::MemoryIDBBackingStore::deleteRecord):
685         (WebCore::IDBServer::MemoryIDBBackingStore::putRecord):
686         (WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
687         (WebCore::IDBServer::MemoryIDBBackingStore::registerObjectStore):
688         (WebCore::IDBServer::MemoryIDBBackingStore::unregisterObjectStore):
689         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
690
691         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
692         (WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
693         (WebCore::IDBServer::UniqueIDBDatabase::performCommitTransaction):
694         (WebCore::IDBServer::UniqueIDBDatabase::didPerformCommitTransaction):
695         (WebCore::IDBServer::UniqueIDBDatabase::didPerformAbortTransaction):
696         (WebCore::IDBServer::UniqueIDBDatabase::enqueueTransaction):
697         (WebCore::IDBServer::UniqueIDBDatabase::transactionSchedulingTimerFired):
698         (WebCore::IDBServer::UniqueIDBDatabase::activateTransactionInBackingStore):
699         (WebCore::IDBServer::UniqueIDBDatabase::performActivateTransactionInBackingStore):
700         (WebCore::IDBServer::UniqueIDBDatabase::didPerformActivateTransactionInBackingStore):
701         (WebCore::IDBServer::scopesOverlap):
702         (WebCore::IDBServer::UniqueIDBDatabase::takeNextRunnableTransaction):
703         (WebCore::IDBServer::UniqueIDBDatabase::inProgressTransactionCompleted):
704         * Modules/indexeddb/server/UniqueIDBDatabase.h:
705
706         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
707         (WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction):
708         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
709
710         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
711         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::create):
712         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction):
713         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::objectStoreIdentifiers):
714         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::didActivateInBackingStore):
715         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
716         
717         * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
718         (WebCore::IDBTransactionInfo::clientTransaction):
719         (WebCore::IDBTransactionInfo::isolatedCopy):
720         * Modules/indexeddb/shared/IDBTransactionInfo.h:
721         
722         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
723         (WebCore::InProcessIDBServer::establishTransaction):
724         (WebCore::InProcessIDBServer::didStartTransaction):
725         * Modules/indexeddb/shared/InProcessIDBServer.h:
726         
727         * bindings/js/IDBBindingUtilities.cpp:
728         (WebCore::deserializeIDBValueData):
729         
730         * bindings/js/JSIDBDatabaseCustom.cpp:
731         (WebCore::JSIDBDatabase::transaction):
732         
733         * bindings/js/ScriptState.cpp:
734         (WebCore::execStateFromPage):
735
736 2015-10-28  Eric Carlson  <eric.carlson@apple.com>
737
738         [MediaStream] Play MediaStream through media element and rendered to canvas
739         https://bugs.webkit.org/show_bug.cgi?id=150449
740
741         Reviewed by Jer Noble.
742
743         * Modules/mediastream/MediaStream.cpp:
744         (WebCore::MediaStream::create): Don't die a recursive death.
745         (WebCore::MediaStream::MediaStream): setClient -> addObserver. Set private stream's public stream pointer.
746         (WebCore::MediaStream::~MediaStream): setClient -> addObserver. Clear private stream's public stream pointer.
747         (WebCore::MediaStream::didAddTrack): Short circuit calling internalAddTrack when the track is unknown.
748         (WebCore::MediaStream::didRemoveTrack): ASSERT that the track is known.
749         * Modules/mediastream/MediaStream.h:
750
751         * Modules/mediastream/MediaStreamTrack.cpp:
752         (WebCore::MediaStreamTrack::trackProducingDataChanged): New.
753         (WebCore::MediaStreamTrack::trackEnabledChanged): New.
754         * Modules/mediastream/MediaStreamTrack.h:
755
756         * Modules/mediastream/RTCPeerConnection.cpp:
757         (WebCore::RTCPeerConnection::didRemoveRemoteStream): Use the new MediaStreamPrivate::publicStream() method.
758
759         * Modules/webaudio/MediaStreamAudioSource.cpp:
760 ]        (WebCore::MediaStreamAudioSource::capabilities): capabilities isn't const.
761         * Modules/webaudio/MediaStreamAudioSource.h:
762
763         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
764         (WebCore::MediaStreamAudioSourceNode::setFormat): Reformat to make it use early return.
765
766         * WebCore.xcodeproj/project.pbxproj: Remove MediaStreamPrivateAVFObjC.mm/h, they are no longer necessary.
767
768         * platform/graphics/MediaPlayer.cpp:
769         (WebCore::buildMediaEnginesVector): Register MediaPlayerPrivateMediaStreamAVFObjC engine.
770
771         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
772         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
773         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): Cleanup, add logging.
774         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC): Add
775           logging, remove private stream observer.
776         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::registerMediaEngine): Cleanup.
777         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable): Ditto.
778         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::getSupportedTypes): Return an empty vector.
779         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load): Use the MediaStreamPrivate passed instead
780           of creating a new private stream. 
781         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::cancelLoad): Pause output.
782         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::prepareToPlay): Add logging.
783         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer): m_previewLayer -> m_videoBackgroundLayer.
784         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setPausedImageVisible): New, show/hide the preview layer and configure
785           the background layer so we show a still image even though the capture device continues to run. Start/stop clock.
786         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play): Don't need to start the source, that happens in in load. Just
787           set flags and hide the paused image.
788         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause): Don't stop the source, it may be shared by more than one 
789           stream/track. Just set the playing flag and show the paused image.
790         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paused): Fix.
791         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::internalSetVolume): New, called by setMuted and setVolume.
792         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVolume): New.
793         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setMuted): Don't mute the source, it doesn't do what you think.
794         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::hasVideo): Pass-through to stream.
795         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::hasAudio): Ditto.
796         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentMediaTime): Return clock time.
797         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState): New.
798         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::activeStatusChanged): Update readyState.
799         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateIntrinsicSize): Update intrinsic size, create layers if necessary.
800         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::createPreviewLayers): Create preview layers.
801         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::characteristicsChanged): Update for changed characteristics.
802         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::seekable): 'seekable' must return an empty TimeRanges object.
803         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext): New.
804         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::scheduleDeferredTask):
805         (WebCore::mimeTypeCache): Deleted.
806         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformMedia): Deleted.
807         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::playInternal): Deleted.
808         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pauseInternal): Deleted.
809         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sizeChanged): Deleted.
810         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::maxMediaTimeSeekable): Deleted.
811         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::minMediaTimeSeekable): Deleted.
812         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::createImageFromSampleBuffer): Deleted.
813         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::supportsAcceleratedRendering): Deleted.
814         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::movieLoadType): Deleted.
815         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::extraMemoryCost): Deleted.
816
817         Delete MediaStreamPrivateAVFObjC.mm/.h as they aren't necessary. 
818         * platform/graphics/avfoundation/objc/MediaStreamPrivateAVFObjC.h: Removed.
819         * platform/graphics/avfoundation/objc/MediaStreamPrivateAVFObjC.mm: Removed.
820
821         * platform/mediastream/MediaStreamPrivate.cpp:
822         (WebCore::MediaStreamPrivate::MediaStreamPrivate): Add track observer!
823         (WebCore::MediaStreamPrivate::addObserver): New.
824         (WebCore::MediaStreamPrivate::removeObserver): New.
825         (WebCore::MediaStreamPrivate::updateActiveState): Remember the first active video track.
826         (WebCore::MediaStreamPrivate::addTrack): Notify observers.
827         (WebCore::MediaStreamPrivate::removeTrack): Ditto.
828         (WebCore::MediaStreamPrivate::startProducingData): Pass-through to tracks.
829         (WebCore::MediaStreamPrivate::stopProducingData): Ditto.
830         (WebCore::MediaStreamPrivate::isProducingData): Ditto.
831         (WebCore::MediaStreamPrivate::hasVideo): Ditto.
832         (WebCore::MediaStreamPrivate::hasAudio): Ditto.
833         (WebCore::MediaStreamPrivate::platformLayer): Ditto.
834         (WebCore::MediaStreamPrivate::paintCurrentFrameInContext): Either pass-through to first active video
835           track, or paint the context black.
836         (WebCore::MediaStreamPrivate::currentFrameImage): Pass-through to first active video track.
837         (WebCore::MediaStreamPrivate::characteristicsChanged): Inform observers.
838         (WebCore::MediaStreamPrivate::trackMutedChanged):
839         (WebCore::MediaStreamPrivate::trackStatesChanged):
840         (WebCore::MediaStreamPrivate::trackEnabledChanged):
841         (WebCore::MediaStreamPrivate::trackProducingDataChanged):
842         (WebCore::MediaStreamPrivate::scheduleDeferredTask): New, call a function asynchronously on
843           the main thread.
844         * platform/mediastream/MediaStreamPrivate.h:
845
846         * platform/mediastream/MediaStreamTrackPrivate.cpp:
847         (WebCore::MediaStreamTrackPrivate::endTrack):
848         (WebCore::MediaStreamTrackPrivate::sourceProducingDataChanged): New, inform observers.
849         (WebCore::MediaStreamTrackPrivate::sourceEnabledChanged): Ditto.
850         * platform/mediastream/MediaStreamTrackPrivate.h:
851
852         * platform/mediastream/RealtimeMediaSource.cpp:
853         (WebCore::RealtimeMediaSource::isProducingDataDidChange): New, inform observers.
854         (WebCore::RealtimeMediaSource::setEnabled): Ditto.
855         (WebCore::RealtimeMediaSource::stop): Call reset();
856         * platform/mediastream/RealtimeMediaSource.h: Don't declare "capabilities" as const so 
857           capabilities can be created and initialized lazily.
858
859         * platform/mediastream/mac/AVAudioCaptureSource.h:
860         * platform/mediastream/mac/AVAudioCaptureSource.mm:
861         (WebCore::AVAudioCaptureSource::initializeCapabilities): New.
862         (WebCore::AVAudioCaptureSource::addObserver): Hold the lock while calling observers so the list
863           can't be mutated.
864         (WebCore::AVAudioCaptureSource::setupCaptureSession): Log and fail if the session won't add the
865           input or output.
866         (WebCore::AVAudioCaptureSource::shutdownCaptureSession): Cleanup.
867         (WebCore::AVAudioCaptureSource::captureOutputDidOutputSampleBufferFromConnection): Don't block
868           if it isn't possible to acquire the lock. Hold the lock while calling observers.
869         (WebCore::AVAudioCaptureSource::capabilities): Deleted.
870
871         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
872         (WebCore::refreshCaptureDeviceList): Don't include devices that can't be used.
873         (WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints):  Use AVCaptureDeviceManager::sourceWithUID
874           so constraints are considered.
875         (WebCore::AVCaptureDeviceManager::sourceWithUID): Don't consider disabled devices. Always
876           create a new capture device so each track starts out with a unique source.
877         * platform/mediastream/mac/AVMediaCaptureSource.h:
878
879         * platform/mediastream/mac/AVMediaCaptureSource.mm:
880         (WebCore::globaAudioCaptureSerialQueue):
881         (WebCore::AVMediaCaptureSource::AVMediaCaptureSource):
882         (WebCore::AVMediaCaptureSource::~AVMediaCaptureSource): Remove KVO observers.
883         (WebCore::AVMediaCaptureSource::startProducingData): m_isRunning is changed in captureSessionIsRunningDidChange.
884         (WebCore::AVMediaCaptureSource::stopProducingData): Ditto.
885         (WebCore::AVMediaCaptureSource::capabilities): New.
886         (WebCore::AVMediaCaptureSource::setupSession): Add KVObservers for the properties we care about.
887         (WebCore::AVMediaCaptureSource::reset): New, cleanup.
888         (WebCore::AVMediaCaptureSource::captureSessionIsRunningDidChange): Dispatch to the main thread 
889           to set m_isRunning, call isProducingDataDidChange so observers can find out.
890         (WebCore::sessionKVOProperties):
891         (-[WebCoreAVMediaCaptureSourceObserver disconnect]):
892         (-[WebCoreAVMediaCaptureSourceObserver captureOutput:didOutputSampleBuffer:fromConnection:]):
893         (-[WebCoreAVMediaCaptureSourceObserver observeValueForKeyPath:ofObject:change:context:]): Respond
894           to running changes.
895         (WebCore::AVMediaCaptureSource::captureSessionStoppedRunning): Deleted.
896         (-[WebCoreAVMediaCaptureSourceObserver captureSessionStoppedRunning:]): Deleted.
897
898         * platform/mediastream/mac/AVVideoCaptureSource.h:
899         * platform/mediastream/mac/AVVideoCaptureSource.mm:
900         (WebCore::AVVideoCaptureSource::initializeCapabilities): Partial implementation.
901         (WebCore::AVVideoCaptureSource::setupCaptureSession):  Log and fail if the session won't add the
902           input or output.
903         (WebCore::AVVideoCaptureSource::shutdownCaptureSession): Cleanup.
904         (WebCore::AVVideoCaptureSource::updateFramerate): Renamed from calculateFramerate.
905         (WebCore::AVVideoCaptureSource::currentFrameImage): Return an Image.
906         (WebCore::AVVideoCaptureSource::platformLayer): New.
907         (WebCore::AVVideoCaptureSource::capabilities): Deleted.
908         (WebCore::AVVideoCaptureSource::calculateFramerate): Deleted.
909
910         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
911         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
912         (WebCore::WebAudioSourceProviderAVFObjC::~WebAudioSourceProviderAVFObjC): AudioConverterRef is
913           not a CF/ObjC object so we can't use a RetainPtr<> for it.
914         (WebCore::WebAudioSourceProviderAVFObjC::provideInput): Ditto.
915         (WebCore::WebAudioSourceProviderAVFObjC::prepare): Ditto.
916         (WebCore::WebAudioSourceProviderAVFObjC::unprepare): Ditto.
917         (WebCore::WebAudioSourceProviderAVFObjC::process): Fix typo in logging.
918
919         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
920         (WebCore::MockSource::capabilities): Update for capabilities change.
921
922         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h: Update for capabilities change.
923
924 2015-10-28  Chris Dumez  <cdumez@apple.com>
925
926         Regression(r191673): [WIN][EFL][GTK] layout tests using data URLs time out
927         https://bugs.webkit.org/show_bug.cgi?id=150661
928
929         Reviewed by Gyuyoung Kim.
930
931         Do a partial revert of r191673. For some reason, using a Timer in
932         DataURLDecoder does not work (it does not fire). Since non COCOA ports
933         don't support RunLoopTimer, this patch reintroduces the use of
934         callOnMainThread() on non-COCOA ports.
935
936         * platform/network/DataURLDecoder.cpp:
937         (WebCore::DataURLDecoder::decode):
938         (WebCore::DataURLDecoder::DecodingResultDispatcher::startTimer): Deleted.
939
940 2015-10-28  Joseph Pecoraro  <pecoraro@apple.com>
941
942         Web Inspector: Rename InspectorResourceAgent to InspectorNetworkAgent
943         https://bugs.webkit.org/show_bug.cgi?id=150654
944
945         Reviewed by Geoffrey Garen.
946
947         * CMakeLists.txt:
948         * WebCore.vcxproj/WebCore.vcxproj:
949         * WebCore.vcxproj/WebCore.vcxproj.filters:
950         * WebCore.xcodeproj/project.pbxproj:
951         * inspector/InspectorAllInOne.cpp:
952         * inspector/InspectorController.cpp:
953         (WebCore::InspectorController::InspectorController):
954         * inspector/InspectorController.h:
955         * inspector/InspectorDOMDebuggerAgent.h:
956         * inspector/InspectorFrontendClient.h:
957         * inspector/InspectorInstrumentation.cpp:
958         (WebCore::InspectorInstrumentation::willRecalculateStyleImpl):
959         (WebCore::InspectorInstrumentation::didRecalculateStyleImpl):
960         (WebCore::InspectorInstrumentation::didScheduleStyleRecalculationImpl):
961         (WebCore::InspectorInstrumentation::willSendRequestImpl):
962         (WebCore::InspectorInstrumentation::markResourceAsCachedImpl):
963         (WebCore::InspectorInstrumentation::didLoadResourceFromMemoryCacheImpl):
964         (WebCore::InspectorInstrumentation::didReceiveResourceResponseImpl):
965         (WebCore::InspectorInstrumentation::didReceiveDataImpl):
966         (WebCore::InspectorInstrumentation::didFinishLoadingImpl):
967         (WebCore::InspectorInstrumentation::didFailLoadingImpl):
968         (WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
969         (WebCore::InspectorInstrumentation::didReceiveXHRResponseImpl):
970         (WebCore::InspectorInstrumentation::willLoadXHRSynchronouslyImpl):
971         (WebCore::InspectorInstrumentation::didLoadXHRSynchronouslyImpl):
972         (WebCore::InspectorInstrumentation::scriptImportedImpl):
973         (WebCore::InspectorInstrumentation::didReceiveScriptResponseImpl):
974         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
975         (WebCore::InspectorInstrumentation::willDestroyCachedResourceImpl):
976         (WebCore::InspectorInstrumentation::didCreateWebSocketImpl):
977         (WebCore::InspectorInstrumentation::willSendWebSocketHandshakeRequestImpl):
978         (WebCore::InspectorInstrumentation::didReceiveWebSocketHandshakeResponseImpl):
979         (WebCore::InspectorInstrumentation::didCloseWebSocketImpl):
980         (WebCore::InspectorInstrumentation::didReceiveWebSocketFrameImpl):
981         (WebCore::InspectorInstrumentation::didReceiveWebSocketFrameErrorImpl):
982         (WebCore::InspectorInstrumentation::didSendWebSocketFrameImpl):
983         * inspector/InspectorLayerTreeAgent.h:
984         * inspector/InspectorNetworkAgent.cpp: Renamed from Source/WebCore/inspector/InspectorResourceAgent.cpp.
985         (WebCore::InspectorNetworkAgent::InspectorNetworkAgent):
986         (WebCore::InspectorNetworkAgent::didCreateFrontendAndBackend):
987         (WebCore::InspectorNetworkAgent::willDestroyFrontendAndBackend):
988         (WebCore::buildObjectForHeaders):
989         (WebCore::buildObjectForTiming):
990         (WebCore::buildObjectForResourceRequest):
991         (WebCore::buildObjectForResourceResponse):
992         (WebCore::buildObjectForCachedResource):
993         (WebCore::InspectorNetworkAgent::~InspectorNetworkAgent):
994         (WebCore::InspectorNetworkAgent::timestamp):
995         (WebCore::InspectorNetworkAgent::willSendRequest):
996         (WebCore::InspectorNetworkAgent::markResourceAsCached):
997         (WebCore::InspectorNetworkAgent::didReceiveResponse):
998         (WebCore::isErrorStatusCode):
999         (WebCore::InspectorNetworkAgent::didReceiveData):
1000         (WebCore::InspectorNetworkAgent::didFinishLoading):
1001         (WebCore::InspectorNetworkAgent::didFailLoading):
1002         (WebCore::InspectorNetworkAgent::didLoadResourceFromMemoryCache):
1003         (WebCore::InspectorNetworkAgent::setInitialScriptContent):
1004         (WebCore::InspectorNetworkAgent::didReceiveScriptResponse):
1005         (WebCore::InspectorNetworkAgent::didFinishXHRLoading):
1006         (WebCore::InspectorNetworkAgent::didReceiveXHRResponse):
1007         (WebCore::InspectorNetworkAgent::willLoadXHRSynchronously):
1008         (WebCore::InspectorNetworkAgent::didLoadXHRSynchronously):
1009         (WebCore::InspectorNetworkAgent::willDestroyCachedResource):
1010         (WebCore::InspectorNetworkAgent::willRecalculateStyle):
1011         (WebCore::InspectorNetworkAgent::didRecalculateStyle):
1012         (WebCore::InspectorNetworkAgent::didScheduleStyleRecalculation):
1013         (WebCore::InspectorNetworkAgent::buildInitiatorObject):
1014         (WebCore::InspectorNetworkAgent::didCreateWebSocket):
1015         (WebCore::InspectorNetworkAgent::willSendWebSocketHandshakeRequest):
1016         (WebCore::InspectorNetworkAgent::didReceiveWebSocketHandshakeResponse):
1017         (WebCore::InspectorNetworkAgent::didCloseWebSocket):
1018         (WebCore::InspectorNetworkAgent::didReceiveWebSocketFrame):
1019         (WebCore::InspectorNetworkAgent::didSendWebSocketFrame):
1020         (WebCore::InspectorNetworkAgent::didReceiveWebSocketFrameError):
1021         (WebCore::InspectorNetworkAgent::enable):
1022         (WebCore::InspectorNetworkAgent::disable):
1023         (WebCore::InspectorNetworkAgent::setExtraHTTPHeaders):
1024         (WebCore::InspectorNetworkAgent::getResponseBody):
1025         (WebCore::InspectorNetworkAgent::setCacheDisabled):
1026         (WebCore::InspectorNetworkAgent::loadResource):
1027         (WebCore::InspectorNetworkAgent::mainFrameNavigated):
1028         * inspector/InspectorNetworkAgent.h: Renamed from Source/WebCore/inspector/InspectorResourceAgent.h.
1029         * inspector/InspectorPageAgent.h:
1030         * inspector/InstrumentingAgents.cpp:
1031         (WebCore::InstrumentingAgents::reset):
1032         * inspector/InstrumentingAgents.h:
1033         (WebCore::InstrumentingAgents::inspectorNetworkAgent):
1034         (WebCore::InstrumentingAgents::setInspectorNetworkAgent):
1035         (WebCore::InstrumentingAgents::inspectorResourceAgent): Deleted.
1036         (WebCore::InstrumentingAgents::setInspectorResourceAgent): Deleted.
1037         * inspector/NetworkResourcesData.h:
1038
1039 2015-10-28  Joseph Pecoraro  <pecoraro@apple.com>
1040
1041         Web Inspector: Remove unused / duplicate WebSocket timeline records
1042         https://bugs.webkit.org/show_bug.cgi?id=150647
1043
1044         Reviewed by Timothy Hatcher.
1045
1046         * Modules/websockets/WebSocketChannel.cpp:
1047         (WebCore::WebSocketChannel::connect):
1048         Only send what is needed by inspector now.
1049
1050         * inspector/InspectorInstrumentation.h:
1051         (WebCore::InspectorInstrumentation::didCreateWebSocket):
1052         (WebCore::InspectorInstrumentation::willSendWebSocketHandshakeRequest):
1053         (WebCore::InspectorInstrumentation::didReceiveWebSocketHandshakeResponse):
1054         (WebCore::InspectorInstrumentation::didCloseWebSocket):
1055         (WebCore::InspectorInstrumentation::didReceiveWebSocketFrame):
1056         (WebCore::InspectorInstrumentation::didReceiveWebSocketFrameError):
1057         (WebCore::InspectorInstrumentation::didSendWebSocketFrame):
1058         These can all fast return if there is no frontend because the inspector
1059         doesn't record any information about web sockets until a frontend is connected.
1060         The inspector in this case just sends events to the frontend when things happen.
1061
1062         * inspector/InspectorInstrumentation.cpp:
1063         (WebCore::InspectorInstrumentation::didCreateWebSocketImpl):
1064         (WebCore::InspectorInstrumentation::willSendWebSocketHandshakeRequestImpl):
1065         (WebCore::InspectorInstrumentation::didReceiveWebSocketHandshakeResponseImpl):
1066         (WebCore::InspectorInstrumentation::didCloseWebSocketImpl):
1067         Stop messaging the Timeline agent, we already message the Resource agent.
1068
1069         * inspector/InspectorTimelineAgent.cpp:
1070         (WebCore::InspectorTimelineAgent::didCreateWebSocket): Deleted.
1071         (WebCore::InspectorTimelineAgent::willSendWebSocketHandshakeRequest): Deleted.
1072         (WebCore::InspectorTimelineAgent::didReceiveWebSocketHandshakeResponse): Deleted.
1073         (WebCore::InspectorTimelineAgent::didDestroyWebSocket): Deleted.
1074         * inspector/InspectorTimelineAgent.h:
1075         * inspector/TimelineRecordFactory.h:
1076         (WebCore::TimelineRecordFactory::createWebSocketCreateData): Deleted.
1077         (WebCore::TimelineRecordFactory::createGenericWebSocketData): Deleted.
1078         This is all duplicate information from the network domain.
1079
1080 2015-10-28  Andy Estes  <aestes@apple.com>
1081
1082         [Content Filtering] Crash when allowing a 0-byte resource to load
1083         https://bugs.webkit.org/show_bug.cgi?id=150644
1084         <rdar://problem/23288538>
1085
1086         Reviewed by Darin Adler.
1087
1088         Test: contentfiltering/allow-empty-document.html
1089
1090         * loader/ContentFilter.cpp:
1091         (WebCore::ContentFilter::deliverResourceData): resourceBuffer will be null if the resource contained no data.
1092
1093 2015-10-28  Chris Dumez  <cdumez@apple.com>
1094
1095         Assertion failure in WebCore::FrameLoader::stopLoading() running fast/events tests
1096         https://bugs.webkit.org/show_bug.cgi?id=150624
1097
1098         Reviewed by Darin Adler.
1099
1100         After r191652, a form's target attribute can no longer refer to a frame's id,
1101         only its name. This is because the frame's id no longer sets the Window name
1102         when the frame's name attribute is missing. This caused a change in behavior
1103         for the fast/events/form-iframe-target-before-load-crash*.html tests, which
1104         exposed a pre-existing bug.
1105
1106         This patch updates the fast/events/form-iframe-target-before-load-crash*.html
1107         tests so they keep testing the same thing as before r191652. It also adds a
1108         variant to keep covering the newly exposed bug.
1109
1110         The issue was that the frame was no longer navigated when submitting the form
1111         (due to the form's target not matching the frame name). Therefore, when
1112         removing the iframe from the document, its navigation has not started yet and
1113         DocumentLoadTiming::navigationStart() is not initialized yet when
1114         FrameLoader::stopLoading() is called and we hit an assertion. This patch
1115         replaces the assertion with an if check as we now know it can happen and we
1116         have test coverage for it.
1117
1118         Test: fast/events/form-iframe-target-before-load-crash.html
1119
1120         * loader/FrameLoader.cpp:
1121         (WebCore::FrameLoader::stopLoading):
1122
1123 2015-10-28  Brian Burg  <bburg@apple.com>
1124
1125         Builtins generator should emit ENABLE(FEATURE) guards based on @conditional annotation
1126         https://bugs.webkit.org/show_bug.cgi?id=150536
1127
1128         Reviewed by Yusuke Suzuki.
1129
1130         Replace @optional=FEATURE with @conditional=ENABLE(FEATURE) in builtins files.
1131
1132         * Modules/streams/ByteLengthQueuingStrategy.js:
1133         * Modules/streams/CountQueuingStrategy.js:
1134         * Modules/streams/ReadableStream.js:
1135         * Modules/streams/ReadableStreamController.js:
1136         * Modules/streams/ReadableStreamInternals.js:
1137         * Modules/streams/ReadableStreamReader.js:
1138         * Modules/streams/StreamInternals.js:
1139         * Modules/streams/WritableStream.js:
1140         * Modules/streams/WritableStreamInternals.js:
1141
1142 2015-10-28  Zalan Bujtas  <zalan@apple.com>
1143
1144         Should never be reached failure in WebCore::backgroundRectForBox
1145         https://bugs.webkit.org/show_bug.cgi?id=150232
1146
1147         Reviewed by Simon Fraser.
1148
1149         We should never end up with simple container for composited layer when background-clip: text is present.
1150         (not even when the box has no decoration to paint)
1151
1152         Test: fast/backgrounds/background-clip-text-with-simple-container.html
1153
1154         * rendering/RenderLayerBacking.cpp:
1155         (WebCore::RenderLayerBacking::paintsBoxDecorations):
1156         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
1157         (WebCore::backgroundRectForBox):
1158
1159 2015-10-28  Chris Dumez  <cdumez@apple.com>
1160
1161         Use RunLoopTimer in DataURLDecoder to avoid issues related to runloops
1162         https://bugs.webkit.org/show_bug.cgi?id=150609
1163         <rdar://problem/22702894>
1164
1165         Reviewed by Antti Koivisto.
1166
1167         Use RunLoopTimer in DataURLDecoder to avoid issues related to RunLoops.
1168         In particular, the callOnMainThread() call could fail to dispatch the
1169         decoding result to the main thread if the client-side would spin its own
1170         RunLoop.
1171
1172         This is similar to the approach used in DocumentLoader for
1173         DocumentLoaderTimer.
1174
1175         No new tests, verified through manual testing.
1176
1177         * WebCore.xcodeproj/project.pbxproj:
1178         * loader/ResourceLoader.cpp:
1179         (WebCore::ResourceLoader::loadDataURL):
1180         * page/Page.cpp:
1181         (WebCore::Page::Page):
1182         * page/Page.h:
1183         * page/mac/PageMac.mm: Renamed from Source/WebCore/page/mac/PageMac.cpp.
1184         (WebCore::Page::platformInitialize):
1185         (WebCore::Page::addSchedulePair):
1186         (WebCore::Page::removeSchedulePair):
1187         * platform/network/DataURLDecoder.cpp:
1188         (WebCore::DataURLDecoder::DecodingResultDispatcher::dispatch):
1189         (WebCore::DataURLDecoder::DecodingResultDispatcher::DecodingResultDispatcher):
1190         (WebCore::DataURLDecoder::DecodingResultDispatcher::startTimer):
1191         (WebCore::DataURLDecoder::DecodingResultDispatcher::timerFired):
1192         (WebCore::DataURLDecoder::createDecodeTask):
1193         (WebCore::DataURLDecoder::decode):
1194         * platform/network/DataURLDecoder.h:
1195
1196 2015-10-28  Brady Eidson  <beidson@apple.com>
1197
1198         Modern IDB: Implement most readonly attributes of IDBObjectStore.
1199         https://bugs.webkit.org/show_bug.cgi?id=150617
1200
1201         Reviewed by Alex Christensen.
1202
1203         Test: storage/indexeddb/modern/objectstore-attributes.html
1204
1205         * Modules/indexeddb/IDBObjectStore.h:
1206
1207         * Modules/indexeddb/client/IDBAnyImpl.cpp:
1208         (WebCore::IDBClient::IDBAny::IDBAny):
1209         * Modules/indexeddb/client/IDBAnyImpl.h:
1210         (WebCore::IDBClient::IDBAny::create):
1211
1212         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
1213         (WebCore::IDBClient::IDBObjectStore::name):
1214         (WebCore::IDBClient::IDBObjectStore::keyPathAny):
1215         (WebCore::IDBClient::IDBObjectStore::keyPath):
1216         (WebCore::IDBClient::IDBObjectStore::transaction):
1217         (WebCore::IDBClient::IDBObjectStore::id): Deleted.
1218         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
1219
1220         * Modules/indexeddb/legacy/LegacyObjectStore.h:
1221         (WebCore::LegacyObjectStore::transaction):
1222
1223 2015-10-28  Hunseop Jeong  <hs85.jeong@samsung.com>
1224
1225         Replace 0 and NULL with nullptr in WebCore/editing.
1226         https://bugs.webkit.org/show_bug.cgi?id=150555
1227
1228         Reviewed by Darin Adler.
1229
1230         No new tests because there is no behavior change.
1231
1232         * editing/ApplyStyleCommand.cpp:
1233         (WebCore::ApplyStyleCommand::ApplyStyleCommand):
1234         (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
1235         (WebCore::ApplyStyleCommand::applyInlineStyle):
1236         * editing/ApplyStyleCommand.h:
1237         (WebCore::ApplyStyleCommand::shouldRemoveInlineStyleFromElement):
1238         * editing/CompositeEditCommand.cpp:
1239         (WebCore::CompositeEditCommand::applyCommandToComposite):
1240         (WebCore::CompositeEditCommand::deleteInsignificantText):
1241         * editing/DeleteSelectionCommand.cpp:
1242         (WebCore::DeleteSelectionCommand::DeleteSelectionCommand):
1243         (WebCore::DeleteSelectionCommand::initializeStartEnd):
1244         * editing/EditCommand.cpp:
1245         (WebCore::EditCommand::EditCommand):
1246         * editing/EditCommand.h:
1247         * editing/EditingStyle.cpp:
1248         (WebCore::HTMLElementEquivalent::HTMLElementEquivalent):
1249         * editing/EditingStyle.h:
1250         (WebCore::EditingStyle::conflictsWithInlineStyleOfElement):
1251         * editing/Editor.h:
1252         * editing/EditorCommand.cpp:
1253         (WebCore::Editor::commandIsSupportedFromMenuOrKeyBinding):
1254         (WebCore::Editor::Command::Command):
1255         * editing/FrameSelection.cpp:
1256         (WebCore::DragCaretController::setCaretPosition):
1257         (WebCore::FrameSelection::directionOfSelection):
1258         * editing/MarkupAccumulator.cpp:
1259         (WebCore::MarkupAccumulator::entityMaskForText):
1260         * editing/MarkupAccumulator.h:
1261         * editing/RenderedPosition.cpp:
1262         (WebCore::rendererFromPosition):
1263         (WebCore::RenderedPosition::RenderedPosition):
1264         * editing/RenderedPosition.h:
1265         (WebCore::RenderedPosition::operator==):
1266         (WebCore::RenderedPosition::uncachedInlineBox):
1267         (WebCore::RenderedPosition::RenderedPosition):
1268         * editing/ReplaceSelectionCommand.cpp:
1269         (WebCore::ReplaceSelectionCommand::handleStyleSpans):
1270         * editing/SetNodeAttributeCommand.cpp:
1271         (WebCore::SetNodeAttributeCommand::doUnapply):
1272         * editing/SmartReplaceCF.cpp:
1273         (WebCore::getSmartSet):
1274         * editing/SpellChecker.cpp:
1275         (WebCore::SpellCheckRequest::SpellCheckRequest):
1276         (WebCore::SpellCheckRequest::didSucceed):
1277         (WebCore::SpellCheckRequest::didCancel):
1278         (WebCore::SpellCheckRequest::setCheckerAndSequence):
1279         (WebCore::SpellCheckRequest::requesterDestroyed):
1280         (WebCore::SpellChecker::SpellChecker):
1281         * editing/SpellChecker.h:
1282         * editing/VisiblePosition.cpp:
1283         (WebCore::VisiblePosition::leftVisuallyDistinctCandidate):
1284         (WebCore::VisiblePosition::rightVisuallyDistinctCandidate):
1285         (WebCore::VisiblePosition::localCaretRect):
1286         (WebCore::enclosingBlockFlowElement):
1287         * editing/VisibleUnits.cpp:
1288         (WebCore::CachedLogicallyOrderedLeafBoxes::CachedLogicallyOrderedLeafBoxes):
1289         (WebCore::CachedLogicallyOrderedLeafBoxes::previousTextOrLineBreakBox):
1290         (WebCore::visualWordPosition):
1291         (WebCore::previousLinePosition):
1292         (WebCore::nextLinePosition):
1293         * editing/htmlediting.cpp:
1294         (WebCore::highestEnclosingNodeOfType):
1295         (WebCore::highestNodeToRemoveInPruning):
1296         * editing/htmlediting.h:
1297         (WebCore::firstPositionInOrBeforeNode):
1298         * editing/ios/EditorIOS.mm:
1299         (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
1300         (WebCore::Editor::fontForSelection):
1301         * editing/mac/AlternativeTextUIController.mm:
1302         (WebCore::AlternativeTextUIController::AlernativeTextContextController::alternativesForContext):
1303         * editing/mac/EditorMac.mm:
1304         (WebCore::Editor::fontForSelection):
1305         * editing/markup.cpp:
1306         * editing/markup.h:
1307
1308 2015-10-28  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1309
1310         [Streams API] Add write method to writable stream
1311         https://bugs.webkit.org/show_bug.cgi?id=150589
1312
1313         Reviewed by Darin Adler.
1314
1315         Write method implemented on writable streams according to the spec.
1316
1317         Current test set suffices. Expectations are updated accordingly.
1318
1319         * Modules/streams/WritableStream.js:
1320         (write):
1321
1322 2015-10-27  Hunseop Jeong  <hs85.jeong@samsung.com>
1323
1324         [Cairo] Incorrect dashed and dotted border painting after r177686.
1325         https://bugs.webkit.org/show_bug.cgi?id=141967
1326
1327         Reviewed by Gyuyoung Kim.
1328
1329         Fix the incorrect dashed/dotted border painting in cairo.
1330
1331         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1332         (WebCore::GraphicsContext::drawLine):
1333         (WebCore::calculateStrokePatternOffset): Deleted.
1334         (WebCore::drawLineOnCairoContext): Deleted.
1335
1336 2015-10-27  Chris Dumez  <cdumez@apple.com>
1337
1338         id of iframe incorrectly sets window name
1339         https://bugs.webkit.org/show_bug.cgi?id=150565
1340
1341         Reviewed by Darin Adler.
1342
1343         As per the specification, the iframe's contentWindow name should be an
1344         empty string if the frame's name attribute is unset:
1345         http://www.whatwg.org/specs/web-apps/current-work/multipage/the-iframe-element.html#attr-iframe-name
1346
1347         Instead, WebKit was using the iframe's id as window name if the name
1348         was unset.
1349
1350         Firefox, IE and Chrome behave according to the specification.
1351
1352         This is a merge of the following Blink commit:
1353         https://src.chromium.org/viewvc/blink?revision=169803&view=revision
1354
1355         Test: fast/frames/iframe-no-name.html
1356
1357         * html/HTMLFrameElementBase.cpp:
1358         (WebCore::HTMLFrameElementBase::parseAttribute):
1359         (WebCore::HTMLFrameElementBase::insertedInto): Deleted.
1360
1361 2015-10-27  Joseph Pecoraro  <pecoraro@apple.com>
1362
1363         Web Inspector: Remove Timeline MarkDOMContent and MarkLoad, data is already available
1364         https://bugs.webkit.org/show_bug.cgi?id=150615
1365
1366         Reviewed by Timothy Hatcher.
1367
1368         The timestamp only event data is already available from `Page.domContentEventFired`
1369         and `Page.loadEventFired` events. We can drop the Timeline specific events in
1370         favor of these which have existed for a very long time (before iOS 7).
1371
1372         * inspector/InspectorInstrumentation.cpp:
1373         (WebCore::InspectorInstrumentation::loadEventFiredImpl):
1374         (WebCore::InspectorInstrumentation::domContentLoadedEventFiredImpl): Deleted.
1375         * inspector/InspectorTimelineAgent.cpp:
1376         (WebCore::InspectorTimelineAgent::didMarkDOMContentEvent): Deleted.
1377         (WebCore::InspectorTimelineAgent::didMarkLoadEvent): Deleted.
1378         (WebCore::toProtocol): Deleted.
1379         * inspector/InspectorTimelineAgent.h:
1380         * inspector/TimelineRecordFactory.cpp:
1381         (WebCore::TimelineRecordFactory::createMarkData): Deleted.
1382         * inspector/TimelineRecordFactory.h:
1383
1384 2015-10-27  Jiewen Tan  <jiewen_tan@apple.com>
1385
1386         Null dereference loading Blink layout test editing/execCommand/format-block-uneditable-crash.html
1387         https://bugs.webkit.org/show_bug.cgi?id=150207
1388         <rdar://problem/23137066>
1389
1390         Reviewed by Enrica Casucci.
1391
1392         This is a merge of Blink r200238:
1393         https://codereview.chromium.org/1280263002
1394
1395         Test: editing/execCommand/format-block-uneditable-crash.html
1396
1397         * editing/ApplyBlockElementCommand.cpp:
1398         (WebCore::ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded):
1399         splitTextNode() will return early if the given text node is not editable. Hence, check
1400         its editablity before calling the method.
1401
1402 2015-10-27  Brady Eidson  <beidson@apple.com>
1403
1404         Modern IDB: IDBTransaction.objectStore() support.
1405         https://bugs.webkit.org/show_bug.cgi?id=150607
1406
1407         Reviewed by Alex Christensen.
1408
1409         Tests: storage/indexeddb/modern/aborted-put.html
1410                storage/indexeddb/modern/idbtransaction-objectstore-failures.html
1411
1412         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
1413         (WebCore::IDBClient::IDBObjectStore::put):
1414         
1415         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
1416         (WebCore::IDBClient::IDBTransaction::objectStore):
1417         (WebCore::IDBClient::IDBTransaction::createObjectStoreOnServer):
1418         * Modules/indexeddb/client/IDBTransactionImpl.h:
1419         
1420         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
1421         (WebCore::IDBServer::MemoryBackingStoreTransaction::addExistingObjectStore):
1422         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
1423         
1424         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1425         (WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction):
1426         
1427         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
1428         (WebCore::IDBDatabaseInfo::infoForExistingObjectStore):
1429         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
1430         
1431         * Modules/indexeddb/shared/IDBTransactionInfo.h:
1432         (WebCore::IDBTransactionInfo::objectStores):
1433
1434 2015-10-27  Joseph Pecoraro  <pecoraro@apple.com>
1435
1436         Web Inspector: Remove unused / duplicated XHR timeline instrumentation
1437         https://bugs.webkit.org/show_bug.cgi?id=150605
1438
1439         Reviewed by Timothy Hatcher.
1440
1441         These records are just duplicates of "EventDispatch" records for XHR
1442         load and readystatechange events. Due to the nesting, the XHR records
1443         were themselves never getting looked at, and their data (URL / readyState)
1444         not shown in the frontend.
1445
1446         * inspector/InspectorInstrumentation.cpp:
1447         (WebCore::InspectorInstrumentation::willDispatchXHRReadyStateChangeEventImpl): Deleted.
1448         (WebCore::InspectorInstrumentation::didDispatchXHRReadyStateChangeEventImpl): Deleted.
1449         (WebCore::InspectorInstrumentation::willDispatchXHRLoadEventImpl): Deleted.
1450         (WebCore::InspectorInstrumentation::didDispatchXHRLoadEventImpl): Deleted.
1451         * inspector/InspectorInstrumentation.h:
1452         (WebCore::InspectorInstrumentation::willDispatchXHRReadyStateChangeEvent): Deleted.
1453         (WebCore::InspectorInstrumentation::didDispatchXHRReadyStateChangeEvent): Deleted.
1454         (WebCore::InspectorInstrumentation::willDispatchXHRLoadEvent): Deleted.
1455         (WebCore::InspectorInstrumentation::didDispatchXHRLoadEvent): Deleted.
1456         * inspector/InspectorTimelineAgent.cpp:
1457         (WebCore::InspectorTimelineAgent::willDispatchXHRReadyStateChangeEvent): Deleted.
1458         (WebCore::InspectorTimelineAgent::didDispatchXHRReadyStateChangeEvent): Deleted.
1459         (WebCore::InspectorTimelineAgent::willDispatchXHRLoadEvent): Deleted.
1460         (WebCore::InspectorTimelineAgent::didDispatchXHRLoadEvent): Deleted.
1461         (WebCore::toProtocol): Deleted.
1462         * inspector/InspectorTimelineAgent.h:
1463         * inspector/TimelineRecordFactory.cpp:
1464         (WebCore::TimelineRecordFactory::createXHRReadyStateChangeData): Deleted.
1465         (WebCore::TimelineRecordFactory::createXHRLoadData): Deleted.
1466         * inspector/TimelineRecordFactory.h:
1467         * xml/XMLHttpRequest.cpp:
1468         (WebCore::XMLHttpRequest::callReadyStateChangeListener): Deleted.
1469
1470 2015-10-27  Joseph Pecoraro  <pecoraro@apple.com>
1471
1472         Web Inspector: Do not send RenderingFrame TimelineRecords that have no children
1473         https://bugs.webkit.org/show_bug.cgi?id=150600
1474
1475         Reviewed by Timothy Hatcher.
1476
1477         * inspector/InspectorTimelineAgent.cpp:
1478         (WebCore::InspectorTimelineAgent::didCompleteCurrentRecord):
1479         The frontend already filters out empty RenderingFrame records
1480         (in TimelineManager.prototype._processRecord). Filter them out
1481         on the backend to reduce protocol traffic / noise.
1482
1483 2015-10-27  Alex Christensen  <achristensen@webkit.org>
1484
1485         Cancel navigation policy checks like we do content policy checks.
1486         https://bugs.webkit.org/show_bug.cgi?id=150582
1487         rdar://problem/22077579
1488
1489         Reviewed by Brent Fulgham.
1490
1491         This was verified manually and I'll write a layout test for it soon.
1492
1493         * loader/DocumentLoader.cpp:
1494         (WebCore::DocumentLoader::DocumentLoader):
1495         (WebCore::DocumentLoader::~DocumentLoader):
1496         (WebCore::DocumentLoader::willSendRequest):
1497         (WebCore::DocumentLoader::continueAfterNavigationPolicy):
1498         (WebCore::DocumentLoader::cancelPolicyCheckIfNeeded):
1499         * loader/DocumentLoader.h:
1500         Add a bool to keep track of whether we are waiting for navigation policy checks, like we do with content policy checks.
1501         Without this check, sometimes callbacks are made to DocumentLoaders that do not exist any more because they do not get
1502         cancelled by cancelPolicyCheckIfNeeded when detaching from the frame.
1503
1504 2015-10-27  Brady Eidson  <beidson@apple.com>
1505
1506         Modern IDB: Support IDBObjectStore.put/get support.
1507         https://bugs.webkit.org/show_bug.cgi?id=150468
1508
1509         Reviewed by Alex Christensen.
1510
1511         Tests: storage/indexeddb/modern/basic-put.html
1512                storage/indexeddb/modern/keypath-basic.html
1513
1514         * CMakeLists.txt:
1515         * WebCore.xcodeproj/project.pbxproj:
1516
1517         * Modules/indexeddb/IDBKeyData.cpp:
1518         (WebCore::IDBKeyData::deletedValue):
1519         (WebCore::IDBKeyData::operator<):
1520         (WebCore::IDBKeyData::operator==):
1521         * Modules/indexeddb/IDBKeyData.h:
1522         (WebCore::IDBKeyData::isValid):
1523         (WebCore::IDBKeyData::operator!=):
1524         (WebCore::IDBKeyData::hash):
1525         (WebCore::IDBKeyData::isDeletedValue):
1526         (WebCore::IDBKeyDataHash::hash):
1527         (WebCore::IDBKeyDataHash::equal):
1528         (WebCore::IDBKeyDataHashTraits::constructDeletedValue):
1529         (WebCore::IDBKeyDataHashTraits::isDeletedValue):
1530         (WebCore::IDBKeyDataHashTraits::emptyValue):
1531         (WebCore::IDBKeyDataHashTraits::isEmptyValue):
1532
1533         * Modules/indexeddb/IndexedDB.h:
1534
1535         * Modules/indexeddb/client/IDBAnyImpl.cpp:
1536         (WebCore::IDBClient::IDBAny::IDBAny):
1537         (WebCore::IDBClient::IDBAny::modernIDBObjectStore):
1538         * Modules/indexeddb/client/IDBAnyImpl.h:
1539         (WebCore::IDBClient::IDBAny::create):
1540
1541         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1542         (WebCore::IDBClient::IDBConnectionToServer::createObjectStore):
1543         (WebCore::IDBClient::IDBConnectionToServer::didCreateObjectStore):
1544         (WebCore::IDBClient::IDBConnectionToServer::putOrAdd):
1545         (WebCore::IDBClient::IDBConnectionToServer::didPutOrAdd):
1546         (WebCore::IDBClient::IDBConnectionToServer::getRecord):
1547         (WebCore::IDBClient::IDBConnectionToServer::didGetRecord):
1548         (WebCore::IDBClient::IDBConnectionToServer::saveOperation):
1549         (WebCore::IDBClient::IDBConnectionToServer::completeOperation):
1550         * Modules/indexeddb/client/IDBConnectionToServer.h:
1551         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
1552
1553         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
1554         (WebCore::IDBClient::IDBObjectStore::autoIncrement):
1555         (WebCore::IDBClient::IDBObjectStore::put):
1556         (WebCore::IDBClient::IDBObjectStore::get):
1557         (WebCore::IDBClient::IDBObjectStore::putOrAdd):
1558         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
1559         (WebCore::IDBClient::IDBObjectStore::info):
1560
1561         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
1562         (WebCore::IDBClient::IDBOpenDBRequest::IDBOpenDBRequest): Deleted.
1563
1564         * Modules/indexeddb/client/IDBRequestImpl.cpp:
1565         (WebCore::IDBClient::IDBRequest::create):
1566         (WebCore::IDBClient::IDBRequest::IDBRequest):
1567         (WebCore::IDBClient::IDBRequest::sourceObjectStoreIdentifier):
1568         (WebCore::IDBClient::IDBRequest::hasPendingActivity):
1569         (WebCore::IDBClient::IDBRequest::dispatchEvent):
1570         (WebCore::IDBClient::IDBRequest::setResult):
1571         (WebCore::IDBClient::IDBRequest::setResultToStructuredClone):
1572         (WebCore::IDBClient::IDBRequest::requestCompleted):
1573         (WebCore::IDBClient::IDBRequest::onError):
1574         (WebCore::IDBClient::IDBRequest::onSuccess):
1575         * Modules/indexeddb/client/IDBRequestImpl.h:
1576
1577         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
1578         (WebCore::IDBClient::IDBTransaction::IDBTransaction):
1579         (WebCore::IDBClient::IDBTransaction::hasPendingActivity):
1580         (WebCore::IDBClient::IDBTransaction::isActive):
1581         (WebCore::IDBClient::IDBTransaction::operationTimerFired):
1582         (WebCore::IDBClient::IDBTransaction::commit):
1583         (WebCore::IDBClient::IDBTransaction::didAbort):
1584         (WebCore::IDBClient::IDBTransaction::createObjectStoreOnServer):
1585         (WebCore::IDBClient::IDBTransaction::requestGetRecord):
1586         (WebCore::IDBClient::IDBTransaction::getRecordOnServer):
1587         (WebCore::IDBClient::IDBTransaction::didGetRecordOnServer):
1588         (WebCore::IDBClient::IDBTransaction::requestPutOrAdd):
1589         (WebCore::IDBClient::IDBTransaction::putOrAddOnServer):
1590         (WebCore::IDBClient::IDBTransaction::didPutOrAddOnServer):
1591         (WebCore::IDBClient::IDBTransaction::activate):
1592         (WebCore::IDBClient::IDBTransaction::deactivate):
1593         * Modules/indexeddb/client/IDBTransactionImpl.h:
1594         (WebCore::IDBClient::IDBTransaction::isReadOnly):
1595         (WebCore::IDBClient::TransactionActivator::TransactionActivator):
1596         (WebCore::IDBClient::TransactionActivator::~TransactionActivator):
1597
1598         * Modules/indexeddb/client/TransactionOperation.cpp: 
1599         (WebCore::IDBClient::TransactionOperation::TransactionOperation):
1600         * Modules/indexeddb/client/TransactionOperation.h:
1601         (WebCore::IDBClient::TransactionOperation::objectStoreIdentifier):
1602         (WebCore::IDBClient::TransactionOperation::transaction):
1603         (WebCore::IDBClient::createTransactionOperation):
1604
1605         * Modules/indexeddb/server/IDBBackingStore.h:
1606         
1607         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
1608         (WebCore::IDBServer::IDBConnectionToClient::didPutOrAdd):
1609         (WebCore::IDBServer::IDBConnectionToClient::didGetRecord):
1610         * Modules/indexeddb/server/IDBConnectionToClient.h:
1611         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
1612
1613         * Modules/indexeddb/server/IDBServer.cpp:
1614         (WebCore::IDBServer::IDBServer::putOrAdd):
1615         (WebCore::IDBServer::IDBServer::getRecord):
1616         * Modules/indexeddb/server/IDBServer.h:
1617
1618         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
1619         (WebCore::IDBServer::MemoryBackingStoreTransaction::recordValueChanged):
1620         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
1621         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
1622
1623         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1624         (WebCore::IDBServer::MemoryIDBBackingStore::keyExistsInObjectStore):
1625         (WebCore::IDBServer::MemoryIDBBackingStore::deleteRecord):
1626         (WebCore::IDBServer::MemoryIDBBackingStore::putRecord):
1627         (WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
1628         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
1629
1630         * Modules/indexeddb/server/MemoryObjectStore.cpp:
1631         (WebCore::IDBServer::MemoryObjectStore::containsRecord):
1632         (WebCore::IDBServer::MemoryObjectStore::deleteRecord):
1633         (WebCore::IDBServer::MemoryObjectStore::putRecord):
1634         (WebCore::IDBServer::MemoryObjectStore::valueForKey):
1635         * Modules/indexeddb/server/MemoryObjectStore.h:
1636
1637         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1638         (WebCore::IDBServer::UniqueIDBDatabase::storeCallback):
1639         (WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
1640         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
1641         (WebCore::IDBServer::UniqueIDBDatabase::didPerformPutOrAdd):
1642         (WebCore::IDBServer::UniqueIDBDatabase::getRecord):
1643         (WebCore::IDBServer::UniqueIDBDatabase::performGetRecord):
1644         (WebCore::IDBServer::UniqueIDBDatabase::didPerformGetRecord):
1645         (WebCore::IDBServer::UniqueIDBDatabase::performKeyDataCallback):
1646         (WebCore::IDBServer::UniqueIDBDatabase::performValueDataCallback):
1647         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1648
1649         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
1650         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::isReadOnly):
1651         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::putOrAdd):
1652         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getRecord):
1653         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
1654
1655         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
1656         (WebCore::IDBDatabaseInfo::infoForExistingObjectStore):
1657         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
1658
1659         * Modules/indexeddb/shared/IDBError.cpp:
1660         (WebCore::idbErrorName):
1661         (WebCore::idbErrorDescription):
1662         * Modules/indexeddb/shared/IDBError.h:
1663
1664         * Modules/indexeddb/shared/IDBRequestData.cpp:
1665         (WebCore::IDBRequestData::IDBRequestData):
1666         (WebCore::IDBRequestData::serverConnectionIdentifier):
1667         (WebCore::IDBRequestData::objectStoreIdentifier):
1668         * Modules/indexeddb/shared/IDBRequestData.h:
1669
1670         * Modules/indexeddb/shared/IDBResultData.cpp:
1671         (WebCore::IDBResultData::IDBResultData):
1672         (WebCore::IDBResultData::putOrAddSuccess):
1673         (WebCore::IDBResultData::getRecordSuccess):
1674         * Modules/indexeddb/shared/IDBResultData.h:
1675         (WebCore::IDBResultData::resultKey):
1676         (WebCore::IDBResultData::resultData):
1677
1678         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
1679         (WebCore::InProcessIDBServer::didPutOrAdd):
1680         (WebCore::InProcessIDBServer::didGetRecord):
1681         (WebCore::InProcessIDBServer::putOrAdd):
1682         (WebCore::InProcessIDBServer::getRecord):
1683         * Modules/indexeddb/shared/InProcessIDBServer.h:
1684
1685         * bindings/js/IDBBindingUtilities.cpp:
1686         (WebCore::idbKeyToJSValue):
1687         (WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath):
1688         (WebCore::canInjectIDBKeyIntoScriptValue):
1689         (WebCore::deserializeIDBValueData):
1690         (WebCore::scriptValueToIDBKey):
1691         (WebCore::idbKeyDataToScriptValue):
1692         * bindings/js/IDBBindingUtilities.h:
1693
1694         * platform/CrossThreadCopier.cpp:
1695         (WebCore::ThreadSafeDataBuffer>::copy):
1696         * platform/CrossThreadCopier.h:
1697
1698         * platform/ThreadSafeDataBuffer.h: Added.
1699         (WebCore::ThreadSafeDataBufferImpl::ThreadSafeDataBufferImpl):
1700         (WebCore::ThreadSafeDataBuffer::adoptVector):
1701         (WebCore::ThreadSafeDataBuffer::copyVector):
1702         (WebCore::ThreadSafeDataBuffer::ThreadSafeDataBuffer):
1703         (WebCore::ThreadSafeDataBuffer::data):
1704
1705 2015-10-27  Tim Horton  <timothy_horton@apple.com>
1706
1707         WKView being inside WKWebView leads to weird API issues
1708         https://bugs.webkit.org/show_bug.cgi?id=150174
1709
1710         Reviewed by Anders Carlsson.
1711
1712         * platform/spi/cg/CoreGraphicsSPI.h:
1713
1714 2015-10-27  Zhuo Li  <zachli@apple.com>
1715
1716         Add WebKit API to clear data type Search Field Recent Searches.
1717         https://bugs.webkit.org/show_bug.cgi?id=150019.
1718
1719         Reviewed by Anders Carlsson.
1720
1721         * platform/cocoa/SearchPopupMenuCocoa.h: Add a function to remove recent searches based on
1722         time.
1723         * platform/cocoa/SearchPopupMenuCocoa.mm:
1724         (WebCore::typeCheckedRecentSearchesArray): Return nil if the recent searches array is
1725         corrupted, otherwise return the array.
1726         (WebCore::typeCheckedDateInRecentSearch): Return nil if the date in recent search is
1727         corrupted, otherwise return the date.
1728         (WebCore::typeCheckedRecentSearchesRemovingRecentSearchesAddedAfterDate): Return nil if the recent searches plist is
1729         corrupted, otherwise return the recent searches plist.
1730         (WebCore::writeEmptyRecentSearchesPlist): Replace the existing recent searches plist if there is
1731         any with a clean one.
1732         (WebCore::loadRecentSearches): Use -typeCheckedRecentSearchesArray and -typeCheckedDateInRecentSearch.
1733         (WebCore::removeRecentlyModifiedRecentSearches):
1734         When the time passed in is equivalent to [NSDate distantPast], clear all recent searches in
1735         the Recent Searches plist. Otherwise, we only clear the recent searches that were created
1736         after or at the time that is passed in as the parameter. If all recent searches associated
1737         with an autosave name were created after or at the time that is passed in as the parameter,
1738         remove this autosave name key and all of its values in the plist. If all recent searches
1739         associated with every autosave name in the plist were created after or at the time that is
1740         passed in as the parameter, clear all recent searches in the Recent Searches plist.
1741
1742         Also, we clear all recent searches in the Recent Searches plist when we find the plist is
1743         corrupted.
1744
1745 2015-10-27  Keith Rollin  <krollin@apple.com>
1746
1747         Do not sanitize user input for input[type=url]
1748         https://bugs.webkit.org/show_bug.cgi?id=150346
1749         <rdar://problem/23243240>
1750
1751         Reviewed by Darin Adler.
1752
1753         Do not sanitize user input in text-based input fields that support
1754         the Selection API, in order to not break JavaScript code that expects
1755         element.value to match what's on the screen.
1756
1757         Test: fast/forms/input-user-input-sanitization.html
1758
1759         * html/TextFieldInputType.cpp:
1760         (WebCore::TextFieldInputType::subtreeHasChanged):
1761
1762 2015-10-20  Zalan Bujtas  <zalan@apple.com>
1763
1764         Subpixel layout: Convert RenderTable* and AutoTableLayout to use LayoutUnit.
1765         https://bugs.webkit.org/show_bug.cgi?id=149366
1766
1767         Reviewed by David Hyatt.
1768
1769         This patch enables non-integral cell space distribution for both
1770         auto and fixed table layout.
1771         Due to the tight layout, float is used to calculate each cell's dimension/position and
1772         we convert them to LayoutUnits while said values are set on the renderer.
1773         Due to the (lack of) LayoutUnit precision, a fudge factor is applied on table cell's minimum width.   
1774
1775         Collapsed table borders are still integral based, tracked here: webkit.org/b/150383
1776
1777         Covered by existing tests.
1778
1779         (WebCore::RenderTableSection::firstLineBaseline): Baseline is still integral (same as normal line layout)
1780         * rendering/RenderTreeAsText.cpp: flooring produces the least amount of rebaseline diff (still over 1200 tests). It doesn't really matter which direction we round
1781         as long as it is consistent.
1782         (WebCore::writeTextRun):
1783         (WebCore::writeSimpleLine):
1784         * platform/graphics/LayoutRect.h:
1785         (WebCore::LayoutRect::LayoutRect):
1786         * rendering/AutoTableLayout.cpp:
1787         (WebCore::AutoTableLayout::recalcColumn):
1788         (WebCore::AutoTableLayout::computeIntrinsicLogicalWidths):
1789         (WebCore::AutoTableLayout::applyPreferredLogicalWidthQuirks):
1790         (WebCore::AutoTableLayout::calcEffectiveLogicalWidth):
1791         (WebCore::AutoTableLayout::layout):
1792         * rendering/AutoTableLayout.h:
1793         * rendering/FixedTableLayout.cpp:
1794         (WebCore::FixedTableLayout::calcWidthArray):
1795         (WebCore::FixedTableLayout::applyPreferredLogicalWidthQuirks):
1796         (WebCore::FixedTableLayout::layout):
1797         * rendering/FixedTableLayout.h:
1798         * rendering/RenderBlock.cpp:
1799         (WebCore::RenderBlock::computePreferredLogicalWidths):
1800         * rendering/RenderTable.cpp:
1801         (WebCore::RenderTable::updateLogicalWidth):
1802         (WebCore::RenderTable::distributeExtraLogicalHeight):
1803         (WebCore::RenderTable::layout):
1804         (WebCore::RenderTable::addOverflowFromChildren):
1805         (WebCore::RenderTable::computePreferredLogicalWidths):
1806         (WebCore::RenderTable::offsetWidthForColumn):
1807         (WebCore::RenderTable::calcBorderStart):
1808         (WebCore::RenderTable::calcBorderEnd):
1809         (WebCore::RenderTable::outerBorderBefore):
1810         (WebCore::RenderTable::outerBorderAfter):
1811         (WebCore::RenderTable::outerBorderStart):
1812         (WebCore::RenderTable::outerBorderEnd):
1813         * rendering/RenderTable.h:
1814         (WebCore::RenderTable::hBorderSpacing):
1815         (WebCore::RenderTable::vBorderSpacing):
1816         (WebCore::RenderTable::outerBorderLeft):
1817         (WebCore::RenderTable::outerBorderRight):
1818         (WebCore::RenderTable::outerBorderTop):
1819         (WebCore::RenderTable::outerBorderBottom):
1820         (WebCore::RenderTable::columnPositions):
1821         (WebCore::RenderTable::setColumnPosition):
1822         * rendering/RenderTableCell.cpp:
1823         (WebCore::RenderTableCell::logicalWidthFromColumns):
1824         (WebCore::RenderTableCell::computeIntrinsicPadding):
1825         (WebCore::RenderTableCell::setCellLogicalWidth):
1826         (WebCore::RenderTableCell::layout):
1827         (WebCore::RenderTableCell::paddingTop):
1828         (WebCore::RenderTableCell::paddingBottom):
1829         (WebCore::RenderTableCell::paddingLeft):
1830         (WebCore::RenderTableCell::paddingRight):
1831         (WebCore::RenderTableCell::paddingBefore):
1832         (WebCore::RenderTableCell::paddingAfter):
1833         (WebCore::RenderTableCell::clippedOverflowRectForRepaint):
1834         (WebCore::RenderTableCell::borderLeft):
1835         (WebCore::RenderTableCell::borderRight):
1836         (WebCore::RenderTableCell::borderTop):
1837         (WebCore::RenderTableCell::borderBottom):
1838         (WebCore::RenderTableCell::borderStart):
1839         (WebCore::RenderTableCell::borderEnd):
1840         (WebCore::RenderTableCell::borderBefore):
1841         (WebCore::RenderTableCell::borderAfter):
1842         (WebCore::RenderTableCell::borderHalfLeft):
1843         (WebCore::RenderTableCell::borderHalfRight):
1844         (WebCore::RenderTableCell::borderHalfTop):
1845         (WebCore::RenderTableCell::borderHalfBottom):
1846         (WebCore::RenderTableCell::borderHalfStart):
1847         (WebCore::RenderTableCell::borderHalfEnd):
1848         (WebCore::RenderTableCell::borderHalfBefore):
1849         (WebCore::RenderTableCell::borderHalfAfter):
1850         (WebCore::CollapsedBorders::addBorder):
1851         (WebCore::RenderTableCell::paintCollapsedBorders):
1852         (WebCore::RenderTableCell::paintBackgroundsBehindCell):
1853         (WebCore::RenderTableCell::paintBoxDecorations):
1854         (WebCore::RenderTableCell::paintMask):
1855         * rendering/RenderTableCell.h:
1856         (WebCore::RenderTableCell::logicalHeightForRowSizing):
1857         * rendering/RenderTableSection.cpp:
1858         (WebCore::RenderTableSection::calcRowLogicalHeight):
1859         (WebCore::RenderTableSection::layout):
1860         (WebCore::RenderTableSection::distributeExtraLogicalHeightToPercentRows):
1861         (WebCore::RenderTableSection::distributeExtraLogicalHeightToAutoRows):
1862         (WebCore::RenderTableSection::distributeRemainingExtraLogicalHeight):
1863         (WebCore::RenderTableSection::distributeExtraLogicalHeightToRows):
1864         (WebCore::RenderTableSection::layoutRows):
1865         (WebCore::RenderTableSection::calcOuterBorderBefore):
1866         (WebCore::RenderTableSection::calcOuterBorderAfter):
1867         (WebCore::RenderTableSection::calcOuterBorderStart):
1868         (WebCore::RenderTableSection::calcOuterBorderEnd):
1869         (WebCore::RenderTableSection::logicalRectForWritingModeAndDirection):
1870         (WebCore::RenderTableSection::dirtiedColumns):
1871         (WebCore::RenderTableSection::spannedColumns):
1872         (WebCore::RenderTableSection::offsetLeftForRowGroupBorder):
1873         (WebCore::RenderTableSection::offsetTopForRowGroupBorder):
1874         (WebCore::RenderTableSection::verticalRowGroupBorderHeight):
1875         (WebCore::RenderTableSection::horizontalRowGroupBorderWidth):
1876         (WebCore::RenderTableSection::paintRowGroupBorderIfRequired):
1877         (WebCore::RenderTableSection::setLogicalPositionForCell):
1878         * rendering/RenderTableSection.h:
1879         (WebCore::RenderTableSection::outerBorderLeft):
1880         (WebCore::RenderTableSection::outerBorderRight):
1881         (WebCore::RenderTableSection::outerBorderTop):
1882         (WebCore::RenderTableSection::outerBorderBottom):
1883         * rendering/style/CollapsedBorderValue.h:
1884         (WebCore::CollapsedBorderValue::CollapsedBorderValue):
1885         (WebCore::CollapsedBorderValue::width):
1886
1887 2015-10-27  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1888
1889         [Streams API] Add close method to writable stream
1890         https://bugs.webkit.org/show_bug.cgi?id=150560
1891
1892         Reviewed by Darin Adler.
1893
1894         Added the close method which requires three additional writable stream internal functions plus a queuing
1895         function to retrieve a value from the queue according to the spec.
1896
1897         Current test set suffices. Expectations were updated accordingly.
1898
1899         * Modules/streams/StreamInternals.js:
1900         (peekQueueValue):
1901         * Modules/streams/WritableStream.js:
1902         (close):
1903         * Modules/streams/WritableStreamInternals.js:
1904         (callOrScheduleWritableStreamAdvanceQueue):
1905         (writableStreamAdvanceQueue):
1906         (closeWritableStream): Added as per spec.
1907
1908 2015-10-26  Brady Eidson  <beidson@apple.com>
1909
1910         Make IDBKeyData from a struct to a class.
1911         https://bugs.webkit.org/show_bug.cgi?id=150576
1912
1913         Reviewed by Alex Christensen.
1914
1915         No new tests (No change in behavior).
1916
1917         * Modules/indexeddb/IDBKeyData.cpp:
1918         (WebCore::IDBKeyData::IDBKeyData):
1919         (WebCore::IDBKeyData::maybeCreateIDBKey):
1920         (WebCore::IDBKeyData::isolatedCopy):
1921         (WebCore::IDBKeyData::encode):
1922         (WebCore::IDBKeyData::decode):
1923         (WebCore::IDBKeyData::compare):
1924         (WebCore::IDBKeyData::loggingString):
1925         (WebCore::IDBKeyData::setArrayValue):
1926         (WebCore::IDBKeyData::setStringValue):
1927         (WebCore::IDBKeyData::setDateValue):
1928         (WebCore::IDBKeyData::setNumberValue):
1929         * Modules/indexeddb/IDBKeyData.h:
1930         (WebCore::IDBKeyData::IDBKeyData):
1931         (WebCore::IDBKeyData::minimum):
1932         (WebCore::IDBKeyData::maximum):
1933         (WebCore::IDBKeyData::isNull):
1934         (WebCore::IDBKeyData::type):
1935         (WebCore::IDBKeyData::encode):
1936         (WebCore::IDBKeyData::decode):
1937         * Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp:
1938         (WebCore::GetOperation::perform):
1939         * bindings/js/IDBBindingUtilities.h:
1940         * platform/CrossThreadCopier.h:
1941
1942 2015-10-26  Philip Chimento  <philip.chimento@gmail.com>
1943
1944         [GTK] [Stable] Build GL texture mapper only if USE_TEXTURE_MAPPER_GL
1945         https://bugs.webkit.org/show_bug.cgi?id=148606
1946
1947         Unreviewed, build-only change.
1948
1949         No new tests, build-only change.
1950
1951         * PlatformGTK.cmake: Remove sources requiring GL from list of
1952         sources that are built when USE_TEXTURE_MAPPER is true, and add a
1953         separate condition within the USE_TEXTURE_MAPPER condition to
1954         build those sources when USE_TEXTURE_MAPPER_GL is true.
1955
1956 2015-10-26  Simon Fraser  <simon.fraser@apple.com>
1957
1958         Remove redundant GraphicsContext::clip(const Path&, WindRule)
1959         https://bugs.webkit.org/show_bug.cgi?id=150584
1960
1961         Reviewed by Tim Horton.
1962
1963         GraphicsContext had both clipPath(const Path&, WindRule) and clip(const Path&, WindRule),
1964         which were mostly the same other than GraphicsContext::clipPath() not clipping if the path
1965         was empty (added, I think by mistake, in r72926), and not calling m_data->clip().
1966
1967         Make clipPath() be the winner, and have it behave like clip() with empty paths, and call m_data->clip().
1968
1969         * platform/graphics/GraphicsContext.cpp:
1970         (WebCore::GraphicsContext::clipRoundedRect):
1971         * platform/graphics/GraphicsContext.h:
1972         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1973         (WebCore::GraphicsContext::clipPath):
1974         (WebCore::GraphicsContext::clip): Deleted.
1975         * platform/graphics/cg/GraphicsContextCG.cpp:
1976         (WebCore::GraphicsContext::clipPath):
1977         (WebCore::GraphicsContext::canvasClip):
1978         (WebCore::GraphicsContext::clip): Deleted.
1979         * rendering/RenderBoxModelObject.cpp:
1980         (WebCore::RenderBoxModelObject::paintBoxShadow): Making a path, calling addRoundedRect() and then clipping
1981         to the path is the same as context.clipRoundedRect().
1982         * rendering/mathml/RenderMathMLRadicalOperator.cpp:
1983         (WebCore::RenderMathMLRadicalOperator::paint):
1984
1985 2015-10-26  Zalan Bujtas  <zalan@apple.com>
1986
1987         Floating box is misplaced after content change.
1988         https://bugs.webkit.org/show_bug.cgi?id=150271
1989
1990         Reviewed by David Hyatt.
1991
1992         Collapse anonymous block when as the result of a sibling removal only floating siblings are left.
1993
1994         Test: fast/block/collapse-anon-block-with-float-siblings-only.html
1995
1996         * rendering/RenderBlock.cpp:
1997         (WebCore::canCollapseAnonymousBlock):
1998         (WebCore::canMergeContiguousAnonymousBlocks):
1999         (WebCore::RenderBlock::collapseAnonymousBoxChild):
2000         (WebCore::RenderBlock::removeChild):
2001         (WebCore::canMergeAnonymousBlock): Deleted.
2002         * rendering/RenderBlock.h:
2003         * rendering/RenderElement.cpp:
2004         (WebCore::RenderElement::removeAnonymousWrappersForInlinesIfNecessary):
2005
2006 2015-10-26  Jiewen Tan  <jiewen_tan@apple.com>
2007
2008         Null dereference loading Blink layout test editing/execCommand/crash-replacing-list-by-list.html
2009         https://bugs.webkit.org/show_bug.cgi?id=149288
2010         <rdar://problem/22746310>
2011
2012         Reviewed by Chris Dumez.
2013
2014         This is a merge of Blink r170821:
2015         https://codereview.chromium.org/220233013
2016
2017         Test: editing/execCommand/crash-replacing-list-by-list.html
2018
2019         * editing/ReplaceSelectionCommand.cpp:
2020         (WebCore::ReplaceSelectionCommand::insertAsListItems):
2021
2022 2015-10-26  Jiewen Tan  <jiewen_tan@apple.com>
2023
2024         Null dereference loading Blink layout test editing/execCommand/insert-image-changing-visibility-crash.html
2025         https://bugs.webkit.org/show_bug.cgi?id=150208
2026         <rdar://problem/23137109>
2027
2028         Reviewed by Chris Dumez.
2029
2030         This is a merge from Blink r168502:
2031         https://codereview.chromium.org/183893018
2032
2033         Test: editing/execCommand/insert-image-changing-visibility-crash.html
2034
2035         * editing/ReplaceSelectionCommand.cpp:
2036         (WebCore::ReplaceSelectionCommand::doApply):
2037         We should check again the visibility of the inserted position again since
2038         the replacement might change the visibility.
2039
2040 2015-10-26  Jiewen Tan  <jiewen_tan@apple.com>
2041
2042         Null dereference loading Blink layout test editing/execCommand/insert-ordered-list-crash.html
2043         https://bugs.webkit.org/show_bug.cgi?id=150209
2044         <rdar://problem/23137198>
2045
2046         Reviewed by Chris Dumez.
2047
2048         This is a merge from Blink r168006:
2049         https://codereview.chromium.org/181283002
2050
2051         Test: editing/execCommand/insert-ordered-list-crash.html
2052
2053         * editing/InsertListCommand.cpp:
2054         (WebCore::InsertListCommand::doApply):
2055         setEndingSelection() might change endingSelection(), we should check again.
2056
2057 2015-10-26  Jiewen Tan  <jiewen_tan@apple.com>
2058
2059         Null dereference loading Blink layout test editing/execCommand/insert-html-to-document-element-crash.html
2060         https://bugs.webkit.org/show_bug.cgi?id=149294
2061         <rdar://problem/22746657>
2062
2063         Reviewed by Darin Adler.
2064
2065         This is a merge of Blink r175019:
2066         https://codereview.chromium.org/300143012
2067
2068         Test: editing/execCommand/insert-html-to-document-element-crash.html
2069
2070         * editing/ReplaceSelectionCommand.cpp:
2071         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
2072         check nullable value |element->parentNode()| before using it.
2073
2074 2015-10-26  Jiewen Tan  <jiewen_tan@apple.com>
2075
2076         Null dereference loading Blink layout test editing/execCommand/indent-nested-blockquotes-crash.html
2077         https://bugs.webkit.org/show_bug.cgi?id=149291
2078         <rdar://problem/22746473>
2079
2080         Reviewed by Darin Adler.
2081
2082         This is a merge of Blink r172967:
2083         https://codereview.chromium.org/251723003
2084
2085         Test: editing/execCommand/indent-nested-blockquotes-crash.html
2086
2087         * editing/CompositeEditCommand.cpp:
2088         (WebCore::CompositeEditCommand::insertNodeAfter):
2089
2090 2015-10-26  Brady Eidson  <beidson@apple.com>
2091
2092         Modern IDB: Backing store objectStores (plumbing for b/150468).
2093         https://bugs.webkit.org/show_bug.cgi?id=150543
2094
2095         Reviewed by Alex Christensen.
2096
2097         No new tests (No change in behavior, plumbing for future testability)
2098
2099         * CMakeLists.txt:
2100         * WebCore.xcodeproj/project.pbxproj:
2101
2102         * Modules/indexeddb/server/IDBBackingStore.h:
2103
2104         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
2105         (WebCore::IDBServer::MemoryBackingStoreTransaction::addNewObjectStore):
2106         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
2107         (WebCore::IDBServer::MemoryBackingStoreTransaction::commit):
2108         (WebCore::IDBServer::MemoryBackingStoreTransaction::finish):
2109         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
2110         (WebCore::IDBServer::MemoryBackingStoreTransaction::isWriting):
2111
2112         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2113         (WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
2114         (WebCore::IDBServer::MemoryIDBBackingStore::removeObjectStoreForVersionChangeAbort):
2115         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
2116
2117         * Modules/indexeddb/server/MemoryObjectStore.cpp:
2118         (WebCore::IDBServer::MemoryObjectStore::create):
2119         (WebCore::IDBServer::MemoryObjectStore::MemoryObjectStore):
2120         (WebCore::IDBServer::MemoryObjectStore::~MemoryObjectStore):
2121         (WebCore::IDBServer::MemoryObjectStore::writeTransactionStarted):
2122         (WebCore::IDBServer::MemoryObjectStore::writeTransactionFinished):
2123         * Modules/indexeddb/server/MemoryObjectStore.h:
2124         (WebCore::IDBServer::MemoryObjectStore::info):
2125
2126         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2127         (WebCore::IDBServer::UniqueIDBDatabase::createObjectStore):
2128
2129         * Modules/indexeddb/shared/IDBError.cpp:
2130         (WebCore::idbErrorName):
2131         (WebCore::idbErrorDescription):
2132         * Modules/indexeddb/shared/IDBError.h:
2133
2134 2015-10-26  Jiewen Tan  <jiewen_tan@apple.com>
2135
2136         Null dereference loading Blink layout test editing/execCommand/indent-inline-box-crash.html
2137         https://bugs.webkit.org/show_bug.cgi?id=149290
2138         <rdar://problem/22746435>
2139
2140         Reviewed by Alex Christensen.
2141
2142         This is a merge of Blink r174952:
2143         https://codereview.chromium.org/297203004
2144
2145         Test: editing/execCommand/indent-inline-box-crash.html
2146
2147         * editing/IndentOutdentCommand.cpp:
2148         (WebCore::IndentOutdentCommand::tryIndentingAsListItem):
2149
2150 2015-10-26  Jiewen Tan  <jiewen_tan@apple.com>
2151
2152         Null dereference loading Blink layout test editing/execCommand/indent-no-visible-contents-crash.html
2153         https://bugs.webkit.org/show_bug.cgi?id=149292
2154         <rdar://problem/22746530>
2155
2156         Reviewed by Alex Christensen.
2157
2158         This is a merge of Blink r176735:
2159         https://codereview.chromium.org/349143002
2160
2161         Test: editing/execCommand/indent-no-visible-contents-crash.html
2162
2163         * editing/CompositeEditCommand.cpp:
2164         (WebCore::CompositeEditCommand::moveParagraphWithClones):
2165         Sometimes callers of this method will pass null startOfParagraphToMove || endOfParagraphToMove,
2166         hence check them before proceeding.
2167
2168 2015-10-26  Anders Carlsson  <andersca@apple.com>
2169
2170         Remove dead context menu code
2171         https://bugs.webkit.org/show_bug.cgi?id=150567
2172
2173         Reviewed by Tim Horton.
2174
2175         * loader/EmptyClients.h:
2176         * page/ContextMenuClient.h:
2177         * page/ContextMenuController.cpp:
2178         (WebCore::ContextMenuController::showContextMenu): Deleted.
2179
2180 2015-10-26  Simon Fraser  <simon.fraser@apple.com>
2181
2182         Implement 'round' and 'space' values for border-image
2183         https://bugs.webkit.org/show_bug.cgi?id=14185
2184
2185         Reviewed by Tim Horton.
2186         
2187         Add support for "round" and "space" values for border-image-repeat.
2188         Following "stretch" and "repeat", the code is added to Image::drawTiled().
2189         
2190         For "round", we compute an integral number of copies of the image that fit,
2191         and then adjust the tile scale.
2192         
2193         For "space", we also compute an integral number N of copies that will fit,
2194         and then divide the remaining space amongst N+1 gaps, adjusting the tiling
2195         phase so that with an even number of images, a gap is centered.
2196
2197         Tests: fast/borders/border-image-round.html
2198                fast/borders/border-image-space.html
2199
2200         * platform/graphics/Image.cpp:
2201         (WebCore::Image::drawTiled):
2202         * platform/graphics/cg/GraphicsContextCG.cpp:
2203         (WebCore::GraphicsContext::drawPattern):
2204
2205 2015-10-26  Simon Fraser  <simon.fraser@apple.com>
2206
2207         Incorrect repeated background-size behavior in keyframes
2208         https://bugs.webkit.org/show_bug.cgi?id=150309
2209
2210         Reviewed by Zalan Bujtas.
2211         
2212         After computing the style for a keyframe, we failed to propagate unset
2213         fill-layer properties to all layers, which caused incorrect behavior when
2214         there were multiple background images, but only one value on a background
2215         property in the keyframes.
2216         
2217         Fix by calling adjustRenderStyle() on keyframe styles, which invokes
2218         style.adjustBackgroundLayers() which fixes the bug.
2219
2220         Test: animations/multiple-backgrounds.html
2221
2222         * css/StyleResolver.cpp:
2223         (WebCore::StyleResolver::styleForKeyframe):
2224
2225 2015-10-26  Chris Dumez  <cdumez@apple.com>
2226
2227         Indexing an object with an integer that is not a supported property index should not call the named property getter
2228         https://bugs.webkit.org/show_bug.cgi?id=148871
2229         <rdar://problem/22589952>
2230
2231         Reviewed by Darin Adler.
2232
2233         Indexing an object with an integer that is not a supported property
2234         index should not call the named property getter, as per the Web IDL
2235         specification:
2236         https://heycam.github.io/webidl/#idl-indexed-properties (Note in blue)
2237
2238         Firefox and Chrome both already behave according to the specification
2239         here so this patch aligns our behavior with other browsers as well.
2240
2241         No new tests, already covered by existing test.
2242
2243         * bindings/scripts/CodeGeneratorJS.pm:
2244         (GenerateGetOwnPropertySlotBody):
2245         (GenerateImplementation):
2246         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2247         (WebCore::JSTestEventTarget::getOwnPropertySlot):
2248         (WebCore::JSTestEventTarget::getOwnPropertySlotByIndex): Deleted.
2249         (WebCore::jsTestEventTargetConstructor): Deleted.
2250
2251 2015-10-26  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2252
2253         [Streams API] Implement abort method on writable streams
2254         https://bugs.webkit.org/show_bug.cgi?id=150444
2255
2256         Reviewed by Darin Adler.
2257
2258         Abort method on writable streams implemented according to the spec.
2259
2260         Current test set suffices. Expectations are updated accordingly.
2261
2262         * Modules/streams/StreamInternals.js:
2263         (promiseInvokeOrFallbackOrNoop): Implemented according to the spec.
2264         * Modules/streams/WritableStream.js:
2265         (abort): Implemented according to the spec.
2266
2267 2015-10-25  Hunseop Jeong  <hs85.jeong@samsung.com>
2268
2269         Use modern for-loops in WebCore/editing.
2270         https://bugs.webkit.org/show_bug.cgi?id=150354
2271
2272         Reviewed by Darin Adler.
2273
2274         No new tests because there is no behavior change.
2275
2276         * editing/AlternativeTextController.cpp:
2277         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
2278         (WebCore::AlternativeTextController::applyAutocorrectionBeforeTypingIfAppropriate):
2279         (WebCore::AlternativeTextController::rootViewRectForRange):
2280         (WebCore::AlternativeTextController::markCorrection):
2281         * editing/ApplyStyleCommand.cpp:
2282         (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
2283         (WebCore::dummySpanAncestorForNode):
2284         (WebCore::ApplyStyleCommand::cleanupUnstyledAppleStyleSpans):
2285         (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
2286         (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
2287         (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement):
2288         (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
2289         (WebCore::ApplyStyleCommand::joinChildTextNodes):
2290         * editing/CompositeEditCommand.cpp:
2291         (WebCore::EditCommandComposition::reapply):
2292         (WebCore::EditCommandComposition::getNodesInCommand):
2293         (WebCore::CompositeEditCommand::removeChildrenInRange):
2294         (WebCore::CompositeEditCommand::removeNode):
2295         (WebCore::copyMarkers):
2296         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
2297         (WebCore::CompositeEditCommand::deleteInsignificantText):
2298         * editing/DictationCommand.cpp:
2299         (WebCore::DictationMarkerSupplier::addMarkersToTextNode):
2300         (WebCore::DictationCommand::collectDictationAlternativesInRange):
2301         * editing/EditingStyle.cpp:
2302         (WebCore::isEditingProperty):
2303         (WebCore::EditingStyle::extractConflictingImplicitStyleOfAttributes):
2304         (WebCore::EditingStyle::elementIsStyledSpanOrHTMLEquivalent):
2305         (WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement):
2306         (WebCore::styleFromMatchedRulesForElement):
2307         (WebCore::diffTextDecorations):
2308         * editing/Editor.cpp:
2309         (WebCore::Editor::setComposition):
2310         (WebCore::Editor::markAndReplaceFor):
2311         * editing/EditorCommand.cpp:
2312         (WebCore::createCommandMap):
2313         * editing/MarkupAccumulator.cpp:
2314         (WebCore::MarkupAccumulator::totalLength):
2315         * editing/MergeIdenticalElementsCommand.cpp:
2316         (WebCore::MergeIdenticalElementsCommand::doApply):
2317         (WebCore::MergeIdenticalElementsCommand::doUnapply):
2318         * editing/ReplaceSelectionCommand.cpp:
2319         (WebCore::ReplacementFragment::removeUnrenderedNodes):
2320         (WebCore::ReplacementFragment::removeInterchangeNodes):
2321         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
2322         (WebCore::removeHeadContents):
2323         * editing/SpellChecker.cpp:
2324         (WebCore::SpellChecker::~SpellChecker):
2325         (WebCore::SpellChecker::client):
2326         (WebCore::SpellChecker::enqueueRequest):
2327         * editing/SplitElementCommand.cpp:
2328         (WebCore::SplitElementCommand::executeApply):
2329         (WebCore::SplitElementCommand::doApply):
2330         (WebCore::SplitElementCommand::doUnapply):
2331         * editing/TextCheckingHelper.cpp:
2332         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
2333         (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange):
2334         * editing/WrapContentsInDummySpanCommand.cpp:
2335         (WebCore::WrapContentsInDummySpanCommand::executeApply):
2336         (WebCore::WrapContentsInDummySpanCommand::doUnapply):
2337         * editing/ios/EditorIOS.mm:
2338         (WebCore::Editor::createFragmentAndAddResources):
2339         * editing/mac/EditorMac.mm:
2340         (WebCore::Editor::WebContentReader::readFilenames):
2341         (WebCore::Editor::createFragmentAndAddResources):
2342         * editing/markup.cpp:
2343         (WebCore::completeURLs):
2344
2345 2015-10-25  Simon Fraser  <simon.fraser@apple.com>
2346
2347         Support bezier paths in clip-path property
2348         https://bugs.webkit.org/show_bug.cgi?id=149996
2349
2350         Reviewed by Darin Adler.
2351         
2352         Support path() in the -webkit-clip-path property, as specified in
2353         https://drafts.csswg.org/css-shapes-2/#supported-basic-shapes
2354         
2355         Added BasicShapePath and CSSBasicShapePath, which both represent the path
2356         as a SVGPathByteStream and wind rule.
2357         
2358         Make BasicShape::canBlend() a virtual function, and implement it on each subclass.
2359         Make various BasicShape subclass function overrides private, other than windRule()
2360         wich is called on derived classes in a few places.
2361         
2362         Add SVGPathBlender::canBlendPaths() which returns true if the given paths can be
2363         interpolated. Uses the same logic as blendAnimatedPath(), without doing any interpolation.
2364         
2365         RenderElement::createsGroup() is fixed to have clip-path trigger a group,
2366         which fixes rendering of clip-path with a descendant compositing layer.
2367
2368         Tests: compositing/masks/clip-path-composited-descendent.html
2369                css3/masking/clip-path-with-path.html
2370                transitions/clip-path-path-transitions.html
2371
2372         * css/BasicShapeFunctions.cpp:
2373         (WebCore::valueForBasicShape):
2374         (WebCore::basicShapeForValue):
2375         * css/CSSBasicShapes.cpp:
2376         (WebCore::CSSBasicShapePath::CSSBasicShapePath):
2377         (WebCore::CSSBasicShapePath::pathData):
2378         (WebCore::buildPathString):
2379         (WebCore::CSSBasicShapePath::cssText):
2380         (WebCore::CSSBasicShapePath::equals):
2381         * css/CSSBasicShapes.h:
2382         * css/CSSParser.cpp:
2383         (WebCore::CSSParser::parseBasicShapePath):
2384         (WebCore::CSSParser::parseBasicShape):
2385         * css/CSSParser.h:
2386         * rendering/RenderElement.h:
2387         (WebCore::RenderElement::createsGroup):
2388         * rendering/style/BasicShapes.cpp:
2389         (WebCore::BasicShapeCircle::canBlend):
2390         (WebCore::BasicShapeEllipse::canBlend):
2391         (WebCore::BasicShapePolygon::canBlend):
2392         (WebCore::BasicShapePath::BasicShapePath):
2393         (WebCore::BasicShapePath::path):
2394         (WebCore::BasicShapePath::operator==):
2395         (WebCore::BasicShapePath::canBlend):
2396         (WebCore::BasicShapePath::blend):
2397         (WebCore::BasicShapeInset::canBlend):
2398         (WebCore::BasicShape::canBlend): Deleted.
2399         * rendering/style/BasicShapes.h:
2400         * svg/SVGPathBlender.cpp:
2401         (WebCore::SVGPathBlender::addAnimatedPath):
2402         (WebCore::SVGPathBlender::blendAnimatedPath):
2403         (WebCore::SVGPathBlender::canBlendPaths):
2404         (WebCore::SVGPathBlender::SVGPathBlender):
2405         (WebCore::SVGPathBlender::blendMoveToSegment):
2406         (WebCore::SVGPathBlender::blendLineToSegment):
2407         (WebCore::SVGPathBlender::blendLineToHorizontalSegment):
2408         (WebCore::SVGPathBlender::blendLineToVerticalSegment):
2409         (WebCore::SVGPathBlender::blendCurveToCubicSegment):
2410         (WebCore::SVGPathBlender::blendCurveToCubicSmoothSegment):
2411         (WebCore::SVGPathBlender::blendCurveToQuadraticSegment):
2412         (WebCore::SVGPathBlender::blendCurveToQuadraticSmoothSegment):
2413         (WebCore::SVGPathBlender::blendArcToSegment):
2414         * svg/SVGPathBlender.h:
2415         * svg/SVGPathByteStream.h:
2416         (WebCore::SVGPathByteStream::operator==):
2417         * svg/SVGPathUtilities.cpp:
2418         (WebCore::canBlendSVGPathByteStreams):
2419         * svg/SVGPathUtilities.h:
2420
2421 2015-10-25  Gwang Yoon Hwang  <yoon@igalia.com>
2422
2423         [TexMap] Fix a misused flag for GstGL
2424         https://bugs.webkit.org/show_bug.cgi?id=150545
2425
2426         Reviewed by Žan Doberšek.
2427
2428         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2429         (WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper):
2430         We should pass TextureMapperGL::Flags to the TextureMapperGL::drawTexture instead of
2431         BitmapTexture::Flags.
2432
2433 2015-10-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2434
2435         Use ImplementedAs for MediaDevices.getUserMediaFromJS
2436         https://bugs.webkit.org/show_bug.cgi?id=150439
2437
2438         Reviewed by Darin Adler.
2439
2440         No change in behavior.
2441
2442         * Modules/mediastream/MediaDevices.h: Removing getUserMediaFromJS C++ function.
2443         * Modules/mediastream/MediaDevices.idl: Marking getUserMediaFromJS as ImplementedAS=getUserMedia
2444
2445 2015-10-24  Gwang Yoon Hwang  <yoon@igalia.com>
2446
2447         Remove setApplyDeviceScaleFactorInCompositor
2448         https://bugs.webkit.org/show_bug.cgi?id=150538
2449
2450         Reviewed by Tim Horton.
2451
2452         It was used to support the device scale factor for chromium port and blackberry
2453         port. But it was removed quite a while ago.
2454
2455         * page/Settings.in:
2456         applyDeviceScaleFactorInCompositor: Deleted
2457         * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
2458         (WebCore::CompositingCoordinator::CompositingCoordinator): Remove uses
2459         of applyDeviceScaleFactorInCompositor.
2460
2461 2015-10-24  Tim Horton  <timothy_horton@apple.com>
2462
2463         Expose more information about the exception in WKErrorJavaScriptExceptionOccurred errors
2464         https://bugs.webkit.org/show_bug.cgi?id=150525
2465
2466         Reviewed by Darin Adler.
2467
2468         Adjusted API test to cover this: WKWebView.EvaluateJavaScriptErrorCases.
2469
2470         * bindings/js/JSDOMBinding.cpp:
2471         (WebCore::reportException):
2472         * bindings/js/JSDOMBinding.h:
2473         Fill in the given struct with computed exception data if it was given.
2474
2475         * bindings/js/ScriptController.cpp:
2476         (WebCore::ScriptController::evaluateInWorld):
2477         (WebCore::ScriptController::evaluate):
2478         (WebCore::ScriptController::executeScript):
2479         * bindings/js/ScriptController.h:
2480         Plumb aforementioned struct through ScriptController.
2481
2482 2015-10-24  Gwang Yoon Hwang  <yoon@igalia.com>
2483
2484         [TexMap] Clean up BitmapTexture and BitmapTextureGL.
2485         https://bugs.webkit.org/show_bug.cgi?id=143298
2486
2487         Reviewed by Žan Doberšek.
2488
2489         No new tests, this is just a refactor.
2490
2491         * platform/graphics/texmap/BitmapTexture.h:
2492         (WebCore::BitmapTexture::canReuseWith): Deleted.
2493         Reuseability of a BitmapTexture is only decided by its size.
2494         We can use size() instead of this method.
2495
2496         * platform/graphics/texmap/BitmapTextureGL.h:
2497         (WebCore::driverSupportsExternalTextureBGRA): Deleted.
2498         We do not have to check a suitable texture format in every
2499         update/reset. It is enough to store the formats in construction time
2500         and reuse them.
2501
2502 2015-10-24  Simon Fraser  <simon.fraser@apple.com>
2503
2504         REGRESSION (r187121): Delayed instantaneous animations not honouring ' forwards' fill-mode
2505         https://bugs.webkit.org/show_bug.cgi?id=150326
2506
2507         Reviewed by Darin Adler.
2508         
2509         With a zero-duration, delayed fill-forwards animation, we'd end up trying
2510         to interpolate between the last and first keyframes, and picking the first
2511         because AnimationBase::progress() had a special case for zero duration. Removing
2512         this check fixes the bug.
2513
2514         Test: animations/fill-mode-forwards-zero-duration.html
2515
2516         * page/animation/AnimationBase.cpp:
2517         (WebCore::AnimationBase::progress):
2518
2519 2015-10-23  Chris Dumez  <cdumez@apple.com>
2520
2521         RadioNodeList should be exposed on Window
2522         https://bugs.webkit.org/show_bug.cgi?id=148869
2523         <rdar://problem/22589828>
2524
2525         Reviewed by Ryosuke Niwa.
2526
2527         RadioNodeList should be exposed on on the global Window object, as per
2528         the HTML specification:
2529         https://html.spec.whatwg.org/multipage/infrastructure.html#radionodelist
2530
2531         This patch addresses the issue, and aligns our behavior with Firefox
2532         and Chrome.
2533
2534         No new tests, already covered by existing tests.
2535
2536         * html/RadioNodeList.idl:
2537
2538 2015-10-23  Joseph Pecoraro  <pecoraro@apple.com>
2539
2540         Web Inspector: Remove unused ScrollLayer Timeline EventType
2541         https://bugs.webkit.org/show_bug.cgi?id=150518
2542
2543         Reviewed by Timothy Hatcher.
2544
2545         * inspector/InspectorInstrumentation.cpp:
2546         (WebCore::InspectorInstrumentation::willScrollLayerImpl): Deleted.
2547         (WebCore::InspectorInstrumentation::didScrollLayerImpl): Deleted.
2548         * inspector/InspectorInstrumentation.h:
2549         (WebCore::InspectorInstrumentation::willScrollLayer): Deleted.
2550         (WebCore::InspectorInstrumentation::didScrollLayer): Deleted.
2551         * inspector/InspectorTimelineAgent.cpp:
2552         (WebCore::InspectorTimelineAgent::willScroll): Deleted.
2553         (WebCore::InspectorTimelineAgent::didScroll): Deleted.
2554         * inspector/InspectorTimelineAgent.h:
2555         * rendering/RenderLayer.cpp:
2556         (WebCore::RenderLayer::scrollTo): Deleted.
2557
2558 2015-10-23  Joseph Pecoraro  <pecoraro@apple.com>
2559
2560         Web Inspector: Clean up InspectorInstrumentation includes
2561         https://bugs.webkit.org/show_bug.cgi?id=150523
2562
2563         Reviewed by Timothy Hatcher.
2564
2565         * Modules/webdatabase/DatabaseManager.cpp:
2566         * WebCore.vcxproj/WebCore.vcxproj:
2567         * WebCore.vcxproj/WebCore.vcxproj.filters:
2568         * WebCore.xcodeproj/project.pbxproj:
2569         * css/MediaQueryEvaluator.cpp:
2570         * dom/EventDispatcher.cpp:
2571         * dom/ExtensionStyleSheets.cpp:
2572         * inspector/InspectorController.h:
2573         * inspector/InspectorDOMDebuggerAgent.cpp:
2574         * inspector/InspectorDatabaseInstrumentation.h: Removed.
2575         * inspector/InspectorInstrumentation.h:
2576         (WebCore::InspectorInstrumentation::didOpenDatabase):
2577         * inspector/InspectorPageAgent.cpp:
2578         * inspector/InspectorTimelineAgent.cpp:
2579         (WebCore::toProtocol): Deleted.
2580         * loader/ResourceLoadScheduler.cpp:
2581         * loader/mac/ResourceLoaderMac.mm:
2582         * page/Screen.cpp:
2583         * rendering/TextAutosizer.cpp:
2584         * testing/Internals.cpp:
2585         (WebCore::Internals::consoleMessageArgumentCounts): Deleted.
2586         * testing/Internals.h:
2587         * testing/Internals.idl:
2588         * workers/AbstractWorker.cpp:
2589
2590 2015-10-23  Simon Fraser  <simon.fraser@apple.com>
2591
2592         Avoid SVG-induced layouts inside Element::absoluteEventBounds()
2593         https://bugs.webkit.org/show_bug.cgi?id=150516
2594
2595         Reviewed by Zalan Bujtas.
2596
2597         Speculative fix for a crash under RenderObject::localToContainerQuad() when
2598         computing the wheel event handler region, which uses Element::absoluteEventHandlerBounds().
2599         Element::absoluteEventBounds() was calling SVGElement::getBoundingBox() in a way
2600         that could trigger a layout.
2601
2602         * dom/Element.cpp:
2603         (WebCore::Element::absoluteEventBounds):
2604
2605 2015-10-23  Alex Christensen  <achristensen@webkit.org>
2606
2607         Progress towards CMake on Mac
2608         https://bugs.webkit.org/show_bug.cgi?id=150517
2609
2610         Reviewed by Tim Horton.
2611
2612         * PlatformMac.cmake:
2613
2614 2015-10-23  Per Arne Vollan  <peavo@outlook.com>
2615
2616         [WinCairo] Improve test results for fast layouttests.
2617         https://bugs.webkit.org/show_bug.cgi?id=150464
2618
2619         Reviewed by Alex Christensen.
2620
2621         Disable the Mac ascent hack for WinCairo.
2622
2623         * platform/graphics/win/SimpleFontDataCairoWin.cpp:
2624         (WebCore::Font::platformInit):
2625
2626 2015-10-23  Simon Fraser  <simon.fraser@apple.com>
2627
2628         REGRESSION (r187121): Multiple-keyframe animations not honouring ' forwards' fill-mode
2629         https://bugs.webkit.org/show_bug.cgi?id=150328
2630
2631         Reviewed by Dean Jackson.
2632         
2633         AnimationBase::getElapsedTime() for a finished animation would return 1 (a progress),
2634         rather than a time value as the caller expects. Fix it to return the total duration
2635         if the animation has finished. This fixes the bug.
2636         
2637         Change CompositeAnimation::pauseAnimationAtTime() to be more permissive, allowing
2638         testing of filling-forwards animations with the pause API.
2639
2640         Test: animations/fill-forwards-end-state.html
2641
2642         * page/animation/AnimationBase.cpp:
2643         (WebCore::AnimationBase::getElapsedTime):
2644         * page/animation/CompositeAnimation.cpp:
2645         (WebCore::CompositeAnimation::pauseAnimationAtTime):
2646
2647 2015-10-23  Chris Dumez  <cdumez@apple.com>
2648
2649         A label element not in a document should not label an element in a document
2650         https://bugs.webkit.org/show_bug.cgi?id=148863
2651         <rdar://problem/22589300>
2652
2653         Reviewed by Ryosuke Niwa.
2654
2655         As per the HTML specification, a label element's 'for' attribute may be
2656         specified to indicate a form control with which the caption is to be
2657         associated. If the attribute is specified, the attribute's value must
2658         be the ID of a labelable element in the same Document as the label
2659         element:
2660         https://html.spec.whatwg.org/multipage/forms.html#attr-label-for
2661
2662         However, our code was failing to check if the label element was actually
2663         in the document before calling document.getElementById(). In such case,
2664         we would potentially return a labelable Element that is not in the same
2665         document as the label Element. This patch fixes the problem.
2666
2667         The new behavior is consistent with Firefox.
2668
2669         No new tests, already covered by existing test.
2670
2671         * html/HTMLLabelElement.cpp:
2672         (WebCore::HTMLLabelElement::control):
2673
2674 2015-10-23  Antoine Quint  <graouts@apple.com>
2675
2676         Support for SVG `beginEvent` event and `onbegin` attribute
2677         https://bugs.webkit.org/show_bug.cgi?id=150442
2678
2679         Reviewed by Dean Jackson.
2680
2681         Add support for the SVG `beginEvent` event, which is fired as an SVG timing element enters its active interval.
2682         Also add support for the SVG `onbegin` attribute which allows the definition of a JS event listener declaratively
2683         for the SVG `beginEvent` event.
2684
2685         Tests: svg/animations/begin-event-attribute.svg
2686                svg/animations/begin-event-script.svg
2687                svg/animations/begin-event-syncbase.svg
2688
2689         * dom/EventNames.h:
2690         * svg/animation/SVGSMILElement.cpp:
2691         (WebCore::smilBeginEventSender):
2692         (WebCore::smilEndEventSender):
2693         (WebCore::SVGSMILElement::~SVGSMILElement):
2694         (WebCore::SVGSMILElement::parseAttribute):
2695         (WebCore::SVGSMILElement::progress):
2696         (WebCore::SVGSMILElement::dispatchPendingEvent):
2697         * svg/svgattrs.in:
2698
2699 2015-10-23  Hyemi Shin  <hyemi.sin@samsung.com>
2700
2701         ConvolverNode.buffer must have same sample-rate as the AudioContext 
2702         https://bugs.webkit.org/show_bug.cgi?id=150385 
2703
2704         Reviewed by Chris Dumez.
2705
2706         ConvolverNode.buffer must be of the same sample-rate as the AudioContext
2707         or an NOT_SUPPORTED_ERR exception MUST be thrown.
2708
2709         Test : webaudio/convolver-setBuffer-different-samplerate.html
2710
2711         * Modules/webaudio/ConvolverNode.cpp:
2712         (WebCore::ConvolverNode::setBuffer):
2713         * Modules/webaudio/ConvolverNode.h:
2714         * Modules/webaudio/ConvolverNode.idl:
2715
2716 2015-10-22  Myles C. Maxfield  <mmaxfield@apple.com>
2717
2718         [OS X] Migrate GraphicsContext::drawLineForDocumentMarker() away from LocalCurrentGraphicsContext
2719         https://bugs.webkit.org/show_bug.cgi?id=150483
2720
2721         Reviewed by Simon Fraser.
2722
2723         LocalCurrentGraphicsContext is an ugly hack to work around the problem that many NS* functions
2724         operate on the current context rather than a context passed as an argument. This patch
2725         migrates from NSRectFillUsingOperation() which has this behavior to CGContextDrawTiledImage()
2726         which performs the same operation but with a passed-in CGContextRef. An added benefit is that
2727         we don't have to mess around with pattern-based NSColors. 
2728
2729         No new tests because there is no behavior change.
2730
2731         * platform/graphics/mac/GraphicsContextMac.mm:
2732         (WebCore::findImage):
2733         (WebCore::GraphicsContext::updateDocumentMarkerResources):
2734         (WebCore::GraphicsContext::drawLineForDocumentMarker):
2735         (WebCore::makePatternColor): Deleted.
2736
2737 2015-10-22  Sam Weinig  <sam@webkit.org>
2738
2739         Navigations on the same host (but with different schemes and ports) should not trigger universal links
2740         <rdar://problem/22811325>
2741         https://bugs.webkit.org/show_bug.cgi?id=150481
2742
2743         Reviewed by Dan Bernstein.
2744
2745         Add new helper which efficiently compares the hosts of two URLs.
2746
2747         * platform/URL.cpp:
2748         (WebCore::hostsAreEqual):
2749         * platform/URL.h:
2750
2751 2015-10-22  Joseph Pecoraro  <pecoraro@apple.com>
2752
2753         Web Inspector: Remove unused Timeline GCEvent Record type
2754         https://bugs.webkit.org/show_bug.cgi?id=150477
2755
2756         Reviewed by Timothy Hatcher.
2757
2758         This event is dispatched through the Heap domain, not Timelines.
2759
2760         * inspector/TimelineRecordFactory.cpp:
2761         (WebCore::TimelineRecordFactory::createGCEventData): Deleted.
2762         * inspector/TimelineRecordFactory.h:
2763
2764 2015-10-22  Gordon Sheridan  <gordon_sheridan@apple.com>
2765
2766         Fix build for clang-700.0.59.5 by replacing deprecated calls to convert points between screen and window coordinates for Mac.
2767         https://bugs.webkit.org/show_bug.cgi?id=150379
2768
2769         Reviewed by Andy Estes.
2770
2771         Provide WAKWindow versions of the non-deprecated methods for converting an NSRect between
2772         window and screen coordinates, which replace the deprecated methods that operated on an NSPoint.
2773
2774         * platform/ios/wak/WAKWindow.h:
2775         * platform/ios/wak/WAKWindow.mm:
2776         (-[WAKWindow convertRectToScreen:]): Added.
2777         (-[WAKWindow convertRectFromScreen:]): Added.
2778
2779 2015-10-22  Alex Christensen  <achristensen@webkit.org>
2780
2781         Fix Mac CMake build after r191433.
2782
2783         * PlatformMac.cmake:
2784         Use CMakeLists.txt to generate UserAgentScripts.h and cpp.
2785
2786 2015-10-22  Daniel Bates  <dabates@apple.com>
2787
2788         Unreviewed, rolling out r191113.
2789
2790         Rollout r144451 since it regressed the visibility of the
2791         search cancel button when a search field is empty or showing
2792         placeholder text. Further investigation is needed.
2793
2794         Reverted changeset:
2795
2796         "[iOS] DOM click event may not be dispatched when page has
2797         :active style and <input type="search">"
2798         https://bugs.webkit.org/show_bug.cgi?id=144451
2799         http://trac.webkit.org/changeset/191113
2800
2801 2015-10-22  Simon Fraser  <simon.fraser@apple.com>
2802
2803         Add ways to log to log channels via a functional syntax, and via a TextStream
2804         https://bugs.webkit.org/show_bug.cgi?id=150472
2805  
2806         Reviewed by Tim Horton.
2807  
2808         Make it possible to write to a WTFLogChannel with a std::function that returns
2809         a const char*, and with stream syntax.
2810  
2811         Enhance TextStream to allow it to generate single-line output.
2812
2813         * platform/Logging.cpp:
2814         (WebCore::logFunctionResult):
2815         * platform/Logging.h:
2816         * platform/text/TextStream.cpp:
2817         (WebCore::TextStream::startGroup):
2818         (WebCore::TextStream::endGroup):
2819         (WebCore::TextStream::nextLine):
2820         (WebCore::TextStream::writeIndent):
2821         * platform/text/TextStream.h:
2822         (WebCore::TextStream::TextStream):
2823
2824 2015-10-22  Alex Christensen  <achristensen@webkit.org>
2825
2826         Progress towards CMake on Mac
2827         https://bugs.webkit.org/show_bug.cgi?id=150466
2828
2829         Reviewed by Chris Dumez.
2830
2831         * PlatformMac.cmake:
2832         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
2833         (WebCore::createAndStoreMasterKey):
2834         * page/mac/WheelEventDeltaFilterMac.mm:
2835         * platform/spi/mac/NSImmediateActionGestureRecognizerSPI.h:
2836
2837 2015-10-22  Myles C. Maxfield  <mmaxfield@apple.com>
2838
2839         [Cocoa] Migrate WKSetPatternPhaseInUserSpace() and WKGetUserToBaseCTM() from WKSI
2840         https://bugs.webkit.org/show_bug.cgi?id=150460
2841
2842         Reviewed by Tim Horton.
2843
2844         No reason to use WKSI for these calls.
2845
2846         No new tests because there is no behavior change.
2847
2848         * platform/graphics/cg/GraphicsContextCG.cpp:
2849         (WebCore::GraphicsContext::applyStrokePattern):
2850         (WebCore::GraphicsContext::applyFillPattern):
2851         (WebCore::GraphicsContext::setPlatformShadow):
2852         * platform/graphics/cg/GraphicsContextCG.h:
2853         (WebCore::getUserToBaseCTM):
2854         * platform/graphics/cg/ImageBufferCG.cpp:
2855         (WebCore::ImageBuffer::putByteArray):
2856         * platform/graphics/mac/GraphicsContextMac.mm:
2857         (WebCore::setPatternPhaseInUserSpace):
2858         (WebCore::GraphicsContext::drawLineForDocumentMarker):
2859         * platform/ios/WebCoreSystemInterfaceIOS.mm:
2860         * platform/mac/WebCoreSystemInterface.h:
2861         * platform/mac/WebCoreSystemInterface.mm:
2862
2863 2015-10-22  Brady Eidson  <beidson@apple.com>
2864
2865         Modern IDB: Basic createObjectStore implementation.
2866         https://bugs.webkit.org/show_bug.cgi?id=150455
2867
2868         Reviewed by Alex Christensen.
2869
2870         Tests: storage/indexeddb/modern/createobjectstore-basic.html
2871                storage/indexeddb/modern/createobjectstore-failures.html
2872
2873         * CMakeLists.txt:
2874         * WebCore.xcodeproj/project.pbxproj:
2875
2876         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
2877         (WebCore::IDBClient::IDBConnectionToServer::createObjectStore):
2878         (WebCore::IDBClient::IDBConnectionToServer::didCreateObjectStore):
2879         * Modules/indexeddb/client/IDBConnectionToServer.h:
2880         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
2881         
2882         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
2883         (WebCore::IDBClient::IDBDatabase::objectStoreNames):
2884         (WebCore::IDBClient::IDBDatabase::createObjectStore):
2885         (WebCore::IDBClient::IDBDatabase::didAbortTransaction):
2886         * Modules/indexeddb/client/IDBDatabaseImpl.h:
2887         (WebCore::IDBClient::IDBDatabase::serverConnection):
2888         
2889         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp: Added.
2890         (WebCore::IDBClient::IDBObjectStore::create):
2891         (WebCore::IDBClient::IDBObjectStore::IDBObjectStore):
2892         (WebCore::IDBClient::IDBObjectStore::~IDBObjectStore):
2893         (WebCore::IDBClient::IDBObjectStore::id):
2894         (WebCore::IDBClient::IDBObjectStore::name):
2895         (WebCore::IDBClient::IDBObjectStore::keyPathAny):
2896         (WebCore::IDBClient::IDBObjectStore::keyPath):
2897         (WebCore::IDBClient::IDBObjectStore::indexNames):
2898         (WebCore::IDBClient::IDBObjectStore::transaction):
2899         (WebCore::IDBClient::IDBObjectStore::autoIncrement):
2900         (WebCore::IDBClient::IDBObjectStore::add):
2901         (WebCore::IDBClient::IDBObjectStore::put):
2902         (WebCore::IDBClient::IDBObjectStore::openCursor):
2903         (WebCore::IDBClient::IDBObjectStore::get):
2904         (WebCore::IDBClient::IDBObjectStore::deleteFunction):
2905         (WebCore::IDBClient::IDBObjectStore::clear):
2906         (WebCore::IDBClient::IDBObjectStore::createIndex):
2907         (WebCore::IDBClient::IDBObjectStore::index):
2908         (WebCore::IDBClient::IDBObjectStore::deleteIndex):
2909         (WebCore::IDBClient::IDBObjectStore::count):
2910         * Modules/indexeddb/client/IDBObjectStoreImpl.h: Added.
2911
2912         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
2913         (WebCore::IDBClient::IDBOpenDBRequest::requestCompleted):
2914
2915         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
2916         (WebCore::IDBClient::IDBTransaction::serverConnection):
2917         (WebCore::IDBClient::IDBTransaction::objectStore):
2918         (WebCore::IDBClient::IDBTransaction::scheduleOperation):
2919         (WebCore::IDBClient::IDBTransaction::operationTimerFired):
2920         (WebCore::IDBClient::IDBTransaction::finishAbortOrCommit):
2921         (WebCore::IDBClient::IDBTransaction::didAbort):
2922         (WebCore::IDBClient::IDBTransaction::didCommit):
2923         (WebCore::IDBClient::IDBTransaction::createObjectStore):
2924         (WebCore::IDBClient::IDBTransaction::createObjectStoreOnServer):
2925         (WebCore::IDBClient::IDBTransaction::didCreateObjectStoreOnServer):
2926         * Modules/indexeddb/client/IDBTransactionImpl.h:
2927         (WebCore::IDBClient::IDBTransaction::originalDatabaseInfo):
2928         (WebCore::IDBClient::IDBTransaction::isVersionChange):
2929         
2930         * Modules/indexeddb/client/TransactionOperation.h: Added.
2931         (WebCore::IDBClient::TransactionOperation::perform):
2932         (WebCore::IDBClient::TransactionOperation::completed):
2933         (WebCore::IDBClient::TransactionOperation::identifier):
2934         (WebCore::IDBClient::TransactionOperation::transactionIdentifier):
2935         (WebCore::IDBClient::TransactionOperation::TransactionOperation):
2936         (WebCore::IDBClient::createTransactionOperation):
2937         
2938         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
2939         (WebCore::IDBServer::IDBConnectionToClient::didCreateObjectStore):
2940         * Modules/indexeddb/server/IDBConnectionToClient.h:
2941         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
2942         
2943         * Modules/indexeddb/server/IDBServer.cpp:
2944         (WebCore::IDBServer::IDBServer::createObjectStore):
2945         * Modules/indexeddb/server/IDBServer.h:
2946         
2947         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2948         (WebCore::IDBServer::UniqueIDBDatabase::createObjectStore):
2949         (WebCore::IDBServer::UniqueIDBDatabase::performCreateObjectStore):
2950         (WebCore::IDBServer::UniqueIDBDatabase::didPerformCreateObjectStore):
2951         (WebCore::IDBServer::UniqueIDBDatabase::performAbortTransaction):
2952         (WebCore::IDBServer::UniqueIDBDatabase::didPerformAbortTransaction):
2953         (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction): Deleted.
2954         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2955         
2956         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
2957         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCreateObjectStore):
2958         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
2959         
2960         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
2961         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::isVersionChange):
2962         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::createObjectStore):
2963         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
2964         
2965         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
2966         (WebCore::IDBDatabaseInfo::hasObjectStore):
2967         (WebCore::IDBDatabaseInfo::createNewObjectStore):
2968         (WebCore::IDBDatabaseInfo::addExistingObjectStore):
2969         (WebCore::IDBDatabaseInfo::objectStoreNames):
2970         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
2971         
2972         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp: Copied from Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.cpp.
2973         (WebCore::IDBObjectStoreInfo::IDBObjectStoreInfo):
2974         (WebCore::IDBObjectStoreInfo::isolatedCopy):
2975         * Modules/indexeddb/shared/IDBObjectStoreInfo.h: Copied from Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.h.
2976         (WebCore::IDBObjectStoreInfo::identifier):
2977         (WebCore::IDBObjectStoreInfo::name):
2978         (WebCore::IDBObjectStoreInfo::keyPath):
2979         (WebCore::IDBObjectStoreInfo::autoIncrement):
2980
2981         * Modules/indexeddb/shared/IDBRequestData.cpp:
2982         (WebCore::IDBRequestData::IDBRequestData):
2983         (WebCore::IDBRequestData::requestIdentifier):
2984         (WebCore::IDBRequestData::transactionIdentifier):
2985         * Modules/indexeddb/shared/IDBRequestData.h:
2986         (WebCore::IDBRequestData::databaseIdentifier):
2987         (WebCore::IDBRequestData::requestIdentifier): Deleted.
2988
2989         * Modules/indexeddb/shared/IDBResultData.cpp:
2990         (WebCore::IDBResultData::IDBResultData):
2991         (WebCore::IDBResultData::createObjectStoreSuccess):
2992         * Modules/indexeddb/shared/IDBResultData.h:
2993
2994         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
2995         (WebCore::InProcessIDBServer::didCreateObjectStore):
2996         (WebCore::InProcessIDBServer::createObjectStore):
2997         * Modules/indexeddb/shared/InProcessIDBServer.h:
2998
2999         * platform/CrossThreadCopier.cpp:
3000         (WebCore::IDBObjectStoreInfo>::copy):
3001         * platform/CrossThreadCopier.h:
3002
3003 2015-10-22  Alex Christensen  <achristensen@webkit.org>
3004
3005         Initial NSURLSession WebResourceLoader implementation
3006         https://bugs.webkit.org/show_bug.cgi?id=150355
3007
3008         Reviewed by Antti Koivisto.
3009
3010         * platform/network/cf/AuthenticationChallenge.h:
3011         (WebCore::AuthenticationChallenge::AuthenticationChallenge): Export constructor for use in WebKit2.
3012
3013 2015-10-22  Frederic Wang  <fred.wang@free.fr>
3014
3015         [Mac] Add support for the USE_TYPO_METRICS flag
3016         https://bugs.webkit.org/show_bug.cgi?id=150394
3017
3018         Reviewed by Myles C. Maxfield.
3019
3020         Make the Cocoa backend use the typo metrics for fonts with a MATH table when the OS/2 USE_TYPO_METRICS flag is set.
3021
3022         No new tests because this is already tested by fonts/use-typo-metrics-1.html
3023
3024         * platform/graphics/cocoa/FontCocoa.mm:
3025         (WebCore::fontHasMathTable): Add a function to verify whether a font has a MATH table.
3026         (WebCore::Font::platformInit): Verify whether the OS/2 USE_TYPO_METRICS flag is set and use the typo metrics if that is the case.
3027
3028 2015-10-22  Wenson Hsieh  <wenson_hsieh@apple.com>
3029
3030         Implement touch-action: manipulation; for iOS
3031         https://bugs.webkit.org/show_bug.cgi?id=149854
3032         <rdar://problem/23017145>
3033
3034         Reviewed by Benjamin Poulain.
3035
3036         Implements the manipulation value for the CSS property touch-action. Adds support for
3037         parsing the touch-action property and two of its values: auto and manipulation.
3038
3039         Tests: css3/touch-action/touch-action-computed-style.html
3040                css3/touch-action/touch-action-manipulation-fast-clicks.html
3041                css3/touch-action/touch-action-parsing.html
3042
3043         * css/CSSComputedStyleDeclaration.cpp:
3044         (WebCore::ComputedStyleExtractor::propertyValue):
3045         * css/CSSParser.cpp:
3046         (WebCore::isValidKeywordPropertyAndValue):
3047         (WebCore::isKeywordPropertyID):
3048         (WebCore::CSSParser::parseValue):
3049         * css/CSSPrimitiveValueMappings.h:
3050         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3051         (WebCore::CSSPrimitiveValue::operator TouchAction):
3052         * css/CSSPropertyNames.in:
3053         * css/CSSValueKeywords.in:
3054         * dom/Element.cpp:
3055         (WebCore::Element::allowsDoubleTapGesture): Here, we determine whether an element that resulted from
3056             hit-testing a touch should allow double-tap gestures. To do this, we walk up the element's parents,
3057             stopping when we detect an element that disallows double tap gestures by having a touch-action other
3058             than auto or by hitting the root node.
3059         * dom/Element.h:
3060         * dom/Node.h:
3061         (WebCore::Node::allowsDoubleTapGesture):
3062         * rendering/style/RenderStyle.h:
3063         * rendering/style/RenderStyleConstants.h:
3064         * rendering/style/StyleRareNonInheritedData.cpp:
3065         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
3066         (WebCore::StyleRareNonInheritedData::operator==):
3067         * rendering/style/StyleRareNonInheritedData.h:
3068
3069 2015-10-22  Ryosuke Niwa  <rniwa@webkit.org>
3070
3071         REGRESSION (r181972): Scroll position changes to top of youtube page when switching tabs
3072         https://bugs.webkit.org/show_bug.cgi?id=150428
3073
3074         Reviewed by Antti Koivisto.
3075
3076         The bug was caused by updateFocusAppearance in WebPage::restoreSelectionInFocusedEditableElement
3077         revealing the focused element which was added in r181972. Fixed the bug by adding an option to
3078         suppress this behavior here.
3079
3080         * dom/Document.cpp:
3081         (WebCore::Document::Document):
3082         (WebCore::Document::updateFocusAppearanceSoon):
3083         * dom/Document.h:
3084         * dom/Element.cpp:
3085         (WebCore::Element::focus):
3086         (WebCore::Element::updateFocusAppearanceAfterAttachIfNeeded):
3087         (WebCore::Element::updateFocusAppearance):
3088         * dom/Element.h:
3089         * history/CachedPage.cpp:
3090         (WebCore::CachedPage::restore):
3091         * html/HTMLAreaElement.cpp:
3092         (WebCore::HTMLAreaElement::updateFocusAppearance):
3093         * html/HTMLAreaElement.h:
3094         * html/HTMLInputElement.cpp:
3095         (WebCore::HTMLInputElement::updateFocusAppearance):
3096         (WebCore::HTMLInputElement::runPostTypeUpdateTasks):
3097         (WebCore::HTMLInputElement::didAttachRenderers):
3098         * html/HTMLInputElement.h:
3099         * html/HTMLTextAreaElement.cpp:
3100         (WebCore::HTMLTextAreaElement::updateFocusAppearance):
3101         * html/HTMLTextAreaElement.h:
3102
3103 2015-10-22  Joonghun Park  <jh718.park@samsung.com>
3104
3105         [EFL] Fix build break since r191439
3106         https://bugs.webkit.org/show_bug.cgi?id=150441
3107
3108         Reviewed by Csaba Osztrogonác.
3109
3110         No new tests, no new behaviours.
3111
3112         * platform/Logging.cpp:
3113         (WebCore::registerNotifyCallback):
3114
3115 2015-10-22  Carlos Garcia Campos  <cgarcia@igalia.com>
3116
3117         Unreviewed. Fix GTK+ build after r191423.
3118
3119         Deprecate removed class WebKitDOMHTMLBaseFontElement.
3120
3121         * PlatformGTK.cmake:
3122         * bindings/gobject/WebKitDOMDeprecated.cpp:
3123         (webkit_dom_html_base_font_element_init):
3124         (webkit_dom_html_base_font_element_class_init):
3125         (webkit_dom_html_base_font_element_get_color):
3126         (webkit_dom_html_base_font_element_set_color):
3127         (webkit_dom_html_base_font_element_get_face):
3128         (webkit_dom_html_base_font_element_set_face):
3129         (webkit_dom_html_base_font_element_get_size):
3130         (webkit_dom_html_base_font_element_set_size):
3131         * bindings/gobject/WebKitDOMDeprecated.h:
3132         * bindings/gobject/WebKitDOMDeprecated.symbols:
3133         * bindings/gobject/WebKitDOMHTMLPrivate.cpp:
3134         * html/HTMLBaseFontElement.h:
3135         * html/HTMLBaseFontElement.idl:
3136
3137 2015-10-22  Xabier Rodriguez Calvar  <calvaris@igalia.com>
3138
3139         [Streams API] Add writable stream attributes
3140         https://bugs.webkit.org/show_bug.cgi?id=150389
3141
3142         Reviewed by Darin Adler.
3143
3144         This patch adds the three writable stream attributes, which are closed, ready and state. They are implemented
3145         according to the spec.
3146
3147         Current test set suffices, expectations were adjusted accordingly.
3148
3149         * Modules/streams/WritableStream.js:
3150         (initializeWritableStream): Style fix.
3151         (closed):
3152         (ready):
3153         (state): Implemented according to the spec.
3154         * Modules/streams/WritableStreamInternals.js:
3155         (isWritableStream): Implemented according to the spec.
3156
3157 2015-10-22  Frederic Wang  <fred.wang@free.fr>
3158
3159         Rollout r190440 for the moment. It broke the build.
3160
3161         * platform/graphics/cocoa/FontCocoa.mm:
3162         (WebCore::Font::platformInit): Deleted.
3163
3164 2015-10-22  Frederic Wang  <fred.wang@free.fr>
3165
3166         Unreviewed compilation fix on Mac.
3167
3168         * platform/graphics/cocoa/FontCocoa.mm:
3169         (WebCore::Font::platformInit): Use a pointer for the third argument of CFArrayContainsValue.
3170
3171 2015-10-21  Frederic Wang  <fred.wang@free.fr>
3172
3173         Unreviewed compilation fix on Mac.
3174
3175         * platform/graphics/cocoa/FontCocoa.mm:
3176         (WebCore::Font::platformInit): Add missing font argument.
3177
3178 2015-10-21  Frederic Wang  <fred.wang@free.fr>
3179
3180         [Mac] Add support for the USE_TYPO_METRICS flag
3181         https://bugs.webkit.org/show_bug.cgi?id=150394
3182
3183         Reviewed by Myles C. Maxfield.
3184
3185         Make the Cocoa backend use the typo metrics for fonts with a MATH table when the OS/2 USE_TYPO_METRICS flag is set.
3186
3187         No new tests because this is already tested by fonts/use-typo-metrics-1.html
3188
3189         * platform/graphics/cocoa/FontCocoa.mm:
3190         (WebCore::Font::platformInit): Verify whether the OS/2 USE_TYPO_METRICS flag is set and use the typo metrics if that is the case.
3191
3192 2015-10-21  Zalan Bujtas  <zalan@apple.com>
3193
3194         Print out the render tree from command line.
3195         https://bugs.webkit.org/show_bug.cgi?id=150416
3196
3197         Use system-wide notification server (https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/notify_register_dispatch.3.html)
3198         to print out the render tree for the live documents.
3199
3200         Usage: notifyutil -p com.apple.WebKit.showRenderTree
3201
3202         Reviewed by Simon Fraser.
3203
3204         No change in functionality.
3205
3206         * platform/Logging.cpp:
3207         (WebCore::registerNotifyCallback):
3208         * platform/Logging.h:
3209         * rendering/RenderObject.cpp:
3210         (WebCore::RenderObject::RenderObject):
3211         (WebCore::printRenderTreeForLiveDocuments):
3212
3213 2015-10-21  Alex Christensen  <achristensen@webkit.org>
3214
3215         Fix CMake clean build after r191423.
3216
3217         * CMakeLists.txt:
3218         HTMLBaseFontElement.idl no longer generates any JavaScript bindings.
3219
3220 2015-10-21  Brian Burg  <bburg@apple.com>
3221
3222         Unreviewed, CMake build fix after r191433.
3223
3224         * CMakeLists.txt: add WritableStreamInternals.js to WebCore_BUILTINS_SOURCES.
3225
3226 2015-10-21  Brian Burg  <bburg@apple.com>
3227
3228         Restructure generate-js-bindings script to be modular and testable
3229         https://bugs.webkit.org/show_bug.cgi?id=149929
3230
3231         Reviewed by Alex Christensen.
3232
3233         * CMakeLists.txt:
3234
3235             Define JavaScriptCore_SCRIPTS_DIR explicitly so the add_custom_command and
3236             shared file lists are identical between JavaScriptCore and WebCore.
3237
3238             The output files additionally depend on all builtin generator script files.
3239
3240         * DerivedSources.make:
3241
3242             Use JavaScriptCore_SCRIPTS_DIR so that the rule for code generation and
3243             shared file lists are identical between JavaScriptCore and WebCore.
3244
3245             The output files additionally depend on all builtin generator script files.
3246
3247         * WebCore.xcodeproj/project.pbxproj:
3248
3249             Define JavaScriptCore_SCRIPTS_DIR before calling DerivedSources.make.
3250             This will eventually be merged with the other similar script paths.
3251
3252         * bindings/js/JSDOMWindowBase.cpp:
3253         (WebCore::JSDOMWindowBase::finishCreation):
3254
3255             Update the generated builtin macro names.
3256
3257         * generate-js-builtins: Removed.
3258
3259 2015-10-21  Alex Christensen  <achristensen@webkit.org>
3260
3261         Recommit r191428.
3262
3263         I don't think it was supposed to be reverted in r191429, and it really does fix the build.
3264
3265         * loader/EmptyClients.h:
3266         (WebCore::EmptyContextMenuClient::~EmptyContextMenuClient):
3267         Remove customizeMenu again.
3268
3269 2015-10-21  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3270
3271         [EFL][GTK][WK2] Fix build break since r191402, r191401
3272         https://bugs.webkit.org/show_bug.cgi?id=150432
3273
3274         Unreviewed EFL and GTK build fix.
3275
3276         * loader/EmptyClients.h:
3277
3278 2015-10-21  Alex Christensen  <achristensen@webkit.org>
3279
3280         Build fix after r191422.
3281
3282         * page/ContextMenuClient.h:
3283         (WebCore::ContextMenuClient::~ContextMenuClient):
3284         Completely remove customizeMenu.
3285
3286 2015-10-21  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3287
3288         Remove unnecessary default quota setting in DatabaseContext::databaseExceededQuota
3289         https://bugs.webkit.org/show_bug.cgi?id=150356
3290
3291         Reviewed by Darin Adler.
3292
3293         All ports have supported DatabaseContext::databaseExceededQuota(). Thus we don't need to
3294         keep a test code to extend database quota anymore.
3295
3296         * Modules/webdatabase/DatabaseContext.cpp:
3297         (WebCore::DatabaseContext::databaseExceededQuota): Deleted.
3298
3299 2015-10-21  Chris Dumez  <cdumez@apple.com>
3300
3301         Un-expose obsolete HTMLBaseFontElement
3302         https://bugs.webkit.org/show_bug.cgi?id=150397
3303
3304         Reviewed by Anders Carlsson.
3305
3306         Un-expose obsolete HTMLBaseFontElement:
3307         - https://html.spec.whatwg.org/multipage/obsolete.html#non-conforming-features
3308
3309         This means that we no longer expose HTMLBaseFontElement on the global
3310         Window object. Firefox and Chrome do not expose it either.
3311
3312         Also, document.createElement("basefont") now returns an HTMLUnknownElement
3313         as per the specification. Firefox and Chrome return a generic HTMLElement
3314         instead but I don't think this is a big compatibility risk.
3315
3316         No new tests, already covered by existing tests.
3317
3318         * html/HTMLBaseFontElement.cpp:
3319         (WebCore::HTMLBaseFontElement::HTMLBaseFontElement):
3320         * html/HTMLBaseFontElement.h:
3321         * html/HTMLBaseFontElement.idl:
3322         * html/HTMLTagNames.in:
3323
3324 2015-10-21  Anders Carlsson  <andersca@apple.com>
3325
3326         Get rid of WebContextMenuClient::customizeMenu, it's no longer used
3327         https://bugs.webkit.org/show_bug.cgi?id=150427
3328
3329         Reviewed by Tim Horton.
3330         * loader/EmptyClients.cpp:
3331         (WebCore::EmptyContextMenuClient::customizeMenu): Deleted.
3332         * loader/EmptyClients.h:
3333         * page/ContextMenuController.cpp:
3334         (WebCore::ContextMenuController::showContextMenu):
3335
3336 2015-10-21  Anders Carlsson  <andersca@apple.com>
3337
3338         Remove dead MHTML code
3339         https://bugs.webkit.org/show_bug.cgi?id=150426
3340
3341         Reviewed by Tim Horton.
3342
3343         * loader/archive/mhtml/MHTMLArchive.cpp:
3344         (WebCore::MHTMLArchive::generateMHTMLData):
3345         (WebCore::MHTMLArchive::generateMHTMLDataUsingBinaryEncoding): Deleted.
3346         * loader/archive/mhtml/MHTMLArchive.h:
3347
3348 2015-10-21  Dean Jackson  <dino@apple.com>
3349
3350         Null dereference loading Blink layout test svg/filters/display-none-filter-primitive.html
3351         https://bugs.webkit.org/show_bug.cgi?id=150212
3352         <rdar://problem/23137376>
3353
3354         Reviewed by Brent Fulgham.
3355
3356         Handle the case where a filter element doesn't have a renderer. Inspired by the Blink
3357         commit:
3358         https://chromium.googlesource.com/chromium/src.git/+/fb79f7fc46552d45127acd2959a23662ad8f271e
3359
3360         Test: svg/filters/display-none-filter-primitive.html
3361
3362         * rendering/svg/RenderSVGResourceFilter.cpp:
3363         (WebCore::RenderSVGResourceFilter::buildPrimitives):
3364         * svg/graphics/filters/SVGFilterBuilder.cpp:
3365         (WebCore::SVGFilterBuilder::appendEffectToEffectReferences):
3366
3367 2015-10-21  Brady Eidson  <beidson@apple.com>
3368
3369         Modern IDB: Add basic transaction aborting.
3370         https://bugs.webkit.org/show_bug.cgi?id=150148
3371
3372         Reviewed by Alex Christensen.
3373
3374         Tests: storage/indexeddb/modern/double-abort.html
3375                storage/indexeddb/modern/versionchange-abort-then-reopen.html
3376
3377         * CMakeLists.txt:
3378         * WebCore.xcodeproj/project.pbxproj:
3379         
3380         * Modules/indexeddb/IndexedDB.h:
3381         
3382         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
3383         (WebCore::IDBClient::IDBConnectionToServer::abortTransaction):
3384         (WebCore::IDBClient::IDBConnectionToServer::didAbortTransaction):
3385         * Modules/indexeddb/client/IDBConnectionToServer.h:
3386         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
3387         
3388         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
3389         (WebCore::IDBClient::IDBDatabase::abortTransaction):
3390         (WebCore::IDBClient::IDBDatabase::didCommitOrAbortTransaction):
3391         * Modules/indexeddb/client/IDBDatabaseImpl.h:
3392         
3393         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
3394         (WebCore::IDBClient::IDBTransaction::IDBTransaction):
3395         (WebCore::IDBClient::IDBTransaction::abort):
3396         (WebCore::IDBClient::IDBTransaction::isFinishedOrFinishing):
3397         (WebCore::IDBClient::IDBTransaction::activationTimerFired):
3398         (WebCore::IDBClient::IDBTransaction::didAbort):
3399         * Modules/indexeddb/client/IDBTransactionImpl.h:
3400         
3401         * Modules/indexeddb/server/IDBBackingStore.h:
3402         
3403         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
3404         (WebCore::IDBServer::IDBConnectionToClient::didAbortTransaction):
3405         * Modules/indexeddb/server/IDBConnectionToClient.h:
3406         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
3407         
3408         * Modules/indexeddb/server/IDBServer.cpp:
3409         (WebCore::IDBServer::IDBServer::abortTransaction):
3410         * Modules/indexeddb/server/IDBServer.h:
3411         
3412         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
3413         (WebCore::IDBServer::MemoryBackingStoreTransaction::create):
3414         (WebCore::IDBServer::MemoryBackingStoreTransaction::MemoryBackingStoreTransaction):
3415         (WebCore::IDBServer::MemoryBackingStoreTransaction::~MemoryBackingStoreTransaction):
3416         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
3417         (WebCore::IDBServer::MemoryBackingStoreTransaction::commit):
3418         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
3419         (WebCore::IDBServer::MemoryBackingStoreTransaction::isVersionChange):
3420         
3421         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
3422         (WebCore::IDBServer::MemoryIDBBackingStore::setDatabaseInfo):
3423         (WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction):
3424         (WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
3425         (WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):
3426         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
3427
3428         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3429         (WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
3430         (WebCore::IDBServer::UniqueIDBDatabase::beginTransactionInBackingStore):
3431         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
3432         (WebCore::IDBServer::UniqueIDBDatabase::performCommitTransaction):
3433         (WebCore::IDBServer::UniqueIDBDatabase::didPerformCommitTransaction):
3434         (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
3435         (WebCore::IDBServer::UniqueIDBDatabase::performAbortTransaction):
3436         (WebCore::IDBServer::UniqueIDBDatabase::didPerformAbortTransaction):
3437         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3438         
3439         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
3440         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction):
3441         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
3442         
3443         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
3444         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction):
3445         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::originalDatabaseInfo):
3446         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::abort):
3447         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
3448         
3449         * Modules/indexeddb/shared/IDBError.cpp:
3450         (WebCore::idbErrorName):
3451         (WebCore::idbErrorDescription):
3452         * Modules/indexeddb/shared/IDBError.h:
3453
3454         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
3455         (WebCore::InProcessIDBServer::didAbortTransaction):
3456         (WebCore::InProcessIDBServer::abortTransaction):
3457         * Modules/indexeddb/shared/InProcessIDBServer.h:
3458
3459 2015-10-21  Chris Dumez  <cdumez@apple.com>
3460
3461         bgsound should use HTMLUnknownElement interface
3462         https://bugs.webkit.org/show_bug.cgi?id=148857
3463         <rdar://problem/22589036>
3464
3465         Reviewed by Sam Weinig.
3466
3467         The blink, bgsound, isindex, multicol, nextid, and spacer elements must
3468         use the HTMLUnknownElement interface, as per the HTML specification:
3469         https://html.spec.whatwg.org/multipage/obsolete.html#other-elements,-attributes-and-apis
3470
3471         WebKit was using HTMLUnknownElement for all of them except bgsound.
3472         This patch fixes the issue and aligns our behavior with Chrome and
3473         Firefox.
3474
3475         No new tests, already covered by existing tests.
3476
3477         * html/HTMLTagNames.in:
3478
3479 2015-10-21  Antoine Quint  <graouts@apple.com>
3480
3481         Support for the SVG `onend` attribute
3482         https://bugs.webkit.org/show_bug.cgi?id=150393
3483
3484         Reviewed by Dean Jackson.
3485
3486         Add support for the SVG `onend` attribute to SVG timing and animation elements, which allow the definition
3487         of a JS event listener declaratively for the SVG `endEvent` event.
3488
3489         Tests: svg/animations/end-event-attribute-expected.svg
3490                svg/animations/end-event-attribute.svg
3491                svg/animations/end-event-syncbase-expected.svg
3492                svg/animations/end-event-syncbase.svg
3493
3494         * dom/EventNames.h:
3495         * svg/animation/SVGSMILElement.cpp:
3496         (WebCore::SVGSMILElement::parseAttribute):
3497         * svg/svgattrs.in:
3498
3499 2015-10-21  Nan Wang  <n_wang@apple.com>
3500
3501         AX: Expose table size and cell indexes on iOS
3502         https://bugs.webkit.org/show_bug.cgi?id=150366
3503
3504         Add support to expose table row/column count and cell indexes on iOS.
3505
3506         Reviewed by Chris Fleizach.
3507
3508         Test: accessibility/aria-table-attributes.html
3509
3510         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3511         (-[WebAccessibilityObjectWrapper tableParent]):
3512         (-[WebAccessibilityObjectWrapper accessibilityElementForRow:andColumn:]):
3513         (-[WebAccessibilityObjectWrapper accessibilityRowCount]):
3514         (-[WebAccessibilityObjectWrapper accessibilityColumnCount]):
3515         (-[WebAccessibilityObjectWrapper accessibilityARIARowCount]):
3516         (-[WebAccessibilityObjectWrapper accessibilityARIAColumnCount]):
3517         (-[WebAccessibilityObjectWrapper accessibilityARIARowIndex]):
3518         (-[WebAccessibilityObjectWrapper accessibilityARIAColumnIndex]):
3519         (-[WebAccessibilityObjectWrapper accessibilityRowRange]):
3520
3521 2015-10-21  Chris Dumez  <cdumez@apple.com>
3522
3523         HTMLIFrameElement.sandbox should be a DOMSettableTokenList
3524         https://bugs.webkit.org/show_bug.cgi?id=150377
3525
3526         Reviewed by Ryosuke Niwa.
3527
3528         HTMLIFrameElement.sandbox should be a DOMSettableTokenList as per the
3529         HTML specification:
3530         - https://html.spec.whatwg.org/multipage/embedded-content.html#htmliframeelement
3531
3532         Chrome and Firefox match the specification but Safari/WebKit was uding
3533         a DOMString.
3534
3535         Test: fast/frames/sandbox-attribute.html
3536
3537         * html/HTMLIFrameElement.cpp:
3538         (WebCore::HTMLIFrameElement::sandbox):
3539         (WebCore::HTMLIFrameElement::parseAttribute):
3540         * html/HTMLIFrameElement.h:
3541         * html/HTMLIFrameElement.idl:
3542
3543 2015-10-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3544
3545         ASSERTION FAILED: markFontData in FontCascade::emphasisMarkHeight
3546         https://bugs.webkit.org/show_bug.cgi?id=150171
3547
3548         Reviewed by Myles C. Maxfield.
3549
3550         It happens with several tests like fast/ruby/text-emphasis.html in
3551         the GTK Debug bot. The tests seem to pass in Release and the rendering
3552         looks correct as well removing the assert. The thing is that
3553         for some reason we can get an empty GlyphData from
3554         FontCascade::getEmphasisMarkGlyphData() when it ends up falling
3555         back to system (FontCascadeFonts::glyphDataForSystemFallback).
3556
3557         * platform/graphics/FontCascade.cpp:
3558         (WebCore::FontCascade::getEmphasisMarkGlyphData): Return
3559         Optional<GlyphData> instead of returning a boolean and an out
3560         parameter. If we get an invalid GlyphData, Nullopt is
3561         returned. Also use a SurrogatePairAwareTextIterator to handle
3562         surrogate pairs.
3563         (WebCore::FontCascade::emphasisMarkAscent):
3564         (WebCore::FontCascade::emphasisMarkDescent):
3565         (WebCore::FontCascade::emphasisMarkHeight):
3566         (WebCore::FontCascade::drawEmphasisMarks):
3567         * platform/graphics/FontCascade.h:
3568         * platform/graphics/GlyphPage.h:
3569         (WebCore::GlyphData::isValid): Return whether the GlyphData is valid.
3570
3571 2015-10-20  Sergio Villar Senin  <svillar@igalia.com>
3572
3573         [css-grid] Fix availableLogicalSpace computation with non-zero baseSize flex tracks
3574         https://bugs.webkit.org/show_bug.cgi?id=150359
3575
3576         Reviewed by Zalan Bujtas.
3577
3578         The availableLogicalSpace computation was incorrect whenever
3579         the flex tracks had a non-zero baseSize before the 1fr unit
3580         size resolution. That happened because when assigning the new
3581         baseSize to the flex track, we were unconditionally
3582         subtracting the whole baseSize to the
3583         availableLogicalSpace. That's correct if the track is a "pure"
3584         flex track, i.e. 2fr, but if the track had a non-zero baseSize
3585         (like minmax(10px, 1fr)) then both the new and the old base
3586         sizes were incorrectly used to compute the
3587         availableLogicalSpace.
3588
3589         We can test the amount of remaining freeSpace by using content
3590         distribution to align and item place on a non-zero baseSize
3591         flex track. The content distribution will be accurate if and
3592         only if the availableLogicalSpace computation is correct.
3593
3594         Test: fast/css-grid-layout/flex-content-distribution.html
3595
3596         * rendering/RenderGrid.cpp:
3597         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
3598
3599 2015-10-21  Xabier Rodriguez Calvar  <calvaris@igalia.com>
3600
3601         [Streams API] Construct a writable stream
3602         https://bugs.webkit.org/show_bug.cgi?id=150360
3603
3604         Reviewed by Darin Adler.
3605
3606         This patch initializes a writable stream according to the spec. To do it we need two internal functions, which
3607         are syncWritableStreamStateWithQueue and errorWritableStream, which are also implemented as a quite direct
3608         translation from the spec.
3609
3610         Current test set suffices, expectations are updated accordingly.
3611
3612         * CMakeLists.txt:
3613         * DerivedSources.make:
3614         * WebCore.xcodeproj/project.pbxproj:
3615         * bindings/js/JSDOMWindowBase.cpp:
3616         * bindings/js/WebCoreBuiltinNames.h:
3617         * bindings/js/WebCoreJSBuiltinInternals.h:
3618         * bindings/js/WebCoreJSBuiltins.cpp:
3619         * bindings/js/WebCoreJSBuiltins.h: Build infrastructure.
3620         * Modules/streams/WritableStream.js:
3621         (initializeWritableStream): Function that acts as constructor of WritableStream.
3622         * Modules/streams/WritableStreamInternals.js:
3623         (syncWritableStreamStateWithQueue):
3624         (errorWritableStream): As per spec.
3625
3626 2015-10-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3627
3628         NetworkProcess: DNS prefetch happens in the Web Process
3629         https://bugs.webkit.org/show_bug.cgi?id=147824
3630
3631         Reviewed by Chris Dumez.
3632
3633         Use FrameLoaderClient to do the DNS prefetch.
3634
3635         * html/HTMLAnchorElement.cpp:
3636         (WebCore::HTMLAnchorElement::parseAttribute):
3637         * loader/EmptyClients.h:
3638         * loader/FrameLoaderClient.h:
3639         * loader/LinkLoader.cpp:
3640         (WebCore::LinkLoader::loadLink):
3641         * page/Chrome.cpp:
3642         (WebCore::Chrome::mouseDidMoveOverElement):
3643
3644 2015-10-21  Frederic Wang  <fred.wang@free.fr>
3645
3646         [FreeType] Add support for the USE_TYPO_METRICS flag
3647         https://bugs.webkit.org/show_bug.cgi?id=150340
3648
3649         Reviewed by Martin Robinson.
3650
3651         Test: fonts/use-typo-metrics-1.html
3652
3653         Make the FreeType backend use the typo metrics when the OS/2 USE_TYPO_METRICS flag is set.
3654         Similar work should be done for other backends, see bug 131839.
3655
3656         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
3657         (WebCore::Font::platformInit): Verify whether the OS/2 USE_TYPO_METRICS flag is set and use the typo metrics if that's the case.
3658
3659 2015-10-20  Hunseop Jeong  <hs85.jeong@samsung.com>
3660
3661         Replace 0 and NULL with nullptr in WebCore/loader.
3662         https://bugs.webkit.org/show_bug.cgi?id=149657
3663
3664         Reviewed by Darin Adler.
3665
3666         No new tests because there is no behavior change.
3667
3668         * loader/CookieJar.cpp:
3669         (WebCore::networkingContext):
3670         * loader/DocumentLoader.cpp:
3671         (WebCore::DocumentLoader::DocumentLoader):
3672         (WebCore::DocumentLoader::frameLoader):
3673         (WebCore::DocumentLoader::popArchiveForSubframe):
3674         (WebCore::DocumentLoader::clearArchiveResources):
3675         (WebCore::DocumentLoader::clearMainResource):
3676         (WebCore::DocumentLoader::subresourceLoaderFinishedLoadingOnePart):
3677         * loader/DocumentThreadableLoader.cpp:
3678         (WebCore::DocumentThreadableLoader::cancel):
3679         (WebCore::DocumentThreadableLoader::setDefersLoading):
3680         (WebCore::DocumentThreadableLoader::clearResource):
3681         * loader/EmptyClients.cpp:
3682         (WebCore::EmptyFrameLoaderClient::createJavaAppletWidget):
3683         (WebCore::EmptyFrameLoaderClient::createNetworkingContext):
3684         * loader/EmptyClients.h:
3685         * loader/FTPDirectoryParser.cpp:
3686         (WebCore::parseOneFTPLine):
3687         * loader/FTPDirectoryParser.h:
3688         (WebCore::ListResult::clear):
3689         * loader/FormSubmission.cpp:
3690         (WebCore::FormSubmission::create):
3691         * loader/FrameLoader.cpp:
3692         (WebCore::FrameLoader::clear):
3693         (WebCore::FrameLoader::stopAllLoaders):
3694         (WebCore::FrameLoader::clearProvisionalLoad):
3695         (WebCore::FrameLoader::transitionToCommitted):
3696         (WebCore::FrameLoader::closeAndRemoveChild):
3697         (WebCore::FrameLoader::detachFromParent):
3698         (WebCore::FrameLoader::detachViewsAndDocumentLoader):
3699         (WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy):
3700         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
3701         * loader/FrameLoader.h:
3702         (WebCore::FrameLoader::stateMachine):
3703         * loader/FrameNetworkingContext.h:
3704         (WebCore::FrameNetworkingContext::invalidate):
3705         * loader/HistoryController.cpp:
3706         (WebCore::HistoryController::replaceState):
3707         * loader/ImageLoader.cpp:
3708         (WebCore::ImageLoader::ImageLoader):
3709         (WebCore::ImageLoader::updateFromElement):
3710         * loader/NetscapePlugInStreamLoader.cpp:
3711         (WebCore::NetscapePlugInStreamLoader::releaseResources):
3712         * loader/ResourceLoadNotifier.h:
3713         * loader/ResourceLoadScheduler.cpp:
3714         (WebCore::resourceLoadScheduler):
3715         * loader/SubresourceLoader.cpp:
3716         (WebCore::SubresourceLoader::releaseResources):
3717         * loader/TextResourceDecoder.cpp:
3718         (WebCore::TextResourceDecoder::TextResourceDecoder):
3719         * loader/ThreadableLoaderClientWrapper.h:
3720         (WebCore::ThreadableLoaderClientWrapper::clearClient):
3721         (WebCore::ThreadableLoaderClientWrapper::done):
3722         * loader/appcache/ApplicationCache.cpp:
3723         (WebCore::fallbackURLLongerThan):
3724         (WebCore::ApplicationCache::ApplicationCache):
3725         (WebCore::ApplicationCache::resourceForRequest):
3726         * loader/appcache/ApplicationCache.h:
3727         (WebCore::ApplicationCache::fallbackURLs):
3728         * loader/appcache/ApplicationCacheGroup.cpp:
3729         (WebCore::ApplicationCacheGroup::ApplicationCacheGroup):
3730         (WebCore::ApplicationCacheGroup::fallbackCacheForMainRequest):
3731         (WebCore::ApplicationCacheGroup::selectCache):
3732         (WebCore::ApplicationCacheGroup::finishedLoadingMainResource):
3733         (WebCore::ApplicationCacheGroup::failedLoadingMainResource):
3734         (WebCore::ApplicationCacheGroup::manifestNotFound):
3735         (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
3736         * loader/appcache/ApplicationCacheHost.cpp:
3737         (WebCore::ApplicationCacheHost::ApplicationCacheHost):
3738         (WebCore::ApplicationCacheHost::setApplicationCache):
3739         * loader/appcache/ApplicationCacheHost.h:
3740         (WebCore::ApplicationCacheHost::candidateApplicationCacheGroup):
3741         * loader/appcache/ApplicationCacheStorage.cpp:
3742         (WebCore::StorageIDJournal::Record::Record):
3743         (WebCore::StorageIDJournal::Record::restore):
3744         (WebCore::ApplicationCacheStorage::loadCacheGroup):
3745         (WebCore::ApplicationCacheStorage::cacheGroupForURL):
3746         (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
3747         (WebCore::ApplicationCacheStorage::cacheGroupDestroyed):
3748         (WebCore::ApplicationCacheStorage::loadCache):
3749         * loader/appcache/DOMApplicationCache.cpp:
3750         (WebCore::DOMApplicationCache::disconnectFrameForPageCache):
3751         (WebCore::DOMApplicationCache::willDestroyGlobalObjectInFrame):
3752         (WebCore::DOMApplicationCache::applicationCacheHost):
3753         (WebCore::DOMApplicationCache::scriptExecutionContext):
3754         (WebCore::DOMApplicationCache::toEventType):
3755         * loader/archive/ArchiveFactory.cpp:
3756         (WebCore::ArchiveFactory::create):
3757         (WebCore::ArchiveFactory::registerKnownArchiveMIMETypes):
3758         * loader/archive/ArchiveResourceCollection.cpp:
3759         (WebCore::ArchiveResourceCollection::archiveResourceForURL):
3760         * loader/archive/cf/LegacyWebArchive.cpp:
3761         (WebCore::LegacyWebArchive::createPropertyListRepresentation):
3762         (WebCore::LegacyWebArchive::createResource):
3763         (WebCore::LegacyWebArchive::create):
3764         (WebCore::LegacyWebArchive::rawDataRepresentation):
3765         * loader/archive/cf/LegacyWebArchiveMac.mm:
3766         (WebCore::LegacyWebArchive::createPropertyListRepresentation):
3767         * loader/archive/mhtml/MHTMLArchive.cpp:
3768         (WebCore::MHTMLArchive::create):
3769         (WebCore::MHTMLArchive::generateMHTMLData):
3770         * loader/archive/mhtml/MHTMLParser.cpp:
3771         (WebCore::MHTMLParser::parseArchiveWithHeader):
3772         (WebCore::MHTMLParser::parseNextPart):
3773         * loader/cache/CachedImage.cpp:
3774         (WebCore::CachedImage::CachedImage):
3775         * loader/cache/CachedImageClient.h:
3776         (WebCore::CachedImageClient::imageChanged):
3777         (WebCore::CachedImageClient::newImageAnimationFrameAvailable):
3778         * loader/cache/CachedRawResource.cpp:
3779         (WebCore::CachedRawResource::calculateIncrementalDataChunk):
3780         * loader/cache/CachedRawResourceClient.h:
3781         (WebCore::CachedRawResourceClient::dataReceived):
3782         (WebCore::CachedRawResourceClient::redirectReceived):
3783         (WebCore::CachedRawResourceClient::getOrCreateReadBuffer):
3784         * loader/cache/CachedResource.cpp:
3785         (WebCore::CachedResource::CachedResource):
3786         (WebCore::CachedResource::clearResourceToRevalidate):
3787         * loader/cache/CachedResourceClientWalker.h:
3788         (WebCore::CachedResourceClientWalker::next):
3789         * loader/cache/CachedResourceHandle.cpp:
3790         (WebCore::CachedResourceHandleBase::CachedResourceHandleBase):
3791         * loader/cache/CachedResourceLoader.cpp:
3792         (WebCore::createResource):
3793         (WebCore::CachedResourceLoader::CachedResourceLoader):
3794         (WebCore::CachedResourceLoader::~CachedResourceLoader):
3795         (WebCore::CachedResourceLoader::canRequest): Return value is bool.
3796         (WebCore::CachedResourceLoader::requestResource):
3797         * loader/cache/CachedResourceLoader.h:
3798         (WebCore::CachedResourceLoader::document):
3799         (WebCore::CachedResourceLoader::setDocument):
3800         (WebCore::CachedResourceLoader::clearDocumentLoader):
3801         * loader/cache/CachedSVGDocumentReference.cpp:
3802         (WebCore::CachedSVGDocumentReference::CachedSVGDocumentReference):
3803         * loader/cf/ResourceLoaderCFNet.cpp:
3804         (WebCore::ResourceLoader::shouldCacheResponse): Return value is bool.
3805         * loader/icon/IconDatabase.cpp:
3806         (WebCore::IconDatabase::synchronousIconForPageURL):
3807         (WebCore::IconDatabase::synchronousNativeIconForPageURL):
3808         (WebCore::IconDatabase::setIconDataForIconURL):
3809         (WebCore::IconDatabase::getOrCreatePageURLRecord):
3810         (WebCore::IconDatabase::cleanupSyncThread):
3811         * loader/icon/IconDatabaseBase.cpp:
3812         (WebCore::IconDatabaseBase::open):
3813         (WebCore::iconDatabase):
3814         * loader/icon/IconDatabaseBase.h:
3815         (WebCore::EnumCallback::performCallback):
3816         (WebCore::EnumCallback::invalidate):
3817         (WebCore::ObjectCallback::performCallback):
3818         (WebCore::ObjectCallback::invalidate):
3819         * loader/icon/PageURLRecord.cpp:
3820         (WebCore::PageURLRecord::~PageURLRecord):
3821         (WebCore::PageURLRecord::setIconRecord):
3822         * loader/mac/ResourceLoaderMac.mm:
3823         (WebCore::ResourceLoader::willCacheResponse):
3824         * loader/soup/CachedRawResourceSoup.cpp:
3825         (WebCore::CachedRawResource::getOrCreateReadBuffer):
3826
3827 2015-10-20  Chris Dumez  <cdumez@apple.com>
3828
3829         Unreviewed, GTK API test fix after r191351.
3830
3831         Reverted API change for GTK bindings.
3832
3833         * html/HTMLOptionsCollection.idl:
3834         * html/HTMLSelectElement.idl:
3835
3836 2015-10-20  Chris Dumez  <cdumez@apple.com>
3837
3838         Unreviewed, Another GTK build fix after r191351.
3839
3840         * html/HTMLCollection.idl:
3841
3842 2015-10-20  Chris Dumez  <cdumez@apple.com>
3843
3844         Unreviewed, Another GTK build fix after r191351.
3845
3846         * html/HTMLFieldSetElement.cpp:
3847         (WebCore::HTMLFieldSetElement::elementsForNativeBindings):
3848         (WebCore::HTMLFieldSetElement::elementsForObjC): Deleted.
3849         * html/HTMLFieldSetElement.h:
3850         * html/HTMLFieldSetElement.idl:
3851
3852 2015-10-20  Chris Fleizach  <cfleizach@apple.com>
3853
3854         AX: CrashTracer: com.apple.WebKit.WebContent at com.apple.WebCore: WebCore::AccessibilityTable::tableElement const + 116
3855         https://bugs.webkit.org/show_bug.cgi?id=150349
3856
3857         Reviewed by Brent Fulgham.
3858
3859         The crash point for this bug says that the parentElement of the firstBody is garbage when it's accessed. 
3860         Unfortunately, I could not reproduce this in-situ or with a test. 
3861         So my speculative solution is to recalculate those body elements to ensure that they're valid before we access.
3862
3863         * accessibility/AccessibilityTable.cpp:
3864         (WebCore::AccessibilityTable::tableElement):
3865         (WebCore::AccessibilityTable::isDataTable):
3866
3867 2015-10-20  Chris Dumez  <cdumez@apple.com>
3868
3869         Unreviewed, GTK build fix after r191351.
3870
3871         * html/HTMLFormElement.cpp:
3872         (WebCore::HTMLFormElement::elementsForNativeBindings):
3873         (WebCore::HTMLFormElement::elementsForObjC): Deleted.
3874         * html/HTMLFormElement.h:
3875         * html/HTMLFormElement.idl:
3876
3877 2015-10-20  Simon Fraser  <simon.fraser@apple.com>
3878
3879         Add basic TextStream output for Images
3880         https://bugs.webkit.org/show_bug.cgi?id=150350
3881
3882         Reviewed by Darin Adler.
3883
3884         Add a TextStream output operator for Image, and virtual dump() member functions
3885         that the various image types override to dump their own data.
3886         
3887         Add isFoo() functions for each image type (surprising that these didn't already
3888         exist) so we can print the image type.
3889         
3890         Make isAnimated() const, and isBitmapImage() private.
3891
3892         * platform/graphics/BitmapImage.cpp:
3893         (WebCore::BitmapImage::dump):
3894         * platform/graphics/BitmapImage.h:
3895         * platform/graphics/CrossfadeGeneratedImage.cpp:
3896         (WebCore::CrossfadeGeneratedImage::dump):
3897         * platform/graphics/CrossfadeGeneratedImage.h:
3898         * platform/graphics/GeneratedImage.cpp:
3899         * platform/graphics/GeneratedImage.h:
3900         * platform/graphics/GradientImage.cpp:
3901         (WebCore::GradientImage::dump):
3902         * platform/graphics/GradientImage.h:
3903         * platform/graphics/Image.cpp:
3904         (WebCore::Image::dump):
3905         (WebCore::operator<<):
3906         * platform/graphics/Image.h:
3907         (WebCore::Image::isGeneratedImage):
3908         (WebCore::Image::isCrossfadeGeneratedImage):
3909         (WebCore::Image::isNamedImageGeneratedImage):
3910         (WebCore::Image::isGradientImage):
3911         (WebCore::Image::isSVGImage):
3912         (WebCore::Image::isAnimated):
3913         * platform/graphics/NamedImageGeneratedImage.cpp:
3914         (WebCore::NamedImageGeneratedImage::dump):
3915         * platform/graphics/NamedImageGeneratedImage.h:
3916         * platform/graphics/cg/PDFDocumentImage.cpp:
3917         (WebCore::PDFDocumentImage::dump):
3918         * platform/graphics/cg/PDFDocumentImage.h:
3919         * svg/graphics/SVGImage.cpp:
3920         (WebCore::SVGImage::dump):
3921         * svg/graphics/SVGImage.h:
3922
3923 2015-10-20  Chris Dumez  <cdumez@apple.com>
3924
3925         Use tighter typing for collections / node lists' item() / namedItem() methods
3926         https://bugs.webkit.org/show_bug.cgi?id=150347
3927
3928         Reviewed by Darin Adler.
3929
3930         Use tighter typing for collections / node lists' item() / namedItem() methods.
3931
3932         * accessibility/AccessibilityRenderObject.cpp:
3933         (WebCore::AccessibilityRenderObject::getDocumentLinks):
3934         * dom/LiveNodeList.h:
3935         * dom/StaticNodeList.cpp:
3936         (WebCore::StaticElementList::item):
3937         * dom/StaticNodeList.h:
3938         * html/CachedHTMLCollection.h:
3939         * html/HTMLAllCollection.idl:
3940         * html/HTMLCollection.idl:
3941         * html/HTMLFieldSetElement.cpp:
3942         (WebCore::HTMLFieldSetElement::elements):
3943         (WebCore::HTMLFieldSetElement::elementsForObjC):
3944         * html/HTMLFieldSetElement.h:
3945         * html/HTMLFieldSetElement.idl:
3946         * html/HTMLFormControlsCollection.cpp:
3947         (WebCore::HTMLFormControlsCollection::customElementAfter):
3948         * html/HTMLFormControlsCollection.h:
3949         * html/HTMLFormControlsCollection.idl:
3950         * html/HTMLFormElement.cpp:
3951         (WebCore::HTMLFormElement::item):
3952         (WebCore::HTMLFormElement::elements):
3953         (WebCore::HTMLFormElement::elementsForObjC):
3954         * html/HTMLFormElement.h:
3955         * html/HTMLFormElement.idl:
3956         * html/HTMLOptionsCollection.cpp:
3957         (WebCore::HTMLOptionsCollection::add):
3958         * html/HTMLOptionsCollection.h:
3959         * html/HTMLOptionsCollection.idl:
3960         * html/HTMLSelectElement.cpp:
3961         (WebCore::HTMLSelectElement::namedItem):
3962         (WebCore::HTMLSelectElement::item):
3963         (WebCore::HTMLSelectElement::setOption):
3964         * html/HTMLSelectElement.idl:
3965         * html/HTMLTableRowElement.cpp:
3966         (WebCore::HTMLTableRowElement::deleteCell):
3967         * html/HTMLTableSectionElement.cpp:
3968         (WebCore::HTMLTableSectionElement::deleteRow):
3969         * html/RadioNodeList.cpp:
3970         (WebCore::toRadioButtonInputElement):
3971         (WebCore::RadioNodeList::value):
3972         (WebCore::RadioNodeList::setValue):
3973         * html/RadioNodeList.h:
3974         * html/RadioNodeList.idl:
3975
3976 2015-10-20  Chris Dumez  <cdumez@apple.com>
3977
3978         Only HTML spaces should be stripped from a <script>'s 'for' / 'event' attributes
3979         https://bugs.webkit.org/show_bug.cgi?id=150335
3980
3981         Reviewed by Darin Adler.
3982
3983         Only HTML spaces should be stripped from a <script>'s 'for' / 'event' attributes:
3984         https://html.spec.whatwg.org/multipage/scripting.html#prepare-a-script (step 12.3)
3985         https://html.spec.whatwg.org/multipage/infrastructure.html#space-character
3986
3987         Previously, we were uding the wrong stripping function and we were stripping
3988         some non-HTML spaces.
3989
3990         Test: fast/dom/script-for-event-spaces.html
3991
3992         * dom/ScriptElement.cpp:
3993         (WebCore::ScriptElement::isScriptForEventSupported):
3994
3995 2015-10-20  Csaba Osztrogonác  <ossy@webkit.org>
3996
3997         Fix the !ENABLE(CSS_GRID_LAYOUT) build after r191128
3998         https://bugs.webkit.org/show_bug.cgi?id=150321
3999
4000         Reviewed by Darin Adler.
4001
4002         * css/CSSGrammar.y.in: Typo fix.
4003
4004 2015-10-20  Tim Horton  <timothy_horton@apple.com>
4005
4006         Try to fix the build by disabling MAC_GESTURE_EVENTS on 10.9 and 10.10
4007
4008         * Configurations/FeatureDefines.xcconfig:
4009
4010 2015-10-13  Sergio Villar Senin  <svillar@igalia.com>
4011
4012         ASSERTION FAILED: computeMainAxisExtentForChild(child, MainOrPreferredSize, mainSize) in WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax
4013         https://bugs.webkit.org/show_bug.cgi?id=149459
4014
4015         Reviewed by Darin Adler.
4016
4017         This was regressed after 189567 where min-height|width:auto
4018         support was added to flex items. The merge from Blink changes
4019         was not correctly done for assertions. In particular we were
4020         asserting if the resolved main size was not strictly greater
4021         than 0, but 0 is actually a valid value.
4022
4023         Test: fast/flexbox/crash-resolved-main-size-zero.html
4024
4025         * rendering/RenderFlexibleBox.cpp:
4026         (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
4027
4028 2015-10-20  Xabier Rodriguez Calvar  <calvaris@igalia.com>
4029
4030         [Streams API] Rework some readable stream internals that can be common to writable streams
4031         https://bugs.webkit.org/show_bug.cgi?id=150133
4032
4033         Reviewed by Darin Adler.
4034
4035         There are some things in ReadableStream internals that be be used also for Writable Streams so it was necessary
4036         to move some functions and refactor some code that can be shared by both implementations.
4037
4038         Queue was written with the functions declared at the implementation and keeping the improvement of having the
4039         total size calculated instead of having to transverse the whole array.
4040
4041         The strategy is kept as an object and a common method is used to validate it as per spec.
4042
4043         Promises are reworked to keep in an internal slot inside the promise object the resolve and reject
4044         functions. For convinience three functions were written, one to create the promise (and keep internally the
4045         resolve and reject functions), one to resolve and another to reject. Promises can still be created with
4046         Promise.resolve or reject as the resolve and rejectStreamsPromise functions operate under the assumption that
4047         the internal slots might not exist.
4048
4049         invokeOrNoop and promiseInvokeOrNoop were moved to the common code as they will be also used by WritableStream.
4050
4051         Current test set suffices.
4052
4053         * CMakeLists.txt:
4054         * DerivedSources.make:
4055         * WebCore.xcodeproj/project.pbxproj:
4056         * bindings/js/JSDOMWindowBase.cpp:
4057         * bindings/js/WebCoreJSBuiltinInternals.h:
4058         * bindings/js/WebCoreJSBuiltins.cpp:
4059         * bindings/js/WebCoreJSBuiltins.h: Build infrastructure.
4060         * Modules/streams/ReadableStream.js: