Unreviewed. Fix scrollbars/custom-scrollbar-appearance-property.html after r191991.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-11-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2
3         Unreviewed. Fix scrollbars/custom-scrollbar-appearance-property.html after r191991.
4
5         Use a similar fix to the mac one.
6
7         * rendering/RenderThemeGtk.cpp:
8         (WebCore::centerRectVerticallyInParentInputElement):
9
10 2015-11-10  Csaba Osztrogonác  <ossy@webkit.org>
11
12         Unreviewed speculative buildfix after r192200.
13
14         * platform/mock/MediaPlaybackTargetPickerMock.cpp:
15         (WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker):
16
17 2015-11-10  Xabier Rodriguez Calvar  <calvaris@igalia.com>
18
19         [Streams API] Shield promises when prototype is replaced from a promise
20         https://bugs.webkit.org/show_bug.cgi?id=151033
21
22         Reviewed by Darin Adler.
23
24         Instead of calling @then or @catch, that could have disappeared if the user successfully replaces a promise
25         constructor, we call the methods stored at @Promise.prototype, which are safe as @Promise.prototype.@then.@call
26         and @Promise.prototype.@catch.@call.
27
28         Test: streams/streams-promises.html, expectations updated.
29
30         * Modules/streams/ReadableStream.js:
31         (initializeReadableStream):
32         * Modules/streams/ReadableStreamInternals.js:
33         (teeReadableStream):
34         (teeReadableStreamPullFunction):
35         (teeReadableStreamBranch2CancelFunction):
36         (cancelReadableStream):
37         * Modules/streams/WritableStream.js:
38         (initializeWritableStream):
39         (abort):
40         * Modules/streams/WritableStreamInternals.js:
41         (callOrScheduleWritableStreamAdvanceQueue):
42
43 2015-11-10  Jon Lee  <jonlee@apple.com>
44
45         REGRESSION (r189567): Inline controls on Mac are misplaced
46         https://bugs.webkit.org/show_bug.cgi?id=151072
47
48         Reviewed by Eric Carlson.
49
50         Test: media/controls/fullscreen-button-inline-layout.html
51
52         For a certain range of video widths, r189567 caused the timeline track to be
53         too large, pushing the buttons on the right side of the inline controls out of
54         the rect bounds.
55
56         The fix is to set min-width to 0. The test added checks to see that the right
57         edge of the fullscreen button is within the rect bounds.
58
59         * Modules/mediacontrols/mediaControlsApple.css:
60         (audio::-webkit-media-controls-timeline-container): Add min-width.
61         (audio::-webkit-media-controls-panel .thumbnail-track): Ditto. Fly-by fix of height rule.
62
63 2015-11-09  Eric Carlson  <eric.carlson@apple.com>
64
65         [Mac] Add a mock AppleTV device for testing
66         https://bugs.webkit.org/show_bug.cgi?id=148912
67         <rdar://problem/22596272>
68
69         Reviewed by Tim Horton.
70
71         No new tests, updated media/controls/airplay-picker.html.
72
73         * Modules/mediasession/WebMediaSessionManager.cpp:
74         (WebCore::WebMediaSessionManager::setMockMediaPlaybackTargetPickerEnabled): New, enable or disable
75           the mock picker.
76         (WebCore::WebMediaSessionManager::setMockMediaPlaybackTargetPickerState): New, set mock picker state.
77         (WebCore::WebMediaSessionManager::mockPicker): New.
78         (WebCore::WebMediaSessionManager::targetPicker): Return the platform or mock picker, as per settings.
79         (WebCore::webMediaSessionManagerOverride): Deleted.
80         (WebCore::WebMediaSessionManager::shared): Deleted.
81         (WebCore::WebMediaSessionManager::setWebMediaSessionManagerOverride): Deleted.
82         * Modules/mediasession/WebMediaSessionManager.h:
83
84         * WebCore.xcodeproj/project.pbxproj: Add MediaPlaybackTargetPickerMock.* and MediaPlaybackTargetMock.*.
85
86         * page/ChromeClient.h: add setMockMediaPlaybackTargetPickerEnabled and setMockMediaPlaybackTargetPickerState.
87
88         * page/Page.cpp:
89         (WebCore::Page::playbackTargetPickerClientStateDidChange):
90         (WebCore::Page::setMockMediaPlaybackTargetPickerEnabled): New.
91         (WebCore::Page::setMockMediaPlaybackTargetPickerState): New.
92         (WebCore::Page::setPlaybackTarget):
93         * page/Page.h:
94
95         * platform/graphics/MediaPlaybackTarget.h:
96         (WebCore::noMediaPlaybackTargetContext):
97         (WebCore::MediaPlaybackTarget::~MediaPlaybackTarget):
98         (WebCore::MediaPlaybackTarget::deviceName):
99         (WebCore::MediaPlaybackTarget::MediaPlaybackTarget):
100
101         * platform/graphics/MediaPlaybackTargetContext.h: Make a class instead of a struct.
102         (WebCore::MediaPlaybackTargetContext::MediaPlaybackTargetContext):
103         (WebCore::MediaPlaybackTargetContext::type):
104         (WebCore::MediaPlaybackTargetContext::mockDeviceName):
105         (WebCore::MediaPlaybackTargetContext::mockState):
106         (WebCore::MediaPlaybackTargetContext::avOutputContext):
107         (WebCore::MediaPlaybackTargetContext::encodingRequiresPlatformData):
108
109         * platform/graphics/MediaPlaybackTargetPicker.cpp: Move much of the code from MediaPlaybackTargetMac.mm
110           here so it can be the base class.
111         (WebCore::MediaPlaybackTargetPicker::MediaPlaybackTargetPicker):
112         (WebCore::MediaPlaybackTargetPicker::~MediaPlaybackTargetPicker):
113         (WebCore::MediaPlaybackTargetPicker::pendingActionTimerFired):
114         (WebCore::MediaPlaybackTargetPicker::addPendingAction):
115         (WebCore::MediaPlaybackTargetPicker::showPlaybackTargetPicker):
116         * platform/graphics/MediaPlaybackTargetPicker.h:
117         (WebCore::MediaPlaybackTargetPicker::availableDevicesDidChange):
118         (WebCore::MediaPlaybackTargetPicker::currentDeviceDidChange):
119         (WebCore::MediaPlaybackTargetPicker::client):
120         (WebCore::MediaPlaybackTargetPicker::setClient):
121
122         * platform/graphics/avfoundation/MediaPlaybackTargetMac.h:
123         (WebCore::MediaPlaybackTargetMac::outputContext):
124         (WebCore::MediaPlaybackTargetMac::targetType): Deleted.
125         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
126         (WebCore::MediaPlaybackTargetMac::targetContext):
127         (WebCore::MediaPlaybackTargetMac::hasActiveRoute):
128         (WebCore::MediaPlaybackTargetMac::deviceName):
129
130         * platform/graphics/avfoundation/WebMediaSessionManagerMac.cpp:
131         (WebCore::WebMediaSessionManager::shared): Renamed from platformManager.
132         (WebCore::WebMediaSessionManagerMac::platformPicker): Renamed from targetPicker.
133         (WebCore::WebMediaSessionManager::platformManager): Deleted.
134         (WebCore::WebMediaSessionManagerMac::targetPicker): Deleted.
135         * platform/graphics/avfoundation/WebMediaSessionManagerMac.h:
136
137         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
138         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
139         (WebCore::MediaPlaybackTargetPickerMac::MediaPlaybackTargetPickerMac):
140         (WebCore::MediaPlaybackTargetPickerMac::~MediaPlaybackTargetPickerMac):
141         (WebCore::MediaPlaybackTargetPickerMac::externalOutputDeviceAvailable):
142         (WebCore::MediaPlaybackTargetPickerMac::playbackTarget):
143         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):
144         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):
145         (WebCore::MediaPlaybackTargetPickerMac::startingMonitoringPlaybackTargets):
146         (WebCore::MediaPlaybackTargetPickerMac::pendingActionTimerFired): Deleted.
147         (WebCore::MediaPlaybackTargetPickerMac::availableDevicesDidChange): Deleted.
148         (WebCore::MediaPlaybackTargetPickerMac::addPendingAction): Deleted.
149         (WebCore::MediaPlaybackTargetPickerMac::currentDeviceDidChange): Deleted.
150
151         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
152         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
153         (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless): Add support for
154           mock target.
155         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetName): Ditto.
156         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget): Ditto.
157         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget): Ditto.
158
159         * platform/mock/MediaPlaybackTargetMock.cpp: Added.
160         (WebCore::MediaPlaybackTargetMock::create): 
161         (WebCore::MediaPlaybackTargetMock::MediaPlaybackTargetMock):
162         (WebCore::MediaPlaybackTargetMock::~MediaPlaybackTargetMock):
163         (WebCore::MediaPlaybackTargetMock::targetContext):
164         (WebCore::toMediaPlaybackTargetMock):
165         * platform/mock/MediaPlaybackTargetMock.h: Added.
166
167         * platform/mock/MediaPlaybackTargetPickerMock.cpp: Added.
168         (WebCore::MediaPlaybackTargetPickerMock::create):
169         (WebCore::MediaPlaybackTargetPickerMock::MediaPlaybackTargetPickerMock):
170         (WebCore::MediaPlaybackTargetPickerMock::~MediaPlaybackTargetPickerMock):
171         (WebCore::MediaPlaybackTargetPickerMock::externalOutputDeviceAvailable):
172         (WebCore::MediaPlaybackTargetPickerMock::playbackTarget):
173         (WebCore::MediaPlaybackTargetPickerMock::timerFired):
174         (WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker):
175         (WebCore::MediaPlaybackTargetPickerMock::startingMonitoringPlaybackTargets):
176         (WebCore::MediaPlaybackTargetPickerMock::stopMonitoringPlaybackTargets):
177         (WebCore::MediaPlaybackTargetPickerMock::invalidatePlaybackTargets):
178         (WebCore::MediaPlaybackTargetPickerMock::setState):
179         * platform/mock/MediaPlaybackTargetPickerMock.h: Added.
180
181         * testing/Internals.cpp:
182         (WebCore::Internals::Internals):
183         (WebCore::Internals::setMockMediaPlaybackTargetPickerEnabled):
184         (WebCore::Internals::setMockMediaPlaybackTargetPickerState):
185         * testing/Internals.h:
186         * testing/Internals.idl:
187
188 2015-11-09  Wenson Hsieh  <wenson_hsieh@apple.com>
189
190         Unreviewed, fix the windows build
191
192         Update the signature of scrollableAreaBoundingBox, changed by r192193.
193
194         * platform/win/PopupMenuWin.cpp:
195         (WebCore::PopupMenuWin::scrollableAreaBoundingBox):
196         * platform/win/PopupMenuWin.h:
197
198 2015-11-09  Simon Fraser  <simon.fraser@apple.com>
199
200         Allow iOS to create linearRGB colorspaces
201         https://bugs.webkit.org/show_bug.cgi?id=151059
202
203         Reviewed by Tim Horton.
204
205         Remove iOS #ifdefs around code that creates linearized RGB colorspaces, as used
206         by SVG filters. Blending doesn't actually work correctly, but there's no reason
207         to #ifdef differently here.
208
209         * platform/graphics/cg/GraphicsContextCG.cpp:
210         * platform/graphics/mac/GraphicsContextMac.mm:
211         (WebCore::linearRGBColorSpaceRef):
212
213 2015-11-09  Wenson Hsieh  <wenson_hsieh@apple.com>
214
215         Sometimes unable to scroll fixed div when the body is scrollable
216         https://bugs.webkit.org/show_bug.cgi?id=151015
217         <rdar://problem/23445723>
218
219         Reviewed by Simon Fraser.
220
221         Currently, if we scroll a page containing a fixed scrollable area, the non-fast-scrollable region corresponding to a fixed
222         area will not move down to reflect its new bounds in absolute coordinates, making it impossible to scroll position: fixed
223         overflow elements when the body's scroll position changes. To fix this, we inflate the non-fast-scrollable region
224         corresponding to scrollable position: fixed elements such that their regions encompass the area, relative to the page,
225         wherein the fixed element may lie when the page is scrolled by any amount within its scroll limits.
226
227         We also optimize the non-fast-scrollable regions emitted by elements that handle wheel events. Currently, if a fixed element
228         also has a wheel event handler, we take the entire document's rect to be non-fast-scrollable. This patch changes this region
229         to behave the same way as fixed scrollable elements above.
230
231         This patch also folds some common logic used to accomplish this into FrameView for use by RenderLayerCompositor and RenderView.
232
233         Test: tiled-drawing/scrolling/non-fast-region/fixed-div-in-scrollable-page.html
234
235         * page/FrameView.cpp:
236         (WebCore::FrameView::fixedScrollableAreaBoundsInflatedForScrolling):
237         (WebCore::FrameView::scrollOffsetRespectingCustomFixedPosition):
238         * page/FrameView.h:
239         * page/scrolling/ScrollingCoordinator.cpp:
240         (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame):
241         * platform/ScrollableArea.h:
242         (WebCore::ScrollableArea::scrollableAreaBoundingBox):
243         * rendering/RenderLayer.cpp:
244         (WebCore::RenderLayer::scrollableAreaBoundingBox):
245         * rendering/RenderLayer.h:
246         * rendering/RenderLayerCompositor.cpp:
247         (WebCore::RenderLayerCompositor::computeExtent):
248         (WebCore::fixedPositionOffset): Deleted.
249         * rendering/RenderView.cpp:
250         (WebCore::RenderView::mapLocalToContainer):
251         (WebCore::RenderView::pushMappingToContainer):
252         (WebCore::RenderView::mapAbsoluteToLocalPoint):
253         (WebCore::RenderView::computeRectForRepaint):
254         (WebCore::fixedPositionOffset): Deleted.
255
256 2015-11-09  Ryan Haddad  <ryanhaddad@apple.com>
257
258         Unreviewed, rolling out r192181.
259
260         This change causes asserts on mac-wk1 debug testers
261
262         Reverted changeset:
263
264         "Fixed crash loading Mozilla layout test
265         editor/libeditor/crashtests/431086-1.xhtml."
266         https://bugs.webkit.org/show_bug.cgi?id=150252
267         http://trac.webkit.org/changeset/192181
268
269 2015-11-09  Jiewen Tan  <jiewen_tan@apple.com>
270
271         Crash when right clicking in input box with -webkit-user-select: none
272         https://bugs.webkit.org/show_bug.cgi?id=145981
273         <rdar://problem/22441925>
274
275         Reviewed by Enrica Casucci.
276
277         Test: editing/selection/minimal-user-select-crash.html
278
279         * editing/Editor.cpp:
280         (WebCore::Editor::hasBidiSelection):
281         Visible position cannot be created because of the style that doesn't allow the selection.
282
283 2015-11-09  Joseph Pecoraro  <pecoraro@apple.com>
284
285         Web Inspector: $0 stops working after navigating to a different domain
286         https://bugs.webkit.org/show_bug.cgi?id=147962
287
288         Reviewed by Brian Burg.
289
290         Test: http/tests/inspector/console/cross-domain-inspected-node-access.html
291
292         The inspector backend injects the CommandLineAPI Source with a
293         corresponding CommandLineAPIHost into each execution context
294         created by the page (main frame, sub frames, etc).
295
296         When creating the JSValue wrapper for the CommandLineAPIHost using
297         the generated toJS(...) DOM bindings, we were using the cached
298         CommandLineAPIHost wrapper values in the single DOMWrapperWorld shared
299         across all frames. This meant that the first time the wrapper was
300         needed it was created in context A. But when needed for context B
301         it was using the wrapper created in context A. Using this wrapper
302         in context B was producing unexpected cross-origin warnings.
303
304         The solution taken here, is to create a new JSValue wrapper for
305         the CommandLineAPIHost per execution context. This way each time
306         the CommandLineAPIHost wrapper is used in a frame, it is using
307         the one created for that frame.
308
309         The C++ host object being wrapped has a lifetime equivalent to
310         the Page. It does not change in this patch. The wrapper values
311         are cleared on page navigation or when the page is closed, and
312         will be garbage collected.
313
314         * WebCore.vcxproj/WebCore.vcxproj:
315         * WebCore.vcxproj/WebCore.vcxproj.filters:
316         * ForwardingHeaders/inspector/PerGlobalObjectWrapperWorld.h: Added.
317         New forwarding header.
318
319         * inspector/CommandLineAPIHost.h:
320         * inspector/CommandLineAPIHost.cpp:
321         (WebCore::CommandLineAPIHost::CommandLineAPIHost):
322         (WebCore::CommandLineAPIHost::wrapper):
323         Cached JSValue wrappers per GlobalObject.
324
325         (WebCore::CommandLineAPIHost::clearAllWrappers):
326         Clear any wrappers we have, including the $0 value itself
327         which we weren't explicitly clearing previously.
328
329         * inspector/CommandLineAPIModule.cpp:
330         (WebCore::CommandLineAPIModule::host):
331         Simplify creating the wrapper.
332
333         * inspector/WebInjectedScriptManager.h:
334         * inspector/WebInjectedScriptManager.cpp:
335         (WebCore::WebInjectedScriptManager::discardInjectedScripts):
336         When the main frame window object clears, also clear the
337         CommandLineAPI wrappers we may have created. Also take this
338         opportunity to clear any $0 value that may have pointed
339         to a value in the previous page.
340
341 2015-11-09  Per Arne Vollan  <peavo@outlook.com>
342
343         [WinCairo][Video][MediaFoundation] Video should be rendered in provided graphics context.
344         https://bugs.webkit.org/show_bug.cgi?id=150941
345
346         Reviewed by Brent Fulgham.
347
348         On WinCairo, we currently render video in a child window of the main browser window.
349         This makes it difficult to render things on top of the video, like video controls and
350         context menus. We should render the video in the graphics context provided by the paint
351         method. This is done by implementing a custom EVR (Enhanced Video Renderer) presenter
352         for Media Foundation.
353
354         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
355         (MFCreateMediaType):
356         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation):
357         (WebCore::MediaPlayerPrivateMediaFoundation::registerMediaEngine):
358         (WebCore::MediaPlayerPrivateMediaFoundation::isAvailable):
359         (WebCore::MediaPlayerPrivateMediaFoundation::setSize):
360         (WebCore::MediaPlayerPrivateMediaFoundation::paint):
361         (WebCore::MediaPlayerPrivateMediaFoundation::createSession):
362         (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
363         (WebCore::MediaPlayerPrivateMediaFoundation::createVideoWindow):
364         (WebCore::MediaPlayerPrivateMediaFoundation::destroyVideoWindow):
365         (WebCore::MediaPlayerPrivateMediaFoundation::invalidateFrameView):
366         (WebCore::MediaPlayerPrivateMediaFoundation::addListener):
367         (WebCore::MediaPlayerPrivateMediaFoundation::createOutputNode):
368         (WebCore::MediaPlayerPrivateMediaFoundation::onTopologySet):
369         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::onMediaPlayerDeleted):
370         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::CustomVideoPresenter):
371         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::~CustomVideoPresenter):
372         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::QueryInterface):
373         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::AddRef):
374         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::Release):
375         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockStart):
376         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockStop):
377         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockPause):
378         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockRestart):
379         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockSetRate):
380         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::ProcessMessage):
381         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetCurrentMediaType):
382         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetDeviceID):
383         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::InitServicePointers):
384         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::ReleaseServicePointers):
385         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetService):
386         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::ActivateObject):
387         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::DetachObject):
388         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::ShutdownObject):
389         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetVideoWindow):
390         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetVideoWindow):
391         (WebCore::setMixerSourceRect):
392         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetVideoPosition):
393         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetVideoPosition):
394         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::RepaintVideo):
395         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::Invoke):
396         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::onMediaPlayerDeleted):
397         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::paintCurrentFrame):
398         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::isActive):
399         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::configureMixer):
400         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::flush):
401         (WebCore::areMediaTypesEqual):
402         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::setMediaType):
403         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::checkShutdown):
404         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::renegotiateMediaType):
405         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNotify):
406         (WebCore::MFOffsetToFloat):
407         (WebCore::MakeOffset):
408         (WebCore::MakeArea):
409         (WebCore::validateVideoArea):
410         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::beginStreaming):
411         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::endStreaming):
412         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::checkEndOfStream):
413         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::isMediaTypeSupported):
414         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::createOptimalVideoType):
415         (WebCore::correctAspectRatio):
416         (WebCore::GetVideoDisplayArea):
417         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::calculateOutputRectangle):
418         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processOutputLoop):
419         (WebCore::setDesiredSampleTime):
420         (WebCore::clearDesiredSampleTime):
421         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processOutput):
422         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::deliverSample):
423         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::trackSample):
424         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::releaseResources):
425         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::onSampleFree):
426         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::notifyEvent):
427         (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::getSample):
428         (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::returnSample):
429         (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::areSamplesPending):
430         (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::initialize):
431         (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::clear):
432         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::setFrameRate):
433         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::startScheduler):
434         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::stopScheduler):
435         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::flush):
436         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::scheduleSample):
437         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::processSamplesInQueue):
438         (WebCore::MFTimeToMilliseconds):
439         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::processSample):
440         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::schedulerThreadProc):
441         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::schedulerThreadProcPrivate):
442         (WebCore::findAdapter):
443         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::Direct3DPresenter):
444         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::~Direct3DPresenter):
445         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::getService):
446         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::checkFormat):
447         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::setVideoWindow):
448         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::setDestinationRect):
449         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createVideoSamples):
450         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::releaseResources):
451         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::checkDeviceState):
452         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample):
453         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):
454         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::initializeD3D):
455         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createD3DDevice):
456         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createD3DSample):
457         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSwapChain):
458         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::getSwapChainPresentParameters):
459         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::updateDestRect):
460         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
461         (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::VideoSamplePool):
462         (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::~VideoSamplePool):
463         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::VideoScheduler):
464         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::~VideoScheduler):
465         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::setPresenter):
466         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::setClockRate):
467         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::lastSampleTime):
468         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::frameDuration):
469         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::getVideoWindow):
470         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::getDestinationRect):
471         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::refreshRate):
472         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetItem):
473         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetItemType):
474         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::CompareItem):
475         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::Compare):
476         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetUINT32):
477         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetUINT64):
478         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetDouble):
479         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetGUID):
480         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetStringLength):
481         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetString):
482         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetAllocatedString):
483         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetBlobSize):
484         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetBlob):
485         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetAllocatedBlob):
486         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetUnknown):
487         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetItem):
488         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::DeleteItem):
489         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::DeleteAllItems):
490         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetUINT32):
491         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetUINT64):
492         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetDouble):
493         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetGUID):
494         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetString):
495         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetBlob):
496         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetUnknown):
497         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::LockStore):
498         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::UnlockStore):
499         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetCount):
500         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetItemByIndex):
501         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::CopyAllItems):
502         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetNativeVideoSize):
503         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetIdealVideoSize):
504         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetAspectRatioMode):
505         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetAspectRatioMode):
506         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetCurrentImage):
507         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetBorderColor):
508         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetBorderColor):
509         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetRenderingPrefs):
510         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetRenderingPrefs):
511         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetFullscreen):
512         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetFullscreen):
513         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetParameters):
514         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::isScrubbing):
515
516 2015-11-09  Alex Christensen  <achristensen@webkit.org>
517
518         XHR timeouts should not fire if there is an immediate network error.
519         https://bugs.webkit.org/show_bug.cgi?id=150577
520
521         Reviewed by Darin Adler.
522
523         This fixes flakiness of http/tests/contentextensions/async-xhr-onerror.html since r191077.
524
525         * xml/XMLHttpRequest.cpp:
526         (WebCore::XMLHttpRequest::createRequest):
527         (WebCore::XMLHttpRequest::internalAbort):
528         (WebCore::XMLHttpRequest::didFinishLoading):
529         If the timeout timer has been started and we are going to immediately report a network error, then stop the timeout timer.
530         The timeout timer sometimes fired before the network error timer if it was a very short timeout (such as 1ms).
531         Also checks to isActive before calling stop on a timer are not necessary.
532
533 2015-11-09  Eric Carlson  <eric.carlson@apple.com>
534
535         [MediaStream] Add mock audio and video sources
536         https://bugs.webkit.org/show_bug.cgi?id=150997
537         <rdar://problem/23453358>
538
539         Reviewed by Jer Noble.
540
541         Create basic mock audio and video realtime media source classes so we can test MediaStream
542         API without requiring test machines to have audio/video input hardware. No new tests added
543         yet, thoe will follow.
544
545         No new tests, these changes will allow us to write MediaStream tests.
546
547         * CMakeLists.txt: Add MockRealtimeAudioSource.cpp, MockRealtimeMediaSource.cpp, and 
548           MockRealtimeVideoSource.cpp
549
550         * PlatformMac.cmake: Add MockRealtimeVideoSourceMac.mm
551
552         * WebCore.xcodeproj/project.pbxproj: Add new files.
553
554         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
555         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::createPreviewLayers): Don't set autoresizingMask,
556           it isn't necessary.
557
558         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
559         (WebCore::refreshCaptureDeviceList): AVCaptureDevice -> getAVCaptureDeviceClass()
560         (WebCore::AVCaptureDeviceManager::bestDeviceForFacingMode): Ditto.
561         (WebCore::AVCaptureDeviceManager::sourceWithUID): Ditto.
562
563         Mac class implements RealtimeVideoSource::platformLayer, returns a CALayer which uses the
564         GraphicsContext as contents.
565         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h: Added.
566         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm: Added.
567         (WebCore::MockRealtimeVideoSource::create):
568         (WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac):
569         (WebCore::MockRealtimeVideoSourceMac::platformLayer):
570         (WebCore::MockRealtimeVideoSourceMac::updatePlatformLayer):
571
572         Mock audio source. Doesn't provide data yet, only provides states and capabilities.
573         * platform/mock/MockRealtimeAudioSource.cpp: Added.
574         (WebCore::MockRealtimeAudioSource::create):
575         (WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource):
576         (WebCore::MockRealtimeAudioSource::updateStates):
577         (WebCore::MockRealtimeAudioSource::initializeCapabilities):
578         * platform/mock/MockRealtimeAudioSource.h: Added.
579         (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource):
580
581         Mock source base class, sets persistent ID and updates states and capabilities.
582         * platform/mock/MockRealtimeMediaSource.cpp: Added.
583         (WebCore::MockRealtimeMediaSource::mockAudioPersistentID):
584         (WebCore::MockRealtimeMediaSource::mockVideoPersistentID):
585         (WebCore::MockRealtimeMediaSource::MockRealtimeMediaSource):
586         (WebCore::MockRealtimeMediaSource::capabilities):
587         (WebCore::MockRealtimeMediaSource::states):
588         * platform/mock/MockRealtimeMediaSource.h: Added.
589         (WebCore::MockRealtimeMediaSource::mockAudioSourcePersistentID):
590         (WebCore::MockRealtimeMediaSource::mockAudioSourceName):
591         (WebCore::MockRealtimeMediaSource::mockVideoSourcePersistentID):
592         (WebCore::MockRealtimeMediaSource::mockVideoSourceName):
593         (WebCore::MockRealtimeMediaSource::trackSourceWithUID):
594         (WebCore::MockRealtimeMediaSource::~MockRealtimeMediaSource):
595         (WebCore::MockRealtimeMediaSource::currentStates):
596         (WebCore::MockRealtimeMediaSource::constraints):
597
598         Use new mock source classes. Create a new source instance for each request instead of reusing the
599         same sources each time.
600         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
601         (WebCore::mockSourceMap):
602         (WebCore::MockRealtimeMediaSourceCenter::registerMockRealtimeMediaSourceCenter):
603         (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints):
604         (WebCore::MockRealtimeMediaSourceCenter::createMediaStream):
605         (WebCore::MockRealtimeMediaSourceCenter::getMediaStreamTrackSources):
606         (WebCore::MockSource::MockSource): Deleted.
607         (WebCore::MockSource::~MockSource): Deleted.
608         (WebCore::MockSource::capabilities): Deleted.
609         (WebCore::MockSource::states): Deleted.
610         (WebCore::mockAudioSourceID): Deleted.
611         (WebCore::mockVideoSourceID): Deleted.
612         (WebCore::initializeMockSources): Deleted.
613
614         Mock video source. Generate bip-bop inspired frames with burned in state information.
615         * platform/mock/MockRealtimeVideoSource.cpp: Added.
616         (WebCore::MockRealtimeVideoSource::create):
617         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
618         (WebCore::MockRealtimeVideoSource::startProducingData):
619         (WebCore::MockRealtimeVideoSource::stopProducingData):
620         (WebCore::MockRealtimeVideoSource::elapsedTime):
621         (WebCore::MockRealtimeVideoSource::updateStates):
622         (WebCore::MockRealtimeVideoSource::initializeCapabilities):
623         (WebCore::MockRealtimeVideoSource::setFacingMode):
624         (WebCore::MockRealtimeVideoSource::setFrameRate):
625         (WebCore::MockRealtimeVideoSource::setSize):
626         (WebCore::MockRealtimeVideoSource::drawAnimation):
627         (WebCore::MockRealtimeVideoSource::drawBoxes):
628         (WebCore::MockRealtimeVideoSource::drawText):
629         (WebCore::MockRealtimeVideoSource::generateFrame):
630         (WebCore::MockRealtimeVideoSource::imageBuffer):
631         (WebCore::MockRealtimeVideoSource::paintCurrentFrameInContext):
632         (WebCore::MockRealtimeVideoSource::currentFrameImage):
633         * platform/mock/MockRealtimeVideoSource.h: Added.
634         (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource):
635         (WebCore::MockRealtimeVideoSource::size):
636         (WebCore::MockRealtimeVideoSource::updatePlatformLayer):
637
638 2015-11-09  Nan Wang  <n_wang@apple.com>
639
640         AX: Input type: time is not accessible on iOS
641         https://bugs.webkit.org/show_bug.cgi?id=150984
642
643         Reviewed by Chris Fleizach.
644
645         Exposed input type: time as popup button on iOS.
646
647         Test: accessibility/ios-simulator/input-type-time.html
648
649         * accessibility/AccessibilityRenderObject.cpp:
650         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
651
652 2015-11-09  Jiewen Tan  <jiewen_tan@apple.com>
653
654         Null dereference loading Blink layout test editing/inserting/insert-html-crash-01.html
655         https://bugs.webkit.org/show_bug.cgi?id=149298
656         <rdar://problem/22746918>
657
658         Reviewed by Ryosuke Niwa.
659
660         The test crashes in the method WebCore::CompositeEditCommand::moveParagraphs() because
661         the other method WebCore::CompositeEditCommand::cleanupAfterDeletion() accidentally
662         deletes the destination node. In WebCore::CompositeEditCommand::cleanupAfterDeletion(),
663         it fails to determine that caretAfterDelete equals to destination as Position::operator==,
664         which is called in VisiblePosition::operator==, only checks the equality of tuple
665         <Anchor Node, Anchor Type, Offset>. It is insufficient as a single position can be
666         represented by multiple tuples. Therefore, this change adds Position::equals() to fortify
667         the equal checking of two positions by considering combinations of different tuple
668         representations.
669
670         Furthermore, it adds VisiblePosition::equals() which considers affinity and call
671         Position::equals() while comparing two visible positions.
672
673         Test: editing/inserting/insert-html-crash-01.html
674
675         * dom/Position.cpp:
676         (WebCore::Position::equals):
677         * dom/Position.h:
678         * editing/CompositeEditCommand.cpp:
679         (WebCore::CompositeEditCommand::cleanupAfterDeletion):
680         Replace operator== with VisiblePosition::equals() to tackle the test case.
681         * editing/VisiblePosition.cpp:
682         (WebCore::VisiblePosition::equals):
683         * editing/VisiblePosition.h:
684
685 2015-11-09  Myles C. Maxfield  <mmaxfield@apple.com>
686
687         Some style changes cause tatechuyoko to be drawn off center
688         https://bugs.webkit.org/show_bug.cgi?id=150986
689         <rdar://problem/20748013>
690
691         Reviewed by Darin Adler.
692
693         Layouts should be idempotent. In particular, during layout, an element should not
694         rely on a previous call to styleDidChange() with a sufficiently high StyleDifference.
695         RenderCombineText was assuming that, if a layout occurs, a previous call to
696         styleDidChange() would have reset the renderedText. However, an ancestor element might
697         cause the RenderCombineText to re-combine when it is already combined. Therefore, the
698         recombination should fully uncombine before recombining.
699
700         Test: fast/text/text-combine-style-change-extra-layout.html
701
702         * rendering/RenderCombineText.cpp:
703         (WebCore::RenderCombineText::combineText): Fully uncombine before recombining.
704
705 2015-11-09  Brent Fulgham  <bfulgham@apple.com>
706
707         [Win] Recognize context flush as an event that requires an update
708         https://bugs.webkit.org/show_bug.cgi?id=151001
709         <rdar://problem/22956040>
710
711         Reviewed by Simon Fraser.
712
713         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
714         (WebCore::WKCACFViewLayerTreeHost::flushContext): Mark view as needing an update
715         when flushing so internal drawing code will do the paint.
716         * rendering/RenderLayerBacking.cpp:
717         (WebCore::RenderLayerBacking::paintIntoLayer): Skip WK2 assert that does
718         not apply to Windows drawing path.
719
720 2015-11-09  Brady Eidson  <beidson@apple.com>
721
722         Modern IDB: Refactor memory objectstore/transaction interation.
723         https://bugs.webkit.org/show_bug.cgi?id=151014
724
725         Reviewed by Darin Adler.
726
727         No new tests (Refactor, no change in behavior).
728
729         * Modules/indexeddb/server/IDBBackingStore.h:
730         
731         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
732         (WebCore::IDBServer::MemoryBackingStoreTransaction::recordValueChanged):
733         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
734         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
735         
736         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
737         (WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
738         (WebCore::IDBServer::MemoryIDBBackingStore::putRecord): Deleted. Renamed to addRecord.
739         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
740         
741         * Modules/indexeddb/server/MemoryObjectStore.cpp:
742         (WebCore::IDBServer::MemoryObjectStore::deleteRecord):
743         (WebCore::IDBServer::MemoryObjectStore::addRecord):
744         (WebCore::IDBServer::MemoryObjectStore::putRecord): Deleted. Renamed to addRecord.
745         (WebCore::IDBServer::MemoryObjectStore::setKeyValue): Deleted. Folded into addRecord.
746         * Modules/indexeddb/server/MemoryObjectStore.h:
747         
748         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
749         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
750
751 2015-11-09  Said Abou-Hallawa  <sabouhallawa@apple.com>
752
753         REGRESSION (r190883): Error calculating the tile size for an SVG with no intrinsic size but with large floating intrinsic ratio
754         https://bugs.webkit.org/show_bug.cgi?id=150904
755
756         Reviewed by Darin Adler.
757         
758         This patch addresses two issues. The first one is a regression from r190883
759         which was rolling out r184895. There was a missing if-statement in 
760         RenderBoxModelObject::calculateImageIntrinsicDimension(). We should return
761         it back. But this if-statement is an optimization; if we hit it we should
762         return the image resolvedSize. But we should also return the same result
763         if we call resolveAgainstIntrinsicWidthOrHeightAndRatio().
764         
765         We had a bug in resolving the intrinsic size of an image using a large
766         intrinsic ratio. We need to do the calculation in LayoutUnits always.
767         Using float calculations and then casting the output to an integer results
768         in significant truncation if the intrinsic ratio is large.
769
770         Test: fast/backgrounds/background-image-large-float-intrinsic-ratio.html
771
772         * rendering/RenderBoxModelObject.cpp:
773         (WebCore::resolveWidthForRatio):
774         (WebCore::resolveHeightForRatio):
775         (WebCore::resolveAgainstIntrinsicWidthOrHeightAndRatio):
776         (WebCore::resolveAgainstIntrinsicRatio):
777         Resolve the image size using its intrinsic ratio in LayoutUnits.
778         
779         (WebCore::RenderBoxModelObject::calculateImageIntrinsicDimensions):
780         Put back an if-statement which was missing from rolling out r184895
781
782 2015-11-09  Youenn Fablet  <youenn.fablet@crf.canon.fr>
783
784         [Streams API] Activate assertions
785         https://bugs.webkit.org/show_bug.cgi?id=151021
786
787         Reviewed by Darin Adler.
788
789         Activating assertions in streams API.
790         Fixing a bug in ReadableStream implementation: when pull promise is rejected,
791         the readable stream may already be errored by some other means.
792
793         Covered by existing test sets in Debug builds.
794
795         * Modules/streams/ReadableStreamInternals.js:
796         (teeReadableStream):
797         (teeReadableStreamPullFunction):
798         (errorReadableStream):
799         (requestReadableStreamPull):
800         (finishClosingReadableStream):
801         (closeReadableStream):
802         (enqueueInReadableStream):
803         (readFromReadableStreamReader):
804         * Modules/streams/ReadableStreamReader.js:
805         (cancel):
806         * Modules/streams/StreamInternals.js:
807         (peekQueueValue):
808         * Modules/streams/WritableStream.js:
809         (write):
810         (state):
811         * Modules/streams/WritableStreamInternals.js:
812         (syncWritableStreamStateWithQueue):
813         (closeWritableStream): Deleted.
814
815 2015-11-09  Xabier Rodriguez Calvar  <calvaris@igalia.com>
816
817         [Streams API] Shield implementation from mangling then and catch promise methods
818         https://bugs.webkit.org/show_bug.cgi?id=150934
819
820         Reviewed by Youenn Fablet.
821
822         This is a first step to get streams code shielded from user replacing the then and catch methods in our
823         promises. We use newly introduced @then and @catch prototype internal slots and that should solve a lot of use
824         cases.
825
826         Test: streams/streams-promises.html.
827
828         * Modules/streams/ReadableStream.js:
829         (initializeReadableStream):
830         * Modules/streams/ReadableStreamInternals.js:
831         (teeReadableStream):
832         (teeReadableStreamPullFunction):
833         (cancelReadableStream):
834         * Modules/streams/WritableStream.js:
835         (initializeWritableStream):
836         (abort):
837         * Modules/streams/WritableStreamInternals.js:
838         (callOrScheduleWritableStreamAdvanceQueue):
839
840 2015-11-09  Manuel Rego Casasnovas  <rego@igalia.com>
841
842         [css-grid] Refactor cachedGridCoordinate() to cachedGridSpan()
843         https://bugs.webkit.org/show_bug.cgi?id=151017
844
845         Reviewed by Sergio Villar Senin.
846
847         We were using cachedGridCoordinate() in lots of places and checking the
848         direction just in the next line. Creating a generic function to do this.
849
850         No new tests, no behavior change.
851
852         * rendering/RenderGrid.cpp:
853         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
854         (WebCore::GridItemWithSpan::GridItemWithSpan):
855         (WebCore::GridItemWithSpan::span):
856         (WebCore::GridItemWithSpan::operator<):
857         (WebCore::RenderGrid::spanningItemCrossesFlexibleSizedTracks):
858         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
859         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
860         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
861         (WebCore::RenderGrid::cachedGridSpan):
862         (WebCore::RenderGrid::gridAreaBreadthForChild):
863         (WebCore::RenderGrid::gridAreaBreadthForChildIncludingAlignmentOffsets):
864         (WebCore::RenderGrid::columnAxisOffsetForChild):
865         (WebCore::RenderGrid::rowAxisOffsetForChild):
866         (WebCore::GridItemWithSpan::gridItem): Deleted.
867         (WebCore::RenderGrid::populateGridPositions): Deleted.
868         * rendering/RenderGrid.h:
869
870 2015-11-09  Youenn Fablet  <youenn.fablet@crf.canon.fr>
871
872         JS Built-ins functions should be able to assert
873         https://bugs.webkit.org/show_bug.cgi?id=150333
874
875         Reviewed by Yusuke Suzuki.
876
877         * Modules/streams/ReadableStreamInternals.js:
878         (privateInitializeReadableStreamReader): Activating an @assert.
879
880 2015-11-02  Sergio Villar Senin  <svillar@igalia.com>
881
882         [css-grid] Improve grid container sizing with size constraints and intrinsic sizes
883         https://bugs.webkit.org/show_bug.cgi?id=150679
884
885         Reviewed by Darin Adler.
886
887         The grid container stores from now on its min-content and
888         max-content block sizes in order to be able to properly
889         compute its intrinsic size. It has to redefine
890         computeIntrinsicLogicalContentHeightUsing() because the
891         behavior of grid is different to "normal" blocks:
892
893         - the min-content size is the sum of the grid container's
894         track sizes in the appropiate axis when the grid is sized
895         under a min-content constraint.
896         - the max-content size is the sum of the grid container's
897         track sizes in the appropiate axis when the grid is sized
898         under a max-content constraint.
899         - the auto block size is the max-content size.
900
901         A nice side effect is that we can now properly detect whether
902         the grid has a definite size on a given axis or not.
903
904         Tests: fast/css-grid-layout/absolute-positioning-definite-sizes.html
905                fast/css-grid-layout/flex-and-intrinsic-sizes.html
906                fast/css-grid-layout/maximize-tracks-definite-indefinite-height.html
907                fast/css-grid-layout/maximize-tracks-definite-indefinite-width.html
908
909         * rendering/RenderBox.h: made
910         computeIntrinsicLogicalContentHeightUsing() virtual.
911         * rendering/RenderGrid.cpp:
912         (WebCore::RenderGrid::GridSizingData::GridSizingData):
913         (WebCore::RenderGrid::GridSizingData::freeSpaceForDirection):
914         (WebCore::RenderGrid::GridSizingData::setFreeSpaceForDirection):
915         (WebCore::RenderGrid::computeTrackBasedLogicalHeight):
916         (WebCore::RenderGrid::computeTrackSizesForDirection):
917         (WebCore::RenderGrid::layoutBlock):
918         (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
919         (WebCore::RenderGrid::computeIntrinsicLogicalHeight):
920         (WebCore::RenderGrid::computeIntrinsicLogicalContentHeightUsing):
921         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
922         (WebCore::RenderGrid::distributeSpaceToTracks):
923         (WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth):
924         (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
925         (WebCore::RenderGrid::layoutGridItems):
926         (WebCore::RenderGrid::populateGridPositions):
927         (WebCore::RenderGrid::gridElementIsShrinkToFit): Deleted.
928         * rendering/RenderGrid.h:
929
930 2015-11-05  Sergio Villar Senin  <svillar@igalia.com>
931
932         [css-grid] Grid placement conflict handling
933         https://bugs.webkit.org/show_bug.cgi?id=150891
934
935         Reviewed by Darin Adler.
936
937         If the placement for a grid item contains two lines, and the
938         start line is further end-ward than the end line, swap the two
939         lines. If the start line is equal to the end line, remove the
940         end line.
941
942         Test: fast/css-grid-layout/swap-lines-if-start-is-further-endward-than-end-line.html
943
944         * rendering/style/GridResolvedPosition.cpp:
945         (WebCore::resolveNamedGridLinePositionFromStyle):
946         (WebCore::resolveGridPositionFromStyle):
947         (WebCore::GridResolvedPosition::GridResolvedPosition):
948         (WebCore::GridResolvedPosition::resolveGridPositionsFromStyle):
949         (WebCore::adjustGridPositionForSide): Deleted.
950         * rendering/style/GridResolvedPosition.h:
951         (WebCore::GridResolvedPosition::prev):
952
953 2015-11-08  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
954
955         [EFL] Add UserAgentEFl.cpp|h
956         https://bugs.webkit.org/show_bug.cgi?id=151007
957
958         Reviewed by Darin Adler.
959
960         As other ports EFL port starts to have UserAgentEfl class in order to support more detailed
961         UA.
962
963         No new tests, no behavior change.
964
965         * PlatformEfl.cmake:
966         * platform/efl/UserAgentEfl.cpp: Added.
967         (WebCore::platformForUAString):
968         (WebCore::platformVersionForUAString):
969         (WebCore::versionForUAString):
970         (WebCore::standardUserAgent):
971         * platform/efl/UserAgentEfl.h: Added.
972
973 2015-11-08  David Kilzer  <ddkilzer@apple.com>
974
975         REGRESSION (r192140): Windows build broke after removing ColorSpace argument to all drawing calls
976         <http://webkit.org/b/150967>
977
978         Unreviewed attempt to fix the Windows build.
979
980         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
981         (PlatformCALayerWin::drawTextAtPoint):
982         * platform/graphics/win/ImageCGWin.cpp:
983         (WebCore::BitmapImage::drawFrameMatchingSourceSize):
984         * rendering/RenderThemeWin.cpp:
985         (WebCore::RenderThemeWin::paintSearchFieldCancelButton):
986         (WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart):
987         (WebCore::RenderThemeWin::paintSearchFieldResultsButton):
988
989 2015-11-08  Youenn Fablet  <youenn.fablet@crf.canon.fr>
990
991         generate-js-builtins.js should support @internal annotation
992         https://bugs.webkit.org/show_bug.cgi?id=150929
993
994         Reviewed by Darin Adler.
995
996         No change in behavior.
997
998         * Modules/streams/ReadableStreamInternals.js: Renamed @internals to @internal.
999         * Modules/streams/StreamInternals.js: Ditto.
1000         * Modules/streams/WritableStreamInternals.js: Ditto.
1001
1002 2015-11-07  Simon Fraser  <simon.fraser@apple.com>
1003
1004         Remove ColorSpace argument to all the drawing calls
1005         https://bugs.webkit.org/show_bug.cgi?id=150967
1006
1007         Reviewed by Darin Adler.
1008
1009         Since the -webkit-color-correction CSS property was removed in r188202, and ColorSpaceDeviceRGB
1010         and ColorSpaceSRGB are functionally equivalent, we can remove all the ColorSpace arguments passed
1011         to drawing functions, and remove RenderStyle::colorSpace(), which was hardcoded to return ColorSpaceSRGB.
1012         
1013         Fill and stroke ColorSpaces are also remove from graphics state, simplifying color save/restore.
1014         
1015         * bindings/scripts/CodeGeneratorObjC.pm:
1016         (GenerateImplementation):
1017         * css/CSSFilterImageValue.cpp:
1018         (WebCore::CSSFilterImageValue::image):
1019         * editing/FrameSelection.cpp:
1020         (WebCore::CaretBase::paintCaret):
1021         * editing/cocoa/HTMLConverter.mm:
1022         (_platformColor):
1023         * html/HTMLCanvasElement.cpp:
1024         (WebCore::HTMLCanvasElement::paint):
1025         * html/canvas/CanvasRenderingContext2D.cpp:
1026         (WebCore::CanvasRenderingContext2D::clearRect):
1027         (WebCore::CanvasRenderingContext2D::applyShadow):
1028         (WebCore::CanvasRenderingContext2D::drawImage):
1029         (WebCore::CanvasRenderingContext2D::compositeBuffer):
1030         (WebCore::drawImageToContext):
1031         (WebCore::CanvasRenderingContext2D::fullCanvasCompositedDrawImage):
1032         (WebCore::CanvasRenderingContext2D::drawTextInternal):
1033         * html/canvas/CanvasRenderingContext2D.h:
1034         * html/canvas/CanvasStyle.cpp:
1035         (WebCore::CanvasStyle::applyStrokeColor):
1036         (WebCore::CanvasStyle::applyFillColor):
1037         * html/canvas/WebGLRenderingContextBase.cpp:
1038         (WebCore::WebGLRenderingContextBase::drawImageIntoBuffer):
1039         * page/DebugPageOverlays.cpp:
1040         (WebCore::RegionOverlay::drawRect):
1041         * page/FrameView.cpp:
1042         (WebCore::FrameView::paintScrollCorner):
1043         (WebCore::FrameView::paintScrollbar):
1044         (WebCore::FrameView::paintContents):
1045         * page/PrintContext.cpp:
1046         (WebCore::PrintContext::spoolAllPagesWithBoundaries):
1047         * platform/ScrollView.cpp:
1048         (WebCore::ScrollView::paintPanScrollIcon):
1049         * platform/ScrollbarTheme.h:
1050         (WebCore::ScrollbarTheme::defaultPaintScrollCorner):
1051         * platform/ScrollbarThemeComposite.cpp:
1052         (WebCore::ScrollbarThemeComposite::paintScrollCorner):
1053         (WebCore::ScrollbarThemeComposite::paintOverhangAreas):
1054         * platform/Theme.cpp:
1055         (WebCore::Theme::drawNamedImage):
1056         * platform/cocoa/ThemeCocoa.cpp:
1057         (WebCore::ThemeCocoa::drawNamedImage):
1058         * platform/graphics/BitmapImage.cpp:
1059         (WebCore::BitmapImage::drawPattern):
1060         * platform/graphics/BitmapImage.h:
1061         * platform/graphics/Color.h:
1062         * platform/graphics/CrossfadeGeneratedImage.cpp:
1063         (WebCore::drawCrossfadeSubimage):
1064         (WebCore::CrossfadeGeneratedImage::draw):
1065         (WebCore::CrossfadeGeneratedImage::drawPattern):
1066         * platform/graphics/CrossfadeGeneratedImage.h:
1067         * platform/graphics/GeneratedImage.h:
1068         * platform/graphics/GradientImage.cpp:
1069         (WebCore::GradientImage::draw):
1070         (WebCore::GradientImage::drawPattern):
1071         * platform/graphics/GradientImage.h:
1072         * platform/graphics/GraphicsContext.cpp:
1073         (WebCore::GraphicsContext::drawRaisedEllipse):
1074         (WebCore::GraphicsContext::setStrokeColor):
1075         (WebCore::GraphicsContext::setShadow):
1076         (WebCore::GraphicsContext::setLegacyShadow):
1077         (WebCore::GraphicsContext::getShadow):
1078         (WebCore::GraphicsContext::setFillColor):
1079         (WebCore::GraphicsContext::drawImage):
1080         (WebCore::GraphicsContext::drawTiledImage):
1081         (WebCore::GraphicsContext::drawImageBuffer):
1082         (WebCore::GraphicsContext::fillRect):
1083         (WebCore::GraphicsContext::fillRoundedRect):
1084         (WebCore::GraphicsContext::fillRectWithRoundedHole):
1085         (WebCore::GraphicsContext::clearShadow): Deleted.
1086         * platform/graphics/GraphicsContext.h:
1087         (WebCore::GraphicsContext::strokeColorSpace): Deleted.
1088         (WebCore::GraphicsContext::fillColorSpace): Deleted.
1089         * platform/graphics/Image.cpp:
1090         (WebCore::Image::fillWithSolidColor):
1091         (WebCore::Image::drawTiled):
1092         * platform/graphics/Image.h:
1093         (WebCore::Image::drawFrameMatchingSourceSize):
1094         * platform/graphics/ImageBuffer.h:
1095         (WebCore::ImageBuffer::create):
1096         * platform/graphics/NamedImageGeneratedImage.cpp:
1097         (WebCore::NamedImageGeneratedImage::draw):
1098         (WebCore::NamedImageGeneratedImage::drawPattern):
1099         * platform/graphics/NamedImageGeneratedImage.h:
1100         * platform/graphics/ShadowBlur.cpp:
1101         (WebCore::ScratchBuffer::setCachedShadowValues):
1102         (WebCore::ScratchBuffer::setCachedInsetShadowValues):
1103         (WebCore::ShadowBlur::ShadowBlur):
1104         (WebCore::ShadowBlur::setShadowValues):
1105         (WebCore::ShadowBlur::drawShadowBuffer):
1106         (WebCore::ShadowBlur::drawRectShadowWithoutTiling):
1107         (WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
1108         (WebCore::ShadowBlur::drawInsetShadowWithTiling):
1109         (WebCore::ShadowBlur::drawRectShadowWithTiling):
1110         (WebCore::ShadowBlur::drawLayerPieces):
1111         (WebCore::ShadowBlur::blurAndColorShadowBuffer):
1112         (WebCore::ShadowBlur::beginShadowLayer):
1113         (WebCore::ShadowBlur::endShadowLayer):
1114         * platform/graphics/ShadowBlur.h:
1115         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1116         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
1117         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
1118         * platform/graphics/ca/GraphicsLayerCA.cpp:
1119         (WebCore::GraphicsLayerCA::setContentsToImage): Deleted.
1120         * platform/graphics/ca/TileGrid.cpp:
1121         (WebCore::TileGrid::platformCALayerPaintContents):
1122         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
1123         (PlatformCALayerWinInternal::drawRepaintCounters):
1124         * platform/graphics/cairo/BitmapImageCairo.cpp:
1125         (WebCore::BitmapImage::draw):
1126         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1127         (WebCore::GraphicsContext::fillRect):
1128         (WebCore::GraphicsContext::setPlatformFillColor):
1129         (WebCore::GraphicsContext::setPlatformStrokeColor):
1130         (WebCore::GraphicsContext::setPlatformShadow):
1131         (WebCore::GraphicsContext::platformFillRoundedRect):
1132         (WebCore::GraphicsContext::fillRectWithRoundedHole):
1133         (WebCore::GraphicsContext::drawPattern):
1134         * platform/graphics/cairo/ImageBufferCairo.cpp:
1135         (WebCore::ImageBuffer::draw):
1136         (WebCore::ImageBuffer::drawPattern):
1137         * platform/graphics/cairo/ImageCairo.cpp:
1138         (WebCore::Image::drawPattern):
1139         * platform/graphics/cg/BitmapImageCG.cpp:
1140         (WebCore::BitmapImage::draw):
1141         * platform/graphics/cg/ColorCG.cpp:
1142         (WebCore::leakCGColor):
1143         (WebCore::cachedCGColor):
1144         * platform/graphics/cg/GraphicsContext3DCG.cpp:
1145         (WebCore::GraphicsContext3D::paintToCanvas):
1146         * platform/graphics/cg/GraphicsContextCG.cpp:
1147         (WebCore::setCGFillColor):
1148         (WebCore::setCGStrokeColor):
1149         (WebCore::GraphicsContext::platformInit):
1150         (WebCore::GraphicsContext::drawNativeImage):
1151         (WebCore::GraphicsContext::drawPattern):
1152         (WebCore::GraphicsContext::drawRect):
1153         (WebCore::GraphicsContext::drawLine):
1154         (WebCore::GraphicsContext::applyFillPattern):
1155         (WebCore::GraphicsContext::fillRect):
1156         (WebCore::GraphicsContext::platformFillRoundedRect):
1157         (WebCore::GraphicsContext::fillRectWithRoundedHole):
1158         (WebCore::GraphicsContext::setPlatformShadow):
1159         (WebCore::GraphicsContext::drawLinesForText):
1160         (WebCore::GraphicsContext::setPlatformStrokeColor):
1161         (WebCore::GraphicsContext::setPlatformFillColor):
1162         (WebCore::sRGBColorSpaceRef): Deleted.
1163         * platform/graphics/cg/ImageBufferCG.cpp:
1164         (WebCore::ImageBuffer::copyImage):
1165         (WebCore::ImageBuffer::draw):
1166         (WebCore::ImageBuffer::drawPattern):
1167         * platform/graphics/cg/ImageCG.cpp:
1168         (WebCore::Image::drawPattern):
1169         (WebCore::Image::imageWithColorSpace): Deleted.
1170         * platform/graphics/cg/PDFDocumentImage.cpp:
1171         (WebCore::PDFDocumentImage::draw):
1172         * platform/graphics/cg/PDFDocumentImage.h:
1173         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1174         (WebCore::FontCascade::drawGlyphs):
1175         * platform/graphics/filters/FEBlend.cpp:
1176         (WebCore::FEBlend::platformApplySoftware):
1177         * platform/graphics/filters/FEColorMatrix.cpp:
1178         (WebCore::FEColorMatrix::platformApplySoftware):
1179         * platform/graphics/filters/FEComposite.cpp:
1180         (WebCore::FEComposite::platformApplySoftware):
1181         * platform/graphics/filters/FEDropShadow.cpp:
1182         (WebCore::FEDropShadow::platformApplySoftware):
1183         * platform/graphics/filters/FEFlood.cpp:
1184         (WebCore::FEFlood::platformApplySoftware):
1185         * platform/graphics/filters/FEMerge.cpp:
1186         (WebCore::FEMerge::platformApplySoftware):
1187         * platform/graphics/filters/FEOffset.cpp:
1188         (WebCore::FEOffset::platformApplySoftware):
1189         * platform/graphics/filters/FETile.cpp:
1190         (WebCore::FETile::platformApplySoftware):
1191         * platform/graphics/filters/SourceAlpha.cpp:
1192         (WebCore::SourceAlpha::platformApplySoftware):
1193         * platform/graphics/filters/SourceGraphic.cpp:
1194         (WebCore::SourceGraphic::platformApplySoftware):
1195         * platform/graphics/ios/IconIOS.mm:
1196         (WebCore::Icon::paint):
1197         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
1198         * platform/graphics/texmap/coordinated/UpdateAtlas.cpp:
1199         * platform/graphics/win/FontCGWin.cpp:
1200         (WebCore::FontCascade::drawGlyphs):
1201         * platform/graphics/win/GraphicsContextCGWin.cpp:
1202         (WebCore::GraphicsContext::drawFocusRing):
1203         * platform/graphics/win/ImageCGWin.cpp:
1204         (WebCore::BitmapImage::getHBITMAPOfSize):
1205         (WebCore::BitmapImage::drawFrameMatchingSourceSize):
1206         * platform/graphics/win/ImageCairoWin.cpp:
1207         (WebCore::BitmapImage::getHBITMAPOfSize):
1208         (WebCore::BitmapImage::drawFrameMatchingSourceSize):
1209         * platform/ios/LegacyTileCache.mm:
1210         (WebCore::LegacyTileCache::drawLayer):
1211         * platform/ios/LegacyTileGridTile.mm:
1212         (WebCore::LegacyTileGridTile::showBorder):
1213         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1214         (WebVideoFullscreenControllerContext::didSetupFullscreen):
1215         * platform/mac/DragImageMac.mm:
1216         (WebCore::drawAtPoint):
1217         * platform/mac/ScrollbarThemeMac.mm:
1218         (WebCore::ScrollbarThemeMac::setUpOverhangAreaBackground):
1219         * platform/mac/ThemeMac.mm:
1220         (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
1221         * platform/mediastream/MediaStreamPrivate.cpp:
1222         (WebCore::MediaStreamPrivate::paintCurrentFrameInContext):
1223         * platform/mock/ScrollbarThemeMock.cpp:
1224         (WebCore::ScrollbarThemeMock::paintTrackBackground):
1225         (WebCore::ScrollbarThemeMock::paintThumb):
1226         * platform/win/DragImageWin.cpp:
1227         (WebCore::createDragImageForLink):
1228         * platform/win/PopupMenuWin.cpp:
1229         (WebCore::PopupMenuWin::paint):
1230         * platform/win/WebCoreTextRenderer.cpp:
1231         (WebCore::doDrawTextAtPoint):
1232         * rendering/EllipsisBox.cpp:
1233         (WebCore::EllipsisBox::paint):
1234         (WebCore::EllipsisBox::paintSelection):
1235         * rendering/FilterEffectRenderer.cpp:
1236         (WebCore::FilterEffectRendererHelper::applyFilterEffect):
1237         * rendering/InlineTextBox.cpp:
1238         (WebCore::InlineTextBox::paintSelection):
1239         (WebCore::InlineTextBox::paintCompositionBackground):
1240         (WebCore::InlineTextBox::paintDecoration):
1241         (WebCore::InlineTextBox::paintTextMatchMarker):
1242         (WebCore::InlineTextBox::paintCompositionUnderline):
1243         * rendering/RenderBlock.cpp:
1244         (WebCore::RenderBlock::blockSelectionGap):
1245         (WebCore::RenderBlock::logicalLeftSelectionGap):
1246         (WebCore::RenderBlock::logicalRightSelectionGap):
1247         * rendering/RenderBox.cpp:
1248         (WebCore::RenderBox::paintClippingMask):
1249         * rendering/RenderBoxModelObject.cpp:
1250         (WebCore::applyBoxShadowForBackground):
1251         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
1252         (WebCore::RenderBoxModelObject::paintBorder):
1253         (WebCore::RenderBoxModelObject::drawBoxSideFromPath):
1254         (WebCore::RenderBoxModelObject::paintBoxShadow):
1255         * rendering/RenderDetailsMarker.cpp:
1256         (WebCore::RenderDetailsMarker::paint):
1257         * rendering/RenderElement.cpp:
1258         (WebCore::RenderElement::drawLineForBoxSide):
1259         (WebCore::RenderElement::paintOutline):
1260         * rendering/RenderEmbeddedObject.cpp:
1261         (WebCore::RenderEmbeddedObject::paintSnapshotImage):
1262         (WebCore::RenderEmbeddedObject::paintReplaced):
1263         * rendering/RenderFileUploadControl.cpp:
1264         (WebCore::RenderFileUploadControl::paintObject):
1265         * rendering/RenderFrameSet.cpp:
1266         (WebCore::RenderFrameSet::paintColumnBorder):
1267         (WebCore::RenderFrameSet::paintRowBorder):
1268         * rendering/RenderImage.cpp:
1269         (WebCore::RenderImage::paintReplaced):
1270         (WebCore::RenderImage::paintIntoRect):
1271         * rendering/RenderLayer.cpp:
1272         (WebCore::RenderLayer::beginTransparencyLayers):
1273         (WebCore::RenderLayer::paintScrollCorner):
1274         (WebCore::RenderLayer::drawPlatformResizerImage):
1275         (WebCore::RenderLayer::paintResizer):
1276         * rendering/RenderListBox.cpp:
1277         (WebCore::RenderListBox::paintItemForeground):
1278         (WebCore::RenderListBox::paintItemBackground):
1279         * rendering/RenderListMarker.cpp:
1280         (WebCore::RenderListMarker::paint):
1281         * rendering/RenderReplaced.cpp:
1282         (WebCore::RenderReplaced::paint):
1283         * rendering/RenderScrollbarTheme.cpp:
1284         (WebCore::RenderScrollbarTheme::paintScrollCorner):
1285         * rendering/RenderSnapshottedPlugIn.cpp:
1286         (WebCore::RenderSnapshottedPlugIn::paintSnapshot):
1287         * rendering/RenderTheme.cpp:
1288         (WebCore::RenderTheme::paintSliderTicks):
1289         * rendering/RenderThemeIOS.mm:
1290         (WebCore::drawAxialGradient):
1291         (WebCore::drawRadialGradient):
1292         (WebCore::RenderThemeIOS::paintCheckboxDecorations):
1293         (WebCore::RenderThemeIOS::paintRadioDecorations):
1294         (WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
1295         (WebCore::RenderThemeIOS::paintSliderTrack):
1296         (WebCore::RenderThemeIOS::paintProgressBar):
1297         (WebCore::RenderThemeIOS::paintFileUploadIconDecorations):
1298         * rendering/RenderThemeMac.mm:
1299         (WebCore::RenderThemeMac::paintProgressBar):
1300         (WebCore::RenderThemeMac::paintMenuListButtonDecorations):
1301         (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
1302         (WebCore::titleTextColorForAttachment):
1303         (WebCore::AttachmentLayout::layOutSubtitle):
1304         (WebCore::paintAttachmentIconBackground):
1305         (WebCore::paintAttachmentTitleBackground):
1306         (WebCore::paintAttachmentProgress):
1307         * rendering/RenderView.cpp:
1308         (WebCore::RenderView::paint):
1309         (WebCore::RenderView::paintBoxDecorations):
1310         * rendering/RenderWidget.cpp:
1311         (WebCore::RenderWidget::paint):
1312         * rendering/RootInlineBox.cpp:
1313         (WebCore::RootInlineBox::lineSelectionGap):
1314         * rendering/SimpleLineLayoutFunctions.cpp:
1315         (WebCore::SimpleLineLayout::paintDebugBorders):
1316         * rendering/TextPaintStyle.cpp:
1317         (WebCore::TextPaintStyle::TextPaintStyle):
1318         (WebCore::adjustColorForVisibilityOnBackground):
1319         (WebCore::computeTextPaintStyle):
1320         (WebCore::updateGraphicsContext):
1321         * rendering/TextPaintStyle.h:
1322         (WebCore::TextPaintStyle::TextPaintStyle):
1323         * rendering/TextPainter.cpp:
1324         (WebCore::ShadowApplier::ShadowApplier):
1325         (WebCore::paintTextWithShadows):
1326         * rendering/mathml/RenderMathMLBlock.cpp:
1327         (WebCore::RenderMathMLBlock::paint):
1328         * rendering/mathml/RenderMathMLFraction.cpp:
1329         (WebCore::RenderMathMLFraction::paint):
1330         * rendering/mathml/RenderMathMLMenclose.cpp:
1331         (WebCore::RenderMathMLMenclose::paint):
1332         * rendering/mathml/RenderMathMLOperator.cpp:
1333         (WebCore::RenderMathMLOperator::paint):
1334         * rendering/mathml/RenderMathMLRadicalOperator.cpp:
1335         (WebCore::RenderMathMLRadicalOperator::paint):
1336         * rendering/mathml/RenderMathMLRoot.cpp:
1337         (WebCore::RenderMathMLRoot::paint):
1338         * rendering/shapes/Shape.cpp:
1339         (WebCore::Shape::createRasterShape):
1340         * rendering/style/NinePieceImage.cpp:
1341         (WebCore::NinePieceImage::paint):
1342         * rendering/style/RenderStyle.h:
1343         * rendering/svg/RenderSVGImage.cpp:
1344         (WebCore::RenderSVGImage::paintForeground):
1345         * rendering/svg/RenderSVGPath.cpp:
1346         (WebCore::useStrokeStyleToFill):
1347         * rendering/svg/RenderSVGResourceFilter.cpp:
1348         (WebCore::RenderSVGResourceFilter::postApplyResource):
1349         * rendering/svg/RenderSVGResourceSolidColor.cpp:
1350         (WebCore::RenderSVGResourceSolidColor::applyResource):
1351         * rendering/svg/SVGInlineTextBox.cpp:
1352         (WebCore::SVGInlineTextBox::paintSelectionBackground):
1353         * rendering/svg/SVGRenderingContext.cpp:
1354         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
1355         (WebCore::SVGRenderingContext::bufferForeground):
1356         * svg/SVGAnimatedColor.cpp:
1357         (WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue):
1358         * svg/graphics/SVGImage.cpp:
1359         (WebCore::SVGImage::drawForContainer):
1360         (WebCore::SVGImage::nativeImageForCurrentFrame):
1361         (WebCore::SVGImage::drawPatternForContainer):
1362         (WebCore::SVGImage::draw):
1363         * svg/graphics/SVGImage.h:
1364         * svg/graphics/SVGImageForContainer.cpp:
1365         (WebCore::SVGImageForContainer::draw):
1366         (WebCore::SVGImageForContainer::drawPattern):
1367         * svg/graphics/SVGImageForContainer.h:
1368         * svg/graphics/filters/SVGFEImage.cpp:
1369         (WebCore::FEImage::platformApplySoftware):
1370         * testing/MockPageOverlayClient.cpp:
1371         (WebCore::MockPageOverlayClient::drawRect):
1372
1373 2015-11-07  Simon Fraser  <simon.fraser@apple.com>
1374
1375         Use ColorSpaceSRGB for image buffers everywhere
1376         https://bugs.webkit.org/show_bug.cgi?id=150990
1377
1378         Reviewed by Zalan Bujtas.
1379
1380         ColorSpaceSRGB and ColorSpaceDeviceRGB are equivalent now, so convert
1381         code that creates image buffers tagged with ColorSpaceDeviceRGB to use ColorSpaceSRGB.
1382
1383         * platform/graphics/GraphicsContext.cpp:
1384         (WebCore::GraphicsContext::createCompatibleBuffer):
1385         * platform/graphics/ImageBuffer.h:
1386         (WebCore::ImageBuffer::create):
1387         * platform/graphics/cg/BitmapImageCG.cpp:
1388         (WebCore::BitmapImage::checkForSolidColor):
1389         * platform/graphics/cg/ColorCG.cpp:
1390         (WebCore::Color::Color):
1391         * platform/graphics/cg/GraphicsContextCG.cpp:
1392         (WebCore::sRGBColorSpaceRef): Deleted.
1393         * platform/graphics/cg/ImageBufferCG.cpp:
1394         (WebCore::ImageBuffer::putByteArray):
1395         * platform/graphics/cocoa/IOSurface.mm:
1396         (IOSurface::createFromImage):
1397         * platform/graphics/filters/FEFlood.h:
1398         * platform/graphics/filters/FETile.cpp:
1399         (WebCore::FETile::platformApplySoftware):
1400         * platform/graphics/filters/FilterEffect.cpp:
1401         (WebCore::FilterEffect::FilterEffect):
1402         * platform/graphics/filters/SourceGraphic.h:
1403         (WebCore::SourceGraphic::SourceGraphic):
1404         * rendering/FilterEffectRenderer.cpp:
1405         (WebCore::FilterEffectRenderer::build):
1406         (WebCore::FilterEffectRenderer::apply):
1407         * rendering/RenderThemeMac.mm:
1408         (WebCore::RenderThemeMac::paintProgressBar):
1409         * rendering/svg/RenderSVGResourceClipper.cpp:
1410         (WebCore::RenderSVGResourceClipper::applyClippingToContext):
1411         * rendering/svg/RenderSVGResourceFilter.cpp:
1412         (WebCore::RenderSVGResourceFilter::buildPrimitives):
1413         * rendering/svg/RenderSVGResourceGradient.cpp:
1414         (WebCore::createMaskAndSwapContextForTextGradient):
1415         * rendering/svg/RenderSVGResourceMasker.cpp:
1416         (WebCore::RenderSVGResourceMasker::applyResource):
1417         * rendering/svg/RenderSVGResourcePattern.cpp:
1418         (WebCore::RenderSVGResourcePattern::createTileImage):
1419         * svg/graphics/SVGImage.cpp:
1420         (WebCore::SVGImage::drawPatternForContainer):
1421         * svg/graphics/filters/SVGFEImage.cpp:
1422         (WebCore::FEImage::platformApplySoftware):
1423
1424 2015-11-07  Zalan Bujtas  <zalan@apple.com>
1425
1426         Crash when subtree layout is set on FrameView while auto size mode is enabled.
1427         https://bugs.webkit.org/show_bug.cgi?id=150995
1428         rdar://problem/22785262
1429
1430         Reviewed by Beth Dakin.
1431
1432         Autosizing initiates multiple synchronous layouts to calculate preferred view width for current content.
1433         FrameView::autoSizeIfEnabled() is called from FrameView::layout() while we are in InPreLayout state.
1434         It is safe to do during full layout.
1435         However, since we setup the subtree state just before the autoSizeIfEnabled() call, reentering it with
1436         a newly issued layout confuses SubtreeLayoutStateMaintainer.
1437
1438         This patch reverses the order of autoSizeIfEnabled() call and the subtree layout state setup.
1439         It also ensures that the first layout requested by autoSizeIfEnabled() always runs on the whole tree.  
1440
1441         Test: fast/dynamic/crash-subtree-layout-when-auto-size-enabled.html
1442
1443         * page/FrameView.cpp:
1444         (WebCore::FrameView::layout):
1445         (WebCore::FrameView::convertSubtreeLayoutToFullLayout):
1446         (WebCore::FrameView::scheduleRelayout):
1447         (WebCore::FrameView::scheduleRelayoutOfSubtree):
1448         (WebCore::FrameView::autoSizeIfEnabled):
1449         * page/FrameView.h:
1450         * testing/Internals.cpp:
1451         (WebCore::Internals::enableAutoSizeMode):
1452         * testing/Internals.h:
1453         * testing/Internals.idl:
1454
1455 2015-11-07  Chris Dumez  <cdumez@apple.com>
1456
1457         embed element without src and type attributes should represent nothing
1458         https://bugs.webkit.org/show_bug.cgi?id=148853
1459         <rdar://problem/22588235>
1460
1461         Reviewed by Zalan Bujtas.
1462
1463         As per the HTML specification, an embed element without src and type
1464         attributes should represent nothing:
1465         https://html.spec.whatwg.org/multipage/embedded-content.html#the-embed-element
1466
1467         This patch fixes the issue by making sure we don't construct a
1468         renderer for such embed elements.
1469
1470         The new behavior is consistent with Firefox but differs from Chrome.
1471
1472         No new tests, already covered by existing tests.
1473
1474         * html/HTMLEmbedElement.cpp:
1475         (WebCore::HTMLEmbedElement::rendererIsNeeded):
1476
1477 2015-11-07  Michael Catanzaro  <mcatanzaro@igalia.com>
1478
1479         Node.h:392:12: warning: 'this' pointer cannot be null in well-defined C++ code
1480         https://bugs.webkit.org/show_bug.cgi?id=150996
1481
1482         Reviewed by Andreas Kling.
1483
1484         Remove ASSERT(this) statement that is triggering hundreds of warnings from Clang.
1485
1486         * dom/Node.h:
1487         (WebCore::Node::document):
1488
1489 2015-11-07  Michael Catanzaro  <mcatanzaro@igalia.com>
1490
1491         Unreviewed, fix GTK build after r191981
1492
1493         * html/HTMLFormControlElement.cpp:
1494
1495 2015-11-06  Scott Valentine  <svalentine@ikayzo.com>
1496
1497         Allow an optional hash algorithm to be passed to generateKey for RSA keys.
1498         https://bugs.webkit.org/show_bug.cgi?id=144938
1499
1500         Reviewed by Alexey Proskuryakov.
1501
1502         Test: crypto/subtle/rsa-export-generated-keys.html
1503
1504         This changeset allows an optional hash parameter to be passed to the generate
1505         key function for RSA type keys. Previously, there was no way to export generated
1506         keys, as no hash function could be associated with the key (required for JWK).
1507
1508         The current WebCrypto API draft requires the hash function to be specified in the
1509         algorithm object passed to generateKey (http://www.w3.org/TR/WebCryptoAPI 20.4),
1510         however, they were made optional in this implementation to maintain compatiblity.
1511
1512         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
1513         (WebCore::getHashAlgorithm):
1514         (WebCore::createHmacParams):
1515         (WebCore::createHmacKeyParams):
1516         (WebCore::createRsaKeyGenParams):
1517         (WebCore::createRsaOaepParams):
1518         (WebCore::createRsaSsaParams):
1519         (WebCore::JSCryptoAlgorithmDictionary::createParametersForImportKey): Deleted.
1520         * bindings/js/SerializedScriptValue.cpp:
1521         (WebCore::CloneDeserializer::readRSAKey):
1522         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
1523         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey):
1524         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
1525         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
1526         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey):
1527         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
1528         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
1529         (WebCore::CryptoAlgorithmRSA_OAEP::generateKey):
1530         (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
1531         * crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
1532         (WebCore::CryptoKeyRSA::CryptoKeyRSA):
1533         (WebCore::CryptoKeyRSA::create):
1534         (WebCore::CryptoKeyRSA::generatePair):
1535         (WebCore::CryptoKeyRSA::restrictToHash): Deleted.
1536         * crypto/keys/CryptoKeyRSA.h:
1537         * crypto/mac/CryptoKeyRSAMac.cpp:
1538         (WebCore::CryptoKeyRSA::CryptoKeyRSA):
1539         (WebCore::CryptoKeyRSA::create):
1540         (WebCore::CryptoKeyRSA::generatePair):
1541         (WebCore::CryptoKeyRSA::restrictToHash): Deleted.
1542         * crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h:
1543
1544 2015-11-06  Wenson Hsieh  <wenson_hsieh@apple.com>
1545
1546         Scrolling iframe inside scrollable div does not work with trackpad
1547         https://bugs.webkit.org/show_bug.cgi?id=150168
1548         <rdar://problem/23143931>
1549
1550         Reviewed by Brent Fulgham.
1551
1552         When scrolling in an iframe nested under an overflow scrolling region, EventHandler::platformPrepareForWheelEvents
1553         fails to compute the correct scrollableArea, using the overflow div's scrollable area instead of the iframe's view.
1554         This causes the latching algorithm to bail out of handling the wheel event. To avoid this, we special-case the
1555         decision to compute the scrollableArea from the scrollableContainer if we are attempting to scroll in an iframe.
1556
1557         Test: fast/scrolling/latching/scroll-iframe-in-overflow.html
1558
1559         * page/mac/EventHandlerMac.mm:
1560         (WebCore::EventHandler::platformPrepareForWheelEvents):
1561
1562 2015-11-06  Brady Eidson  <beidson@apple.com>
1563
1564         Modern IDB: Make the result data for a "get" request be an IDBGetResult.
1565         https://bugs.webkit.org/show_bug.cgi?id=150985
1566
1567         Reviewed by Alex Christensen.
1568
1569         No new tests (Refactor, no change in behavior).
1570
1571         * Modules/indexeddb/IDBGetResult.h:
1572         (WebCore::IDBGetResult::IDBGetResult):
1573         (WebCore::IDBGetResult::dataFromBuffer):
1574         (WebCore::IDBGetResult::isolatedCopy):
1575         
1576         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
1577         (WebCore::IDBClient::IDBTransaction::didGetRecordOnServer):
1578         
1579         * Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp:
1580         (WebCore::GetOperation::perform):
1581         
1582         * Modules/indexeddb/server/IDBBackingStore.h:
1583         
1584         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1585         (WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord):
1586         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
1587         
1588         * Modules/indexeddb/server/MemoryIndex.cpp:
1589         (WebCore::IDBServer::MemoryIndex::valueForKeyRange):
1590         * Modules/indexeddb/server/MemoryIndex.h:
1591         
1592         * Modules/indexeddb/server/MemoryObjectStore.cpp:
1593         (WebCore::IDBServer::MemoryObjectStore::indexValueForKeyRange):
1594         * Modules/indexeddb/server/MemoryObjectStore.h:
1595         
1596         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1597         (WebCore::IDBServer::UniqueIDBDatabase::storeCallback):
1598         (WebCore::IDBServer::UniqueIDBDatabase::getRecord):
1599         (WebCore::IDBServer::UniqueIDBDatabase::performGetIndexRecord):
1600         (WebCore::IDBServer::UniqueIDBDatabase::didPerformGetRecord):
1601         (WebCore::IDBServer::UniqueIDBDatabase::performGetResultCallback):
1602         (WebCore::IDBServer::UniqueIDBDatabase::performValueDataCallback): Deleted.
1603         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1604         
1605         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
1606         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getRecord):
1607         
1608         * Modules/indexeddb/shared/IDBResultData.cpp:
1609         (WebCore::IDBResultData::IDBResultData):
1610         (WebCore::IDBResultData::getRecordSuccess):
1611         (WebCore::IDBResultData::getResult):
1612         * Modules/indexeddb/shared/IDBResultData.h:
1613         (WebCore::IDBResultData::resultData): Deleted.
1614
1615 2015-11-06  Chris Dumez  <cdumez@apple.com>
1616
1617         Remove unused HTMLFormControlsCollection::namedItem()
1618         https://bugs.webkit.org/show_bug.cgi?id=150975
1619
1620         Reviewed by Andreas Kling.
1621
1622         Remove unused HTMLFormControlsCollection::namedItem().
1623         JSHTMLFormControlsCollection::namedItem() calls namedItems() on the
1624         implementation object, not namedItem() because it returns a
1625         RadioNodeList when there are several matches.
1626
1627         * html/HTMLFormControlsCollection.cpp:
1628         (WebCore::firstNamedItem): Deleted.
1629         (WebCore::HTMLFormControlsCollection::namedItem): Deleted.
1630         * html/HTMLFormControlsCollection.h:
1631
1632 2015-11-06  Myles C. Maxfield  <mmaxfield@apple.com>
1633
1634         REGRESSION(r182286): Tatechuyoko following ruby is drawn too far to the right
1635         https://bugs.webkit.org/show_bug.cgi?id=150923
1636
1637         Reviewed by Zalan Bujtas.
1638
1639         Ever since r182286, expansion opportunities in justified ruby were moved to their neighboring
1640         elements (thereby forbidding trailing nor leading expansions inside ruby). However, when the
1641         neighboring element is tatechuyoko, we will erroneously honor the expansion opportunity inside
1642         the tatechuyoko, thereby moving it horizontally.
1643
1644         Tatechuyoko should never have expansion opportunities inside it.
1645
1646         Test: fast/text/ruby-justify-tatechuyoko.html
1647
1648         * rendering/RenderBlockLineLayout.cpp:
1649         (WebCore::expansionBehaviorForInlineTextBox):
1650
1651 2015-11-06  Mario Sanchez Prada  <mario@endlessm.com>
1652
1653         Layout Test accessibility/win/linked-elements.html is crashing on win debug
1654         https://bugs.webkit.org/show_bug.cgi?id=150944
1655
1656         Reviewed by Chris Fleizach.
1657
1658         Be more precise ASSERTing on textUnderElement, only checking that the render
1659         tree is stable before using TextIteraror when in 'IncludeAllChildren' mode.
1660
1661         * accessibility/AccessibilityRenderObject.cpp:
1662         (WebCore::AccessibilityRenderObject::textUnderElement):
1663
1664 2015-11-06  Carlos Garcia Campos  <cgarcia@igalia.com>
1665
1666         [GStreamer] Use MainThreadNotifier to send notifications to main thread in WebKitWebSourceGStreamer
1667         https://bugs.webkit.org/show_bug.cgi?id=150890
1668
1669         Reviewed by Žan Doberšek.
1670
1671         Instead of the GThreadSafeMainLoopSources.
1672
1673         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1674         (webKitWebSrcStop):
1675         (webKitWebSrcChangeState):
1676         (webKitWebSrcNeedData):
1677         (webKitWebSrcEnoughData):
1678         (webKitWebSrcSeek):
1679         (StreamingClient::handleResponseReceived):
1680         (StreamingClient::handleDataReceived):
1681         (StreamingClient::handleNotifyFinished):
1682         (webKitWebSrcFinalize): Deleted.
1683         (webKitWebSrcSetProperty): Deleted.
1684         (webKitWebSrcGetProperty): Deleted.
1685         (webKitWebSrcSetExtraHeader): Deleted.
1686         (webKitWebSrcStart): Deleted.
1687         (webKitWebSrcGetProtocols): Deleted.
1688         (webKitWebSrcGetUri): Deleted.
1689         (webKitWebSrcSetUri): Deleted.
1690         (webKitWebSrcUriHandlerInit): Deleted.
1691
1692 2015-11-06  Carlos Garcia Campos  <cgarcia@igalia.com>
1693
1694         [GStreamer] Use MainThreadNotifier to send notifications to main thread in TrackPrivateGStreamer
1695         https://bugs.webkit.org/show_bug.cgi?id=150889
1696
1697         Reviewed by Žan Doberšek.
1698
1699         Instead of the GThreadSafeMainLoopSources.
1700
1701         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
1702         (WebCore::InbandTextTrackPrivateGStreamer::InbandTextTrackPrivateGStreamer):
1703         (WebCore::InbandTextTrackPrivateGStreamer::handleSample):
1704         (WebCore::InbandTextTrackPrivateGStreamer::streamChanged):
1705         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
1706         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
1707         (WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer):
1708         (WebCore::TrackPrivateBaseGStreamer::disconnect):
1709         (WebCore::TrackPrivateBaseGStreamer::activeChangedCallback):
1710         (WebCore::TrackPrivateBaseGStreamer::tagsChangedCallback):
1711         (WebCore::TrackPrivateBaseGStreamer::tagsChanged):
1712         (WebCore::TrackPrivateBaseGStreamer::~TrackPrivateBaseGStreamer): Deleted.
1713         (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfActiveChanged): Deleted.
1714         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
1715
1716 2015-11-06  Csaba Osztrogonác  <ossy@webkit.org>
1717
1718         Suppress deprecated-declarations warning in WebCore/platform/URL.cpp
1719         https://bugs.webkit.org/show_bug.cgi?id=150803
1720
1721         Reviewed by Alexey Proskuryakov.
1722
1723         * platform/URL.cpp:
1724         (WebCore::appendEncodedHostname):
1725
1726 2015-11-06  Carlos Garcia Campos  <cgarcia@igalia.com>
1727
1728         [GStreamer] Do not use GThreadSafeMainLoopSource to send notifications to the main thread in MediaPlayerPrivateGStreamer
1729         https://bugs.webkit.org/show_bug.cgi?id=150888
1730
1731         Reviewed by Žan Doberšek.
1732
1733         Analyzing how the main loop sources were used in GST code I've
1734         noticed that in most of the cases they are used to send
1735         notifications to the main thread. The way it works in those cases
1736         is that some state is updated in whatever thread and we notify the
1737         main thread to use the new state. There's no data passed to the
1738         main thread, they are just notifications. I've also noticed that
1739         we are not doing this exactly as expected in several of those
1740         cases. GThreadSafeMainLoopSource cancels the current source when a
1741         new one is scheduled, and that was done this way because previous
1742         code in GST using GSources directly did it that way. But that's
1743         not what we want, if there's a notification pending, since the
1744         state is updated, we can just wait for it to happen instead of
1745         cancelling and scheduling a new one. I've also noticed that in
1746         most of the cases where we schedule notifications to the main
1747         thread, we can be already in the main thread, so we could avoid
1748         the schedule entirely.
1749         We can use RunLoop::dispatch() to send notifications to the main
1750         thread, but there's no way to cancel those tasks. This patch adds
1751         a new helper class MainThreadNotifier that uses an enum of flags to
1752         handle different kind of notifications. It uses
1753         RunLoop::dispatch() to send notifications to the main thread, but
1754         only if there isn't one pending for the given type.
1755         This patch also makes signal callbacks static members to be able
1756         to make the private methods actually private.
1757
1758         * platform/graphics/gstreamer/MainThreadNotifier.h: Added.
1759         (WebCore::MainThreadNotifier::MainThreadNotifier):
1760         (WebCore::MainThreadNotifier::notify):
1761         (WebCore::MainThreadNotifier::cancelPendingNotifications):
1762         (WebCore::MainThreadNotifier::addPendingNotification):
1763         (WebCore::MainThreadNotifier::removePendingNotification):
1764         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1765         (WebCore::MediaPlayerPrivateGStreamer::setAudioStreamPropertiesCallback):
1766         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
1767         (WebCore::MediaPlayerPrivateGStreamer::videoChangedCallback):
1768         (WebCore::MediaPlayerPrivateGStreamer::videoSinkCapsChangedCallback):
1769         (WebCore::MediaPlayerPrivateGStreamer::audioChangedCallback):
1770         (WebCore::MediaPlayerPrivateGStreamer::textChangedCallback):
1771         (WebCore::MediaPlayerPrivateGStreamer::newTextSampleCallback):
1772         (WebCore::MediaPlayerPrivateGStreamer::sourceChangedCallback):
1773         (WebCore::MediaPlayerPrivateGStreamer::createAudioSink):
1774         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
1775         (WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties): Deleted.
1776         (WebCore::MediaPlayerPrivateGStreamer::registerMediaEngine): Deleted.
1777         (WebCore::initializeGStreamerAndRegisterWebKitElements): Deleted.
1778         (WebCore::MediaPlayerPrivateGStreamer::load): Deleted.
1779         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): Deleted.
1780         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): Deleted.
1781         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText): Deleted.
1782         (WebCore::MediaPlayerPrivateGStreamer::canSaveMediaData): Deleted.
1783         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1784         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1785         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
1786         (WebCore::MediaPlayerPrivateGStreamerBase::volumeChangedCallback):
1787         (WebCore::MediaPlayerPrivateGStreamerBase::muteChangedCallback):
1788         (WebCore::MediaPlayerPrivateGStreamerBase::repaintCallback):
1789         (WebCore::MediaPlayerPrivateGStreamerBase::drawCallback):
1790         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
1791         (WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement):
1792         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase): Deleted.
1793         (WebCore::MediaPlayerPrivateGStreamerBase::setPipeline): Deleted.
1794         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage): Deleted.
1795         (WebCore::MediaPlayerPrivateGStreamerBase::muted): Deleted.
1796         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): Deleted.
1797         (WebCore::MediaPlayerPrivateGStreamerBase::droppedFrameCount): Deleted.
1798         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1799         (WebCore::MediaPlayerPrivateGStreamerBase::setVisible): Deleted.
1800
1801 2015-11-06  Yoav Weiss  <yoav@yoav.ws>
1802
1803         Expose HTMLImageElement sizes attribute in IDL
1804         https://bugs.webkit.org/show_bug.cgi?id=150230
1805
1806         Reviewed by Darin Adler.
1807
1808         No new tests, but fixed test expectations for exposed interfaces.
1809
1810         * html/HTMLImageElement.idl: Make sure that `sizes` is exposed as an IDL attribute, to ensure proper feature detection of sizes support.
1811
1812 2015-11-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1813
1814         [GStreamer] Use RunLoop::Timer instead of GMainLoopSource in video sink
1815         https://bugs.webkit.org/show_bug.cgi?id=150807
1816
1817         Reviewed by Žan Doberšek.
1818
1819         Since we always wait until the sample is actually rendered we
1820         don't really need either a thread safe main loop source, nor
1821         cancelling if already requested and other things GMainLoopSource does.
1822         This adds a helper class VideoRenderRequestScheduler to use the
1823         RunLoop::Timer. All the logic to syncronize between threads has
1824         been moved to this helper class too.
1825
1826         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
1827         (VideoRenderRequestScheduler::VideoRenderRequestScheduler):
1828         (VideoRenderRequestScheduler::start):
1829         (VideoRenderRequestScheduler::stop):
1830         (VideoRenderRequestScheduler::requestRender):
1831         (VideoRenderRequestScheduler::isUnlocked):
1832         (VideoRenderRequestScheduler::render):
1833         (_WebKitVideoSinkPrivate::_WebKitVideoSinkPrivate):
1834         (webkitVideoSinkRepaintRequested):
1835         (webkitVideoSinkRender):
1836         (webkitVideoSinkUnlock):
1837         (webkitVideoSinkUnlockStop):
1838         (webkitVideoSinkStop):
1839         (webkitVideoSinkStart):
1840         (_WebKitVideoSinkPrivate::~_WebKitVideoSinkPrivate): Deleted.
1841         (webkitVideoSinkTimeoutCallback): Deleted.
1842         (unlockSampleMutex): Deleted.
1843
1844 2015-11-05  Nikos Andronikos  <nikos.andronikos-webkit@cisra.canon.com.au>
1845
1846         Add runtime and compile time flags for enabling Web Animations API and model.
1847         https://bugs.webkit.org/show_bug.cgi?id=150914
1848
1849         Reviewed by Benjamin Poulain.
1850
1851         Add ENABLE_WEB_ANIMATIONS compile time flag, runtime flag webAnimationsEnabled and Expose WK2 preference for runtime flag.
1852
1853         * Configurations/FeatureDefines.xcconfig:
1854         * bindings/generic/RuntimeEnabledFeatures.cpp:
1855         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
1856         * bindings/generic/RuntimeEnabledFeatures.h:
1857         (WebCore::RuntimeEnabledFeatures::setWebAnimationsEnabled):
1858         (WebCore::RuntimeEnabledFeatures::webAnimationsEnabled):
1859
1860 2015-11-05  Commit Queue  <commit-queue@webkit.org>
1861
1862         Unreviewed, rolling out r192089.
1863         https://bugs.webkit.org/show_bug.cgi?id=150966
1864
1865         This change broke an existing layout test on Yosemite and
1866         Mavericks (Requested by ryanhaddad on #webkit).
1867
1868         Reverted changeset:
1869
1870         "Preview on apple.com/contact with all text selected shows a
1871         map"
1872         https://bugs.webkit.org/show_bug.cgi?id=150963
1873         http://trac.webkit.org/changeset/192089
1874
1875 2015-11-05  Tim Horton  <timothy_horton@apple.com>
1876
1877         Preview on apple.com/contact with all text selected shows a map
1878         https://bugs.webkit.org/show_bug.cgi?id=150963
1879         <rdar://problem/23421750>
1880
1881         Reviewed by Beth Dakin.
1882
1883         * editing/mac/DictionaryLookup.h:
1884         * editing/mac/DictionaryLookup.mm:
1885         (WebCore::DictionaryLookup::rangeForSelection):
1886         If the range that Lookup decides to use doesn't intersect the hit point,
1887         just ignore Lookup.
1888
1889         (WebCore::DictionaryLookup::rangeAtHitTestResult):
1890         If the selection-based Lookup fails to find a usable result, fall back
1891         to looking around the hit point.
1892
1893 2015-11-05  Brady Eidson  <beidson@apple.com>
1894
1895         Modern IDB: Implement IDBIndex get/getKey/count requests.
1896         https://bugs.webkit.org/show_bug.cgi?id=150910
1897
1898         Reviewed by Alex Christensen.
1899
1900         Tests: storage/indexeddb/modern/index-get-count-basic.html
1901                storage/indexeddb/modern/index-get-count-failures.html
1902
1903         * Modules/indexeddb/IndexedDB.h:
1904
1905         * Modules/indexeddb/client/IDBAnyImpl.cpp:
1906         (WebCore::IDBClient::IDBAny::IDBAny):
1907         (WebCore::IDBClient::IDBAny::modernIDBIndex):
1908         * Modules/indexeddb/client/IDBAnyImpl.h:
1909         (WebCore::IDBClient::IDBAny::create):
1910         (WebCore::IDBClient::IDBAny::createUndefined):
1911
1912         * Modules/indexeddb/client/IDBIndexImpl.cpp:
1913         (WebCore::IDBClient::IDBIndex::count):
1914         (WebCore::IDBClient::IDBIndex::doCount):
1915         (WebCore::IDBClient::IDBIndex::get):
1916         (WebCore::IDBClient::IDBIndex::doGet):
1917         (WebCore::IDBClient::IDBIndex::getKey):
1918         (WebCore::IDBClient::IDBIndex::doGetKey):
1919         * Modules/indexeddb/client/IDBIndexImpl.h:
1920         (WebCore::IDBClient::IDBIndex::info):
1921         
1922         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
1923         (WebCore::IDBClient::IDBObjectStore::isDeleted):
1924         (WebCore::IDBClient::IDBObjectStore::modernTransaction):
1925         
1926         * Modules/indexeddb/client/IDBRequestImpl.cpp:
1927         (WebCore::IDBClient::IDBRequest::createCount):
1928         (WebCore::IDBClient::IDBRequest::createGet):
1929         (WebCore::IDBClient::IDBRequest::IDBRequest):
1930         (WebCore::IDBClient::IDBRequest::sourceObjectStoreIdentifier):
1931         (WebCore::IDBClient::IDBRequest::sourceIndexIdentifier):
1932         (WebCore::IDBClient::IDBRequest::requestedIndexRecordType):
1933         (WebCore::IDBClient::IDBRequest::setResultToUndefined):
1934         * Modules/indexeddb/client/IDBRequestImpl.h:
1935         
1936         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
1937         (WebCore::IDBClient::IDBTransaction::requestGetValue):
1938         (WebCore::IDBClient::IDBTransaction::requestGetKey):
1939         (WebCore::IDBClient::IDBTransaction::didGetRecordOnServer):
1940         (WebCore::IDBClient::IDBTransaction::requestCount):
1941         * Modules/indexeddb/client/IDBTransactionImpl.h:
1942         
1943         * Modules/indexeddb/client/TransactionOperation.cpp:
1944         (WebCore::IDBClient::TransactionOperation::TransactionOperation):
1945         * Modules/indexeddb/client/TransactionOperation.h:
1946         (WebCore::IDBClient::TransactionOperation::indexIdentifier):
1947         (WebCore::IDBClient::TransactionOperation::indexRecordType):
1948         
1949         * Modules/indexeddb/server/IDBBackingStore.h:
1950         
1951         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1952         (WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
1953         (WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord):
1954         (WebCore::IDBServer::MemoryIDBBackingStore::getCount):
1955         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
1956         
1957         * Modules/indexeddb/server/MemoryIndex.cpp:
1958         (WebCore::IDBServer::MemoryIndex::valueForKeyRange):
1959         (WebCore::IDBServer::MemoryIndex::countForKeyRange):
1960         * Modules/indexeddb/server/MemoryIndex.h:
1961         
1962         * Modules/indexeddb/server/MemoryObjectStore.cpp:
1963         (WebCore::IDBServer::MemoryObjectStore::createIndex):
1964         (WebCore::IDBServer::MemoryObjectStore::countForKeyRange):
1965         (WebCore::IDBServer::MemoryObjectStore::indexValueForKeyRange):
1966         * Modules/indexeddb/server/MemoryObjectStore.h:
1967         
1968         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1969         (WebCore::IDBServer::UniqueIDBDatabase::getRecord):
1970         (WebCore::IDBServer::UniqueIDBDatabase::performGetIndexRecord):
1971         (WebCore::IDBServer::UniqueIDBDatabase::getCount):
1972         (WebCore::IDBServer::UniqueIDBDatabase::performGetCount):
1973         (WebCore::IDBServer::UniqueIDBDatabase::performGetRecord): Deleted.
1974         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1975         
1976         * Modules/indexeddb/shared/IDBRequestData.cpp:
1977         (WebCore::IDBRequestData::IDBRequestData):
1978         (WebCore::IDBRequestData::objectStoreIdentifier):
1979         (WebCore::IDBRequestData::indexIdentifier):
1980         (WebCore::IDBRequestData::indexRecordType):
1981         * Modules/indexeddb/shared/IDBRequestData.h:
1982
1983 2015-11-05  Zhuo Li  <zachli@apple.com>
1984
1985         Rename the variable to avoid conflict between the variable and the parameter.
1986         https://bugs.webkit.org/show_bug.cgi?id=150019.
1987
1988         Reviewed by Dan Bernstein.
1989
1990         * platform/cocoa/SearchPopupMenuCocoa.mm:
1991         (WebCore::typeCheckedRecentSearchesRemovingRecentSearchesAddedAfterDate): Rename `date`
1992         to `dateAdded` so that it does not have the same name as the parameter passed in.
1993
1994 2015-11-05  Joseph Pecoraro  <pecoraro@apple.com>
1995
1996         Web Inspector: Clean up InjectedScript uses
1997         https://bugs.webkit.org/show_bug.cgi?id=150921
1998
1999         Reviewed by Timothy Hatcher.
2000
2001         * inspector/CommandLineAPIModule.cpp:
2002         (WebCore::CommandLineAPIModule::injectIfNeeded):
2003         (WebCore::CommandLineAPIModule::CommandLineAPIModule):
2004         * inspector/CommandLineAPIModule.h:
2005         * inspector/WebInjectedScriptManager.cpp:
2006         (WebCore::WebInjectedScriptManager::didCreateInjectedScript):
2007         * inspector/WebInjectedScriptManager.h:
2008
2009 2015-11-05  Joseph Pecoraro  <pecoraro@apple.com>
2010
2011         Web Inspector: Put ScriptDebugServer into InspectorEnvironment and cleanup duplicate references
2012         https://bugs.webkit.org/show_bug.cgi?id=150869
2013
2014         Reviewed by Brian Burg.
2015
2016         Refactoring covered by existing tests.
2017
2018         * WebCore.xcodeproj/project.pbxproj:
2019         Privately export PageScriptDebuggerAgent.h due to InspectorController.h needing it.
2020
2021         * inspector/InspectorController.h:
2022         * inspector/InspectorController.cpp:
2023         (WebCore::InspectorController::InspectorController):
2024         (WebCore::InspectorController::scriptDebugServer):
2025         Own the PageScriptDebugServer.
2026
2027         * inspector/WorkerInspectorController.h:
2028         * inspector/WorkerInspectorController.cpp:
2029         (WebCore::WorkerInspectorController::WorkerInspectorController):
2030         (WebCore::WorkerInspectorController::scriptDebugServer):
2031         Own the WorkerScriptDebugServer.
2032
2033         (WebCore::WorkerInspectorController::vm):
2034         Use the VM accessed through the worker global object.
2035
2036         * inspector/InspectorWebAgentBase.h:
2037         (WebCore::InspectorAgentBase::InspectorAgentBase):
2038         Given Web agents a m_environment convenience to access the InspectorEnvironment.
2039
2040         * inspector/InspectorNetworkAgent.cpp:
2041         (WebCore::InspectorNetworkAgent::timestamp):
2042         * inspector/InspectorPageAgent.cpp:
2043         (WebCore::InspectorPageAgent::timestamp):
2044         (WebCore::InspectorPageAgent::enable):
2045         (WebCore::InspectorPageAgent::frameStartedLoading):
2046         * inspector/InspectorTimelineAgent.cpp:
2047         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
2048         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
2049         (WebCore::InspectorTimelineAgent::internalStart):
2050         (WebCore::InspectorTimelineAgent::internalStop):
2051         (WebCore::InspectorTimelineAgent::timestamp):
2052         (WebCore::InspectorTimelineAgent::startFromConsole):
2053         (WebCore::InspectorTimelineAgent::willCallFunction):
2054         (WebCore::InspectorTimelineAgent::willEvaluateScript):
2055         (WebCore::InspectorTimelineAgent::setPageScriptDebugServer): Deleted.
2056         * inspector/InspectorTimelineAgent.h:
2057         Use the InspectorEnvironment for VM / ScriptDebugServer.
2058
2059         * inspector/PageDebuggerAgent.cpp:
2060         (WebCore::PageDebuggerAgent::PageDebuggerAgent): Deleted.
2061         (WebCore::PageDebuggerAgent::scriptDebugServer): Deleted.
2062         * inspector/PageDebuggerAgent.h:
2063         * inspector/PageRuntimeAgent.cpp:
2064         (WebCore::PageRuntimeAgent::globalVM): Deleted.
2065         * inspector/PageRuntimeAgent.h:
2066         * inspector/WorkerDebuggerAgent.h:
2067         * inspector/WorkerRuntimeAgent.cpp:
2068         (WebCore::WorkerRuntimeAgent::globalVM): Deleted.
2069         * inspector/WorkerRuntimeAgent.h:
2070         * inspector/WorkerDebuggerAgent.cpp:
2071         (WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent): Deleted.
2072         (WebCore::WorkerDebuggerAgent::scriptDebugServer): Deleted.
2073         Remove now unnecessary subclass code.
2074
2075         (WebCore::WorkerDebuggerAgent::interruptAndDispatchInspectorCommands):
2076         One more special case for accessing Worker properties from the ScriptDebugServer.
2077
2078 2015-11-05  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2079
2080         [Streams API] Shield implementation from user mangling Promise.reject and resolve methods
2081         https://bugs.webkit.org/show_bug.cgi?id=150895
2082
2083         Reviewed by Youenn Fablet.
2084
2085         Replace all calls to @Promise.resolve and @Promise.reject with their internal slot counterparts. This way we
2086         ensure that if the user replaces those constructor methods, our implementation still works.
2087
2088         Test: streams/streams-promises.html.
2089
2090         * Modules/streams/ReadableStream.js:
2091         (initializeReadableStream):
2092         (cancel):
2093         * Modules/streams/ReadableStreamInternals.js:
2094         (privateInitializeReadableStreamReader):
2095         (cancelReadableStream):
2096         (readFromReadableStreamReader):
2097         * Modules/streams/ReadableStreamReader.js:
2098         (cancel):
2099         (read):
2100         (closed):
2101         * Modules/streams/StreamInternals.js:
2102         (promiseInvokeOrNoop):
2103         (promiseInvokeOrFallbackOrNoop):
2104         * Modules/streams/WritableStream.js:
2105         (initializeWritableStream):
2106         (abort):
2107         (close):
2108         (write):
2109         (closed):
2110         (ready):
2111
2112 2015-11-05  Andreas Kling  <akling@apple.com>
2113
2114         Give ResourceUsageOverlay a stacked chart for dirty memory per category.
2115         <https://webkit.org/b/150905>
2116
2117         Reviewed by Antti Koivisto.
2118
2119         Refactored the data gathering to operate on "memory categories", a memory category is at
2120         the top level a VM tag, e.g the VM tag for our bmalloc allocator. It can in turn have
2121         sub-categories, e.g one for the GC heap, which allocates all of its blocks through bmalloc
2122         and thus end up in the same tag.
2123
2124         Each category also has a hard-coded color, which is used consistently in labels and charts.
2125
2126         Also went back to drawing everything with CGContext directly instead of GraphicsContext
2127         since the latter is not thread safe.
2128
2129         * page/ResourceUsageOverlay.h:
2130         * page/cocoa/ResourceUsageOverlayCocoa.mm:
2131         (-[WebOverlayLayer drawInContext:]):
2132         (WebCore::RingBuffer::last):
2133         (WebCore::MemoryCategoryInfo::MemoryCategoryInfo):
2134         (WebCore::ResourceUsageData::ResourceUsageData):
2135         (WebCore::showText):
2136         (WebCore::drawGraphLabel):
2137         (WebCore::drawCpuHistory):
2138         (WebCore::drawGCHistory):
2139         (WebCore::drawMemHistory):
2140         (WebCore::drawSlice):
2141         (WebCore::drawMemoryPie):
2142         (WebCore::ResourceUsageOverlay::platformDraw):
2143         (WebCore::categoryForVMTag):
2144         (WebCore::runSamplerThread):
2145         (WebCore::drawPlate): Deleted.
2146         (WebCore::fontCascade): Deleted.
2147         (WebCore::ResourceUsageOverlay::draw): Deleted.
2148
2149 2015-11-05  Simon Fraser  <simon.fraser@apple.com>
2150
2151         Having page overlays causes iframe to get composited
2152         https://bugs.webkit.org/show_bug.cgi?id=150920
2153
2154         Reviewed by Tim Horton.
2155         
2156         When deciding whether to enable compositing for a subframe, don't consult the
2157         main frame's overlay count. Only do that for the main frame.
2158
2159         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2160
2161 2015-11-05  Manuel Rego Casasnovas  <rego@igalia.com>
2162
2163         [css-grid] Support positioned grid children
2164         https://bugs.webkit.org/show_bug.cgi?id=150837
2165
2166         Reviewed by Darin Adler.
2167
2168         According to the spec positioned grid children have
2169         a special behavior described at:
2170         https://drafts.csswg.org/css-grid/#abspos
2171
2172         The idea is that for positioned children the containing block will
2173         correspond to the padding edges of the grid container, unless the
2174         grid placement properties are defined.
2175         This not only affects to positioned grid items (direct children) but
2176         also to any descendant where the containing block is the grid container.
2177
2178         In order to manage this special behavior, the patch is overriding
2179         RenderBlock::layoutPositionedObject() to calculate the position and size
2180         depending on the grid-placement properties.
2181
2182         RenderBox class has some changes to calculate the containing block width
2183         and height for positioned objects (using the override value). And also
2184         to compute their static position.
2185
2186         Finally, the positioned items are not taken into account in all the
2187         different grid methods, in order that they do not interfere the layout
2188         of the grid as stated in the spec.
2189
2190         Tests: fast/css-grid-layout/absolute-positioning-grid-container-containing-block.html
2191                fast/css-grid-layout/absolute-positioning-grid-container-parent.html
2192                fast/css-grid-layout/grid-positioned-items-background.html
2193                fast/css-grid-layout/grid-positioned-items-implicit-grid-line.html
2194                fast/css-grid-layout/grid-positioned-items-implicit-grid.html
2195                fast/css-grid-layout/grid-positioned-items-unknown-named-grid-line.html
2196                fast/css-grid-layout/grid-sizing-positioned-items.html
2197                fast/css-grid-layout/positioned-grid-items-should-not-create-implicit-tracks.html
2198                fast/css-grid-layout/positioned-grid-items-should-not-take-up-space.html
2199
2200         * rendering/OrderIterator.cpp:
2201         (WebCore::OrderIterator::next): Fix method to avoid issues if no items
2202         are added to the iterator.
2203         * rendering/RenderBlock.h: Mark layoutPositionedObject() as virtual.
2204         * rendering/RenderBox.cpp: Add new maps for inline/block extra offsets.
2205         (WebCore::RenderBox::~RenderBox): Clear the new maps.
2206         (WebCore::RenderBox::extraInlineOffset): Extra offset that we need to
2207         apply to positioned grid children due to the grid placement properties.
2208         (WebCore::RenderBox::extraBlockOffset): Ditto.
2209         (WebCore::RenderBox::setExtraInlineOffset):
2210         (WebCore::RenderBox::setExtraBlockOffset):
2211         (WebCore::RenderBox::clearExtraInlineAndBlockOffests):
2212         (WebCore::RenderBox::containingBlockLogicalWidthForPositioned): Use the
2213         override containing block if any.
2214         (WebCore::RenderBox::containingBlockLogicalHeightForPositioned): Ditto.
2215         (WebCore::RenderBox::computePositionedLogicalWidth): Add the extra
2216         offset if it's a positioned element.
2217         (WebCore::RenderBox::computePositionedLogicalHeight): Ditto.
2218         * rendering/RenderBox.h:
2219         (WebCore::RenderBox::scrollbarLogicalWidth): Add utility method.
2220         * rendering/RenderGrid.cpp:
2221         (WebCore::RenderGrid::layoutBlock): Clear grid after layout positioned
2222         objects instead of at the end of layoutGridItems().
2223         (WebCore::RenderGrid::placeItemsOnGrid): Ignore positioned items.
2224         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator): Ditto.
2225         (WebCore::RenderGrid::layoutGridItems): Ditto.
2226         (WebCore::RenderGrid::prepareChildForPositionedLayout): Set static
2227         position for positioned items.
2228         (WebCore::RenderGrid::layoutPositionedObject): Calculate position and
2229         size for positioned children.
2230         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild): Calculate
2231         extra offset and breadth for positioned children.
2232         * rendering/RenderGrid.h:
2233         * rendering/style/GridResolvedPosition.cpp:
2234         (WebCore::GridResolvedPosition::isNonExistentNamedLineOrArea): Make it a
2235         public static method.
2236         (WebCore::GridUnresolvedSpan::adjustGridPositionsFromStyle): Fix calls
2237         to isNonExistentNamedLineOrArea().
2238         (WebCore::resolveGridPositionFromStyle): Ditto.
2239         * rendering/style/GridResolvedPosition.h: Make
2240         isNonExistentNamedLineOrArea() public.
2241
2242 2015-11-04  Jiewen Tan  <jiewen_tan@apple.com>
2243
2244         Null dereference loading Blink layout test editing/execCommand/delete-hidden-crash.html
2245         https://bugs.webkit.org/show_bug.cgi?id=149289
2246         <rdar://problem/22746352>
2247
2248         Reviewed by Enrica Casucci.
2249
2250         This is a merge of Blink r176497:
2251         https://codereview.chromium.org/340713003
2252
2253         It ensures the start & end positions in DeleteSelectionCommand::initializePositionData
2254         are editable.
2255
2256         Test: editing/execCommand/delete-hidden-crash.html
2257
2258         * editing/DeleteSelectionCommand.cpp:
2259         (WebCore::DeleteSelectionCommand::initializePositionData):
2260         * editing/Editor.cpp:
2261         (WebCore::Editor::advanceToNextMisspelling):
2262         * editing/htmlediting.cpp:
2263         (WebCore::firstEditablePositionAfterPositionInRoot):
2264         (WebCore::lastEditablePositionBeforePositionInRoot):
2265         These two functions don't make any sense to return VisiblePosition. Change them
2266         to return Position instead. Since there is a viable conversion from Position to
2267         VisiblePosition. It should not change the behavior of any other components depending
2268         on it.
2269         * editing/htmlediting.h:
2270
2271 2015-11-03  Myles C. Maxfield  <mmaxfield@apple.com>
2272
2273         Ruby base ending in tatechuyoko forces a line break before the tatechuyoko
2274         https://bugs.webkit.org/show_bug.cgi?id=150883
2275
2276         Reviewed by Darin Adler.
2277
2278         Asking the width of a 0-length tatechuyoko should return 0.
2279
2280         Test: fast/text/ruby-tatechuyoko.html
2281
2282         * rendering/RenderCombineText.cpp:
2283         (WebCore::RenderCombineText::width):
2284
2285 2015-11-04  Tim Horton  <timothy_horton@apple.com>
2286
2287         Update the name of a Mail class that we hardcode
2288         https://bugs.webkit.org/show_bug.cgi?id=150879
2289         <rdar://problem/23384627>
2290
2291         Reviewed by Alexey Proskuryakov.
2292
2293         * editing/cocoa/HTMLConverter.mm:
2294         (_WebMessageDocumentClass):
2295
2296 2015-11-04  Eric Carlson  <eric.carlson@apple.com>
2297
2298         [MediaStream] A RealtimeMediaSource should begin producing data automatically
2299         https://bugs.webkit.org/show_bug.cgi?id=150851
2300         rdar://problem/23380636
2301
2302         A RealtimeMediaSource should be producing data unless it is muted, which is not under the 
2303         control of the application, so a local source should begin producing data as soon as it
2304         is added to a stream. Remove "producing data" and "enabled" observer callbacks because 
2305         they don't provide anything that the "muted" callback already provides.
2306         
2307         Reviewed by Jer Noble.
2308
2309         * Modules/mediastream/MediaStreamTrack.cpp:
2310         (WebCore::MediaStreamTrack::trackProducingDataChanged): Deleted.
2311         * Modules/mediastream/MediaStreamTrack.h:
2312
2313         * Modules/mediastream/UserMediaRequest.cpp:
2314         (WebCore::UserMediaRequest::didCreateStream): Tell sources to begin producing data.
2315
2316         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2317         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load): Don't call stream->startProducingData,
2318           it isn't necessary.
2319         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setReadyState): Call characteristicsChanged 
2320           when the readyState changes.
2321
2322         * platform/mediastream/MediaStreamPrivate.cpp:
2323         (WebCore::MediaStreamPrivate::trackProducingDataChanged): Deleted.
2324         * platform/mediastream/MediaStreamPrivate.h:
2325
2326         * platform/mediastream/MediaStreamTrackPrivate.cpp:
2327         (WebCore::MediaStreamTrackPrivate::sourceProducingDataChanged): Deleted.
2328         (WebCore::MediaStreamTrackPrivate::sourceEnabledChanged): Deleted.
2329         * platform/mediastream/MediaStreamTrackPrivate.h:
2330
2331         * platform/mediastream/RealtimeMediaSource.cpp:
2332         (WebCore::RealtimeMediaSource::isProducingDataDidChange): Deleted.
2333         (WebCore::RealtimeMediaSource::setEnabled): Deleted.
2334         * platform/mediastream/RealtimeMediaSource.h:
2335
2336         * platform/mediastream/mac/AVAudioCaptureSource.mm:
2337         (WebCore::AVAudioCaptureSource::captureOutputDidOutputSampleBufferFromConnection): !enabled() -> muted().
2338
2339         * platform/mediastream/mac/AVMediaCaptureSource.mm:
2340         (WebCore::AVMediaCaptureSource::captureSessionIsRunningDidChange): Don't call isProducingDataDidChange..
2341
2342         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2343         (WebCore::AVVideoCaptureSource::processNewFrame): !enabled() -> muted().
2344
2345 2015-11-04  Jer Noble  <jer.noble@apple.com>
2346
2347         [iOS] <video> elements without audio tracks should not interrupt music
2348         https://bugs.webkit.org/show_bug.cgi?id=149888
2349
2350         Reviewed by Eric Carlson.
2351
2352         Tests: TestWebKitAPI/Tests/WebKit/ios/AudioSessionCategoryIOS.mm
2353
2354         Only set the AVAudioSession category to "playback" when the video element in question has an
2355         audio track.
2356
2357         Add a new PlatformMediaSessionClient method called canProduceAudio(), overridden in HTMLMediaElement
2358         and AudioContext, which is checked when updating the AudioSession category in 
2359         PlatformMediaSessionManager::updateSessionState().
2360
2361         * Modules/webaudio/AudioContext.h:
2362         * html/HTMLMediaElement.cpp:
2363         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
2364         * html/HTMLMediaElement.h:
2365         * platform/audio/PlatformMediaSession.cpp:
2366         (WebCore::PlatformMediaSession::activeAudioSessionRequired):
2367         (WebCore::PlatformMediaSession::setCanProduceAudio):
2368         * platform/audio/PlatformMediaSession.h:
2369         (WebCore::PlatformMediaSession::canProduceAudio):
2370         * platform/audio/PlatformMediaSessionManager.cpp:
2371         (WebCore::PlatformMediaSessionManager::canProduceAudio):
2372         (WebCore::PlatformMediaSessionManager::sessionCanProduceAudioChanged):
2373         (WebCore::PlatformMediaSessionManager::activeAudioSessionRequired):
2374         (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
2375         * platform/audio/PlatformMediaSessionManager.h:
2376         * platform/audio/mac/MediaSessionManagerMac.cpp:
2377         (PlatformMediaSessionManager::updateSessionState):
2378
2379 2015-11-03  Dean Jackson  <dino@apple.com>
2380
2381         Accept 8 and 4 value hex colors (#RRGGBBAA)
2382         https://bugs.webkit.org/show_bug.cgi?id=150853
2383         <rdar://problem/23380930>
2384
2385         Reviewed by Simon Fraser.
2386
2387         CSS Color Level 4 allows #RGBA and #RRGGBBAA values
2388         for colors.
2389
2390         Test: fast/css/hex-colors.html
2391
2392         * platform/graphics/Color.cpp:
2393         (WebCore::parseHexColorInternal): Update the color parsing for
2394         the new syntax.
2395
2396 2015-11-04  Mario Sanchez Prada  <mario@webkit.org>
2397
2398         [AX] WebProcess from WebKitGtk+ 2.10.0 compiled in Debug mode hits ASSERT on textUnderElement
2399         https://bugs.webkit.org/show_bug.cgi?id=150670
2400
2401         Reviewed by Chris Fleizach.
2402
2403         Move the ASSERTs stating that the render tree is stable before using the
2404         TextIterator to their right place, in AccessibilityRenderObject, so that
2405         we don't crash in debug builds in cases when this condition is irrelevant.
2406
2407         Test: accessibility/gtk/list-item-with-pseudo-element-crash.html
2408
2409         * accessibility/AccessibilityNodeObject.cpp:
2410         (WebCore::AccessibilityNodeObject::textUnderElement): Removed ASSERTs.
2411         * accessibility/AccessibilityRenderObject.cpp:
2412         (WebCore::AccessibilityRenderObject::textUnderElement): Added ASSERTs, but
2413         only before calling plainText and using the right document for the node.
2414
2415 2015-11-04  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2416
2417         [Streams API] Shield streams against user replacing the Promise constructor
2418         https://bugs.webkit.org/show_bug.cgi?id=150887
2419
2420         Reviewed by Youenn Fablet.
2421
2422         With this rework, we shield the Streams implementation against the user doing something like "Promise =
2423         function() { /* do garbage */ };".
2424
2425         Test: streams/streams-promises.html.
2426
2427         * Modules/streams/ReadableStream.js:
2428         (initializeReadableStream):
2429         (cancel):
2430         * Modules/streams/ReadableStreamInternals.js:
2431         (privateInitializeReadableStreamReader):
2432         (cancelReadableStream):
2433         (readFromReadableStreamReader):
2434         * Modules/streams/ReadableStreamReader.js:
2435         (cancel):
2436         (read):
2437         (closed):
2438         * Modules/streams/StreamInternals.js:
2439         (promiseInvokeOrNoop):
2440         (promiseInvokeOrFallbackOrNoop):
2441         * Modules/streams/WritableStream.js:
2442         (initializeWritableStream):
2443         (abort):
2444         (close):
2445         (write):
2446         (closed):
2447         (ready):
2448         * Modules/streams/WritableStreamInternals.js:
2449         (syncWritableStreamStateWithQueue):
2450
2451 2015-11-04  Antoine Quint  <graouts@apple.com>
2452
2453         SVG: hit testing region for <text> elements is incorrect
2454         https://bugs.webkit.org/show_bug.cgi?id=150838
2455
2456         Reviewed by Dean Jackson.
2457
2458         Hit testing for SVG <text> elements was using the same code as hit testing
2459         for CSS-rendered elements. However, in SVG, text elements should only hit
2460         test based on their character cells, not the rectangular bounds of the
2461         element, see section 16.6 of the SVG 1.1 specification:
2462         
2463         http://www.w3.org/TR/SVG11/interact.html#PointerEventsProperty
2464         
2465         So we now hit test each SVGTextFragment of each SVGInlineTextBox
2466         that is a child of an SVGRootInlineBox to correctly find whether the
2467         provided HitTestLocation is contained within a character cell. 
2468
2469         Tests: svg/hittest/text-dominant-baseline-hanging.svg
2470                svg/hittest/text-multiple-dx-values.svg
2471                svg/hittest/text-with-multiple-tspans.svg
2472                svg/hittest/text-with-text-node-and-content-elements.svg
2473                svg/hittest/text-with-text-node-only.svg
2474                svg/hittest/text-with-text-path.svg
2475
2476         * rendering/RootInlineBox.h:
2477         Remove the final keyword since nodeAtPoint() may now be subclassed as
2478         implemented in SVGRootInlineBox.
2479  
2480         * rendering/svg/SVGInlineTextBox.cpp:
2481         (WebCore::SVGInlineTextBox::nodeAtPoint):
2482         Iterate over the SVGTextFragments to look for a fragment containing the
2483         provided HitTestLocation.
2484  
2485         * rendering/svg/SVGRootInlineBox.cpp:
2486         (WebCore::SVGRootInlineBox::nodeAtPoint):
2487         * rendering/svg/SVGRootInlineBox.h:
2488         Override RootInlineBox::nodeAtPoint() to delegate hit testing to the
2489         children inline boxes.
2490
2491 2015-11-04  Carlos Garcia Campos  <cgarcia@igalia.com>
2492
2493         [GStreamer] Use RunLoop::Timer for ready state timer in MediaPlayerPrivateGStreamer
2494         https://bugs.webkit.org/show_bug.cgi?id=150836
2495
2496         Reviewed by Philippe Normand.
2497
2498         We don't really need a GThreadSafeMainLoopSource for this simple timer.
2499
2500         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2501         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
2502         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
2503         (WebCore::MediaPlayerPrivateGStreamer::readyTimerFired):
2504         (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
2505         (WebCore::MediaPlayerPrivateGStreamer::loadingFailed):
2506         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2507
2508 2015-11-04  Frederic Wang  <fred.wang@free.fr>
2509
2510         Add support for the USE_TYPO_METRICS flag on iOS
2511         https://bugs.webkit.org/show_bug.cgi?id=131839
2512
2513         Reviewed by Darin Adler.
2514
2515         Make the iOS Font service use the typo metrics for fonts with a MATH table when the OS/2 USE_TYPO_METRICS flag is set.
2516         The code shared by iOS, OS X and AppleWin is moved into a separate OpenTypeCG module.
2517
2518         No new tests because this is already tested by fonts/use-typo-metrics-1.html
2519
2520         * PlatformAppleWin.cmake: Add OpenTypeCG files.
2521         * PlatformMac.cmake: ditto.
2522         * WebCore.vcxproj/WebCore.vcxproj: ditto.
2523         * WebCore.vcxproj/WebCore.vcxproj.filters: ditto.
2524         * WebCore.xcodeproj/project.pbxproj: ditto.
2525         * platform/graphics/cocoa/FontCocoa.mm:
2526         (WebCore::Font::platformInit): Use functions from OpenTypeCG.
2527         (WebCore::fontHasMathTable): Deleted.
2528         * platform/graphics/ios/FontServicesIOS.mm:
2529         (WebCore::FontServicesIOS::FontServicesIOS): Use the typo metrics for fonts with a MATH table when the OS/2 USE_TYPO_METRICS flag is set.
2530         * platform/graphics/opentype/OpenTypeCG.h: Added.
2531         * platform/graphics/opentype/OpenTypeCG.cpp: Added.
2532         (WebCore::OpenType::fontHasMathTable): Move this code from FontCocoa.mm.
2533         (WebCore::OpenType::readShortFromTable): Inline function to read a 16-bit big endian integer from the OS/2 table and to cast it into a short integer.
2534         (WebCore::OpenType::tryGetTypoMetrics): Move this code from FontCocoa.mm.
2535         * platform/graphics/opentype/OpenTypeTypes.h: Add missing Glyph.h header needed by TableWithCoverage::getCoverageIndex.
2536         * platform/graphics/win/SimpleFontDataCGWin.cpp:
2537         (WebCore::Font::platformInit): Use functions from OpenTypeCG.
2538
2539 2015-11-04  Chris Dumez  <cdumez@apple.com>
2540
2541         Regression(r191652): Colloquy doesn’t render any chat content
2542         https://bugs.webkit.org/show_bug.cgi?id=150861
2543         <rdar://problem/23381007>
2544
2545         Reviewed by Antti Koivisto.
2546
2547         Do a partial revert of r191652 as this web-exposed behavior change
2548         broke Colloquy app. This only reverts the code change, the tests
2549         are left as is so that they don't rely of the frame ID setting the
2550         Window name.
2551
2552         * html/HTMLFrameElementBase.cpp:
2553         (WebCore::HTMLFrameElementBase::parseAttribute):
2554         (WebCore::HTMLFrameElementBase::setNameAndOpenURL):
2555
2556 2015-11-03  Brady Eidson  <beidson@apple.com>
2557
2558         Modern IDB: Fill out IDBIndex, create MemoryIndex in backing store.
2559         https://bugs.webkit.org/show_bug.cgi?id=150868
2560
2561         Reviewed by Alex Christensen.
2562
2563         Tests: storage/indexeddb/modern/create-index-failures.html
2564                storage/indexeddb/modern/get-index-failures.html
2565                storage/indexeddb/modern/idbindex-properties-basic.html
2566
2567         Note: The MemoryIndex in the backing store doesn't actually do anything yet.
2568         
2569         That's coming next.
2570     
2571         * CMakeLists.txt:
2572         * WebCore.xcodeproj/project.pbxproj:
2573
2574         * Modules/indexeddb/IDBIndex.h:
2575
2576         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
2577         (WebCore::IDBClient::IDBConnectionToServer::createIndex):
2578         (WebCore::IDBClient::IDBConnectionToServer::didCreateIndex):
2579         * Modules/indexeddb/client/IDBConnectionToServer.h:
2580         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
2581
2582         * Modules/indexeddb/client/IDBCursorWithValueImpl.h:
2583
2584         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
2585         (WebCore::IDBClient::IDBDatabase::didCreateIndexInfo):
2586         * Modules/indexeddb/client/IDBDatabaseImpl.h:
2587
2588         * Modules/indexeddb/client/IDBIndexImpl.cpp:
2589         (WebCore::IDBClient::IDBIndex::create):
2590         (WebCore::IDBClient::IDBIndex::IDBIndex):
2591         (WebCore::IDBClient::IDBIndex::objectStore):
2592         (WebCore::IDBClient::IDBIndex::keyPathAny):
2593         (WebCore::IDBClient::IDBIndex::openCursor):
2594         (WebCore::IDBClient::IDBIndex::count):
2595         (WebCore::IDBClient::IDBIndex::openKeyCursor):
2596         (WebCore::IDBClient::IDBIndex::get):
2597         (WebCore::IDBClient::IDBIndex::getKey):
2598         * Modules/indexeddb/client/IDBIndexImpl.h:
2599
2600         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
2601         (WebCore::IDBClient::IDBObjectStore::createIndex):
2602         (WebCore::IDBClient::IDBObjectStore::index):
2603         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
2604
2605         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
2606         (WebCore::IDBClient::IDBTransaction::createObjectStore):
2607         (WebCore::IDBClient::IDBTransaction::createIndex):
2608         (WebCore::IDBClient::IDBTransaction::createIndexOnServer):
2609         (WebCore::IDBClient::IDBTransaction::didCreateIndexOnServer):
2610         * Modules/indexeddb/client/IDBTransactionImpl.h:
2611
2612         * Modules/indexeddb/legacy/LegacyIndex.h:
2613
2614         * Modules/indexeddb/server/IDBBackingStore.h:
2615
2616         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
2617         (WebCore::IDBServer::IDBConnectionToClient::didCreateIndex):
2618         * Modules/indexeddb/server/IDBConnectionToClient.h:
2619         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
2620
2621         * Modules/indexeddb/server/IDBServer.cpp:
2622         (WebCore::IDBServer::IDBServer::createIndex):
2623         * Modules/indexeddb/server/IDBServer.h:
2624
2625         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
2626         (WebCore::IDBServer::MemoryBackingStoreTransaction::addNewIndex):
2627         (WebCore::IDBServer::MemoryBackingStoreTransaction::addExistingIndex):
2628         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
2629
2630         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2631         (WebCore::IDBServer::MemoryIDBBackingStore::createIndex):
2632         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
2633
2634         * Modules/indexeddb/server/MemoryIndex.cpp: Added.
2635         (WebCore::IDBServer::MemoryIndex::create):
2636         (WebCore::IDBServer::MemoryIndex::MemoryIndex):
2637         (WebCore::IDBServer::MemoryIndex::~MemoryIndex):
2638         * Modules/indexeddb/server/MemoryIndex.h: Added.
2639         (WebCore::IDBServer::MemoryIndex::info):
2640
2641         * Modules/indexeddb/server/MemoryObjectStore.cpp:
2642         (WebCore::IDBServer::MemoryObjectStore::createIndex):
2643         (WebCore::IDBServer::MemoryObjectStore::registerIndex):
2644         (WebCore::IDBServer::MemoryObjectStore::unregisterIndex):
2645         * Modules/indexeddb/server/MemoryObjectStore.h:
2646
2647         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2648         (WebCore::IDBServer::UniqueIDBDatabase::createIndex):
2649         (WebCore::IDBServer::UniqueIDBDatabase::performCreateIndex):
2650         (WebCore::IDBServer::UniqueIDBDatabase::didPerformCreateIndex):
2651         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2652
2653         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
2654         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCreateIndex):
2655         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
2656
2657         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
2658         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::createIndex):
2659         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
2660
2661         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
2662         (WebCore::IDBDatabaseInfo::getInfoForExistingObjectStore):
2663         (WebCore::IDBDatabaseInfo::infoForExistingObjectStore):
2664         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
2665
2666         * Modules/indexeddb/shared/IDBIndexInfo.cpp:
2667         (WebCore::IDBIndexInfo::IDBIndexInfo):
2668         (WebCore::IDBIndexInfo::isolatedCopy):
2669         * Modules/indexeddb/shared/IDBIndexInfo.h:
2670         (WebCore::IDBIndexInfo::identifier):
2671         (WebCore::IDBIndexInfo::objectStoreIdentifier):
2672
2673         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
2674         (WebCore::IDBObjectStoreInfo::createNewIndex):
2675         (WebCore::IDBObjectStoreInfo::addExistingIndex):
2676         (WebCore::IDBObjectStoreInfo::hasIndex):
2677         (WebCore::IDBObjectStoreInfo::infoForExistingIndex):
2678         (WebCore::IDBObjectStoreInfo::isolatedCopy):
2679         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
2680
2681         * Modules/indexeddb/shared/IDBResultData.cpp:
2682         (WebCore::IDBResultData::createIndexSuccess):
2683         * Modules/indexeddb/shared/IDBResultData.h:
2684
2685         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
2686         (WebCore::InProcessIDBServer::didCreateIndex):
2687         (WebCore::InProcessIDBServer::createIndex):
2688         * Modules/indexeddb/shared/InProcessIDBServer.h:
2689
2690         * bindings/js/JSIDBObjectStoreCustom.cpp:
2691         (WebCore::JSIDBObjectStore::createIndex):
2692
2693         * platform/CrossThreadCopier.cpp:
2694         (WebCore::IDBIndexInfo>::copy):
2695         * platform/CrossThreadCopier.h:
2696
2697 2015-11-03  Andy Estes  <aestes@apple.com>
2698
2699         [Cocoa] Only query for kMGQDeviceName on iOS
2700         https://bugs.webkit.org/show_bug.cgi?id=150858
2701
2702         Reviewed by Brent Fulgham.
2703
2704         * platform/ios/Device.cpp:
2705         (WebCore::deviceName): On non-iOS platorms, just return "iPhone" as the device name.
2706
2707 2015-11-03  Geoffrey Garen  <ggaren@apple.com>
2708
2709         Provide a way to turn off const in WebKit2.
2710
2711         Reviewed by Sam Weinig.
2712
2713         * bindings/js/JSDOMWindowBase.cpp:
2714         (WebCore::JSDOMWindowBase::commonVM):
2715         * page/Settings.h:
2716         (WebCore::Settings::shouldUseHighResolutionTimers):
2717         (WebCore::Settings::shouldRewriteConstAsVar):
2718         (WebCore::Settings::setShouldRewriteConstAsVar):
2719         (WebCore::Settings::backgroundShouldExtendBeyondPage):
2720
2721 2015-11-03  Joseph Pecoraro  <pecoraro@apple.com>
2722
2723         Web Inspector: Remove duplication among ScriptDebugServer subclasses
2724         https://bugs.webkit.org/show_bug.cgi?id=150860
2725
2726         Reviewed by Timothy Hatcher.
2727
2728         Refactoring covered by existing tests.
2729
2730         * bindings/js/WorkerScriptDebugServer.cpp:
2731         (WebCore::WorkerScriptDebugServer::attachDebugger):
2732         (WebCore::WorkerScriptDebugServer::detachDebugger):
2733         (WebCore::WorkerScriptDebugServer::addListener): Deleted.
2734         (WebCore::WorkerScriptDebugServer::removeListener): Deleted.
2735         * bindings/js/WorkerScriptDebugServer.h:
2736         * inspector/PageDebuggerAgent.cpp:
2737         (WebCore::PageDebuggerAgent::startListeningScriptDebugServer): Deleted.
2738         (WebCore::PageDebuggerAgent::stopListeningScriptDebugServer): Deleted.
2739         * inspector/PageDebuggerAgent.h:
2740         * inspector/PageScriptDebugServer.cpp:
2741         (WebCore::PageScriptDebugServer::attachDebugger):
2742         (WebCore::PageScriptDebugServer::detachDebugger):
2743         (WebCore::PageScriptDebugServer::addListener): Deleted.
2744         (WebCore::PageScriptDebugServer::removeListener): Deleted.
2745         * inspector/PageScriptDebugServer.h:
2746         * inspector/WorkerDebuggerAgent.cpp:
2747         (WebCore::WorkerDebuggerAgent::startListeningScriptDebugServer): Deleted.
2748         (WebCore::WorkerDebuggerAgent::stopListeningScriptDebugServer): Deleted.
2749         * inspector/WorkerDebuggerAgent.h:
2750
2751 2015-11-03  Jiewen Tan  <jiewen_tan@apple.com>
2752
2753         Null dereference loading Blink layout test scrollbars/custom-scrollbar-appearance-property.html
2754         https://bugs.webkit.org/show_bug.cgi?id=149312
2755         <rdar://problem/22748910>
2756
2757         Reviewed by Darin Adler.
2758
2759         This is a merge from Blink r167503:
2760         https://codereview.chromium.org/173433002
2761
2762         Test: scrollbars/custom-scrollbar-appearance-property.html
2763
2764         * rendering/RenderThemeMac.mm:
2765         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
2766         (WebCore::RenderThemeMac::paintSearchFieldResultsDecorationPart):
2767
2768 2015-11-03  Andreas Kling  <akling@apple.com>
2769
2770         ResourceUsageOverlay should show GC-owned malloc memory.
2771         <https://webkit.org/b/150846>
2772
2773         Reviewed by Anders Carlsson.
2774
2775         Add a memory category for GC-owned malloc memory. This carves a significant chunk off of
2776         the gigantic "bmalloc" mystery slice.
2777
2778         * page/ResourceUsageOverlay.h:
2779         * page/cocoa/ResourceUsageOverlayCocoa.mm:
2780         (WebCore::drawMemoryPie):
2781         (WebCore::ResourceUsageOverlay::draw):
2782         (WebCore::runSamplerThread):
2783
2784 2015-11-03  Saam barati  <sbarati@apple.com>
2785
2786         Rewrite "const" as "var" for iTunes/iBooks on the Mac
2787         https://bugs.webkit.org/show_bug.cgi?id=150852
2788
2789         Reviewed by Geoffrey Garen.
2790
2791         * bindings/js/JSDOMWindowBase.cpp:
2792         (WebCore::JSDOMWindowBase::commonVM):
2793
2794 2015-10-30  Jon Honeycutt  <jhoneycutt@apple.com>
2795
2796         Implement support for the autocomplete attribute
2797         https://bugs.webkit.org/show_bug.cgi?id=150731
2798         rdar://problem/21078968
2799
2800         The autocomplete attribute is defined by
2801         https://html.spec.whatwg.org/multipage/forms.html#autofill.
2802
2803         Reviewed by Brent Fulgham.
2804
2805         Test: fast/forms/autocomplete-tokens.html
2806
2807         * html/HTMLFormControlElement.cpp:
2808         (WebCore::isContactToken):
2809         Return true if this is a contact token.
2810         (WebCore::categoryForAutofillFieldToken):
2811         Adds all of the autofill field tokens to a map, and returns the
2812         category for a given token.
2813         (WebCore::maxTokensForAutofillFieldCategory):
2814         Return the maximum number of tokens an autofill category supports.
2815         (WebCore::HTMLFormControlElement::parseAutocompleteAttribute):
2816         Implement the processing model defined in
2817         https://html.spec.whatwg.org/multipage/forms.html#processing-model-3
2818         with respect to the IDL-exposed autofill value.
2819         (WebCore::HTMLFormControlElement::setAutocomplete):
2820         Set the autocomplete attribute to the given string.
2821
2822         * html/HTMLFormControlElement.h:
2823         Declare setAutocomplete() and autocomplete().
2824
2825         * html/HTMLInputElement.idl:
2826         Remove the Reflect attribute. We now have custom processing for getting
2827         this attribute.
2828
2829         * html/HTMLSelectElement.idl:
2830         Declare the autocomplete attribute.
2831
2832         * html/HTMLTextAreaElement.idl:
2833         Ditto.
2834
2835 2015-11-03  Brady Eidson  <beidson@apple.com>
2836
2837         Modern IDB: Land empty IDBCursor/Index IDL implementations.
2838         https://bugs.webkit.org/show_bug.cgi?id=150839
2839
2840         Reviewed by Alex Christensen.
2841
2842         No new tests (No change in behavior).
2843
2844         * CMakeLists.txt:
2845         * WebCore.xcodeproj/project.pbxproj:
2846
2847         * Modules/indexeddb/IDBIndex.h:
2848         
2849         * Modules/indexeddb/client/IDBCursorImpl.cpp: Added.
2850         (WebCore::IDBClient::IDBCursor::~IDBCursor):
2851         (WebCore::IDBClient::IDBCursor::direction):
2852         (WebCore::IDBClient::IDBCursor::key):
2853         (WebCore::IDBClient::IDBCursor::primaryKey):
2854         (WebCore::IDBClient::IDBCursor::value):
2855         (WebCore::IDBClient::IDBCursor::source):
2856         (WebCore::IDBClient::IDBCursor::update):
2857         (WebCore::IDBClient::IDBCursor::advance):
2858         (WebCore::IDBClient::IDBCursor::continueFunction):
2859         (WebCore::IDBClient::IDBCursor::deleteFunction):
2860         * Modules/indexeddb/client/IDBCursorImpl.h: Added.
2861         
2862         * Modules/indexeddb/client/IDBCursorWithValueImpl.cpp: Added.
2863         * Modules/indexeddb/client/IDBCursorWithValueImpl.h: Added.
2864         
2865         * Modules/indexeddb/client/IDBIndexImpl.cpp: Added.
2866         (WebCore::IDBClient::IDBIndex::~IDBIndex):
2867         (WebCore::IDBClient::IDBIndex::name):
2868         (WebCore::IDBClient::IDBIndex::objectStore):
2869         (WebCore::IDBClient::IDBIndex::keyPathAny):
2870         (WebCore::IDBClient::IDBIndex::keyPath):
2871         (WebCore::IDBClient::IDBIndex::unique):
2872         (WebCore::IDBClient::IDBIndex::multiEntry):
2873         (WebCore::IDBClient::IDBIndex::openCursor):
2874         (WebCore::IDBClient::IDBIndex::count):
2875         (WebCore::IDBClient::IDBIndex::openKeyCursor):
2876         (WebCore::IDBClient::IDBIndex::get):
2877         (WebCore::IDBClient::IDBIndex::getKey):
2878         * Modules/indexeddb/client/IDBIndexImpl.h: Copied from Source/WebCore/Modules/indexeddb/IDBIndex.h.
2879         
2880         * Modules/indexeddb/legacy/LegacyIndex.h:
2881         (WebCore::LegacyIndex::id):
2882         
2883         * Modules/indexeddb/shared/IDBIndexInfo.cpp: Added.
2884         * Modules/indexeddb/shared/IDBIndexInfo.h: Added.
2885         (WebCore::IDBIndexInfo::name):
2886         (WebCore::IDBIndexInfo::keyPath):
2887         (WebCore::IDBIndexInfo::unique):
2888         (WebCore::IDBIndexInfo::multiEntry):
2889
2890 2015-11-03  Myles C. Maxfield  <mmaxfield@apple.com>
2891
2892         Addressing post-review comments on r191934.
2893
2894         Unreviewed.
2895
2896         * platform/graphics/mac/FontCustomPlatformData.cpp:
2897         (WebCore::FontCustomPlatformData::supportsFormat):
2898
2899 2015-11-03  Joseph Pecoraro  <pecoraro@apple.com>
2900
2901         Web Inspector: Move ScriptDebugServer::Task to WorkerScriptDebugServer where it is actually used
2902         https://bugs.webkit.org/show_bug.cgi?id=150847
2903
2904         Reviewed by Timothy Hatcher.
2905
2906         * bindings/js/WorkerScriptDebugServer.cpp:
2907         (WebCore::WorkerScriptDebugServer::interruptAndRunTask):
2908         * bindings/js/WorkerScriptDebugServer.h:
2909         * inspector/WorkerDebuggerAgent.cpp:
2910
2911 2015-11-03  Tim Horton  <timothy_horton@apple.com>
2912
2913         Fix the build.
2914
2915         * platform/Widget.h:
2916         (WebCore::Widget::boundsRect):
2917         (WebCore::Widget::resize):
2918
2919 2015-11-03  Myles C. Maxfield  <mmaxfield@apple.com>
2920
2921         font-variant-* properties in @font-face declarations should be honored
2922         https://bugs.webkit.org/show_bug.cgi?id=149771
2923
2924         Reviewed by Simon Fraser.
2925
2926         According to the CSS Fonts Level 3 spec, web authors are allowed to put
2927         font-feature-settings / font-variant-* inside @font-face blocks. These
2928         properties are supposed to be applied at a specific time during the
2929         font selection algorithm.
2930
2931         This patch gives a FontFeatureSettings object and a FontVariantSettings
2932         object to CSSFontFace, and moves common parsing logic from
2933         StyleBuilderCustom to a shared location. Then, once the two properties
2934         are parsed from the @font-face block, the relevant data structures are
2935         passed down into the font selection algorithm. This algorithm then
2936         consults with these values at the correct time (inside
2937         preparePlatformFont()).
2938
2939         Tests: css3/font-feature-settings-font-face-rendering.html
2940                css3/font-variant-font-face-all.html
2941                css3/font-variant-font-face-override.html
2942
2943         * WebCore.xcodeproj/project.pbxproj: Add a header for the common
2944         location of parsing font-variant-ligatures, font-variant-numeric,
2945         and font-variant-east-asian.
2946         * css/CSSFontFace.cpp:
2947         (WebCore::CSSFontFace::font): Pass the relevant data structures
2948         into the font selection algorithm.
2949         * css/CSSFontFace.h: Add FontFeatureSettings and FontVariantSettings
2950         member variables.
2951         (WebCore::CSSFontFace::insertFeature):
2952         (WebCore::CSSFontFace::setVariantCommonLigatures):
2953         (WebCore::CSSFontFace::setVariantDiscretionaryLigatures):
2954         (WebCore::CSSFontFace::setVariantHistoricalLigatures):
2955         (WebCore::CSSFontFace::setVariantContextualAlternates):
2956         (WebCore::CSSFontFace::setVariantPosition):
2957         (WebCore::CSSFontFace::setVariantCaps):
2958         (WebCore::CSSFontFace::setVariantNumericFigure):
2959         (WebCore::CSSFontFace::setVariantNumericSpacing):
2960         (WebCore::CSSFontFace::setVariantNumericFraction):
2961         (WebCore::CSSFontFace::setVariantNumericOrdinal):
2962         (WebCore::CSSFontFace::setVariantNumericSlashedZero):
2963         (WebCore::CSSFontFace::setVariantAlternates):
2964         (WebCore::CSSFontFace::setVariantEastAsianVariant):
2965         (WebCore::CSSFontFace::setVariantEastAsianWidth):
2966         (WebCore::CSSFontFace::setVariantEastAsianRuby):
2967         * css/CSSFontFaceSource.cpp:
2968         (WebCore::CSSFontFaceSource::font): Pass the relevant data
2969         structures into the font selection algorithm.
2970         * css/CSSFontFaceSource.h: Ditto.
2971         * css/CSSFontSelector.cpp:
2972         (WebCore::CSSFontSelector::addFontFaceRule): Call the shared
2973         parsing logic to populate the FontFeatureSettings and
2974         FontVariantSettings members.
2975         * css/FontVariantBuilder.h: Added. Destination for shared parsing
2976         logic.
2977         (WebCore::applyValueFontVariantLigatures):
2978         (WebCore::applyValueFontVariantNumeric):
2979         (WebCore::applyValueFontVariantEastAsian):
2980         * css/StyleBuilderCustom.h: Source for shared parsing logic.
2981         (WebCore::StyleBuilderCustom::applyValueFontVariantLigatures):
2982         (WebCore::StyleBuilderCustom::applyValueFontVariantNumeric):
2983         (WebCore::StyleBuilderCustom::applyValueFontVariantEastAsian):
2984         * loader/cache/CachedFont.cpp: Pass the relevant data structures
2985         into the font selection algorithm.
2986         (WebCore::CachedFont::createFont):
2987         (WebCore::CachedFont::platformDataFromCustomData):
2988         * loader/cache/CachedFont.h: Ditto.
2989         * loader/cache/CachedSVGFont.cpp: Ditto.
2990         (WebCore::CachedSVGFont::createFont):
2991         (WebCore::CachedSVGFont::platformDataFromCustomData):
2992         * loader/cache/CachedSVGFont.h: Ditto.
2993         * platform/graphics/FontCache.h: Ditto.
2994         * platform/graphics/FontCascade.cpp:
2995         (WebCore::FontCascade::codePath): Adjust comment.
2996         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2997         (WebCore::preparePlatformFont): Consult with the newly parsed values.
2998         (WebCore::fontWithFamily): Pass the relevant data structures into the
2999         font selection algorithm.
3000         (WebCore::FontCache::systemFallbackForCharacters): Ditto.
3001         * platform/graphics/mac/FontCustomPlatformData.cpp:
3002         (WebCore::FontCustomPlatformData::fontPlatformData): Ditto.
3003         * platform/graphics/mac/FontCustomPlatformData.h: Ditto.
3004
3005 2015-11-03  Joseph Pecoraro  <pecoraro@apple.com>
3006
3007         Web Inspector: Handle or Remove ParseHTML Timeline Event Records
3008         https://bugs.webkit.org/show_bug.cgi?id=150689
3009
3010         Reviewed by Timothy Hatcher.
3011
3012         Remove ParseHTML nesting recordings. We were not using them
3013         and for most pages their self-time is very small in comparison
3014         to other events. We may consider adding it back later for
3015         UI purposes but for now the frontend doesn't use the records
3016         so lets remove it.
3017
3018         * html/parser/HTMLDocumentParser.cpp:
3019         (WebCore::HTMLDocumentParser::pumpTokenizer): Deleted.
3020         * inspector/InspectorInstrumentation.cpp:
3021         (WebCore::InspectorInstrumentation::willWriteHTMLImpl): Deleted.
3022         (WebCore::InspectorInstrumentation::didWriteHTMLImpl): Deleted.
3023         * inspector/InspectorInstrumentation.h:
3024         (WebCore::InspectorInstrumentation::willWriteHTML): Deleted.
3025         (WebCore::InspectorInstrumentation::didWriteHTML): Deleted.
3026         * inspector/InspectorTimelineAgent.cpp:
3027         (WebCore::InspectorTimelineAgent::willWriteHTML): Deleted.
3028         (WebCore::InspectorTimelineAgent::didWriteHTML): Deleted.
3029         (WebCore::toProtocol): Deleted.
3030         * inspector/InspectorTimelineAgent.h:
3031         * inspector/TimelineRecordFactory.cpp:
3032         (WebCore::TimelineRecordFactory::createParseHTMLData): Deleted.
3033         * inspector/TimelineRecordFactory.h:
3034
3035 2015-11-03  Keith Rollin  <krollin@apple.com>
3036
3037         HTMLOptionElement.text should never return the value of label
3038         https://bugs.webkit.org/show_bug.cgi?id=148862
3039         rdar://problem/22589226
3040
3041         Reviewed by Darin Adler.
3042
3043         According to the HTML spec, `option` elements should have the
3044         following behavior:
3045
3046             - the `text` property should return text contents of element
3047             - the `label` property should return value of label attribute if
3048               it exists, else return text property
3049             - the UI should display label property
3050
3051         12 years ago, in order to be compatibile with browsers of the time, we
3052         diverged from this behavior: the text property behaved like the label
3053         property, and the text property was used for display. This resulted in
3054         our UI incidentally conforming to the spec, but also in the text
3055         property *not* conforming to the spec. See <rdar://problem/3532519>
3056         for discussion on this change.
3057
3058         The behavior of the browsers we were conforming to has changed. In
3059         particular, the text property in Firefox now conforms to the spec
3060         instead of behaving as we did. Therefore, it's less important to
3061         retain our old behavior for the sake of compatibility. This check-in
3062         brings us into conformance with the spec. The result is that the UI
3063         stays the same, but the text property will return different values than
3064         it used to if the option element has a label attribute that used to
3065         hide it.
3066
3067         Updated tests:
3068         - fast/dom/HTMLOptionElement/option-text.html:
3069         - fast/forms/HTMLOptionElement_label01.html:
3070         - fast/forms/HTMLOptionElement_label02.html:
3071         - fast/forms/HTMLOptionElement_label03.html:
3072         - fast/forms/HTMLOptionElement_label04.html:
3073         - fast/forms/HTMLOptionElement_label05.html:
3074         - fast/forms/HTMLOptionElement_label06.html:
3075         - fast/forms/HTMLOptionElement_label07.html:
3076         - fast/forms/option-value-and-label.html:
3077
3078         * accessibility/AccessibilityListBoxOption.cpp:
3079         (WebCore::AccessibilityListBoxOption::stringValue):
3080         * accessibility/AccessibilityMenuListOption.cpp:
3081         (WebCore::AccessibilityMenuListOption::stringValue):
3082         * html/HTMLOptionElement.cpp:
3083         (WebCore::HTMLOptionElement::text):
3084         (WebCore::HTMLOptionElement::textIndentedToRespectGroupLabel):
3085
3086 2015-11-03  Andreas Kling  <akling@apple.com>
3087
3088         ResourceUsageOverlay should draw itself using WebCore::GraphicsContext.
3089         <https://webkit.org/b/150841>
3090
3091         Reviewed by Antti Koivisto.
3092
3093         Use WebCore text drawing primitives instead of poking at the CGContext directly.
3094         And stop using deprecated CoreGraphics APIs, too.
3095
3096         * page/cocoa/ResourceUsageOverlayCocoa.mm:
3097         (WebCore::drawCpuHistory):
3098         (WebCore::drawGCHistory):
3099
3100             Adjust for unflipped Y axis.
3101
3102         (WebCore::fontCascade):
3103         (WebCore::showText):
3104
3105             Draw using WebCore text drawing primitives.
3106
3107         (WebCore::ResourceUsageOverlay::draw):
3108
3109             Remove CGContext calls and stop flipping the Y axis.
3110
3111 2015-11-03  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3112
3113         [Streams API] Vended promise capabilities should not need @resolve/@reject fields
3114         https://bugs.webkit.org/show_bug.cgi?id=150835
3115
3116         Reviewed by Darin Adler.
3117
3118         No change in behavior, covered by existing tests.
3119
3120         * Modules/streams/ReadableStreamInternals.js:
3121         (privateInitializeReadableStreamReader): Removed @resolve/@reject fields from resolved/rejected @closedPromiseCapability.
3122         * Modules/streams/WritableStream.js:
3123         (initializeWritableStream): Removed @resolve/@reject fields from resolved readyPromiseCapability.
3124         * Modules/streams/WritableStreamInternals.js:
3125         (syncWritableStreamStateWithQueue): Updated code to be closer to spec and removing the need to resolve an already resolved promise.
3126
3127 2015-11-03  Hunseop Jeong  <hs85.jeong@samsung.com>
3128
3129         Replace 0 and NULL with nullptr in WebCore/dom.
3130         https://bugs.webkit.org/show_bug.cgi?id=150788
3131
3132         Reviewed by Darin Adler.
3133
3134         No new tests because there is no behavior change.
3135
3136         * dom/Attr.cpp:
3137         (WebCore::Attr::Attr):
3138         (WebCore::Attr::detachFromElementWithValue):
3139         (WebCore::Attr::attachToElement):
3140         * dom/Attr.h:
3141         * dom/CheckedRadioButtons.cpp:
3142         (WebCore::RadioButtonGroup::updateCheckedState):
3143         (WebCore::CheckedRadioButtons::checkedButtonForGroup):
3144         (WebCore::CheckedRadioButtons::isInRequiredGroup):
3145         * dom/ChildListMutationScope.cpp:
3146         (WebCore::ChildListMutationAccumulator::enqueueMutationRecord):
3147         * dom/ContainerNode.cpp:
3148         (WebCore::ContainerNode::removeBetween):
3149         * dom/ContainerNode.h:
3150         (WebCore::ContainerNode::ContainerNode):
3151         * dom/ContainerNodeAlgorithms.cpp:
3152         (WebCore::notifyNodeRemovedFromDocument):
3153         * dom/Document.h:
3154         (WebCore::Document::wellFormed):
3155         (WebCore::Document::scriptRunner):
3156         (WebCore::Document::moduleLoader):
3157         (WebCore::Document::currentScript):
3158         (WebCore::Document::webkitFullscreenElement):
3159         * dom/DocumentOrderedMap.h:
3160         (WebCore::DocumentOrderedMap::MapEntry::MapEntry):
3161         * dom/DocumentParser.cpp:
3162         (WebCore::DocumentParser::detach):
3163         (WebCore::DocumentParser::suspendScheduledTasks):
3164         * dom/Element.cpp:
3165         (WebCore::Element::setAttributeInternal):
3166         (WebCore::Element::shadowRoot):
3167         (WebCore::Element::blur):
3168         (WebCore::Element::beforePseudoElement):
3169         (WebCore::Element::afterPseudoElement):
3170         (WebCore::Element::setBeforePseudoElement):
3171         * dom/Event.cpp:
3172         (WebCore::Event::Event):
3173         * dom/Event.h:
3174         (WebCore::Event::legacyReturnValue):
3175         (WebCore::Event::setLegacyReturnValue):
3176         (WebCore::Event::clipboardData):
3177         * dom/EventContext.cpp:
3178         (WebCore::MouseOrFocusEventContext::MouseOrFocusEventContext):
3179         * dom/EventDispatcher.cpp:
3180         (WebCore::EventPath::lastContextIfExists):
3181         (WebCore::EventDispatcher::dispatchEvent):
3182         * dom/EventListenerMap.cpp:
3183         (WebCore::EventListenerMap::copyEventListenersNotCreatedFromMarkupToTarget):
3184         (WebCore::EventListenerIterator::EventListenerIterator):
3185         * dom/EventListenerMap.h:
3186         * dom/EventTarget.cpp:
3187         (WebCore::EventTarget::fireEventListeners):
3188         * dom/FocusEvent.cpp:
3189         (WebCore::FocusEventInit::FocusEventInit):
3190         * dom/GenericEventQueue.cpp:
3191         (WebCore::GenericEventQueue::enqueueEvent):
3192         * dom/IdTargetObserverRegistry.h:
3193         (WebCore::IdTargetObserverRegistry::IdTargetObserverRegistry):
3194         (WebCore::IdTargetObserverRegistry::notifyObservers):
3195         * dom/IgnoreDestructiveWriteCountIncrementer.h:
3196         (WebCore::IgnoreDestructiveWriteCountIncrementer::IgnoreDestructiveWriteCountIncrementer):
3197         * dom/MessageEvent.cpp:
3198         (WebCore::MessageEvent::MessageEvent):
3199         * dom/MessageEvent.h:
3200         * dom/MessagePort.cpp:
3201         (WebCore::MessagePort::contextDestroyed):
3202         (WebCore::MessagePort::dispatchMessages):
3203         (WebCore::MessagePort::locallyEntangledPort):
3204         (WebCore::MessagePort::disentanglePorts):
3205         * dom/MouseEvent.cpp:
3206         (WebCore::MouseEventInit::MouseEventInit):
3207         (WebCore::MouseEvent::cloneFor):
3208         * dom/MouseEvent.h:
3209         (WebCore::MouseEvent::dataTransfer):
3210         * dom/MouseRelatedEvent.cpp:
3211         (WebCore::MouseRelatedEvent::MouseRelatedEvent):
3212         (WebCore::MouseRelatedEvent::computeRelativePosition):
3213         * dom/MutationEvent.h:
3214         * dom/Node.cpp:
3215         (WebCore::Node::nodeLists):
3216         (WebCore::Node::clearNodeLists):
3217         (WebCore::Node::nonShadowBoundaryParentNode):
3218         (WebCore::Node::parentOrShadowHostElement):
3219         * dom/Node.h:
3220         * dom/NodeRareData.h:
3221         (WebCore::NodeListsNodeData::removeCachedCollection):
3222         (WebCore::NodeListsNodeData::isEmpty):
3223         * dom/PendingScript.cpp:
3224         (WebCore::PendingScript::releaseElementAndClear):
3225         * dom/PopStateEvent.cpp:
3226         (WebCore::PopStateEvent::PopStateEvent):
3227         * dom/Position.h:
3228         (WebCore::Position::deprecatedNode):
3229         (WebCore::Position::document):
3230         (WebCore::Position::rootEditableElement):
3231         * dom/PositionIterator.cpp:
3232         (WebCore::PositionIterator::decrement):
3233         * dom/PositionIterator.h:
3234         (WebCore::PositionIterator::PositionIterator):
3235         * dom/ProcessingInstruction.cpp:
3236         (WebCore::ProcessingInstruction::ProcessingInstruction):
3237         (WebCore::ProcessingInstruction::checkStyleSheet):
3238         (WebCore::ProcessingInstruction::parseStyleSheet):
3239         * dom/ProcessingInstruction.h:
3240         * dom/RangeBoundaryPoint.h:
3241         (WebCore::RangeBoundaryPoint::RangeBoundaryPoint):
3242         * dom/ScriptElement.cpp:
3243         (WebCore::ScriptElement::ScriptElement):
3244         (WebCore::ScriptElement::stopLoadRequest):
3245         (WebCore::ScriptElement::notifyFinished):
3246         (WebCore::ScriptElement::ignoresLoadRequest):
3247         * dom/ScriptedAnimationController.h:
3248         (WebCore::ScriptedAnimationController::create):
3249         (WebCore::ScriptedAnimationController::clearDocumentPointer):
3250         * dom/StyledElement.cpp:
3251         (WebCore::PresentationAttributeCacheKey::PresentationAttributeCacheKey):
3252         (WebCore::StyledElement::addSubresourceAttributeURLs):
3253         (WebCore::StyledElement::rebuildPresentationAttributeStyle):
3254         * dom/StyledElement.h:
3255         (WebCore::StyledElement::additionalPresentationAttributeStyle):
3256         (WebCore::StyledElement::inlineStyle):
3257         * dom/TemplateContentDocumentFragment.h:
3258         * dom/TextEvent.cpp:
3259         (WebCore::TextEvent::TextEvent):
3260         * dom/UIEvent.cpp:
3261         (WebCore::UIEventInit::UIEventInit):
3262         * dom/UserTypingGestureIndicator.cpp:
3263         (WebCore::UserTypingGestureIndicator::UserTypingGestureIndicator):
3264         (WebCore::UserTypingGestureIndicator::~UserTypingGestureIndicator):
3265         * dom/ViewportArguments.cpp:
3266         (WebCore::restrictScaleFactorToInitialScaleIfNotUserScalable):
3267         (WebCore::numericPrefix):
3268         * dom/default/PlatformMessagePortChannel.cpp:
3269         (WebCore::MessagePortChannel::disentangle):
3270         (WebCore::MessagePortChannel::postMessageToRemote):
3271         (WebCore::PlatformMessagePortChannel::PlatformMessagePortChannel):
3272         * dom/default/PlatformMessagePortChannel.h:
3273
3274 2015-11-02  Wenson Hsieh  <wenson_hsieh@apple.com>
3275
3276         Tapping *below* some <input>s can focus them in Mobile Safari
3277         https://bugs.webkit.org/show_bug.cgi?id=146244
3278         <rdar://problem/21509310>
3279
3280         Reviewed by Darin Adler.
3281
3282         Removes iOS-specific logic in positionForPointRespectingEditingBoundaries that was causing us to focus inputs by
3283         tapping on the document element. We believe this logic, which causes VisiblePosition finding to recurse from a non-
3284         editable element to an editable child, is not necessary to focus editable elements underneath non-editable elements,
3285         since hit-testing will already have selected the contentEditable element prior to searching for a suitable
3286         VisiblePosition. Further investigation shows that this logic was added to fix <rdar://problem/5545799>, in which the
3287         first character in a Notes document could not be selected. However, I have not been able to reproduce this bug after
3288         removing this logic.
3289
3290         As a result of this change, we can also enable a WK1 test, editing/selection/click-outside-editable-div.html, that
3291         had also been marked as failing due to positionForPointRespectingEditingBoundaries recursing into a contentEditable
3292         div.
3293
3294         Test: fast/events/ios/clicking-document-should-not-trigger-focus.html
3295
3296         * rendering/RenderBlock.cpp:
3297         (WebCore::positionForPointRespectingEditingBoundaries): Deleted.
3298
3299 2015-11-03  Myles C. Maxfield  <mmaxfield@apple.com>
3300
3301         Update to match text-orientation spec
3302         https://bugs.webkit.org/show_bug.cgi?id=150765
3303
3304         Reviewed by Darin Adler.
3305
3306         The CSS spec has removed the "sideways-right" value of text-orientation in favor
3307         of "sideways." This patch makes the parser treat "sideways-right" the same as
3308         "sideways."
3309
3310         Test: fast/text/orientation-sideways-right.html
3311
3312         * css/CSSPrimitiveValueMappings.h:
3313         (WebCore::CSSPrimitiveValue::operator TextOrientation):
3314         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Deleted.
3315         * rendering/style/RenderStyle.cpp:
3316         (WebCore::RenderStyle::fontAndGlyphOrientation): Deleted.
3317         * rendering/style/RenderStyleConstants.h:
3318
3319 2015-11-03  Xabier Rodriguez Calvar  <calvaris@igalia.com>
3320
3321         [Streams API] Rework promises to use @newPromiseCapability
3322         https://bugs.webkit.org/show_bug.cgi?id=150627
3323
3324         Reviewed by Youenn Fablet.
3325
3326         We are removing the stream promises functions in favor of @newPromiseCapabity which basically provides the same
3327         functionality (keeping the resolve and reject functions without external slots). Slots and variables were
3328         renamed as *PromiseCapability to show that they no longer hold just a promise, but a promise capability.
3329
3330         Internal rework, no new tests needed.
3331
3332         * Modules/streams/ReadableStreamInternals.js:
3333         (privateInitializeReadableStreamReader.this.closedPromiseCapability.resolve):
3334         (privateInitializeReadableStreamReader.this.closedPromiseCapability.reject):
3335         (privateInitializeReadableStreamReader):
3336         (teeReadableStream):
3337         (teeReadableStreamBranch2CancelFunction):
3338         (errorReadableStream):
3339         (closeReadableStreamReader):
3340         (enqueueInReadableStream):
3341         (readFromReadableStreamReader):
3342         * Modules/streams/ReadableStreamReader.js:
3343         (closed):
3344         * Modules/streams/StreamInternals.js:
3345         (createNewStreamsPromise): Deleted.
3346         (resolveStreamsPromise): Deleted.
3347         (rejectStreamsPromise): Deleted.
3348         * Modules/streams/WritableStream.js:
3349         (this.readyPromiseCapability.resolve):
3350         (this.readyPromiseCapability.reject):
3351         (initializeWritableStream):
3352         (close):
3353         (write):
3354         (closed):
3355         (ready):
3356         * Modules/streams/WritableStreamInternals.js:
3357         (syncWritableStreamStateWithQueue):
3358         (errorWritableStream):
3359         * bindings/js/WebCoreBuiltinNames.h:
3360
3361 2015-11-03  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3362
3363         Move webkitGetUserMedia to JS Builtin
3364         https://bugs.webkit.org/show_bug.cgi?id=149499
3365
3366         Reviewed by Darin Adler.
3367
3368         Implemented webkitGetUserMedia as a JSBuiltin wrapper around navigator.mediaDevices.getUserMedia.
3369
3370         Removed cpp based version.
3371
3372         The js builting implementation checks for argument but does not raise exception when the request is not supported.
3373         The error callback is called instead, in an asynchronous fashion.
3374         The js builtin implementation does not check first that it is called on navigator, contrary to the cpp implementation.
3375         This is done afterwards when calling navigator.MediaDevices.@getUserMedia.
3376
3377         Covered by existing and modified tests.
3378
3379         * CMakeLists.txt: Adding NavigatorUserMedia.js as built-in JS file.
3380         * DerivedSources.make: Ditto.
3381         * Modules/mediastream/NavigatorUserMedia.idl: Making webkitGetUserMedia JSBuiltin
3382         * Modules/mediastream/NavigatorUserMedia.js:
3383         (webkitGetUserMedia):
3384         * Modules/mediastream/NavigatorUserMediaErrorCallback.h: Removed.
3385         * Modules/mediastream/NavigatorUserMediaErrorCallback.idl: Removed.
3386         * Modules/mediastream/NavigatorUserMediaSuccessCallback.h: Removed.
3387         * Modules/mediastream/NavigatorUserMediaSuccessCallback.idl: Removed.
3388         * Modules/mediastream/UserMediaRequest.cpp:
3389         * Modules/mediastream/UserMediaRequest.h:
3390         * WebCore.xcodeproj/project.pbxproj:
3391         * bindings/js/JSDOMWindowBase.cpp:
3392         (WebCore::JSDOMWindowBase::finishCreation): Style modifications.
3393         * bindings/js/JSNavigatorCustom.cpp: Removed.
3394         * bindings/js/WebCoreJSBuiltins.cpp: Adding support for NavigatorUserMedia.js built-in JS file.
3395         * bindings/js/WebCoreJSBuiltins.h: Ditto.
3396         (WebCore::JSBuiltinFunctions::JSBuiltinFunctions):
3397         (WebCore::JSBuiltinFunctions::navigatorUserMediaBuiltins):
3398
3399 2015-11-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3400
3401         [GStreamer] Use GstBus sync message handler and schedule tasks to the main thread with RunLoop::dispatch
3402         https://bugs.webkit.org/show_bug.cgi?id=150800
3403
3404         Reviewed by Philippe Normand.
3405
3406         This way we would avoid all the GScource + polling mechanism that
3407         GST uses internally to handle messages asynchronously in the main thread.
3408
3409         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
3410         (WTF::adoptGRef):
3411         (WTF::refGPtr<GstMessage>):
3412         (WTF::derefGPtr<GstMessage>):
3413         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
3414         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3415         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
3416         Initialize the WeakPtr factory.
3417         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
3418         reset the GstBus sync handler.
3419         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Make it void.