853dd1b7c518c8db450cdf2f8f9b05d559597609
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-10-07  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
2
3         Automate WebCore JS builtins generation and build system
4         https://bugs.webkit.org/show_bug.cgi?id=149751
5
6         Reviewed by Darin Adler.
7
8         Adding annotations to JS files to know whether they should be under a compilation flag and
9         whether they are JS internals or JS tied to WebIDL.
10         If a file is said as JS internals, all function names are exported automatically.
11         Added auto generation of WebCoreJSBuiltins.cpp
12         Added auto generation of JSBuiltinFunctions class inside WebCoreJSBuiltins that takes the role of
13         WebCoreJSClientData as wrapper for builtins. Renamed WebCoreJSClientData to JSClientData.
14         Added auto generation of PrivateWebCoreJSBuiltins that is a wrapper around all private functions, used by
15         JSDOMWindowBase. The class is named JSBuiltinInternalFunctions.
16
17         The remaining manual part for private functions is the pairing between private identifiers and
18         the private JS functions within JSDOMWindowBase::finishCreation.
19
20         Covered by existing tests.
21
22         * CMakeLists.txt:
23         * DerivedSources.make:
24         * Modules/streams/ByteLengthQueuingStrategy.js:
25         * Modules/streams/CountQueuingStrategy.js:
26         * Modules/streams/ReadableStream.js:
27         * Modules/streams/ReadableStreamInternals.js:
28         * WebCore.order:
29         * WebCore.vcxproj/WebCore.vcxproj:
30         * WebCore.xcodeproj/project.pbxproj:
31         * bindings/js/DOMWrapperWorld.cpp:
32         (WebCore::DOMWrapperWorld::DOMWrapperWorld):
33         (WebCore::DOMWrapperWorld::~DOMWrapperWorld):
34         (WebCore::normalWorld):
35         * bindings/js/JSDOMWindowBase.cpp:
36         (WebCore::JSDOMWindowBase::JSDOMWindowBase):
37         (WebCore::JSDOMWindowBase::finishCreation):
38         (WebCore::JSDOMWindowBase::visitChildren):
39         (WebCore::JSDOMWindowBase::fireFrameClearedWatchpointsForWindow):
40         * bindings/js/JSDOMWindowBase.h:
41         * bindings/js/ScriptController.cpp:
42         (WebCore::ScriptController::getAllWorlds):
43         * bindings/js/SerializedScriptValue.cpp:
44         (WebCore::SerializedScriptValue::transferArrayBuffers):
45         * bindings/js/WebCoreJSClientData.h:
46         (WebCore::JSClientData::JSClientData):
47         (WebCore::JSClientData::~JSClientData):
48         (WebCore::JSClientData::builtinFunctions):
49         (WebCore::initNormalWorldClientData):
50         (WebCore::WebCoreJSClientData::WebCoreJSClientData): Deleted.
51         (WebCore::WebCoreJSClientData::~WebCoreJSClientData): Deleted.
52         (WebCore::WebCoreJSClientData::readableStreamBuiltins): Deleted.
53         (WebCore::WebCoreJSClientData::readableStreamControllerBuiltins): Deleted.
54         (WebCore::WebCoreJSClientData::readableStreamInternalsBuiltins): Deleted.
55         (WebCore::WebCoreJSClientData::readableStreamReaderBuiltins): Deleted.
56         (WebCore::WebCoreJSClientData::byteLengthQueuingStrategyBuiltins): Deleted.
57         (WebCore::WebCoreJSClientData::countQueuingStrategyBuiltins): Deleted.
58         * generate-js-builtins-allinone: Added.
59         (retrieveGenerationParameters):
60         (retrieveFilesWithParameters):
61         (retrieveFilesWithParameters.FileInput):
62         (writeConditional):
63         (JSBuiltinFunctions):
64         (Private):
65         (JSBuiltinInternalFunctions):
66         (copytempfile):
67
68 2015-10-05  Sergio Villar Senin  <svillar@igalia.com>
69
70         [css-grid] Implement grid gutters
71         https://bugs.webkit.org/show_bug.cgi?id=149800
72
73         Reviewed by Darin Adler.
74
75         Authors can now specify the gutters between grid lines, i.e.,
76         the space between two consecutive grid lines. This can be done
77         using the new '-webkit-grid-column-gap 'and
78         '-webkit-grid-row-gap' properties (or the '-webkit-grid-gap'
79         shorthand).
80
81         From the track sizing algorithm POV, gutters are treated as
82         fixed size columns. The primary consequence is that grids are
83         enlarged (depending on the number of tracks). Gutters also
84         affect the sizing of content-sized tracks and fr tracks as
85         long as the grid have spanning items. Those tracks will become
86         smaller as gutters will consume part of the item's size, so
87         the tracks won't need to grow as much as they used to.
88
89         Tests: fast/css-grid-layout/grid-gutters-and-alignment.html
90                fast/css-grid-layout/grid-gutters-and-flex-content.html
91                fast/css-grid-layout/grid-gutters-and-tracks.html
92                fast/css-grid-layout/grid-gutters-get-set.html
93
94         * css/CSSComputedStyleDeclaration.cpp:
95         (WebCore::valueForGridTrackList):
96         (WebCore::ComputedStyleExtractor::propertyValue):
97         * css/CSSParser.cpp:
98         (WebCore::isSimpleLengthPropertyID):
99         (WebCore::CSSParser::parseValue):
100         (WebCore::CSSParser::parseGridGapShorthand):
101         * css/CSSParser.h:
102         * css/CSSPropertyNames.in:
103         * rendering/RenderGrid.cpp:
104         (WebCore::RenderGrid::guttersSize):
105         (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
106         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
107         (WebCore::RenderGrid::layoutGridItems):
108         (WebCore::RenderGrid::gridAreaBreadthForChild):
109         (WebCore::RenderGrid::populateGridPositions):
110         (WebCore::RenderGrid::columnAxisOffsetForChild):
111         (WebCore::RenderGrid::rowAxisOffsetForChild):
112         * rendering/RenderGrid.h:
113         * rendering/style/RenderStyle.h:
114         * rendering/style/StyleGridData.cpp:
115         (WebCore::StyleGridData::StyleGridData):
116         * rendering/style/StyleGridData.h:
117         (WebCore::StyleGridData::operator==):
118
119 2015-10-07  ChangSeok Oh  <changseok.oh@collabora.com>
120
121         [GTK] Progress bar is broken on recent GTK+
122         https://bugs.webkit.org/show_bug.cgi?id=149831
123
124         Reviewed by Carlos Garcia Campos.
125
126         The gtk progress bar has been broken after bumping up to Gtk+-3.16. This is because
127         the way of rendering progress bar changed after gtk+-3.13.7. See more
128         https://mail.gnome.org/archives/commits-list/2014-August/msg03865.html
129         gtk_render_activity is no longer valid to paint a progress bar on a newer gtk+.
130         It should be done with gtk_render_background and gtk_render_frame.
131
132         Test: fast/dom/HTMLProgressElement/native-progress-bar.html
133
134         * rendering/RenderThemeGtk.cpp:
135         (WebCore::RenderThemeGtk::paintProgressBar):
136
137 2015-10-06  Michael Catanzaro  <mcatanzaro@igalia.com>
138
139         [GTK] Add autocleanups
140         https://bugs.webkit.org/show_bug.cgi?id=149588
141
142         Reviewed by Darin Adler.
143
144         * PlatformGTK.cmake:
145         * bindings/scripts/gobject-generate-headers.pl:
146
147 2015-10-06  Zalan Bujtas  <zalan@apple.com>
148
149         Paint artifacts when hovering on http://jsfiddle.net/Sherbrow/T87Mn/
150         https://bugs.webkit.org/show_bug.cgi?id=149535
151         rdar://problem/22874920
152
153         Reviewed by Simon Fraser.
154
155         When due to some style change, a renderer's self-painting layer is getting destroyed 
156         and the parent's overflow is no longer set to visible, we don't clean up the overflow part.
157
158         When a renderer has a self-painting layer, the parent stops tracking the child's 
159         visual overflow rect. All overflow painting is delegated to the self-painting layer.
160         However when this layer gets destroyed, no-one issues repaint to clean up
161         the overflow bits.
162         This patch ensures that we issue a repaint when the self-painting layer is destroyed
163         and the triggering style change requires full repaint.
164
165         Test: fast/repaint/overflow-hidden-with-self-painting-child-layer.html
166
167         * rendering/RenderLayer.h:
168         * rendering/RenderLayerModelObject.cpp:
169         (WebCore::RenderLayerModelObject::styleDidChange):
170
171 2015-10-06  Jer Noble  <jer.noble@apple.com>
172
173         [Mac] REGRESSION(r173318): Seeks never complete for media loaded with QTKit.
174         https://bugs.webkit.org/show_bug.cgi?id=149845
175
176         Reviewed by Darin Adler.
177
178         When converting from time-as-double to MediaTime, a regression was introduced
179         when checking whether m_seekTo was set to a valid value or not. The clause
180         `time != -1` should be translated to `time.isValid()`, not `!time.isValid()`.
181
182         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
183         (WebCore::MediaPlayerPrivateQTKit::timeChanged):
184
185 2015-10-06  Brady Eidson  <beidson@apple.com>
186
187         Rename IDBRequestIdentifier to IDBResourceIdentifier.
188         https://bugs.webkit.org/show_bug.cgi?id=149861
189
190         Reviewed by Alex Christensen.
191
192         No new tests (No change in behavior).
193
194         Turns out having an object representing a (connection ID + unique ID pair) is useful for more than just IDBRequests.
195
196         * CMakeLists.txt:
197         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
198         (WebCore::IDBClient::IDBConnectionToServer::deleteDatabase):
199         (WebCore::IDBClient::IDBConnectionToServer::openDatabase):
200         * Modules/indexeddb/client/IDBConnectionToServer.h:
201         * Modules/indexeddb/client/IDBRequestImpl.cpp:
202         (WebCore::IDBClient::IDBRequest::IDBRequest):
203         * Modules/indexeddb/client/IDBRequestImpl.h:
204         (WebCore::IDBClient::IDBRequest::resourceIdentifier):
205         (WebCore::IDBClient::IDBRequest::requestIdentifier): Deleted.
206         * Modules/indexeddb/shared/IDBRequestData.h:
207         (WebCore::IDBRequestData::requestIdentifier):
208         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp: Renamed from Source/WebCore/Modules/indexeddb/shared/IDBRequestIdentifier.cpp.
209         (WebCore::nextResourceNumber):
210         (WebCore::IDBResourceIdentifier::IDBResourceIdentifier):
211         (WebCore::IDBResourceIdentifier::emptyValue):
212         (WebCore::IDBResourceIdentifier::deletedValue):
213         (WebCore::IDBResourceIdentifier::isHashTableDeletedValue):
214         * Modules/indexeddb/shared/IDBResourceIdentifier.h: Renamed from Source/WebCore/Modules/indexeddb/shared/IDBRequestIdentifier.h.
215         (WebCore::IDBResourceIdentifier::isEmpty):
216         (WebCore::IDBResourceIdentifier::hash):
217         (WebCore::IDBResourceIdentifier::operator==):
218         (WebCore::IDBResourceIdentifier::connectionIdentifier):
219         (WebCore::IDBResourceIdentifierHash::hash):
220         (WebCore::IDBResourceIdentifierHash::equal):
221         (WebCore::IDBResourceIdentifierHashTraits::emptyValue):
222         (WebCore::IDBResourceIdentifierHashTraits::isEmptyValue):
223         (WebCore::IDBResourceIdentifierHashTraits::constructDeletedValue):
224         (WebCore::IDBResourceIdentifierHashTraits::isDeletedValue):
225         * Modules/indexeddb/shared/IDBResultData.cpp:
226         (WebCore::IDBResultData::IDBResultData):
227         * Modules/indexeddb/shared/IDBResultData.h:
228         (WebCore::IDBResultData::requestIdentifier):
229         * WebCore.xcodeproj/project.pbxproj:
230
231 2015-10-06  Nan Wang  <n_wang@apple.com>
232
233         AX: ARIA 1.1: aria-orientation now defaults to undefined, supported on more elements, and role-specific defaults are defined.
234         https://bugs.webkit.org/show_bug.cgi?id=132177
235
236         Reviewed by Chris Fleizach.
237
238         Added role-specific defaults and changed general default to undefined.
239         Also added more elements to support aria-orientation on Mac.
240
241         Test: accessibility/mac/aria-orientation.html
242
243         * accessibility/AccessibilityObject.cpp:
244         (WebCore::AccessibilityObject::orientation):
245         (WebCore::AccessibilityObject::isDescendantOfObject):
246         * accessibility/AccessibilityObject.h:
247         (WebCore::AccessibilityObject::isColorWell):
248         (WebCore::AccessibilityObject::isSplitter):
249         (WebCore::AccessibilityObject::isToolbar):
250         (WebCore::AccessibilityObject::isChecked):
251         (WebCore::AccessibilityObject::isEnabled):
252         * accessibility/AccessibilityRenderObject.cpp:
253         (WebCore::AccessibilityRenderObject::orientation):
254         * accessibility/AccessibilityScrollView.cpp:
255         (WebCore::AccessibilityScrollView::scrollBar):
256         * accessibility/AccessibilityScrollbar.cpp:
257         (WebCore::AccessibilityScrollbar::orientation):
258         (WebCore::AccessibilityScrollbar::isEnabled):
259         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
260         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
261         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
262
263 2015-10-06  Per Arne Vollan  <peavo@outlook.com>
264
265         [WinCairo] GStreamer compile errors.
266         https://bugs.webkit.org/show_bug.cgi?id=149839
267
268         Reviewed by Alex Christensen.
269
270         Help MSVC to resolve ambiguous calls.
271
272         * platform/graphics/MediaPlayer.h:
273         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
274         (WebCore::InbandTextTrackPrivateGStreamer::handleSample):
275         (WebCore::InbandTextTrackPrivateGStreamer::streamChanged):
276         (WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample):
277         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
278         (WebCore::MediaPlayerPrivateGStreamer::videoChanged):
279         (WebCore::MediaPlayerPrivateGStreamer::videoCapsChanged):
280         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
281         (WebCore::MediaPlayerPrivateGStreamer::audioChanged):
282         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
283         (WebCore::MediaPlayerPrivateGStreamer::textChanged):
284         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
285         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
286         (WebCore::MediaPlayerPrivateGStreamerBase::volumeChanged):
287         (WebCore::MediaPlayerPrivateGStreamerBase::networkState):
288         (WebCore::MediaPlayerPrivateGStreamerBase::muteChanged):
289         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
290         (WebCore::TrackPrivateBaseGStreamer::activeChanged):
291         (WebCore::TrackPrivateBaseGStreamer::tagsChanged):
292         (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfActiveChanged):
293         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
294         (webkitVideoSinkRender):
295         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
296         (webKitWebSrcChangeState):
297         (webKitWebSrcNeedDataCb):
298         (webKitWebSrcEnoughDataMainCb):
299         (webKitWebSrcEnoughDataCb):
300         (webKitWebSrcSeekMainCb):
301         (webKitWebSrcSeekDataCb):
302
303 2015-10-06  Chris Dumez  <cdumez@apple.com>
304
305         Refactor TokenPreloadScanner::StartTagScanner::processAttribute()
306         https://bugs.webkit.org/show_bug.cgi?id=149847
307
308         Reviewed by Antti Koivisto.
309
310         Refactor TokenPreloadScanner::StartTagScanner::processAttribute() to only
311         process attributes that make sense given the current tagId. In particular,
312         - We only process the charset parameter if the tag is a link or a script.
313         - We only process the sizes / srcset attributes if the tag is an img.
314
315         * html/parser/HTMLPreloadScanner.cpp:
316         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
317         (WebCore::TokenPreloadScanner::StartTagScanner::setUrlToLoad): Deleted.
318
319 2015-10-06  Youenn Fablet  <youenn.fablet@crf.canon.fr>
320
321         Binding generator XXConstructor::finishCreation should take references as parameters
322         https://bugs.webkit.org/show_bug.cgi?id=149838
323
324         Reviewed by Darin Adler.
325
326         Updated the binding generator so that XXConstructor::finishCreation
327         takes a JSDOMGlobalObject& in lieu of a JSDOMGlobalObject*.
328
329         Covered by rebased binding tests.
330
331         * bindings/scripts/CodeGeneratorJS.pm:
332         (GenerateConstructorDeclaration):
333         (GenerateConstructorHelperMethods):
334         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
335         (WebCore::JSTestActiveDOMObjectConstructor::create):
336         (WebCore::JSTestActiveDOMObjectConstructor::finishCreation):
337         * bindings/scripts/test/JS/JSTestCallback.cpp:
338         (WebCore::JSTestCallbackConstructor::create):
339         (WebCore::JSTestCallbackConstructor::finishCreation):
340         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
341         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::create):
342         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::finishCreation):
343         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
344         (WebCore::JSTestCustomNamedGetterConstructor::create):
345         (WebCore::JSTestCustomNamedGetterConstructor::finishCreation):
346         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
347         (WebCore::JSTestEventConstructorConstructor::create):
348         (WebCore::JSTestEventConstructorConstructor::finishCreation):
349         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
350         (WebCore::JSTestEventTargetConstructor::create):
351         (WebCore::JSTestEventTargetConstructor::finishCreation):
352         * bindings/scripts/test/JS/JSTestException.cpp:
353         (WebCore::JSTestExceptionConstructor::create):
354         (WebCore::JSTestExceptionConstructor::finishCreation):
355         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
356         (WebCore::JSTestGenerateIsReachableConstructor::create):
357         (WebCore::JSTestGenerateIsReachableConstructor::finishCreation):
358         * bindings/scripts/test/JS/JSTestInterface.cpp:
359         (WebCore::JSTestInterfaceConstructor::create):
360         (WebCore::JSTestInterfaceConstructor::finishCreation):
361         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
362         (WebCore::JSTestJSBuiltinConstructorConstructor::create):
363         (WebCore::JSTestJSBuiltinConstructorConstructor::finishCreation):
364         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
365         (WebCore::JSTestMediaQueryListListenerConstructor::create):
366         (WebCore::JSTestMediaQueryListListenerConstructor::finishCreation):
367         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
368         (WebCore::JSTestNamedConstructorConstructor::create):
369         (WebCore::JSTestNamedConstructorNamedConstructor::create):
370         (WebCore::JSTestNamedConstructorConstructor::finishCreation):
371         (WebCore::JSTestNamedConstructorNamedConstructor::finishCreation):
372         * bindings/scripts/test/JS/JSTestNode.cpp:
373         (WebCore::JSTestNodeConstructor::create):
374         (WebCore::JSTestNodeConstructor::finishCreation):
375         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
376         (WebCore::JSTestNondeterministicConstructor::create):
377         (WebCore::JSTestNondeterministicConstructor::finishCreation):
378         * bindings/scripts/test/JS/JSTestObj.cpp:
379         (WebCore::JSTestObjConstructor::create):
380         (WebCore::JSTestObjConstructor::finishCreation):
381         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
382         (WebCore::JSTestOverloadedConstructorsConstructor::create):
383         (WebCore::JSTestOverloadedConstructorsConstructor::finishCreation):
384         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
385         (WebCore::JSTestOverrideBuiltinsConstructor::create):
386         (WebCore::JSTestOverrideBuiltinsConstructor::finishCreation):
387         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
388         (WebCore::JSTestSerializedScriptValueInterfaceConstructor::create):
389         (WebCore::JSTestSerializedScriptValueInterfaceConstructor::finishCreation):
390         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
391         (WebCore::JSTestTypedefsConstructor::create):
392         (WebCore::JSTestTypedefsConstructor::finishCreation):
393         * bindings/scripts/test/JS/JSattribute.cpp:
394         (WebCore::JSattributeConstructor::create):
395         (WebCore::JSattributeConstructor::finishCreation):
396         * bindings/scripts/test/JS/JSreadonly.cpp:
397         (WebCore::JSreadonlyConstructor::create):
398         (WebCore::JSreadonlyConstructor::finishCreation):
399
400 2015-10-06  Jiewen Tan  <jiewen_tan@apple.com>
401
402         Fix crash in ApplyStyleCommand::applyRelativeFontStyleChange()
403         https://bugs.webkit.org/show_bug.cgi?id=149300
404         <rdar://problem/22747046>
405
406         Reviewed by Chris Dumez.
407
408         This is a merge of Blink r167845 and r194944:
409         https://codereview.chromium.org/177093016
410         https://codereview.chromium.org/1124863003
411
412         Test: editing/style/apply-style-crash2.html
413               editing/style/apply-style-crash3.html
414
415         * editing/ApplyStyleCommand.cpp:
416         (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
417         The issue was that we would traverse the DOM tree past the beyondEnd 
418         under some circumstances and thus NodeTraversal::next() would return 
419         null unexpectedly. This CL adds a check to make sure startNode != beyondEnd 
420         before traversing to avoid the problem.
421
422         Besides that, this CL hardens changing font style over unknown elements.
423         When adjusting the start node position of where to apply a font style
424         command, check that we haven't stepped off the end.
425
426         This CL also adds a few more assertions to catch similar issues 
427         more easily in the future.
428
429 2015-10-06  Javier Fernandez  <jfernandez@igalia.com>
430
431         [CSS Grid Layout] Don't need to reset auto-margins during grid items layout
432         https://bugs.webkit.org/show_bug.cgi?id=149764
433
434         Reviewed by Darin Adler.
435
436         This patch implements a refactoring of the auto-margin alignment code for grid
437         items so it uses start/end and before/after margin logic terms.
438
439         I addition, it avoids resetting the auto-margin values, which requires an extra
440         layout, before applying the alignment logic.
441
442         No new tests because there is no behavior change.
443
444         * rendering/RenderGrid.cpp:
445         (WebCore::RenderGrid::computeMarginLogicalHeightForChild): Computing margins if child needs layout.
446         (WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching):
447         (WebCore::RenderGrid::updateAutoMarginsInRowAxisIfNeeded): Using start/end logical margins.
448         (WebCore::RenderGrid::updateAutoMarginsInColumnAxisIfNeeded): Using before/after logical margins.
449         (WebCore::RenderGrid::columnAxisOffsetForChild): Just added comment.
450         (WebCore::RenderGrid::rowAxisOffsetForChild): Just added comment.
451
452 2015-10-06  Tim Horton  <timothy_horton@apple.com>
453
454         Tile map shows a green rect when threaded scrolling is disabled
455         https://bugs.webkit.org/show_bug.cgi?id=149716
456
457         Reviewed by Darin Adler.
458
459         Green is supposed to indicate that we're using the fast path; if threaded
460         scrolling is disabled, we're definitely not doing that.
461
462         * platform/graphics/TiledBacking.h:
463         * platform/graphics/ca/TileController.cpp:
464         (WebCore::TileController::TileController):
465         * platform/graphics/ca/TileCoverageMap.cpp:
466         (WebCore::TileCoverageMap::update):
467         Default to the "we have no ScrollingCoordinator" purple indication;
468         if a ScrollingCoordinator comes along it will setScrollingModeIndication
469         and change it from this default.
470
471 2015-10-06  Zalan Bujtas  <zalan@apple.com>
472
473         Remove redundant isComposited() function and replace
474         hasLayer() && layer()->isComposited() with RenderObject::isComposited().
475         https://bugs.webkit.org/show_bug.cgi?id=149846
476
477         Reviewed by Simon Fraser.
478
479         No change in functionality.
480
481         * rendering/RenderLayerCompositor.cpp:
482         (WebCore::RenderLayerCompositor::requiresCompositingForPlugin):
483         (WebCore::RenderLayerCompositor::requiresCompositingForFrame):
484         * rendering/RenderObject.cpp:
485         (WebCore::RenderObject::repaintUsingContainer):
486         * rendering/RenderThemeMac.mm:
487         (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
488         * rendering/RenderView.cpp:
489         (WebCore::rendererObscuresBackground):
490         (WebCore::isComposited): Deleted.
491         * rendering/RenderWidget.cpp:
492         (WebCore::RenderWidget::setWidgetGeometry):
493
494 2015-10-06  Commit Queue  <commit-queue@webkit.org>
495
496         Unreviewed, rolling out r190619.
497         https://bugs.webkit.org/show_bug.cgi?id=149849
498
499         borke the binding tests on iOS at least (Requested by youenn
500         on #webkit).
501
502         Reverted changeset:
503
504         "Binding generator XXConstructor::finishCreation should take
505         references as parameters"
506         https://bugs.webkit.org/show_bug.cgi?id=149838
507         http://trac.webkit.org/changeset/190619
508
509 2015-10-05  Wenson Hsieh  <wenson_hsieh@apple.com>
510
511         Slider knobs should scale when rendering while zoomed
512         https://bugs.webkit.org/show_bug.cgi?id=149835
513         <rdar://problem/22897080>
514
515         Reviewed by Darin Adler.
516
517         Make slider knobs follow suit with the rest of the unscaled form controls
518         by rendering to an offscreen buffer when the page is zoomed or scaled and
519         then rendering a scaled version of the offscreen buffer onto the page.
520
521         * platform/mac/ThemeMac.mm:
522         (WebCore::drawCellOrFocusRingIntoRectWithView): Helper function for drawing
523             cells and/or focus rings.
524         (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext): Refactored to
525             handle drawing slider knobs as well.
526         * rendering/RenderThemeMac.mm:
527         (WebCore::RenderThemeMac::paintSliderThumb): Use scaled rendering when necessary.
528
529 2015-10-06  Chris Dumez  <cdumez@apple.com>
530
531         [Web IDL] 'length' property is wrong for variadic operations
532         https://bugs.webkit.org/show_bug.cgi?id=149714
533
534         Reviewed by Darin Adler.
535
536         The value of the 'length' property was wrong for variadic operations:
537         - https://heycam.github.io/webidl/#dfn-optional-argument
538
539         The final argument of a variadic operation is considered to be an
540         optional argument. Therefore, we should not account for it when
541         computing the value of the 'length' property. This patch fixes WebKit's
542         behavior to match the specification.
543
544         Test: fast/dom/variadic-operations-length.html
545
546         * bindings/scripts/CodeGeneratorJS.pm:
547         (GetFunctionLength):
548         * bindings/scripts/test/JS/JSTestObj.cpp:
549         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
550         (WebCore::JSTestOverloadedConstructorsConstructor::finishCreation):
551
552 2015-10-06  Youenn Fablet  <youenn.fablet@crf.canon.fr>
553
554         Binding generator should add builtin header for JSBuiltin attributes
555         https://bugs.webkit.org/show_bug.cgi?id=149837
556
557         Reviewed by Darin Adler.
558
559         Ensured XXBuiltins.h header is included for builtin attributes.
560         Renamed AddIncludesForJSBuiltinMethods as AddJSBuiltinIncludesIfNeeded.
561         Test loop is done through all functions and attributes to handle conditional correctly.
562
563         Covered by existing and added binding tests.
564
565         * bindings/scripts/CodeGeneratorJS.pm:
566         (GenerateImplementation):
567         (AddJSBuiltinIncludesIfNeeded):
568         * bindings/scripts/test/JS/JSTestObj.cpp:
569         * bindings/scripts/test/ObjC/DOMTestObj.h:
570         * bindings/scripts/test/ObjC/DOMTestObj.mm:
571         * bindings/scripts/test/TestObj.idl:
572
573 2015-10-06  Youenn Fablet  <youenn.fablet@crf.canon.fr>
574
575         Binding generator XXConstructor::finishCreation should take references as parameters
576         https://bugs.webkit.org/show_bug.cgi?id=149838
577
578         Reviewed by Darin Adler.
579
580         Updated the binding generator so that XXConstructor::finishCreation
581         takes a JSDOMGlobalObject& in lieu of a JSDOMGlobalObject*.
582
583         Covered by rebased binding tests.
584
585         * bindings/scripts/CodeGeneratorJS.pm:
586         (GenerateConstructorDeclaration):
587         (GenerateConstructorHelperMethods):
588         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
589         (WebCore::JSTestActiveDOMObjectConstructor::create):
590         (WebCore::JSTestActiveDOMObjectConstructor::finishCreation):
591         * bindings/scripts/test/JS/JSTestCallback.cpp:
592         (WebCore::JSTestCallbackConstructor::create):
593         (WebCore::JSTestCallbackConstructor::finishCreation):
594         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
595         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::create):
596         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::finishCreation):
597         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
598         (WebCore::JSTestCustomNamedGetterConstructor::create):
599         (WebCore::JSTestCustomNamedGetterConstructor::finishCreation):
600         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
601         (WebCore::JSTestEventConstructorConstructor::create):
602         (WebCore::JSTestEventConstructorConstructor::finishCreation):
603         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
604         (WebCore::JSTestEventTargetConstructor::create):
605         (WebCore::JSTestEventTargetConstructor::finishCreation):
606         * bindings/scripts/test/JS/JSTestException.cpp:
607         (WebCore::JSTestExceptionConstructor::create):
608         (WebCore::JSTestExceptionConstructor::finishCreation):
609         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
610         (WebCore::JSTestGenerateIsReachableConstructor::create):
611         (WebCore::JSTestGenerateIsReachableConstructor::finishCreation):
612         * bindings/scripts/test/JS/JSTestInterface.cpp:
613         (WebCore::JSTestInterfaceConstructor::create):
614         (WebCore::JSTestInterfaceConstructor::finishCreation):
615         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
616         (WebCore::JSTestJSBuiltinConstructorConstructor::create):
617         (WebCore::JSTestJSBuiltinConstructorConstructor::finishCreation):
618         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
619         (WebCore::JSTestMediaQueryListListenerConstructor::create):
620         (WebCore::JSTestMediaQueryListListenerConstructor::finishCreation):
621         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
622         (WebCore::JSTestNamedConstructorConstructor::create):
623         (WebCore::JSTestNamedConstructorNamedConstructor::create):
624         (WebCore::JSTestNamedConstructorConstructor::finishCreation):
625         (WebCore::JSTestNamedConstructorNamedConstructor::finishCreation):
626         * bindings/scripts/test/JS/JSTestNode.cpp:
627         (WebCore::JSTestNodeConstructor::create):
628         (WebCore::JSTestNodeConstructor::finishCreation):
629         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
630         (WebCore::JSTestNondeterministicConstructor::create):
631         (WebCore::JSTestNondeterministicConstructor::finishCreation):
632         * bindings/scripts/test/JS/JSTestObj.cpp:
633         (WebCore::JSTestObjConstructor::create):
634         (WebCore::JSTestObjConstructor::finishCreation):
635         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
636         (WebCore::JSTestOverloadedConstructorsConstructor::create):
637         (WebCore::JSTestOverloadedConstructorsConstructor::finishCreation):
638         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
639         (WebCore::JSTestOverrideBuiltinsConstructor::create):
640         (WebCore::JSTestOverrideBuiltinsConstructor::finishCreation):
641         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
642         (WebCore::JSTestSerializedScriptValueInterfaceConstructor::create):
643         (WebCore::JSTestSerializedScriptValueInterfaceConstructor::finishCreation):
644         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
645         (WebCore::JSTestTypedefsConstructor::create):
646         (WebCore::JSTestTypedefsConstructor::finishCreation):
647         * bindings/scripts/test/JS/JSattribute.cpp:
648         (WebCore::JSattributeConstructor::create):
649         (WebCore::JSattributeConstructor::finishCreation):
650         * bindings/scripts/test/JS/JSreadonly.cpp:
651         (WebCore::JSreadonlyConstructor::create):
652         (WebCore::JSreadonlyConstructor::finishCreation):
653
654 2015-10-06  Hunseop Jeong  <hs85.jeong@samsung.com>
655
656         [Cairo] fast/canvas/canvas-imageSmoothingFoo tests failed after r190383.
657         https://bugs.webkit.org/show_bug.cgi?id=149752
658
659         Reviewed by Carlos Garcia Campos.
660
661         CG's low interpolation quality setting is equivalent to most other browsers default or high settings.
662
663         * html/canvas/CanvasRenderingContext2D.cpp:
664         (WebCore::CanvasRenderingContext2D::State::State):
665
666 2015-10-06  Daniel Bates  <dbates@webkit.org>
667
668         Enable XSLT when building WebKit for iOS using the public iOS SDK
669         https://bugs.webkit.org/show_bug.cgi?id=149827
670
671         Reviewed by Alexey Proskuryakov.
672
673         * Configurations/FeatureDefines.xcconfig:
674
675 2015-10-06  Brent Fulgham  <bfulgham@apple.com>
676
677         [Win] Correct positioning error introduced in r190235
678         https://bugs.webkit.org/show_bug.cgi?id=149631
679         <rdar://problem/22635080>
680
681         Reviewed by Simon Fraser.
682
683         Covered by existing compositing tests:
684           css3/filters/clipping-overflow-scroll-with-pixel-moving-effect-on.html
685           fast/layers/no-clipping-overflow-hidden-added-after-transform.html
686           fast/layers/no-clipping-overflow-hidden-added-after-transition.html
687           fast/layers/no-clipping-overflow-hidden-hardware-acceleration.html
688           transforms/2d/preserve3d-not-fixed-container.html
689
690         * platform/graphics/ca/TileGrid.cpp:
691         (TileGrid::platformCALayerPaintContents): No need to do this extra flipping step
692         on Windows.
693         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
694         (PlatformCALayerWinInternal::displayCallback): We should always flip the
695         coordinate system when drawing these layers on Windows.
696         (shouldInvertBeforeDrawingContent): Deleted.
697         * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
698         (WebTiledBackingLayerWin::displayCallback): We do not need to flip coordinates
699         for these tiled layers; that's already accounted for in common tile drawing code.
700
701 2015-10-06  Emanuele Aina  <emanuele.aina@collabora.com>
702
703         Fix ENABLE_OPENGL=OFF builds
704         https://bugs.webkit.org/show_bug.cgi?id=146511
705
706         Reviewed by Darin Adler.
707
708         * platform/graphics/texmap/BitmapTextureGL.h:
709         * platform/graphics/texmap/BitmapTextureGL.cpp:
710         * platform/graphics/texmap/TextureMapperGL.h:
711         * platform/graphics/texmap/TextureMapperGL.cpp:
712         * platform/graphics/texmap/TextureMapperShaderProgram.h:
713         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
714         Fix TEXTURE_MAPPER_GL vs. TEXTURE_MAPPER guards to make sure that
715         ENABLE_OPENGL=OFF only disables the GL-related parts.
716
717 2015-10-06  Alex Christensen  <achristensen@webkit.org>
718
719         Fix Windows build after r190611.
720
721         * PlatformWin.cmake:
722         Forward headers from contentextensions.
723
724 2015-10-06  Hunseop Jeong  <hs85.jeong@samsung.com>
725
726         Use modern for-loops in WebCore/html.
727         https://bugs.webkit.org/show_bug.cgi?id=149662
728
729         Reviewed by Darin Adler.
730
731         No new tests because there is no behavior change.
732
733         * html/DOMFormData.cpp:
734         (WebCore::DOMFormData::DOMFormData):
735         * html/EmailInputType.cpp:
736         (WebCore::EmailInputType::typeMismatchFor):
737         * html/FileInputType.cpp:
738         (WebCore::FileInputType::receiveDroppedFiles):
739         * html/FormController.cpp:
740         (WebCore::FormControlState::serializeTo):
741         (WebCore::FormControlState::deserialize):
742         (WebCore::SavedFormState::serializeTo):
743         (WebCore::SavedFormState::getReferencedFilePaths):
744         (WebCore::FormController::createSavedFormStateMap):
745         (WebCore::FormController::formElementsState):
746         (WebCore::FormController::restoreControlStateIn):
747         (WebCore::FormController::getReferencedFilePaths):
748         * html/HTMLAnchorElement.cpp:
749         (WebCore::hasNonEmptyBox):
750         * html/HTMLCanvasElement.cpp:
751         (WebCore::HTMLCanvasElement::~HTMLCanvasElement):
752         (WebCore::HTMLCanvasElement::notifyObserversCanvasChanged):
753         (WebCore::HTMLCanvasElement::reset):
754         (WebCore::HTMLCanvasElement::paintsIntoCanvasBuffer):
755         * html/HTMLFieldSetElement.cpp:
756         (WebCore::HTMLFieldSetElement::length):
757         * html/HTMLFormControlsCollection.cpp:
758         (WebCore::firstNamedItem):
759         * html/HTMLFormElement.cpp:
760         (WebCore::HTMLFormElement::~HTMLFormElement):
761         (WebCore::HTMLFormElement::formWouldHaveSecureSubmission):
762         (WebCore::HTMLFormElement::removedFrom):
763         (WebCore::HTMLFormElement::length):
764         (WebCore::HTMLFormElement::submitImplicitly):
765         (WebCore::HTMLFormElement::validateInteractively):
766         (WebCore::HTMLFormElement::getTextFieldValues):
767         (WebCore::HTMLFormElement::submit):
768         (WebCore::HTMLFormElement::reset):
769         (WebCore::HTMLFormElement::defaultButton):
770         (WebCore::HTMLFormElement::checkInvalidControlsAndCollectUnhandled):
771         (WebCore::HTMLFormElement::removeFromPastNamesMap):
772         (WebCore::HTMLFormElement::documentDidResumeFromPageCache):
773         * html/HTMLInputElement.cpp:
774         (WebCore::parseAcceptAttribute):
775         * html/HTMLKeygenElement.cpp:
776         (WebCore::HTMLKeygenElement::HTMLKeygenElement):
777         * html/HTMLMediaElement.cpp:
778         (WebCore::HTMLMediaElement::setMediaGroup):
779         * html/HTMLOptionElement.cpp:
780         (WebCore::HTMLOptionElement::index):
781         * html/HTMLSelectElement.cpp:
782         (WebCore::HTMLSelectElement::saveLastSelection):
783         (WebCore::HTMLSelectElement::setActiveSelectionAnchorIndex):
784         (WebCore::HTMLSelectElement::setActiveSelectionEndIndex):
785         (WebCore::HTMLSelectElement::selectedIndex):
786         (WebCore::HTMLSelectElement::deselectItemsWithoutValidation):
787         (WebCore::HTMLSelectElement::saveFormControlState):
788         (WebCore::HTMLSelectElement::restoreFormControlState):
789         (WebCore::HTMLSelectElement::appendFormData):
790         (WebCore::HTMLSelectElement::reset):
791         * html/HTMLTextAreaElement.cpp:
792         (WebCore::HTMLTextAreaElement::setDefaultValue):
793         * html/InputType.cpp:
794         (WebCore::populateInputTypeFactoryMap):
795         * html/MediaController.cpp:
796         (MediaController::duration):
797         (MediaController::setCurrentTime):
798         (MediaController::play):
799         (MediaController::setPlaybackRate):
800         (MediaController::setVolume):
801         (MediaController::setMuted):
802         (playbackStateWaiting):
803         (MediaController::updateMediaElements):
804         (MediaController::bringElementUpToSpeed):
805         (MediaController::isBlocked):
806         (MediaController::hasEnded):
807         (MediaController::asyncEventTimerFired):
808         (MediaController::clearPositionTimerFired):
809         (MediaController::hasAudio):
810         (MediaController::hasVideo):
811         (MediaController::hasClosedCaptions):
812         (MediaController::setClosedCaptionsVisible):
813         (MediaController::supportsScanning):
814         (MediaController::beginScrubbing):
815         (MediaController::endScrubbing):
816         (MediaController::canPlay):
817         (MediaController::isLiveStream):
818         (MediaController::hasCurrentSrc):
819         (MediaController::returnToRealtime):
820         * html/MediaFragmentURIParser.cpp:
821         (WebCore::MediaFragmentURIParser::parseTimeFragment):
822         * html/PublicURLManager.cpp:
823         (WebCore::PublicURLManager::revoke):
824         (WebCore::PublicURLManager::stop):
825         * html/canvas/WebGLBuffer.cpp:
826         (WebCore::WebGLBuffer::getCachedMaxIndex):
827         (WebCore::WebGLBuffer::setCachedMaxIndex):
828         (WebCore::WebGLBuffer::setTarget):
829         * html/canvas/WebGLContextGroup.cpp:
830         (WebCore::WebGLContextGroup::loseContextGroup):
831         * html/canvas/WebGLDrawBuffers.cpp:
832         (WebCore::WebGLDrawBuffers::satisfiesWebGLRequirements):
833         * html/canvas/WebGLFramebuffer.cpp:
834         (WebCore::WebGLFramebuffer::removeAttachmentFromBoundFramebuffer):
835         (WebCore::WebGLFramebuffer::checkStatus):
836         (WebCore::WebGLFramebuffer::deleteObjectImpl):
837         (WebCore::WebGLFramebuffer::initializeAttachments):
838         (WebCore::WebGLFramebuffer::drawBuffers):
839         * html/canvas/WebGLRenderingContextBase.cpp:
840         (WebCore::WebGLRenderingContextBase::~WebGLRenderingContextBase):
841         (WebCore::WebGLRenderingContextBase::deleteTexture):
842         * html/canvas/WebGLVertexArrayObject.cpp:
843         (WebCore::WebGLVertexArrayObject::deleteObjectImpl):
844         * html/canvas/WebGLVertexArrayObjectOES.cpp:
845         (WebCore::WebGLVertexArrayObjectOES::deleteObjectImpl):
846         * html/parser/AtomicHTMLToken.h:
847         (WebCore::AtomicHTMLToken::initializeAttributes):
848         * html/parser/HTMLConstructionSite.cpp:
849         (WebCore::HTMLConstructionSite::mergeAttributesFromTokenIntoElement):
850         * html/parser/HTMLFormattingElementList.cpp:
851         (WebCore::HTMLFormattingElementList::ensureNoahsArkCondition):
852         * html/parser/HTMLPreloadScanner.cpp:
853         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
854         * html/parser/XSSAuditor.cpp:
855         (WebCore::semicolonSeparatedValueContainsJavaScriptURL):
856         * html/shadow/ContentDistributor.cpp:
857         (WebCore::ContentDistributor::distribute):
858         (WebCore::ContentDistributor::invalidate):
859         * html/shadow/MediaControlElements.cpp:
860         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
861         (WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
862         (WebCore::MediaControlTextTrackContainerElement::updateActiveCuesFontSize):
863         * html/track/AudioTrackList.cpp:
864         (AudioTrackList::getTrackById):
865         * html/track/LoadableTextTrack.cpp:
866         (WebCore::LoadableTextTrack::newCuesAvailable):
867         (WebCore::LoadableTextTrack::newRegionsAvailable):
868         * html/track/TextTrackCueList.cpp:
869         (WebCore::TextTrackCueList::getCueById):
870         (WebCore::TextTrackCueList::activeCues):
871         * html/track/TextTrackList.cpp:
872         (TextTrackList::getTrackIndexRelativeToRenderedTracks):
873         (TextTrackList::invalidateTrackIndexesAfterTrack):
874         * html/track/TrackListBase.cpp:
875         (TrackListBase::isAnyTrackEnabled):
876         * html/track/VideoTrackList.cpp:
877         (VideoTrackList::getTrackById):
878
879 2015-10-06  Alex Christensen  <achristensen@webkit.org>
880
881         Report error when main resource is blocked by content blocker
882         https://bugs.webkit.org/show_bug.cgi?id=149719
883         rdar://problem/21970595
884
885         Reviewed by Brady Eidson.
886
887         Test: http/tests/contentextensions/main-resource.html
888
889         * English.lproj/Localizable.strings:
890         * contentextensions/ContentExtensionActions.h:
891         * contentextensions/ContentExtensionError.h:
892         (WebCore::ContentExtensions::make_error_code):
893         * contentextensions/ContentExtensionsBackend.cpp:
894         (WebCore::ContentExtensions::ContentExtensionsBackend::globalDisplayNoneStyleSheet):
895         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
896         Instead of nulling out the ResourceRequest, processContentExtensionRulesForLoad 
897         now returns a status indicating whether the request should be blocked.
898         This is needed because the DocumentLoader needs a CachedResource with an error representing the blocking
899         (WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule):
900         * contentextensions/ContentExtensionsBackend.h:
901         * html/HTMLMediaElement.cpp:
902         (WebCore::HTMLMediaElement::loadResource):
903         * loader/DocumentLoader.cpp:
904         (WebCore::DocumentLoader::startLoadingMainResource):
905         Dispatch an error if the resource is blocked by a content blocker.
906         * loader/EmptyClients.h:
907         * loader/FrameLoader.cpp:
908         (WebCore::FrameLoader::loadResourceSynchronously):
909         (WebCore::FrameLoader::cancelledError):
910         (WebCore::FrameLoader::blockedByContentBlockerError):
911         (WebCore::FrameLoader::connectionProperties):
912         * loader/FrameLoader.h:
913         * loader/FrameLoaderClient.h:
914         * loader/ResourceLoader.cpp:
915         (WebCore::ResourceLoader::willSendRequestInternal):
916         * loader/cache/CachedResourceLoader.cpp:
917         (WebCore::CachedResourceLoader::requestResource):
918         * page/UserContentController.cpp:
919         (WebCore::UserContentController::removeAllUserContentExtensions):
920         (WebCore::UserContentController::processContentExtensionRulesForLoad):
921         (WebCore::UserContentController::actionsForResourceLoad):
922         * page/UserContentController.h:
923         * platform/efl/ErrorsEfl.cpp:
924         (WebCore::blockedError):
925         (WebCore::blockedByContentBlockerError):
926         (WebCore::cannotShowURLError):
927         * platform/efl/ErrorsEfl.h:
928         * platform/gtk/ErrorsGtk.cpp:
929         (WebCore::blockedError):
930         (WebCore::blockedByContentBlockerError):
931         (WebCore::cannotShowURLError):
932         * platform/gtk/ErrorsGtk.h:
933
934 2015-10-06  Xabier Rodriguez Calvar  <calvaris@igalia.com>
935
936         JSBuiltinConstructor must always add builtin header
937         https://bugs.webkit.org/show_bug.cgi?id=149759
938
939         Reviewed by Darin Adler.
940
941         Covered by TestJSBuiltinConstructor.idl.
942
943         * bindings/scripts/CodeGeneratorJS.pm:
944         (AddIncludesForJSBuiltinMethods): Forces adding the builtin header when the JSBuiltinConstructor is present.
945         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp: Expectation.
946
947 2015-10-05  Youenn Fablet  <youenn.fablet@crf.canon.fr>
948
949         Migrate streams API to JS Builtins
950         https://bugs.webkit.org/show_bug.cgi?id=147092
951
952         Reviewed by Darin Adler.
953
954         Moved ReadableStream implementation from C++ to JS Builtins.
955         Created specific private constructors for ReadableStreamReader and ReadableStreamController.
956         Added these constructors to  JSDOMWindowBase.
957         Constructors are based on a template found in JSDOMConstructor which might serve to webidl-generated classes as well.
958
959         Covered by existing tests.
960
961         * CMakeLists.txt:
962         * DerivedSources.make:
963         * Modules/streams/ReadableStream.cpp: Removed.
964         * Modules/streams/ReadableStream.h: Removed.
965         * Modules/streams/ReadableStream.idl:
966         * Modules/streams/ReadableStream.js:
967         (strategy.size):
968         (initializeReadableStream):
969         (cancel):
970         (getReader):
971         (pipeTo):
972         (tee):
973         (locked):
974         * Modules/streams/ReadableStreamController.h:
975         * Modules/streams/ReadableStreamController.idl:
976         * Modules/streams/ReadableStreamController.js: Added.
977         (enqueue):
978         (error):
979         (close):
980         (desiredSize):
981         * Modules/streams/ReadableStreamInternals.js:
982         (privateInitializeReadableStreamReader):
983         (privateInitializeReadableStreamController):
984         (isReadableStream):
985         (isReadableStreamReader):
986         (isReadableStreamController):
987         (errorReadableStream):
988         (requestReadableStreamPull):
989         (getReadableStreamDesiredSize):
990         (releaseReadableStreamReader):
991         (cancelReadableStream):
992         (finishClosingReadableStream):
993         (closeReadableStream):
994         (closeReadableStreamReader):
995         (enqueueInReadableStream):
996         (readFromReadableStreamReader):
997         (invokeOrNoop):
998         (promiseInvokeOrNoop):
999         * Modules/streams/ReadableStreamReader.cpp: Removed.
1000         * Modules/streams/ReadableStreamReader.h:
1001         * Modules/streams/ReadableStreamReader.idl:
1002         * Modules/streams/ReadableStreamReader.js: Copied from Source/WebCore/Modules/streams/ReadableStream.js.
1003         (cancel):
1004         (read):
1005         (releaseLock):
1006         (closed):
1007         * WebCore.vcxproj/WebCore.vcxproj:
1008         * WebCore.vcxproj/WebCore.vcxproj.filters:
1009         * WebCore.xcodeproj/project.pbxproj:
1010         * bindings/js/JSBindingsAllInOne.cpp:
1011         * bindings/js/JSDOMConstructor.h: Added.
1012         (WebCore::JSBuiltinConstructor::create):
1013         (WebCore::JSBuiltinConstructor::createStructure):
1014         (WebCore::JSBuiltinConstructor::JSBuiltinConstructor):
1015         (WebCore::JSBuiltinConstructor::initializeProperties):
1016         (WebCore::JSBuiltinConstructor<JSClass>::finishCreation):
1017         (WebCore::JSBuiltinConstructor<JSClass>::construct):
1018         (WebCore::JSBuiltinConstructor<JSClass>::getConstructData):
1019         * bindings/js/JSDOMWindowBase.cpp:
1020         (WebCore::JSDOMWindowBase::finishCreation):
1021         * bindings/js/JSReadableStreamControllerCustom.cpp: Removed.
1022         * bindings/js/JSReadableStreamCustom.cpp: Removed.
1023         * bindings/js/JSReadableStreamPrivateConstructors.cpp: Added.
1024         (WebCore::constructJSReadableStreamController):
1025         (WebCore::constructJSReadableStreamReader):
1026         (WebCore::JSBuiltinConstructor<JSReadableStreamReader>::createJSObject):
1027         (WebCore::JSBuiltinConstructor<JSReadableStreamController>::createJSObject):
1028         (WebCore::JSBuiltinReadableStreamReaderPrivateConstructor::createInitializeFunction):
1029         (WebCore::JSBuiltinReadableStreamControllerPrivateConstructor::createInitializeFunction):
1030         (WebCore::createReadableStreamReaderPrivateConstructor):
1031         (WebCore::createReadableStreamControllerPrivateConstructor):
1032         * bindings/js/JSReadableStreamPrivateConstructors.h: Added.
1033         * bindings/js/JSReadableStreamReaderCustom.cpp: Removed.
1034         * bindings/js/ReadableJSStream.cpp: Removed.
1035         * bindings/js/ReadableJSStream.h: Removed.
1036         * bindings/js/WebCoreBuiltinNames.h: Added.
1037         (WebCore::WebCoreBuiltinNames::WebCoreBuiltinNames):
1038         * bindings/js/WebCoreJSBuiltins.cpp:
1039         * bindings/js/WebCoreJSClientData.h:
1040         (WebCore::WebCoreJSClientData::WebCoreJSClientData):
1041         (WebCore::WebCoreJSClientData::builtinNames):
1042         (WebCore::WebCoreJSClientData::readableStreamControllerBuiltins):
1043         (WebCore::WebCoreJSClientData::readableStreamReaderBuiltins):
1044
1045 2015-10-05  Chris Dumez  <cdumez@apple.com>
1046
1047         data: URLs should not be preloaded
1048         https://bugs.webkit.org/show_bug.cgi?id=149829
1049
1050         Reviewed by Ryosuke Niwa.
1051
1052         Update the HTMLPreloadScanner so that data: URLs do not get preloaded.
1053         There is no need as the data is already available.
1054
1055         Test: fast/preloader/image-data-url.html
1056
1057         * html/parser/HTMLPreloadScanner.cpp:
1058         (WebCore::TokenPreloadScanner::StartTagScanner::shouldPreload):
1059
1060 2015-10-05  Jer Noble  <jer.noble@apple.com>
1061
1062         [iOS] REGRESSION(r190434): Media continues to play when locking screen
1063         https://bugs.webkit.org/show_bug.cgi?id=149822
1064
1065         Reviewed by Brent Fulgham.
1066
1067         In MediaSessionManagerIOS.mm, both -applicationWillEnterForeground: and
1068         -applicationDidBecomeActive: called
1069         PlatformMediaSessionManager::applicationWillEnterForeground(), leading to the
1070         PlatformMediaSession's m_interruptionCount becoming increasingly unbalanced.
1071
1072         Rename PlatformMediaSessionManager::applicationWillEnterForeground() to
1073         applicationDidEnterForeground() to more correctly reflect when this notification will be
1074         called. Add a new method, MediaSessionManagerIOS::applicationWillEnterForeground(bool),
1075         whose paramater is whether the screen was locked. This allows the beginInterruption() and
1076         endInterruption() methods to be correctly balanced.
1077
1078         Drive-by fix: remove the unimplemented declarations for application{will,did}Enter{Fore,Back}ground()
1079         from PlatformMediaSession.h.
1080
1081         * platform/audio/PlatformMediaSession.h:
1082         * platform/audio/PlatformMediaSessionManager.cpp:
1083         (WebCore::PlatformMediaSessionManager::applicationDidEnterForeground):
1084         (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground): Deleted.
1085         * platform/audio/PlatformMediaSessionManager.h:
1086         * platform/audio/ios/MediaSessionManagerIOS.h:
1087         * platform/audio/ios/MediaSessionManagerIOS.mm:
1088         (WebCore::MediaSessionManageriOS::applicationDidEnterBackground):
1089         (WebCore::MediaSessionManageriOS::applicationWillEnterForeground):
1090         (-[WebMediaSessionHelper applicationWillEnterForeground:]):
1091         (-[WebMediaSessionHelper applicationDidBecomeActive:]):
1092         * testing/Internals.cpp:
1093         (WebCore::Internals::applicationDidEnterForeground):
1094         (WebCore::Internals::applicationWillEnterForeground): Deleted.
1095         * testing/Internals.h:
1096         * testing/Internals.idl:
1097
1098 2015-10-05  Alex Christensen  <achristensen@webkit.org>
1099
1100         Invalid CSS Selector for Content Blockers invalidates others
1101         https://bugs.webkit.org/show_bug.cgi?id=148446
1102         rdar://problem/22918235
1103
1104         Reviewed by Benjamin Poulain.
1105
1106         Test: http/tests/contentextensions/invalid-selector.html
1107
1108         * contentextensions/ContentExtensionParser.cpp:
1109         (WebCore::ContentExtensions::loadTrigger):
1110         (WebCore::ContentExtensions::isValidSelector):
1111         (WebCore::ContentExtensions::loadAction):
1112         (WebCore::ContentExtensions::loadRule):
1113         Add a check to see if a selector is valid before adding it.
1114
1115 2015-10-05  Jiewen Tan  <jiewen_tan@apple.com>
1116
1117         CSSGradientValue should check whether gradientLength is zero or not.
1118         https://bugs.webkit.org/show_bug.cgi?id=149373
1119         <rdar://problem/22771418>
1120
1121         Reviewed by Darin Adler.
1122
1123         This is a merge of Blink r158220,
1124         https://chromiumcodereview.appspot.com/24350008
1125
1126         Test: fast/gradients/css3-repeating-radial-gradients-crash.html
1127
1128         * css/CSSGradientValue.cpp:
1129         (WebCore::CSSGradientValue::addStops):
1130         Check whether gradientLength > 0 before using it as denominator.
1131
1132 2015-10-05  Dean Jackson  <dino@apple.com>
1133
1134         EXT_texture_filter_anisotropic extension exposed with WEBKIT_ prefix
1135         https://bugs.webkit.org/show_bug.cgi?id=149765
1136         <rdar://problem/22983722>
1137
1138         Reviewed by Beth Dakin.
1139
1140         We can now remove the WEBKIT_ prefix from this extension.
1141
1142         Test: fast/canvas/webgl/unprefixed-anisotropic-extension.html
1143
1144         * html/canvas/WebGL2RenderingContext.cpp: Support the prefixed and unprefixed form.
1145         (WebCore::WebGL2RenderingContext::getExtension):
1146         * html/canvas/WebGLRenderingContext.cpp:
1147         (WebCore::WebGLRenderingContext::getExtension):
1148         (WebCore::WebGLRenderingContext::getSupportedExtensions):
1149
1150 2015-10-05  Dean Jackson  <dino@apple.com>
1151
1152         Reference cycles during SVG dependency invalidation
1153         https://bugs.webkit.org/show_bug.cgi?id=149824
1154         <rdar://problem/22771412>
1155
1156         Reviewed by Tim Horton.
1157
1158         Detect any reference cycles as we are invalidating.
1159
1160         This is mostly a merge of the following Blink commit:
1161         https://chromium.googlesource.com/chromium/blink/+/a4bc83453bda89823b672877dc02247652a02d51
1162
1163         Test: svg/custom/reference-cycle.svg
1164
1165         * rendering/svg/RenderSVGResource.cpp:
1166         (WebCore::removeFromCacheAndInvalidateDependencies): Keep around a hash
1167         table of dependencies, so that we can detect if an element is already
1168         present before marking it.
1169
1170 2015-10-05  Jiewen Tan  <jiewen_tan@apple.com>
1171
1172         Fix null pointer dereference in WebSocket::connect()        
1173         https://bugs.webkit.org/show_bug.cgi?id=149311
1174         <rdar://problem/22748858>
1175
1176         Reviewed by Chris Dumez.
1177
1178         This is a merge of Blink r187441,
1179         https://codereview.chromium.org/785933005
1180
1181         Test: http/tests/websocket/construct-in-detached-frame.html
1182
1183         * Modules/websockets/WebSocket.cpp:
1184         (WebCore::WebSocket::connect):
1185         Call function implemented below instead of duplicating the code.
1186         * page/ContentSecurityPolicy.cpp:
1187         (WebCore::ContentSecurityPolicy::shouldBypassMainWorldContentSecurityPolicy):
1188         * page/ContentSecurityPolicy.h:
1189         Factor the logic to check shouldBypassMainWorldContentSecurityPolicy into 
1190         a function in this class. Check Frame pointers are not null before getting 
1191         shouldBypassMainWorldContentSecurityPolicy via those pointers.
1192         * page/EventSource.cpp:
1193         (WebCore::EventSource::create):
1194         This got fixed as a bonus.
1195         * xml/XMLHttpRequest.cpp:
1196         (WebCore::XMLHttpRequest::open):
1197         This got fixed as a bonus too.
1198
1199 2015-10-05  Beth Dakin  <bdakin@apple.com>
1200
1201         WebCore::IOSurface should ask the IOSurface for the pixel format instead of 
1202         caching it
1203         https://bugs.webkit.org/show_bug.cgi?id=149820
1204         -and corresponding-
1205         rdar://problem/22976230
1206
1207         Reviewed by Tim Horton.
1208
1209         Also there is no reason to make YUV be iOS only, so this patch removes those 
1210         PLATFORM checks.
1211
1212         * platform/graphics/cocoa/IOSurface.h:
1213         * platform/graphics/cocoa/IOSurface.mm:
1214         (IOSurface::IOSurface):
1215         (IOSurface::format):
1216         * platform/spi/cocoa/IOSurfaceSPI.h:
1217
1218 2015-10-02  Ryosuke Niwa  <rniwa@webkit.org>
1219
1220         ShadowRoot with leading or trailing white space cause a crash
1221         https://bugs.webkit.org/show_bug.cgi?id=149782
1222
1223         Reviewed by Chris Dumez.
1224
1225         Fixed the crash by adding a null pointer check since a TextNode that appears as a direct child
1226         of a ShadowRoot doesn't have a parent element.
1227
1228         Test: fast/shadow-dom/shadow-root-with-child-whitespace-text-crash.html
1229
1230         * style/RenderTreePosition.cpp:
1231         (WebCore::RenderTreePosition::previousSiblingRenderer):
1232
1233 2015-10-05  Beth Dakin  <bdakin@apple.com>
1234
1235         Build fix. 
1236
1237         * platform/spi/cocoa/IOSurfaceSPI.h:
1238
1239 2015-10-05  Beth Dakin  <bdakin@apple.com>
1240
1241         Unreviewed build fix.
1242
1243         * platform/spi/cocoa/IOSurfaceSPI.h:
1244
1245 2015-10-05  Brady Eidson  <beidson@apple.com>
1246
1247         Modernize IDBRequest::ReadyState into an enum class.
1248         https://bugs.webkit.org/show_bug.cgi?id=149817
1249
1250         Reviewed by Alex Christensen.
1251
1252         No new tests (Refactor, no behavior change).
1253
1254         * Modules/indexeddb/IDBRequest.h:
1255         
1256         * Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp:
1257         (WebCore::LegacyOpenDBRequest::shouldEnqueueEvent):
1258         
1259         * Modules/indexeddb/legacy/LegacyRequest.cpp:
1260         (WebCore::LegacyRequest::LegacyRequest):
1261         (WebCore::LegacyRequest::result):
1262         (WebCore::LegacyRequest::error):
1263         (WebCore::LegacyRequest::errorCode):
1264         (WebCore::LegacyRequest::readyState):
1265         (WebCore::LegacyRequest::markEarlyDeath):
1266         (WebCore::LegacyRequest::abort):
1267         (WebCore::LegacyRequest::setCursorDetails):
1268         (WebCore::LegacyRequest::setPendingCursor):
1269         (WebCore::LegacyRequest::setResultCursor):
1270         (WebCore::LegacyRequest::finishCursor):
1271         (WebCore::LegacyRequest::shouldEnqueueEvent):
1272         (WebCore::LegacyRequest::stop):
1273         (WebCore::LegacyRequest::dispatchEvent):
1274         (WebCore::LegacyRequest::transactionDidFinishAndDispatch):
1275         (WebCore::LegacyRequest::enqueueEvent):
1276         * Modules/indexeddb/legacy/LegacyRequest.h:
1277
1278 2015-10-05  Jiewen Tan  <jiewen_tan@apple.com>
1279
1280         Cleaning up after revision 190339
1281         https://bugs.webkit.org/show_bug.cgi?id=149732
1282
1283         Reviewed by Myles C. Maxfield.
1284
1285         * xml/XSLStyleSheet.h:
1286         * xml/XSLStyleSheetLibxslt.cpp:
1287         (WebCore::XSLStyleSheet::compileStyleSheet):
1288
1289 2015-10-05  Beth Dakin  <bdakin@apple.com>
1290
1291         Errant space!!
1292         * platform/graphics/cocoa/IOSurface.mm:
1293         (IOSurface::releaseGraphicsContext):
1294         (IOSurface::convertToFormat):
1295
1296 2015-10-05  Beth Dakin  <bdakin@apple.com>
1297
1298         Compress snapshots on iOS
1299         https://bugs.webkit.org/show_bug.cgi?id=149814
1300         -and corresponding-
1301         rdar://problem/22976230
1302
1303         Reviewed by Simon Fraser.
1304
1305         Though the default is still RGBA, it is now possible to create an IOSurface 
1306         that uses the YUV422 pixel format.
1307         * platform/graphics/cocoa/IOSurface.h:
1308         * platform/graphics/cocoa/IOSurface.mm:
1309         (IOSurface::surfaceFromPool):
1310         (IOSurface::create):
1311         (IOSurface::createFromImage):
1312         (IOSurface::IOSurface):
1313         (IOSurface::releaseGraphicsContext):
1314
1315         In order to have a YUV IOSurface, we actually have to create an RGBA surface 
1316         first and then convert it to YUV, so this class method will handle that.
1317         (IOSurface::convertToFormat):
1318
1319         Necessary SPI.
1320         * platform/spi/cocoa/IOSurfaceSPI.h:
1321
1322 2015-10-05  Zalan Bujtas  <zalan@apple.com>
1323
1324         Mark the line dirty when RenderQuote's text changes.
1325         https://bugs.webkit.org/show_bug.cgi?id=149784
1326         rdar://problem/22558169
1327
1328         Reviewed by Antti Koivisto.
1329
1330         When quotation mark changes ( " -> ' or empty string), we
1331         need to mark the line dirty to ensure its content gets laid out properly.
1332
1333         Test: fast/inline/quotation-text-changes-dynamically.html
1334
1335         * rendering/RenderQuote.cpp:
1336         (WebCore::quoteTextRenderer):
1337         (WebCore::RenderQuote::updateText):
1338         (WebCore::fragmentChild): Deleted.
1339
1340 2015-10-03  Filip Pizlo  <fpizlo@apple.com>
1341
1342         Allow an object's marking state to track The Three Colors
1343         https://bugs.webkit.org/show_bug.cgi?id=149654
1344
1345         Reviewed by Geoffrey Garen.
1346
1347         No new tests because no new behavior.
1348
1349         * bindings/scripts/CodeGeneratorJS.pm:
1350         (GenerateImplementation):
1351
1352 2015-10-05  Katlyn Graff  <kgraff@apple.com>
1353
1354         Update setImageSmoothingQuality for additional reviews.
1355         https://bugs.webkit.org/show_bug.cgi?id=149541
1356
1357         Reviewed by Chris Dumez.
1358
1359         * html/canvas/CanvasRenderingContext2D.cpp:
1360         (WebCore::CanvasRenderingContext2D::setImageSmoothingQuality):
1361
1362 2015-10-05  Andreas Kling  <akling@apple.com>
1363
1364         Remove unused HistoryItem::targetItem()
1365         <https://webkit.org/b/149803>
1366
1367         Reviewed by Anders Carlsson.
1368
1369         This is ancient code with no remaining clients since 2010 (r53650)
1370
1371         * history/HistoryItem.cpp:
1372         (WebCore::HistoryItem::findTargetItem): Deleted.
1373         (WebCore::HistoryItem::targetItem): Deleted.
1374         * history/HistoryItem.h:
1375
1376 2015-10-05  Myles C. Maxfield  <mmaxfield@apple.com>
1377
1378         Unprefix -webkit-font-feature-settings
1379         https://bugs.webkit.org/show_bug.cgi?id=149722
1380
1381         Reviewed by Sam Weinig.
1382
1383         * css/CSSComputedStyleDeclaration.cpp:
1384         (WebCore::ComputedStyleExtractor::propertyValue):
1385         * css/CSSParser.cpp:
1386         (WebCore::CSSParser::parseValue):
1387         (WebCore::CSSParser::parseFontFeatureSettings):
1388         * css/CSSPropertyNames.in:
1389         * css/CSSValueKeywords.in:
1390         * css/StyleBuilderCustom.h:
1391         (WebCore::StyleBuilderCustom::applyInitialFontFeatureSettings):
1392         (WebCore::StyleBuilderCustom::applyInheritFontFeatureSettings):
1393         (WebCore::StyleBuilderCustom::applyInitialWebkitFontFeatureSettings): Deleted.
1394         (WebCore::StyleBuilderCustom::applyInheritWebkitFontFeatureSettings): Deleted.
1395
1396 2015-10-05  Zan Dobersek  <zdobersek@igalia.com>
1397
1398         [GStreamer] Replace uses of std::bind() with lambdas
1399         https://bugs.webkit.org/show_bug.cgi?id=149802
1400
1401         Reviewed by Carlos Garcia Campos.
1402
1403         Instead of std::bind(), use C++ lambdas to create std::function<>
1404         wrappers in GStreamer-related class implementations.
1405
1406         Ref-counted classes are protected by capturing a RefPtr object.
1407         GstObject-derived objects are protected by capturing a GRefPtr object.
1408         Necessary specializations for WebKitVideoSink and WebKitWebSrc are added.
1409
1410         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
1411         (WebCore::AudioFileReader::createBus):
1412         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
1413         (WTF::adoptGRef):
1414         (WTF::refGPtr<WebKitVideoSink>):
1415         (WTF::derefGPtr<WebKitVideoSink>):
1416         (WTF::refGPtr<WebKitWebSrc>):
1417         (WTF::derefGPtr<WebKitWebSrc>):
1418         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
1419         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
1420         (WebCore::InbandTextTrackPrivateGStreamer::handleSample):
1421         (WebCore::InbandTextTrackPrivateGStreamer::streamChanged):
1422         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1423         (WebCore::MediaPlayerPrivateGStreamer::videoChanged):
1424         (WebCore::MediaPlayerPrivateGStreamer::videoCapsChanged):
1425         (WebCore::MediaPlayerPrivateGStreamer::audioChanged):
1426         (WebCore::MediaPlayerPrivateGStreamer::textChanged):
1427         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1428         (WebCore::MediaPlayerPrivateGStreamerBase::volumeChanged):
1429         (WebCore::MediaPlayerPrivateGStreamerBase::muteChanged):
1430         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
1431         (WebCore::TrackPrivateBaseGStreamer::activeChanged):
1432         (WebCore::TrackPrivateBaseGStreamer::tagsChanged):
1433         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
1434         (webkitVideoSinkRender):
1435         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1436         (webKitWebSrcChangeState):
1437         (webKitWebSrcNeedDataCb):
1438         (webKitWebSrcEnoughDataCb):
1439         (webKitWebSrcSeekDataCb):
1440
1441 2015-10-05  Andreas Kling  <akling@apple.com>
1442
1443         Remove unused HistoryItem::parent
1444         <https://webkit.org/b/149803>
1445
1446         Reviewed by Anders Carlsson.
1447
1448         Remove the effectively-unused "parent" field from HistoryItem.
1449         This also allows us to get rid of a HistoryItem constructor.
1450
1451         * history/HistoryItem.cpp:
1452         (WebCore::HistoryItem::HistoryItem): Deleted.
1453         (WebCore::HistoryItem::reset): Deleted.
1454         (WebCore::HistoryItem::parent): Deleted.
1455         (WebCore::HistoryItem::setParent): Deleted.
1456         * history/HistoryItem.h:
1457         (WebCore::HistoryItem::create): Deleted.
1458         * loader/HistoryController.cpp:
1459         (WebCore::HistoryController::initializeItem): Deleted.
1460
1461 2015-10-05  Zan Dobersek  <zdobersek@igalia.com>
1462
1463         GLContext should control ownership of context-related objects
1464         https://bugs.webkit.org/show_bug.cgi?id=149794
1465
1466         Reviewed by Martin Robinson.
1467
1468         Creation of GLContext objects can depend on various platform-specific
1469         objects like native window representations. Since these objects are
1470         used solely for the GLContext purposes, it would make sense to allow
1471         GLContext to provide an extensible way to impose ownership on these
1472         objects and control their lifetime.
1473
1474         GLContext::Data is declared with a defaulted virtual destructor.
1475         Users of these implementations can declare classes that derive from
1476         GLContext::Data and store context-related objects in instances of the
1477         derived class, and ensure that these objects are properly cleaned up
1478         when GLContext destroys the Data object.
1479
1480         The GLContext::Data object is managed through a protected
1481         std::unique_ptr<> member in the GLContext class. For now the member
1482         is only set in GLContextEGL::createWindowContext() and is destroyed
1483         during the GLContext destruction.
1484
1485         The local OffscreenContextData class in
1486         PlatformDisplayWayland::createSharingGLContext() derives from
1487         GLContext::Data and is used to store the wl_surface and
1488         EGLNativeWindowType (aka wl_egl_window) objects for offscreen
1489         GLContexts under the Wayland platform that are used for the sharing
1490         context and WebGL, effectively avoiding the leak that would further
1491         propagate problems into the compositor and the graphics library.
1492         (Such offscreen contexts are actually mimicked via a 1x1px
1493         wl_egl_window object that acts as a dummy base for the related
1494         wl_surface object).
1495
1496         * platform/graphics/GLContext.h:
1497         * platform/graphics/egl/GLContextEGL.cpp:
1498         (WebCore::GLContextEGL::createWindowContext):
1499         * platform/graphics/egl/GLContextEGL.h:
1500         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
1501         (WebCore::PlatformDisplayWayland::createSharingGLContext):
1502
1503 2015-10-05  Zan Dobersek  <zdobersek@igalia.com>
1504
1505         Make gdk.h inclusion in FontPlatformDataFreeType.cpp properly GTK-specific
1506         https://bugs.webkit.org/show_bug.cgi?id=149793
1507
1508         Reviewed by Carlos Garcia Campos.
1509
1510         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
1511         Instead of including <gdk/gdk.h> header for all platforms but EFL, only
1512         include it for the GTK platform, since no other platform depends on the
1513         GDK library.
1514
1515 2015-10-03  Ricky Mondello  <rmondello@apple.com>
1516
1517         "Plug-in is blocked" message doesn't draw correctly
1518         https://bugs.webkit.org/show_bug.cgi?id=149741
1519         <rdar://problem/22920949>
1520
1521         Patch by Conrad Shultz and Ricky Mondello.
1522
1523         Reviewed by Anders Carlsson.
1524
1525         No new tests are added.
1526
1527         Add PluginData API to check whether a MIME type is supported, regardless of plug-in visibility.
1528
1529         * plugins/PluginData.cpp:
1530         (WebCore::PluginData::getWebVisibleMimesAndPluginIndices): Adopt getMimesAndPluginIndiciesForPlugins.
1531         (WebCore::PluginData::getMimesAndPluginIndices): Added.
1532         (WebCore::PluginData::getMimesAndPluginIndiciesForPlugins): Essentially factored out of
1533             getWebVisibleMimesAndPluginIndices.
1534         (WebCore::PluginData::supportsMimeType): Added. Somewhat similar to preexisting supportsWebVisibleMimeType.
1535         * plugins/PluginData.h: Declare supportsMimeType.
1536
1537 2015-10-02  Antti Koivisto  <antti@apple.com>
1538
1539         Inserting a child to a slot assigned node doesn't trigger repaint
1540         https://bugs.webkit.org/show_bug.cgi?id=149739
1541
1542         Reviewed by Ryosuke Niwa.
1543
1544         Test: fast/shadow-dom/insert-child-to-assigned-node.html
1545
1546         * dom/Node.cpp:
1547         (WebCore::Node::derefEventTarget):
1548         (WebCore::traverseStyleParent):
1549         (WebCore::traverseFirstStyleParent):
1550         (WebCore::Node::updateAncestorsForStyleRecalc):
1551
1552             Traverse in style parent order.
1553
1554 2015-10-02  Joseph Pecoraro  <pecoraro@apple.com>
1555
1556         Unreviewed, rolling out r190520, some tests assert / crash.
1557
1558         * ForwardingHeaders/heap/HeapObserver.h: Removed.
1559         * ForwardingHeaders/inspector/agents/InspectorHeapAgent.h: Removed.
1560         * WebCore.vcxproj/WebCore.vcxproj:
1561         * WebCore.vcxproj/WebCore.vcxproj.filters:
1562         * inspector/InspectorController.cpp:
1563         (WebCore::InspectorController::InspectorController): Deleted.
1564         (WebCore::InspectorController::vm): Deleted.
1565         * inspector/InspectorController.h:
1566         * inspector/WorkerInspectorController.cpp:
1567         (WebCore::WorkerInspectorController::vm): Deleted.
1568         * inspector/WorkerInspectorController.h:
1569
1570 2015-10-02  Joseph Pecoraro  <pecoraro@apple.com>
1571
1572         Web Inspector: Include Garbage Collection Event in Timeline
1573         https://bugs.webkit.org/show_bug.cgi?id=142510
1574
1575         Reviewed by Geoffrey Garen.
1576
1577         Tests: inspector/heap/garbageCollected.html
1578                inspector/heap/gc.html
1579
1580         * ForwardingHeaders/heap/HeapObserver.h: Added.
1581         * ForwardingHeaders/inspector/agents/InspectorHeapAgent.h: Added.
1582         * WebCore.vcxproj/WebCore.vcxproj:
1583         * WebCore.vcxproj/WebCore.vcxproj.filters:
1584         Forwarding headers.
1585
1586         * inspector/InspectorController.cpp:
1587         (WebCore::InspectorController::InspectorController):
1588         (WebCore::InspectorController::vm):
1589         * inspector/InspectorController.h:
1590         * inspector/WorkerInspectorController.cpp:
1591         (WebCore::WorkerInspectorController::vm):
1592         * inspector/WorkerInspectorController.h:
1593         Implement InspectorEnvironment::vm and create a Heap agent for the
1594         Page inspector controller.
1595
1596 2015-10-02  Jer Noble  <jer.noble@apple.com>
1597
1598         [MSE] Browser crashes when appending invalid data to MSE source buffer
1599         https://bugs.webkit.org/show_bug.cgi?id=149689
1600
1601         Reviewed by Darin Adler.
1602
1603         Test: media/media-source/media-source-stpp-crash.html
1604
1605         Bail out early (as specced) after disconnecting the SourceBuffer from its MediaSource.
1606
1607         * Modules/mediasource/SourceBuffer.cpp:
1608         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
1609
1610 2015-10-02  Simon Fraser  <simon.fraser@apple.com>
1611
1612         ASSERTION FAILED: param >= 0 in AnimationBase::updateStateMachine()
1613         https://bugs.webkit.org/show_bug.cgi?id=149737
1614         rdar://problem/19017465
1615
1616         Reviewed by Dean Jackson.
1617
1618         CoreAnimation can give us an animation beginTime that is slightly into the future,
1619         which results in 'param' here being < 0, so relax the assertion slightly.
1620         
1621         Fixes lots of assertions running iOS WK2 layout tests.
1622
1623         * page/animation/AnimationBase.cpp:
1624         (WebCore::AnimationBase::updateStateMachine):
1625
1626 2015-10-02  Per Arne Vollan  <peavo@outlook.com>
1627
1628         [WinCairo] Fix linker warnings.
1629         https://bugs.webkit.org/show_bug.cgi?id=149754
1630
1631         Reviewed by Alex Christensen.
1632
1633         Avoid compiling these files twice, they are already included in
1634         RenderingAllInOne.cpp.
1635
1636         * PlatformWinCairo.cmake:
1637
1638 2015-10-02  Alex Christensen  <achristensen@webkit.org>
1639
1640         Reloading without content blockers doesn't apply to resource loads after the main frame finishes
1641         https://bugs.webkit.org/show_bug.cgi?id=149430
1642         rdar://problem/22742222
1643
1644         Reviewed by Geoffrey Garen.
1645
1646         Test: http/tests/contentextensions/disable-blocker.html
1647
1648         * html/HTMLMediaElement.cpp:
1649         (WebCore::HTMLMediaElement::loadResource):
1650         * loader/DocumentLoader.h:
1651         (WebCore::DocumentLoader::userContentExtensionsEnabled):
1652         (WebCore::DocumentLoader::setUserContentExtensionsEnabled):
1653         Store and use the state of whether content blockers are enabled or not on the DocumentLoader
1654         so that it stays constant for a document's entire life.  This state comes from the Page when
1655         making the DocumentLoader in WebKit2.
1656         * loader/FrameLoader.cpp:
1657         (WebCore::FrameLoader::loadResourceSynchronously):
1658         * loader/ResourceLoader.cpp:
1659         (WebCore::ResourceLoader::willSendRequestInternal):
1660         * loader/cache/CachedResourceLoader.cpp:
1661         (WebCore::CachedResourceLoader::requestResource):
1662         * page/DOMWindow.cpp:
1663         (WebCore::DOMWindow::open):
1664         * page/UserContentController.cpp:
1665         (WebCore::UserContentController::removeAllUserContentExtensions):
1666         (WebCore::UserContentController::processContentExtensionRulesForLoad):
1667         (WebCore::UserContentController::actionsForResourceLoad):
1668         * page/UserContentController.h:
1669
1670 2015-10-02  Antoine Quint  <graouts@apple.com>
1671
1672         popstate is fired at the wrong time on load
1673         https://bugs.webkit.org/show_bug.cgi?id=94265
1674
1675         Reviewed by Darin Adler.
1676
1677         Don't fire popstate event on initial document load
1678
1679         According to the specification [1], a popstate event should only be fired
1680         when the document has a "last entry" and the entry being navigated to isn't
1681         it.  A document is created without a "last entry" and gets one just after
1682         this check when it is first navigated to, so a popstate should be fired any
1683         time a document is navigated to except for the first time after it has been
1684         created.
1685
1686         Patch adapted from work by jl@opera.com on Blink [2].
1687
1688         [1] http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#traverse-the-history (step 12-14 in particular)
1689         [2] https://src.chromium.org/viewvc/blink?revision=165221&view=revision
1690
1691         * dom/Document.cpp:
1692         (WebCore::Document::implicitClose):
1693
1694 2015-10-02  Javier Fernandez  <jfernandez@igalia.com>
1695
1696         [CSS Grid Layout] Support for Content Alignment in grid layout
1697         https://bugs.webkit.org/show_bug.cgi?id=145520
1698
1699         Reviewed by Darin Adler.
1700
1701         According to CSS Box Alignment specification, Content Distribution
1702         alignment controls alignment of the box's content within the box. The
1703         alignment container is the grid container's content box. The alignment
1704         subjects are the grid tracks.
1705
1706         This patch implements Grid Layout support for Content Distribution
1707         alignment along both block/column and inline/row axis, which are handled
1708         by align-content and justify-content properties respectively.
1709
1710         This patch provides support for overflow handling, similar to what
1711         Self Alignment provides with grid items, and both <content-position>
1712         and <content-distribution> values.
1713
1714         Baseline Alignment is still missing because it requires some additional
1715         behavior to be supported on grids before considering its implementation.
1716
1717         Tests: css3/overwrite-content-alignment.html
1718                css3/overwrite-self-alignment.html
1719                fast/css-grid-layout/grid-align-content-distribution-vertical-lr.html
1720                fast/css-grid-layout/grid-align-content-distribution-vertical-rl.html
1721                fast/css-grid-layout/grid-align-content-distribution.html
1722                fast/css-grid-layout/grid-align-content-vertical-lr.html
1723                fast/css-grid-layout/grid-align-content-vertical-rl.html
1724                fast/css-grid-layout/grid-align-content.html
1725                fast/css-grid-layout/grid-content-alignment-overflow.html
1726                fast/css-grid-layout/grid-content-alignment-with-different-sized-tracks.html
1727                fast/css-grid-layout/grid-content-alignment-with-span-vertical-lr.html
1728                fast/css-grid-layout/grid-content-alignment-with-span-vertical-rl.html
1729                fast/css-grid-layout/grid-content-alignment-with-span.html
1730                fast/css-grid-layout/grid-justify-content-distribution-vertical-lr.html
1731                fast/css-grid-layout/grid-justify-content-distribution-vertical-rl.html
1732                fast/css-grid-layout/grid-justify-content-distribution.html
1733                fast/css-grid-layout/grid-justify-content-vertical-lr.html
1734                fast/css-grid-layout/grid-justify-content-vertical-rl.html
1735                fast/css-grid-layout/grid-justify-content.html
1736
1737         * rendering/RenderFlexibleBox.cpp:
1738         (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
1739         (WebCore::RenderFlexibleBox::layoutColumnReverse):
1740         (WebCore::RenderFlexibleBox::alignFlexLines):
1741         * rendering/RenderGrid.cpp:
1742         (WebCore::ContentAlignmentData::ContentAlignmentData):
1743         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
1744         (WebCore::RenderGrid::layoutGridItems):
1745         (WebCore::RenderGrid::gridAreaBreadthForChild):
1746         (WebCore::RenderGrid::populateGridPositions):
1747         (WebCore::resolveContentDistributionFallback):
1748         (WebCore::offsetToStartEdge):
1749         (WebCore::offsetToEndEdge):
1750         (WebCore::contentDistributionOffset):
1751         (WebCore::RenderGrid::computeContentPositionAndDistributionColumnOffset):
1752         (WebCore::RenderGrid::computeContentPositionAndDistributionRowOffset):
1753         (WebCore::RenderGrid::findChildLogicalPosition):
1754         (WebCore::RenderGrid::computePreferredLogicalWidths): Deleted.
1755         (WebCore::RenderGrid::autoPlacementMajorAxisDirection): Deleted.
1756         (WebCore::RenderGrid::autoPlacementMinorAxisDirection): Deleted.
1757         (WebCore::RenderGrid::cachedGridCoordinate): Deleted.
1758         (WebCore::RenderGrid::rowPositionForChild): Deleted.
1759         * rendering/RenderGrid.h:
1760         * rendering/style/RenderStyle.cpp:
1761         (WebCore::RenderStyle::resolvedAlignContentPosition):
1762         (WebCore::RenderStyle::resolvedAlignContentDistribution):
1763         (WebCore::RenderStyle::resolvedJustifyContentPosition):
1764         (WebCore::RenderStyle::resolvedJustifyContentDistribution):
1765         * rendering/style/RenderStyle.h:
1766
1767 2015-10-02  Dean Jackson  <dino@apple.com>
1768
1769         Attempted build fix.
1770
1771         * DerivedSources.make:
1772         * page/make_settings.pl:
1773         (printGetterAndSetter):
1774
1775 2015-10-01  Dean Jackson  <dino@apple.com>
1776
1777         Expose WEBGL_debug_renderer_info
1778         https://bugs.webkit.org/show_bug.cgi?id=149735
1779         <rdar://problem/18343500>
1780
1781         Reviewed by Simon Fraser.
1782
1783         Take two at landing this.
1784
1785         Enable the extension that allows content to query
1786         for the GPUs vendor and details.
1787
1788         Now that we're enabling this, there was no need for
1789         the internal setting that identified privileged situations.
1790         However, since this meant that WEBGL_debug_shaders was
1791         also exposed, I explicitly disable it since it is
1792         not yet conformant.
1793
1794         Test: fast/canvas/webgl/webgl-debug-renderer-info.html
1795         as well as the general conformance suite.
1796
1797         * html/canvas/WebGL2RenderingContext.cpp: No need to guard around allowPrivilegedExtensions().
1798         (WebCore::WebGL2RenderingContext::getExtension):
1799         (WebCore::WebGL2RenderingContext::getSupportedExtensions):
1800         * html/canvas/WebGLRenderingContext.cpp: Ditto.
1801         (WebCore::WebGLRenderingContext::getExtension):
1802         (WebCore::WebGLRenderingContext::getSupportedExtensions):
1803         * html/canvas/WebGLRenderingContextBase.cpp:
1804         (WebCore::WebGLRenderingContextBase::allowPrivilegedExtensions): Deleted.
1805         * html/canvas/WebGLRenderingContextBase.h:
1806         * page/Settings.in: Remove privilegedWebGLExtensions.
1807         * platform/graphics/opengl/Extensions3DOpenGL.cpp: Forbid the translated shader
1808         extension while it is still buggy.
1809         (WebCore::Extensions3DOpenGL::supportsExtension):
1810
1811 2015-10-01  Csaba Osztrogonác  <ossy@webkit.org>
1812
1813         Fix the #if guard in PointerLockController.cpp
1814         https://bugs.webkit.org/show_bug.cgi?id=149705
1815
1816         Reviewed by Gyuyoung Kim.
1817
1818         * page/PointerLockController.cpp:
1819
1820 2015-10-01  Dean Jackson  <dino@apple.com>
1821
1822         Rollout r190446 for the moment. It broke the build.
1823
1824         * html/canvas/WebGL2RenderingContext.cpp:
1825         (WebCore::WebGL2RenderingContext::getExtension):
1826         (WebCore::WebGL2RenderingContext::getSupportedExtensions):
1827         * html/canvas/WebGLRenderingContext.cpp:
1828         (WebCore::WebGLRenderingContext::getExtension):
1829         (WebCore::WebGLRenderingContext::getSupportedExtensions):
1830         * html/canvas/WebGLRenderingContextBase.cpp:
1831         (WebCore::WebGLRenderingContextBase::allowPrivilegedExtensions):
1832         * html/canvas/WebGLRenderingContextBase.h:
1833         * page/Settings.in:
1834         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
1835         (WebCore::Extensions3DOpenGL::supportsExtension): Deleted.
1836
1837 2015-10-01  Jaehun Lim  <ljaehun.lim@samsung.com>
1838
1839         Unreviewed, fix build warning after r190434
1840
1841         Fix error: variable ‘interruption’ set but not used [-Werror=unused-but-set-variable]
1842
1843         * testing/Internals.cpp:
1844         (WebCore::Internals::beginMediaSessionInterruption):
1845
1846 2015-10-01  Dean Jackson  <dino@apple.com>
1847
1848         Expose WEBGL_debug_renderer_info
1849         https://bugs.webkit.org/show_bug.cgi?id=149735
1850         <rdar://problem/18343500>
1851
1852         Reviewed by Simon Fraser.
1853
1854         Enable the extension that allows content to query
1855         for the GPUs vendor and details.
1856
1857         Now that we're enabling this, there was no need for
1858         the internal setting that identified privileged situations.
1859         However, since this meant that WEBGL_debug_shaders was
1860         also exposed, I explicitly disable it since it is
1861         not yet conformant.
1862
1863         Test: fast/canvas/webgl/webgl-debug-renderer-info.html
1864         as well as the general conformance suite.
1865
1866         * html/canvas/WebGL2RenderingContext.cpp: No need to guard around allowPrivilegedExtensions().
1867         (WebCore::WebGL2RenderingContext::getExtension):
1868         (WebCore::WebGL2RenderingContext::getSupportedExtensions):
1869         * html/canvas/WebGLRenderingContext.cpp: Ditto.
1870         (WebCore::WebGLRenderingContext::getExtension):
1871         (WebCore::WebGLRenderingContext::getSupportedExtensions):
1872         * html/canvas/WebGLRenderingContextBase.cpp:
1873         (WebCore::WebGLRenderingContextBase::allowPrivilegedExtensions): Deleted.
1874         * html/canvas/WebGLRenderingContextBase.h:
1875         * page/Settings.in: Remove privilegedWebGLExtensions.
1876         * platform/graphics/opengl/Extensions3DOpenGL.cpp: Forbid the translated shader
1877         extension while it is still buggy.
1878         (WebCore::Extensions3DOpenGL::supportsExtension):
1879
1880 2015-10-01  Eric Carlson  <eric.carlson@apple.com>
1881
1882         [iOS] AirPlay should not stop when the screen locks
1883         https://bugs.webkit.org/show_bug.cgi?id=148315
1884         <rdar://problem/22770703>
1885
1886         Reviewed by Jer Noble.
1887
1888         Tested by media/video-interruption-with-resume-allowing-play.html
1889                   media/video-interruption-with-resume-not-allowing-play.html
1890
1891         * Modules/webaudio/AudioContext.h: overrideBackgroundPlaybackRestriction -> 
1892           shouldOverrideBackgroundPlaybackRestriction.
1893
1894         * html/HTMLMediaElement.cpp:
1895         (WebCore::HTMLMediaElement::suspendPlayback): Fix a typo in the logging.
1896         (WebCore::HTMLMediaElement::mayResumePlayback): Ditto.
1897         (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction): Renamed from
1898           overrideBackgroundPlaybackRestriction.
1899         (WebCore::HTMLMediaElement::overrideBackgroundPlaybackRestriction): Deleted.
1900         * html/HTMLMediaElement.h:
1901
1902         * platform/audio/PlatformMediaSession.cpp:
1903         (WebCore::stateName):
1904         (WebCore::interruptionName): New, log the name of the interruption.
1905         (WebCore::PlatformMediaSession::beginInterruption): Log the interruption type. Don't
1906           increment the interruption counter if we are going to ignore it. Incorporate logic
1907           from doInterruption.
1908         (WebCore::PlatformMediaSession::doInterruption): Deleted.
1909         (WebCore::PlatformMediaSession::shouldDoInterruption): Deleted.
1910         (WebCore::PlatformMediaSession::forceInterruption): Deleted.
1911
1912         * platform/audio/PlatformMediaSession.h: Add SuspendedUnderLock interruption type.
1913         * platform/audio/PlatformMediaSessionManager.cpp:
1914         (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground): Deleted.
1915         * platform/audio/PlatformMediaSessionManager.h:
1916
1917         * platform/audio/ios/MediaSessionManagerIOS.h:
1918         * platform/audio/ios/MediaSessionManagerIOS.mm:
1919         (WebCore::MediaSessionManageriOS::applicationDidEnterBackground): Call beginInterruption
1920           when appropriate.
1921
1922 2015-10-01  Ryosuke Niwa  <rniwa@webkit.org>
1923
1924         Slot elements should support fallback contents
1925         https://bugs.webkit.org/show_bug.cgi?id=149701
1926
1927         Reviewed by Antti Koivisto.
1928
1929         Following discussions on Github discussions [1] [2], we're adding the default rule of `display: contents`
1930         on slot elements and making slot elements render its children when there are no assigned nodes [3].
1931
1932         Make these changes by attaching renderers on direct-children of slot elements when there are no assigned
1933         nodes during render tree construction. Note `display: contents` will be aded in webkit.org/b/149439.
1934
1935         [1] https://github.com/w3c/webcomponents/issues/317
1936         [2] https://github.com/w3c/webcomponents/issues/308
1937         [3] https://github.com/w3c/webcomponents/issues/308#issuecomment-143655347
1938
1939         Tests: fast/shadow-dom/css-scoping-shadow-slot-fallback.html
1940                fast/shadow-dom/shadow-layout-after-slot-fallback-changes.html
1941
1942         * style/StyleResolveTree.cpp:
1943         (WebCore::Style::attachSlotAssignees):
1944         (WebCore::Style::detachSlotAssignees):
1945         (WebCore::Style::resolveSlotAssignees):
1946
1947 2015-10-01  Brent Fulgham  <bfulgham@apple.com>
1948
1949         Latch does not clear when a scroll snap animation is triggered
1950         https://bugs.webkit.org/show_bug.cgi?id=149681
1951         <rdar://problem/22733922>
1952
1953         Reviewed by Simon Fraser.
1954
1955         Test: tiled-drawing/scrolling/latched-div-with-scroll-snap.html
1956
1957         The scroll snap animation logic bypasses some of the normal clean-up code used
1958         for wheel event handling. When this happens, the scroll latching state is not
1959         cleared. In some cases this "stale" latch state is used when starting a new
1960         gesture in the same frame. This causes the wrong page element to receive the
1961         mouse wheel events, and hilarity ensues.
1962
1963         * page/mac/EventHandlerMac.mm:
1964         (WebCore::EventHandler::platformNotifyIfEndGesture): Clear latched state when
1965         ending the gesture.
1966
1967 2015-10-01  Brent Fulgham  <bfulgham@apple.com>
1968
1969         [Win] Unreviewed CMake build fixes.
1970
1971         * CMakeLists.txt: Match original Windows build flags for WebCoreTest.
1972         * PlatformAppleWin.cmake: Use the same build defines as the
1973         original Windows build.
1974
1975 2015-09-30  João Oliveira  <hello@jxs.pt>
1976
1977         Web Inspector: Adjust font size of Developer Tools using Command,+ or Command,-
1978         https://bugs.webkit.org/show_bug.cgi?id=149590
1979
1980         Reviewed by Joseph Pecoraro.
1981
1982         Patch by João Oliveira and Brian Burg.
1983
1984         Expose the frontend page's zoom factor so we can implement relative zoom.
1985
1986         * inspector/InspectorFrontendHost.cpp:
1987         (WebCore::InspectorFrontendHost::zoomFactor): Added.
1988         * inspector/InspectorFrontendHost.h:
1989         * inspector/InspectorFrontendHost.idl:
1990         * page/Frame.h:
1991         (WebCore::Frame::pageZoomFactor):
1992
1993 2015-10-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1994
1995         [GTK] Websites with invalid auth header keep loading forever
1996         https://bugs.webkit.org/show_bug.cgi?id=149710
1997
1998         Reviewed by Martin Robinson.
1999
2000         We don't correctly handle a null realm from the server when
2001         retrieving and storing credentials from libsecret. First
2002         secret_attributes_build() fails because we pass a null domain, and
2003         we pass null attributes to secret_service_search() that returns
2004         early on a g_return macro and the callback is never called so the
2005         load doesn't continue after the auth challenge.
2006
2007         * platform/network/gtk/CredentialBackingStore.cpp:
2008         (WebCore::createAttributeHashTableFromChallenge):
2009         (WebCore::CredentialBackingStore::credentialForChallenge):
2010         (WebCore::CredentialBackingStore::storeCredentialsForChallenge):
2011
2012 2015-10-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2013
2014         Refactor binding generator to factor JS DOM class m_impl handling
2015         https://bugs.webkit.org/show_bug.cgi?id=149660
2016
2017         Reviewed by Darin Adler.
2018
2019         Added JSDOMWrapperWithImplementation template class to move m_impl out of the binding generator.
2020         Updated custom bindings to use impl() instead of m_impl directly.
2021         Updated binding generator accordingly.
2022
2023         Covered by existing tests and binding tests.
2024
2025         * bindings/js/JSDOMStringMapCustom.cpp:
2026         (WebCore::JSDOMStringMap::getOwnPropertyNames):
2027         (WebCore::JSDOMStringMap::deleteProperty):
2028         * bindings/js/JSDOMWrapper.h:
2029         (WebCore::JSDOMWrapperWithImplementation::impl):
2030         (WebCore::JSDOMWrapperWithImplementation::~JSDOMWrapperWithImplementation):
2031         (WebCore::JSDOMWrapperWithImplementation::JSDOMWrapperWithImplementation):
2032         (WebCore::JSDOMWrapperWithImplementation::releaseImpl):
2033         * bindings/js/JSGeolocationCustom.cpp:
2034         (WebCore::JSGeolocation::getCurrentPosition):
2035         (WebCore::JSGeolocation::watchPosition):
2036         * bindings/js/JSSQLResultSetRowListCustom.cpp:
2037         (WebCore::JSSQLResultSetRowList::item):
2038         * bindings/js/JSSQLTransactionCustom.cpp:
2039         (WebCore::JSSQLTransaction::executeSql):
2040         * bindings/js/JSStorageCustom.cpp:
2041         (WebCore::JSStorage::deleteProperty):
2042         (WebCore::JSStorage::getOwnPropertyNames):
2043         * bindings/js/JSSubtleCryptoCustom.cpp:
2044         (WebCore::JSSubtleCrypto::encrypt):
2045         (WebCore::JSSubtleCrypto::decrypt):
2046         (WebCore::JSSubtleCrypto::sign):
2047         (WebCore::JSSubtleCrypto::verify):
2048         (WebCore::JSSubtleCrypto::wrapKey):
2049         (WebCore::JSSubtleCrypto::unwrapKey):
2050         * bindings/scripts/CodeGeneratorJS.pm:
2051         (GetParentClassName):
2052         (GetImplClassName):
2053         (GenerateHeader):
2054         (GenerateImplementation):
2055         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2056         (WebCore::JSTestActiveDOMObject::JSTestActiveDOMObject):
2057         (WebCore::JSTestActiveDOMObject::getOwnPropertySlot): Deleted.
2058         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
2059         (WebCore::JSTestActiveDOMObject::~JSTestActiveDOMObject):
2060         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2061         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::JSTestCustomConstructorWithNoInterfaceObject):
2062         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor): Deleted.
2063         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
2064         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::~JSTestCustomConstructorWithNoInterfaceObject):
2065         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::finishCreation): Deleted.
2066         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2067         (WebCore::JSTestCustomNamedGetter::JSTestCustomNamedGetter):
2068         (WebCore::JSTestCustomNamedGetter::getOwnPropertySlot): Deleted.
2069         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
2070         (WebCore::JSTestCustomNamedGetter::~JSTestCustomNamedGetter):
2071         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2072         (WebCore::JSTestEventConstructor::JSTestEventConstructor):
2073         (WebCore::jsTestEventConstructorAttr1): Deleted.
2074         * bindings/scripts/test/JS/JSTestEventConstructor.h:
2075         (WebCore::JSTestEventConstructor::~JSTestEventConstructor):
2076         (WebCore::JSTestEventConstructor::finishCreation): Deleted.
2077         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2078         (WebCore::JSTestEventTarget::JSTestEventTarget):
2079         (WebCore::JSTestEventTarget::getOwnPropertySlot): Deleted.
2080         * bindings/scripts/test/JS/JSTestEventTarget.h:
2081         (WebCore::JSTestEventTarget::~JSTestEventTarget):
2082         * bindings/scripts/test/JS/JSTestException.cpp:
2083         (WebCore::JSTestException::JSTestException):
2084         (WebCore::JSTestException::getOwnPropertySlot): Deleted.
2085         * bindings/scripts/test/JS/JSTestException.h:
2086         (WebCore::JSTestException::~JSTestException):
2087         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2088         (WebCore::JSTestGenerateIsReachable::JSTestGenerateIsReachable):
2089         (WebCore::jsTestGenerateIsReachableConstructor): Deleted.
2090         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
2091         (WebCore::JSTestGenerateIsReachable::~JSTestGenerateIsReachable):
2092         (WebCore::JSTestGenerateIsReachable::finishCreation): Deleted.
2093         * bindings/scripts/test/JS/JSTestInterface.cpp:
2094         (WebCore::JSTestInterface::JSTestInterface):
2095         (WebCore::JSTestInterface::getOwnPropertySlot): Deleted.
2096         * bindings/scripts/test/JS/JSTestInterface.h:
2097         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2098         (WebCore::jsTestJSBuiltinConstructorConstructor): Deleted.
2099         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
2100         (WebCore::JSTestJSBuiltinConstructor::~JSTestJSBuiltinConstructor):
2101         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2102         (WebCore::JSTestMediaQueryListListener::JSTestMediaQueryListListener):
2103         (WebCore::jsTestMediaQueryListListenerConstructor): Deleted.
2104         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
2105         (WebCore::JSTestMediaQueryListListener::~JSTestMediaQueryListListener):
2106         (WebCore::JSTestMediaQueryListListener::finishCreation): Deleted.
2107         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2108         (WebCore::JSTestNamedConstructor::JSTestNamedConstructor):
2109         (WebCore::jsTestNamedConstructorConstructor): Deleted.
2110         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
2111         (WebCore::JSTestNamedConstructor::~JSTestNamedConstructor):
2112         (WebCore::JSTestNamedConstructor::finishCreation): Deleted.
2113         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2114         (WebCore::JSTestNondeterministic::JSTestNondeterministic):
2115         (WebCore::jsTestNondeterministicNondeterministicReadonlyAttr): Deleted.
2116         * bindings/scripts/test/JS/JSTestNondeterministic.h:
2117         (WebCore::JSTestNondeterministic::~JSTestNondeterministic):
2118         (WebCore::JSTestNondeterministic::finishCreation): Deleted.
2119         * bindings/scripts/test/JS/JSTestObj.cpp:
2120         (WebCore::JSTestObj::JSTestObj):
2121         (WebCore::JSTestObj::getOwnPropertySlot): Deleted.
2122         * bindings/scripts/test/JS/JSTestObj.h:
2123         (WebCore::JSTestObj::~JSTestObj):
2124         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2125         (WebCore::JSTestOverloadedConstructors::JSTestOverloadedConstructors):
2126         (WebCore::jsTestOverloadedConstructorsConstructor): Deleted.
2127         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
2128         (WebCore::JSTestOverloadedConstructors::~JSTestOverloadedConstructors):
2129         (WebCore::JSTestOverloadedConstructors::finishCreation): Deleted.
2130         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2131         (WebCore::JSTestOverrideBuiltins::JSTestOverrideBuiltins):
2132         (WebCore::JSTestOverrideBuiltins::getOwnPropertySlot): Deleted.
2133         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
2134         (WebCore::JSTestOverrideBuiltins::~JSTestOverrideBuiltins):
2135         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2136         (WebCore::JSTestSerializedScriptValueInterface::JSTestSerializedScriptValueInterface):
2137         (WebCore::jsTestSerializedScriptValueInterfaceValue): Deleted.
2138         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
2139         (WebCore::JSTestSerializedScriptValueInterface::~JSTestSerializedScriptValueInterface):
2140         (WebCore::JSTestSerializedScriptValueInterface::finishCreation): Deleted.
2141         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2142         (WebCore::JSTestTypedefs::JSTestTypedefs):
2143         (WebCore::JSTestTypedefs::getOwnPropertySlot): Deleted.
2144         * bindings/scripts/test/JS/JSTestTypedefs.h:
2145         (WebCore::JSTestTypedefs::~JSTestTypedefs):
2146         * bindings/scripts/test/JS/JSattribute.cpp:
2147         (WebCore::JSattribute::JSattribute):
2148         (WebCore::jsattributeReadonly): Deleted.
2149         * bindings/scripts/test/JS/JSattribute.h:
2150         (WebCore::JSattribute::~JSattribute):
2151         (WebCore::JSattribute::finishCreation): Deleted.
2152         * bindings/scripts/test/JS/JSreadonly.cpp:
2153         (WebCore::JSreadonly::JSreadonly):
2154         (WebCore::jsreadonlyConstructor): Deleted.
2155         * bindings/scripts/test/JS/JSreadonly.h:
2156         (WebCore::JSreadonly::~JSreadonly):
2157         (WebCore::JSreadonly::finishCreation): Deleted.
2158
2159 2015-10-01  Csaba Osztrogonác  <ossy@webkit.org>
2160
2161         Fix the ARM build after r190192
2162         https://bugs.webkit.org/show_bug.cgi?id=149620
2163
2164         Reviewed by Darin Adler.
2165
2166         * platform/graphics/FontFeatureSettings.h:
2167         (WebCore::fontFeatureTag):
2168
2169 2015-10-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2170
2171         [Streams API] Add support for private WebCore JS builtins functions
2172         https://bugs.webkit.org/show_bug.cgi?id=149518
2173
2174         Reviewed by Darin Adler.
2175
2176         Using ReadableStream tee method as a testbed to add support for private WebCore JS builtins functions.
2177         Private functions are hooked to JSDOMWindowBase, as it is the one connected to WebCoreClientData.
2178         WebCoreClientData is responsible to export the private function symbols to the VM.
2179
2180         Updated generate-js-builtins script to generate a class that can create and own all JS functions.
2181         This class is used by JSDOMWindowBase to create the JS builtin functions.
2182         It is also used to manage the GC of these objects.
2183
2184         Covered by rebased tests.
2185
2186         * CMakeLists.txt: Adding ReadableStreamInternals builtin files.
2187         * DerivedSources.cpp: Ditto.
2188         * DerivedSources.make: Ditto.
2189         * Modules/streams/ReadableStream.idl: Adding tee declaration as builtin
2190         * Modules/streams/ReadableStream.js:
2191         (tee): Calling @teeReadableStream
2192         * Modules/streams/ReadableStreamInternals.js: Barebone @teeReadableStream implementation.
2193         (teeReadableStream):
2194         * WebCore.vcxproj/WebCore.vcxproj: Adding ReadableStreamInternals builtin files.
2195         * WebCore.xcodeproj/project.pbxproj: Adding ReadableStreamInternals builtin files.
2196         * bindings/js/JSDOMWindowBase.cpp:
2197         (WebCore::JSDOMWindowBase::JSDOMWindowBase): Creating ReadableStreamInternalsBuiltinFunctions object.
2198         (WebCore::JSDOMWindowBase::finishCreation): Creating builtin functions through ReadableStreamInternalsBuiltinFunctions and registering them to the JS engine.
2199         (WebCore::JSDOMWindowBase::visitChildren): Ensuring GC does not collect private builtin functions through ReadableStreamInternalsBuiltinFunctions object
2200         * bindings/js/JSDOMWindowBase.h:
2201         * bindings/js/WebCoreJSClientData.h:
2202         (WebCore::WebCoreJSClientData::WebCoreJSClientData): Exporting private names of ReadableStreamInternalsBuiltins
2203         (WebCore::WebCoreJSClientData::readableStreamBuiltins):
2204         (WebCore::WebCoreJSClientData::readableStreamInternalsBuiltins):
2205         * generate-js-builtins: Adding support for ReadableStreamInternalsBuiltinFunctions and exportNames.
2206
2207 2015-10-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2208
2209         Binding generator should make mutable CachedAttribute member fields
2210         https://bugs.webkit.org/show_bug.cgi?id=148056
2211
2212         Reviewed by Chris Dumez.
2213
2214         Making mutable CachedAttribute member fields.
2215         Removing const_cast from custom binding code.
2216         Rebased bindings tests.
2217
2218         No change in behavior.
2219
2220         * bindings/js/JSHistoryCustom.cpp:
2221         (WebCore::JSHistory::state):
2222         * bindings/js/JSMessageEventCustom.cpp:
2223         (WebCore::JSMessageEvent::data):
2224         * bindings/js/JSPopStateEventCustom.cpp:
2225         (WebCore::cacheState):
2226         (WebCore::JSPopStateEvent::state):
2227         * bindings/js/JSReadableStreamReaderEventCustom.cpp:
2228         (WebCore::JSReadableStreamReader::closed):
2229         * bindings/js/JSXMLHttpRequestCustom.cpp:
2230         (WebCore::JSXMLHttpRequest::response):
2231         * bindings/scripts/CodeGeneratorJS.pm:
2232         (GenerateHeader):
2233         * bindings/scripts/test/JS/JSTestObj.h:
2234         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
2235
2236 2015-10-01  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2237
2238         [Streams API] Create ByteLengthQueuingStrategy object as per spec
2239         https://bugs.webkit.org/show_bug.cgi?id=147153
2240
2241         Reviewed by Darin Adler.
2242
2243         Added ByteLengthQueuingStream class as the spec defines at https://streams.spec.whatwg.org/#blqs-class.
2244
2245         Tests are covered by current set.
2246
2247         * CMakeLists.txt:
2248         * DerivedSources.cpp:
2249         * DerivedSources.make:
2250         * WebCore.vcxproj/WebCore.vcxproj:
2251         * WebCore.vcxproj/WebCore.vcxproj.filters:
2252         * WebCore.xcodeproj/project.pbxproj:
2253         * bindings/js/WebCoreJSBuiltins.cpp: Added build instructions.
2254         * Modules/streams/ByteLengthQueuingStrategy.idl: Added.
2255         * Modules/streams/ByteLengthQueuingStrategy.js: Copied from Source/WebCore/bindings/js/WebCoreJSBuiltins.cpp.
2256         (size): Return byteLength attribute of the chunk.
2257         (initializeByteLengthQueuingStrategy): Initialize the highWaterMark property.
2258         * bindings/js/WebCoreJSClientData.h:
2259         (WebCore::WebCoreJSClientData::WebCoreJSClientData): Initialize the blqs builtins.
2260         (WebCore::WebCoreJSClientData::byteLengthQueuingStrategyBuiltins): Return the attribute.
2261
2262 2015-10-01  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2263
2264         Clean up all uses of PassRefPtr in Modules/geolocation
2265         https://bugs.webkit.org/show_bug.cgi?id=149552
2266
2267         Reviewed by Darin Adler.
2268
2269         * Modules/geolocation/GeoNotifier.cpp:
2270         (WebCore::GeoNotifier::GeoNotifier):
2271         (WebCore::GeoNotifier::setFatalError):
2272         * Modules/geolocation/GeoNotifier.h:
2273         (WebCore::GeoNotifier::create):
2274         * Modules/geolocation/Geolocation.cpp:
2275         (WebCore::createGeoposition):
2276         (WebCore::createPositionError):
2277         (WebCore::Geolocation::Watchers::add):
2278         (WebCore::Geolocation::getCurrentPosition):
2279         (WebCore::Geolocation::watchPosition):
2280         (WebCore::Geolocation::startRequest):
2281         * Modules/geolocation/Geolocation.h:
2282         * Modules/geolocation/GeolocationError.h:
2283         * Modules/geolocation/GeolocationPosition.h:
2284         * Modules/geolocation/Geoposition.h:
2285         (WebCore::Geoposition::create):
2286         (WebCore::Geoposition::isolatedCopy):
2287         (WebCore::Geoposition::Geoposition):
2288         * Modules/geolocation/PositionError.h:
2289         * Modules/geolocation/PositionOptions.h:
2290
2291 2015-09-30  Hunseop Jeong  <hs85.jeong@samsung.com>
2292
2293         [EFL][Gtk] Try to fix the build after r190379.
2294         https://bugs.webkit.org/show_bug.cgi?id=149693
2295
2296         Reviewed by Gyuyoung Kim.
2297
2298         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
2299
2300 2015-09-30  Katlyn Graff  <kgraff@apple.com>
2301
2302         Add support for the imageSmoothingQuality property for CanvasRenderingContext2D.
2303         https://bugs.webkit.org/show_bug.cgi?id=149541
2304
2305         Reviewed by Ryosuke Niwa.
2306
2307         As documented here: https://html.spec.whatwg.org/multipage/scripting.html#image-smoothing
2308         Exposes the smooothing quality of algorithms used for scaling images. Valid input
2309         values are low, medium, and high: associated algorithms are expected to vary for
2310         differing hardware. setImageSmoothingQuality provides a handle into CGInterpolationQuality.
2311
2312         Test: fast/canvas/canvas-imageSmoothingQuality.html
2313
2314         * html/canvas/CanvasRenderingContext2D.cpp:
2315         (WebCore::CanvasRenderingContext2D::State::State):
2316         (WebCore::CanvasRenderingContext2D::State::operator=):
2317         (WebCore::smoothingToInterpolationQuality):
2318         (WebCore::CanvasRenderingContext2D::imageSmoothingQuality):
2319         (WebCore::CanvasRenderingContext2D::setImageSmoothingQuality):
2320         (WebCore::CanvasRenderingContext2D::setImageSmoothingEnabled):
2321         * html/canvas/CanvasRenderingContext2D.h:
2322         * html/canvas/CanvasRenderingContext2D.idl:
2323
2324 2015-09-30  Dean Jackson  <dino@apple.com>
2325
2326         GraphicsContext3D::mappedSymbolName should initialize count variable
2327         https://bugs.webkit.org/show_bug.cgi?id=149692
2328         <rdar://problem/22871304>
2329
2330         Reviewed by Simon Fraser.
2331
2332         While debugging another WebGL issue, I noticed that some
2333         OpenGL renderers can get into a state where they
2334         drop resources (e.g. a GPU reset). If we don't detect that
2335         in time, we might try to ask for the currently attached
2336         resources and our in-parameter will not be set. In this
2337         case, initialize it to zero so that we don't do silly things.
2338
2339         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2340         (WebCore::GraphicsContext3D::mappedSymbolName): Initialize count to 0.
2341
2342 2015-09-30  Dean Jackson  <dino@apple.com>
2343
2344         Crash in gleLookupHashObject when context is lost
2345         https://bugs.webkit.org/show_bug.cgi?id=149690
2346         <rdar://problem/22751585>
2347         <rdar://problem/22465495>
2348
2349         Reviewed by Simon Fraser.
2350
2351         When we received notification that the GPU has reset,
2352         we were nulling out and deleting our OpenGL contexts
2353         and then trying to do it all over again. The fix was
2354         to flip the order of operations.
2355
2356         While there I added some logging, and changed the
2357         way we check GPU status to make sure we do a check
2358         after the first draw call.
2359
2360         Unfortunately we can't test automatically because it
2361         involves resetting the GPU which can possibly cause
2362         concurrent tests to fail.
2363
2364         * platform/graphics/mac/GraphicsContext3DMac.mm:
2365         (WebCore::GraphicsContext3D::checkGPUStatusIfNecessary): Move forceContextLost()
2366         to be the first thing we do after we've realised we need to
2367         bail.
2368
2369 2015-09-30  Brady Eidson  <beidson@apple.com>
2370
2371         Add UniqueIDBDatabase object, IDBBackingStore objects, and a database operation thread.
2372         https://bugs.webkit.org/show_bug.cgi?id=149678
2373
2374         Reviewed by Alex Christensen.
2375
2376         Test: storage/indexeddb/modern/opendatabase-request-event.html
2377
2378         - UniqueIDBDatabase represents a specific IDB database instance that can have multiple 
2379           connections to it.
2380         - IDBBackingStore is an abstract representation of a unique database's backing store, 
2381           and has a concrete in-memory implementation for now.
2382         - The database thread exists on IDBServer and is for offloading actual database I/O from 
2383           the main thread.
2384
2385         * CMakeLists.txt:
2386
2387         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
2388         (WebCore::IDBDatabaseIdentifier::isolatedCopy):
2389         * Modules/indexeddb/IDBDatabaseIdentifier.h:
2390
2391         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
2392         (WebCore::IDBClient::IDBConnectionToServer::openDatabase):
2393         (WebCore::IDBClient::IDBConnectionToServer::didOpenDatabase):
2394         * Modules/indexeddb/client/IDBConnectionToServer.h:
2395         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
2396
2397         * Modules/indexeddb/client/IDBFactoryImpl.cpp:
2398         (WebCore::IDBClient::IDBFactory::openInternal):
2399
2400         * Modules/indexeddb/server/IDBBackingStore.h: Copied from Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h.
2401         (WebCore::IDBServer::IDBBackingStore::~IDBBackingStore):
2402
2403         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
2404         (WebCore::IDBServer::IDBConnectionToClient::didOpenDatabase):
2405         * Modules/indexeddb/server/IDBConnectionToClient.h:
2406         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
2407
2408         * Modules/indexeddb/server/IDBServer.cpp:
2409         (WebCore::IDBServer::IDBServer::IDBServer):
2410         (WebCore::IDBServer::IDBServer::getOrCreateUniqueIDBDatabase):
2411         (WebCore::IDBServer::IDBServer::createBackingStore):
2412         (WebCore::IDBServer::IDBServer::openDatabase):
2413         (WebCore::IDBServer::IDBServer::deleteDatabase):
2414         (WebCore::IDBServer::IDBServer::postDatabaseTask):
2415         (WebCore::IDBServer::IDBServer::postDatabaseTaskReply):
2416         (WebCore::IDBServer::IDBServer::databaseThreadEntry):
2417         (WebCore::IDBServer::IDBServer::databaseRunLoop):
2418         (WebCore::IDBServer::IDBServer::handleTaskRepliesOnMainThread):
2419         * Modules/indexeddb/server/IDBServer.h:
2420
2421         * Modules/indexeddb/server/IDBServerOperation.cpp: Copied from Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h.
2422         (WebCore::IDBServer::IDBServerOperation::create):
2423         (WebCore::IDBServer::IDBServerOperation::IDBServerOperation):
2424         * Modules/indexeddb/server/IDBServerOperation.h: Copied from Source/WebCore/Modules/indexeddb/server/IDBServer.h.
2425         (WebCore::IDBServer::IDBServerOperation::connection):
2426         (WebCore::IDBServer::IDBServerOperation::requestData):
2427
2428         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp: Copied from Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp.
2429         (WebCore::IDBServer::MemoryIDBBackingStore::create):
2430         (WebCore::IDBServer::MemoryIDBBackingStore::MemoryIDBBackingStore):
2431         (WebCore::IDBServer::MemoryIDBBackingStore::~MemoryIDBBackingStore):
2432         (WebCore::IDBServer::MemoryIDBBackingStore::getOrEstablishDatabaseInfo):
2433         * Modules/indexeddb/server/MemoryIDBBackingStore.h: Copied from Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h.
2434
2435         * Modules/indexeddb/server/UniqueIDBDatabase.cpp: Added.
2436         (WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
2437         (WebCore::IDBServer::UniqueIDBDatabase::openDatabaseConnection):
2438         (WebCore::IDBServer::UniqueIDBDatabase::handleOpenDatabaseOperations):
2439         (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
2440         (WebCore::IDBServer::UniqueIDBDatabase::didOpenBackingStore):
2441         * Modules/indexeddb/server/UniqueIDBDatabase.h: Copied from Source/WebCore/Modules/indexeddb/server/IDBServer.h.
2442         (WebCore::IDBServer::UniqueIDBDatabase::create):
2443
2444         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h.
2445         (WebCore::IDBDatabaseInfo::IDBDatabaseInfo):
2446         (WebCore::IDBDatabaseInfo::isolatedCopy):
2447         * Modules/indexeddb/shared/IDBDatabaseInfo.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h.
2448         (WebCore::IDBDatabaseInfo::IDBDatabaseInfo):
2449
2450         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
2451         (WebCore::InProcessIDBServer::didDeleteDatabase):
2452         (WebCore::InProcessIDBServer::openDatabase):
2453         (WebCore::InProcessIDBServer::didOpenDatabase):
2454         * Modules/indexeddb/shared/InProcessIDBServer.h:
2455
2456         * WebCore.xcodeproj/project.pbxproj:
2457
2458         * platform/CrossThreadCopier.cpp:
2459         (WebCore::IDBDatabaseInfo>::copy):
2460         (WebCore::IDBDatabaseIdentifier>::copy):
2461         * platform/CrossThreadCopier.h:
2462
2463 2015-09-30  Myles C. Maxfield  <mmaxfield@apple.com>
2464
2465         Crash when using an SVG font with > 390 glyphs
2466         https://bugs.webkit.org/show_bug.cgi?id=149677
2467         <rdar://problem/21676402>
2468
2469         Reviewed by Simon Fraser.
2470
2471         The "Charset Index" in OTF are indices into a collection of strings. There are
2472         390 predefined strings in this collection. We were currently assigning each
2473         glyph to one of these strings. However, if there are more glyphs than strings,
2474         we will be using invalid indices.
2475
2476         The values of the strings themselves are not necessary for SVG fonts. Therefore,
2477         the solution is to create a single dummy string, and have all glyphs target it.
2478
2479         Tests: svg/custom/many-glyphs.svg
2480
2481         * css/CSSFontFaceSource.cpp:
2482         (WebCore::CSSFontFaceSource::font):
2483         * svg/SVGToOTFFontConversion.cpp:
2484         (WebCore::SVGToOTFFontConverter::appendCFFTable):
2485
2486 2015-09-30  Chris Dumez  <cdumez@apple.com>
2487
2488         Unreviewed, roll out r188331: "NetworkProcess: DNS prefetch happens in the Web Process"
2489         <rdar://problem/22560715>
2490
2491         Speculative roll out of r188331 as we had a ~2.5% PLT regression around
2492         the time it landed and it seems the most likely culprit. I'll reland if
2493         the perf bots do not recover after the roll out.
2494
2495         * html/HTMLAnchorElement.cpp:
2496         (WebCore::HTMLAnchorElement::parseAttribute):
2497         * loader/FrameLoaderClient.h:
2498         * loader/LinkLoader.cpp:
2499         (WebCore::LinkLoader::loadLink):
2500         * page/Chrome.cpp:
2501         (WebCore::Chrome::mouseDidMoveOverElement):
2502
2503 2015-09-30  Timothy Horton  <timothy_horton@apple.com>
2504
2505         Compute document marker rects at use time instead of paint time
2506         https://bugs.webkit.org/show_bug.cgi?id=149643
2507
2508         Reviewed by Darin Adler.
2509
2510         * dom/DocumentMarkerController.cpp:
2511         (WebCore::DocumentMarkerController::DocumentMarkerController):
2512         (WebCore::DocumentMarkerController::detach):
2513         Store and zero the Document backpointer.
2514
2515         (WebCore::DocumentMarkerController::addMarker):
2516         (WebCore::DocumentMarkerController::addTextMatchMarker):
2517         (WebCore::DocumentMarkerController::addDictationPhraseWithAlternativesMarker):
2518         (WebCore::DocumentMarkerController::addDictationResultMarker):
2519         (WebCore::DocumentMarkerController::copyMarkers):
2520         Remove some useless comments.
2521
2522         (WebCore::updateRenderedRectsForMarker):
2523         Use Range to compute the (unclipped, absolute) text rects, and store them
2524         on the RenderedDocumentMarker.
2525
2526         (WebCore::DocumentMarkerController::invalidateRectsForAllMarkers):
2527         (WebCore::DocumentMarkerController::invalidateRectsForMarkersInNode):
2528         Mark the relevant markers' rects as invalid, and notify the ChromeClient.
2529
2530         (WebCore::DocumentMarkerController::updateRectsForInvalidatedMarkersOfType):
2531         Run through all markers, computing rects for ones that don't have valid rects.
2532         We will do layout (once) if necessary. However, this is most commonly
2533         called from a place where layout should already be up to date, so this
2534         should not happen often. updateRenderedRectsForMarker also asserts
2535         that layout is up to date.
2536
2537         (WebCore::DocumentMarkerController::renderedRectsForMarkers):
2538         Retrieve all markers of the given type, clip them by overflow clip and
2539         frame clip, and return them to the caller.
2540
2541         (WebCore::DocumentMarkerController::addMarker):
2542         (WebCore::DocumentMarkerController::markerContainingPoint):
2543         (WebCore::DocumentMarkerController::markersFor):
2544         (WebCore::DocumentMarkerController::repaintMarkers):
2545         (WebCore::DocumentMarkerController::shiftMarkers):
2546         (DocumentMarkerController::setMarkersActive):
2547         (DocumentMarkerController::hasMarkers):
2548         Modern iteration.
2549         
2550         (WebCore::DocumentMarkerController::invalidateRenderedRectsForMarkersInRect): Deleted.
2551         * dom/DocumentMarkerController.h:
2552
2553         * dom/Document.cpp:
2554         (WebCore::Document::Document):
2555         Pass the Document to the DocumentMarkerController.
2556
2557         * dom/RenderedDocumentMarker.h:
2558         (WebCore::RenderedDocumentMarker::contains):
2559         (WebCore::RenderedDocumentMarker::setUnclippedAbsoluteRects):
2560         (WebCore::RenderedDocumentMarker::unclippedAbsoluteRects):
2561         (WebCore::RenderedDocumentMarker::invalidate):
2562         (WebCore::RenderedDocumentMarker::isValid):
2563         (WebCore::RenderedDocumentMarker::addRenderedRect): Deleted.
2564         (WebCore::RenderedDocumentMarker::renderedRects): Deleted.
2565         Instead of keeping "rendered" rects, keep unclipped rects in absolute
2566         document coordinates. Invalidation will happen wholesale instead of
2567         based on dirty rects, because computation no longer happens at paint
2568         time, so it's safe to throw all of the rects away.
2569         Keep track of whether we have valid rects or not.
2570
2571         * editing/Editor.cpp:
2572         (WebCore::Editor::countMatchesForText):
2573         We don't need to do a fake whole-document paint just to compute the
2574         document marker rects. They are computed on demand, using layout information
2575         instead of paint-time information.
2576
2577         * page/ChromeClient.h:
2578         Remove an unnecessary semicolon.
2579         Add didInvalidateDocumentMarkerRects, which DocumentMarkerController
2580         will call whenever document marker rects are invalidated (and when e.g.
2581         the find holes PageOverlay should repaint itself).
2582
2583         * page/FrameView.cpp:
2584         (WebCore::FrameView::layout):
2585         Invalidate document marker's layout-computed rects after layout is complete.
2586         They'll be lazily recomputed when next requested.
2587
2588         (WebCore::FrameView::willPaintContents):
2589         Remove the pre-painting invalidation of document marker rects.
2590
2591         * rendering/InlineTextBox.cpp:
2592         (WebCore::InlineTextBox::paintTextMatchMarker):
2593         (WebCore::InlineTextBox::paintDocumentMarker): Deleted.
2594         (WebCore::InlineTextBox::computeRectForReplacementMarker): Deleted.
2595         (WebCore::InlineTextBox::paintDocumentMarkers): Deleted.
2596         Don't bother computing rendered rects for document markers at paint time.
2597         Just do the actual painting work (which, for replacement markers, is
2598         nothing at all).
2599
2600         * rendering/InlineTextBox.h:
2601         * rendering/RenderLayer.cpp:
2602         (WebCore::RenderLayer::updateLayerPositions):
2603         (WebCore::RenderLayer::updateLayerPositionsAfterScroll):
2604         When RenderLayers move, invalidate document marker rects.
2605
2606         * rendering/svg/SVGInlineFlowBox.cpp:
2607         (WebCore::SVGInlineFlowBox::paint):
2608         (WebCore::SVGInlineFlowBox::computeTextMatchMarkerRectForRenderer): Deleted.
2609         * rendering/svg/SVGInlineFlowBox.h:
2610         * rendering/svg/SVGRootInlineBox.cpp:
2611         (WebCore::SVGRootInlineBox::paint):
2612         Don't bother computing rendered rects for document markers at paint time.
2613
2614         * testing/Internals.cpp:
2615         (WebCore::markerTypeFrom):
2616         (WebCore::markerTypesFrom):
2617         Add markerTypeFrom, which returns MarkerType enum values for the input string
2618         instead of a MarkerTypes class.
2619
2620         (WebCore::Internals::dumpMarkerRects):
2621         Dump all markers for the given type, and request them from DocumentMarkerController
2622         instead of from the RenderedDocumentMarker, because we want fully clipped
2623         rects, which can only be obtained from DocumentMarkerController.
2624
2625         * editing/FrameSelection.cpp:
2626         (WebCore::FrameSelection::getTextRectangles):
2627         Avoid enclosing unnecessarily, to avoid inflating zero-width text rects
2628         to have a non-zero width. Callers appear to be OK with non-integral positions.
2629
2630         * testing/Internals.h:
2631         * testing/Internals.idl:
2632
2633 2015-09-30  Eric Carlson  <eric.carlson@apple.com>
2634
2635         REGRESSION(r190262): User media unit test failures after r190262
2636         https://bugs.webkit.org/show_bug.cgi?id=149580
2637
2638         Reviewed by Darin Adler.
2639
2640         * Modules/mediastream/RTCPeerConnection.cpp:
2641         (WebCore::RTCPeerConnection::getStats): Drive-by fix to deal with optional param.
2642
2643         * Modules/mediastream/UserMediaRequest.cpp:
2644         (WebCore::UserMediaRequest::constraintsValidated): Swap the track parameter order.
2645         * Modules/mediastream/UserMediaRequest.h:
2646
2647         * platform/mediastream/MediaStreamCreationClient.h:
2648         (WebCore::MediaStreamCreationClient::validateRequestConstraints): Swap the track parameter order.
2649
2650         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
2651         (WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints): If there is no 
2652           constraint for a media type, don't return a device of that type.
2653
2654         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
2655         (WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable): Ditto.
2656
2657         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
2658         (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints): Ditto.
2659
2660         * platform/mock/TimerEventBasedMock.h:
2661         (WebCore::TimerEvent::~TimerEvent): Clear the m_mock pointer.
2662
2663         * platform/mock/UserMediaClientMock.h:
2664         (WebCore::UserMediaClientMock::fire): Deal with empty device vectors.
2665
2666         * testing/Internals.cpp:
2667         (WebCore::Internals::Internals): Don't register UserMediaController, it isn't needed for
2668           WKTR.
2669
2670 2015-09-29  Antti Koivisto  <antti@apple.com>
2671
2672         Use separate style resolver for user agent shadow trees
2673         https://bugs.webkit.org/show_bug.cgi?id=149626
2674
2675         Reviewed by Andreas Kling.
2676
2677         We now support separate style resolvers for shadow trees. Use this mechanism to have a separate
2678         per-document style resolver for user agent shadow trees. This isolates user agent shadow trees
2679         from author style better and simplifies the style resolver. It can also avoid some unnecessary style recalcs.
2680
2681         * css/DocumentRuleSets.cpp:
2682         (WebCore::DocumentRuleSets::resetAuthorStyle):
2683         (WebCore::DocumentRuleSets::appendAuthorStyleSheets):
2684
2685             Change interface so that only the new rules are provided.
2686
2687         * css/DocumentRuleSets.h:
2688         * css/ElementRuleCollector.cpp:
2689         (WebCore::ElementRuleCollector::addElementStyleProperties):
2690         (WebCore::ElementRuleCollector::collectMatchingRules):
2691
2692             We can remove special bailout as shadow tree style resolver won't have other author style
2693
2694         (WebCore::ElementRuleCollector::sortAndTransferMatchedRules):
2695
2696             Remove the exception that disables property whitelists for UA stylesheets. We don't seem to use the feature.
2697
2698         (WebCore::ElementRuleCollector::matchUARules):
2699         (WebCore::MatchingUARulesScope::MatchingUARulesScope): Deleted.
2700         (WebCore::MatchingUARulesScope::~MatchingUARulesScope): Deleted.
2701         (WebCore::MatchingUARulesScope::isMatchingUARules): Deleted.
2702
2703             Remove this unnecessary hack.
2704
2705         * css/ElementRuleCollector.h:
2706         (WebCore::ElementRuleCollector::ElementRuleCollector):
2707         * css/RuleSet.cpp:
2708         (WebCore::RuleSet::addStyleRule):
2709         (WebCore::RuleSet::copyShadowPseudoElementRulesFrom):
2710
2711             Also copy WebVTT rules. They are currently a sort of mixture of UA and author shadow tree.
2712
2713         (WebCore::shrinkMapVectorsToFit):
2714         * css/RuleSet.h:
2715         (WebCore::RuleData::containsUncommonAttributeSelector):
2716         (WebCore::RuleData::linkMatchType):
2717         (WebCore::RuleData::hasDocumentSecurityOrigin):
2718         (WebCore::RuleData::propertyWhitelistType):
2719         (WebCore::RuleData::descendantSelectorIdentifierHashes):
2720         (WebCore::RuleSet::ruleCount):
2721         (WebCore::RuleSet::hasShadowPseudoElementRules):
2722         * css/StyleInvalidationAnalysis.cpp:
2723         (WebCore::StyleInvalidationAnalysis::StyleInvalidationAnalysis):
2724         (WebCore::StyleInvalidationAnalysis::invalidateIfNeeded):
2725
2726             Don't invalidate the whole tree when author shadow pseudo element rules change. Just invalidate the shadow trees.
2727
2728         (WebCore::StyleInvalidationAnalysis::invalidateStyleForTree):
2729         (WebCore::StyleInvalidationAnalysis::invalidateStyle):
2730         (WebCore::invalidateIfNeeded): Deleted.
2731         (WebCore::invalidateStyleForTree): Deleted.
2732         * css/StyleInvalidationAnalysis.h:
2733         (WebCore::StyleInvalidationAnalysis::dirtiesAllStyle):
2734         (WebCore::StyleInvalidationAnalysis::hasShadowPseudoElementRulesInAuthorSheet):
2735         * css/StyleResolver.cpp:
2736         (WebCore::StyleResolver::MatchResult::addMatchedProperties):
2737         (WebCore::StyleResolver::StyleResolver):
2738         (WebCore::StyleResolver::appendAuthorStyleSheets):
2739
2740             Simpler interface.
2741
2742         * css/StyleResolver.h:
2743         (WebCore::StyleResolver::document):
2744         (WebCore::StyleResolver::documentSettings):
2745         (WebCore::StyleResolver::ruleSets):
2746         * dom/AuthorStyleSheets.cpp:
2747         (WebCore::AuthorStyleSheets::collectActiveStyleSheets):
2748         (WebCore::AuthorStyleSheets::analyzeStyleSheetChange):
2749
2750             Cleanups.
2751
2752         (WebCore::filterEnabledNonemptyCSSStyleSheets):
2753         (WebCore::AuthorStyleSheets::updateActiveStyleSheets):
2754         (WebCore::AuthorStyleSheets::updateStyleResolver):
2755
2756             Factor to a function.
2757             Copy any author shadow pseudo elements to user agent shadow tree resolver.
2758
2759         (WebCore::AuthorStyleSheets::activeStyleSheetsForInspector):
2760         * dom/AuthorStyleSheets.h:
2761         * dom/Document.cpp:
2762         (WebCore::Document::createStyleResolver):
2763         (WebCore::Document::userAgentShadowTreeStyleResolver):
2764
2765             Use separate resolver.
2766
2767         (WebCore::Document::fontsNeedUpdate):
2768         (WebCore::Document::clearStyleResolver):
2769         * dom/Document.h:
2770         (WebCore::Document::ensureStyleResolver):
2771         * dom/ShadowRoot.cpp:
2772         (WebCore::ShadowRoot::styleResolver):
2773
2774             Return document-global shadow tree resolver for ua trees.
2775
2776         * style/StyleResolveTree.cpp:
2777         (WebCore::Style::resolveShadowTree):
2778
2779             Take styleChange of shadow root into account.
2780
2781 2015-09-30  Gwang Yoon Hwang  <yoon@igalia.com>
2782
2783         [GTK] Support HiDPI Properly in WebKitGtk+ with the TextureMapper
2784         https://bugs.webkit.org/show_bug.cgi?id=141782
2785
2786         Reviewed by Carlos Garcia Campos.
2787
2788         This patch fixes HiDPI issue in the TextureMapper.
2789         To support HiDPI in the TextureMapper, we need to draw scaled contents
2790         in the TextureMapperTile, and apply the global scale in the root layer
2791         to apply transforms correctly.
2792
2793         Supporting the device scale is handled at LayerTreeHostGtk and
2794         TextureMapperBackingStore, and GraphicsLayerTextureMapper doesn't handle
2795         the device scale directly.
2796
2797         From the TextureMapperLayer, deviceScale and pageScale do not have to be
2798         handled differently. These are multiplied and provided to
2799         TextureMapperBackingStore.
2800
2801         * platform/graphics/texmap/TextureMapperTile.cpp:
2802         (WebCore::TextureMapperTile::updateContents):
2803         * platform/graphics/texmap/TextureMapperTile.h:
2804         * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
2805
2806             Modified to increase the cover rect for tiles creation. For the image
2807             contents, it just creates texture with a image size, regardless of the
2808             contents scale.
2809
2810         * platform/graphics/texmap/BitmapTexture.cpp:
2811         (WebCore::BitmapTexture::updateContents):
2812
2813             Apply the device scale to the graphics context before painting contents.
2814
2815         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2816         (WebCore::GraphicsLayerTextureMapper::setContentsToImage):
2817         (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded):
2818
2819             Apply the device scale and the page scale to the backing store
2820
2821 2015-09-29  Ryosuke Niwa  <rniwa@webkit.org>
2822
2823         ASSERTION FAILED: !isUnreachableNode(m_target.get()) when hovering over any input element
2824         https://bugs.webkit.org/show_bug.cgi?id=149589
2825
2826         Reviewed by Darin Adler.
2827
2828         The bug was caused by target not being reset across shadow boundary when SHADOW_DOM was disabled.
2829
2830         No new tests since exiting tests cover this in debug builds. e.g. editing/deleting/5290534.html
2831
2832         * dom/EventDispatcher.cpp:
2833         (WebCore::EventPath::EventPath):
2834
2835 2015-09-29  Jon Honeycutt  <jhoneycutt@apple.com>
2836
2837         Avoid reparsing an XSLT stylesheet after the first failure.
2838         https://bugs.webkit.org/show_bug.cgi?id=149188
2839         <rdar://problem/22709912>
2840
2841         Reviewed by Dave Hyatt.
2842
2843         Patch by Jiewen Tan, jiewen_tan@apple.com.
2844
2845         Test: svg/custom/invalid-xslt-crash.svg
2846
2847         * xml/XSLStyleSheet.h:
2848         Add a new member variable m_compilationFailed that tracks whether
2849         compilation has failed. Default value is false.
2850
2851         * xml/XSLStyleSheetLibxslt.cpp:
2852         (WebCore::XSLStyleSheet::compileStyleSheet):
2853         Return early if the compilation has failed before. After compiling the
2854         style sheet, if we failed, set m_compilationFailed to true.
2855
2856 2015-09-29  Hunseop Jeong  <hs85.jeong@samsung.com>
2857
2858         Use modern for-loops in WebCore/loader.
2859         https://bugs.webkit.org/show_bug.cgi?id=149397
2860
2861         Reviewed by Darin Adler.
2862
2863         No new tests because there is no behavior change.
2864
2865         * loader/CrossOriginAccessControl.cpp:
2866         (WebCore::parseAccessControlExposeHeadersAllowList):
2867         * loader/DocumentLoader.cpp:
2868         (WebCore::DocumentLoader::substituteResourceDeliveryTimerFired):
2869         * loader/FormSubmission.cpp:
2870         (WebCore::FormSubmission::create):
2871         * loader/FrameLoader.cpp:
2872         (WebCore::FrameLoader::~FrameLoader):
2873         (WebCore::FrameLoader::commitProvisionalLoad):
2874         (WebCore::FrameLoader::detachChildren):
2875         (WebCore::FrameLoader::shouldClose):
2876         (WebCore::FrameLoader::tellClientAboutPastMemoryCacheLoads):
2877         * loader/HistoryController.cpp:
2878         (WebCore::HistoryController::currentFramesMatchItem):
2879         * loader/SubframeLoader.cpp:
2880         (WebCore::findPluginMIMETypeFromURL):
2881         (WebCore::SubframeLoader::createJavaAppletWidget):
2882         * loader/appcache/ApplicationCache.cpp:
2883         (WebCore::ApplicationCache::isURLInOnlineWhitelist):
2884         (WebCore::ApplicationCache::urlMatchesFallbackNamespace):
2885         * loader/appcache/ApplicationCacheGroup.cpp:
2886         (WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
2887         (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
2888         (WebCore::ApplicationCacheGroup::postListenerTask):
2889         * loader/appcache/ApplicationCacheHost.cpp:
2890         (WebCore::ApplicationCacheHost::stopDeferringEvents):
2891         * loader/appcache/ApplicationCacheStorage.cpp:
2892         (WebCore::StorageIDJournal::~StorageIDJournal):
2893         (WebCore::ApplicationCacheStorage::store):
2894         (WebCore::ApplicationCacheStorage::getOriginsWithCache):
2895         * loader/archive/Archive.cpp:
2896         (WebCore::Archive::clearAllSubframeArchivesImpl):
2897         * loader/archive/ArchiveResourceCollection.cpp:
2898         (WebCore::ArchiveResourceCollection::addAllResources):
2899         * loader/archive/cf/LegacyWebArchive.cpp:
2900         (WebCore::LegacyWebArchive::createPropertyListRepresentation):
2901         (WebCore::LegacyWebArchive::create):
2902         * loader/archive/mhtml/MHTMLArchive.cpp:
2903         (WebCore::MHTMLArchive::generateMHTMLData):
2904         * loader/cache/CachedImage.cpp:
2905         (WebCore::CachedImage::switchClientsToRevalidatedResource):
2906         (WebCore::CachedImage::createImage):
2907         * loader/cache/CachedResource.cpp:
2908         (WebCore::CachedResource::switchClientsToRevalidatedResource):
2909         * loader/cache/CachedResourceLoader.cpp:
2910         (WebCore::CachedResourceLoader::~CachedResourceLoader):
2911         (WebCore::CachedResourceLoader::reloadImagesIfNotDeferred):
2912         (WebCore::CachedResourceLoader::garbageCollectDocumentResources):
2913         (WebCore::CachedResourceLoader::isPreloaded):
2914         (WebCore::CachedResourceLoader::printPreloadStats):
2915         * loader/icon/IconDatabase.cpp:
2916         (WebCore::IconDatabase::removeAllIcons):
2917         (WebCore::IconDatabase::setIconDataForIconURL):
2918         (WebCore::IconDatabase::iconRecordCountWithData):
2919         (WebCore::IconDatabase::notifyPendingLoadDecisions):
2920         (WebCore::IconDatabase::performURLImport):
2921         (WebCore::IconDatabase::performPendingRetainAndReleaseOperations):
2922         (WebCore::IconDatabase::readFromDatabase):
2923         (WebCore::IconDatabase::writeToDatabase):
2924
2925 2015-09-29  Chris Dumez  <cdumez@apple.com>
2926
2927         sectionRowIndex must return -1 when its parent is not a table, tbody, thead, or tfoot
2928         https://bugs.webkit.org/show_bug.cgi?id=148841
2929         <rdar://problem/22586870>
2930
2931         Reviewed by Ryosuke Niwa.
2932
2933         Update HTMLTableRowElement.sectionRowIndex to match the specification:
2934         https://html.spec.whatwg.org/multipage/tables.html#dom-tr-sectionrowindex
2935
2936         In particular, it now returns -1 if the parent is not a table, tbody,
2937         thead and tfoot.
2938
2939         No new tests, already covered by existing test.
2940
2941         * html/HTMLTableRowElement.cpp:
2942         (WebCore::HTMLTableRowElement::sectionRowIndex):
2943
2944 2015-09-29  Daniel Bates  <dabates@apple.com>
2945
2946         Make WebKit for iOS Simulator build with the public iOS 9 SDK
2947         https://bugs.webkit.org/show_bug.cgi?id=149652
2948
2949         Reviewed by Simon Fraser.
2950
2951         * WebCore.xcodeproj/project.pbxproj: Add private header pthreadSPI.h. Also move entry for IDBTransaction.h so that it is in sorted order.
2952         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: Substitute AVPlayerViewControllerDelegate_WebKitOnly for AVPlayerViewControllerDelegate.
2953         * platform/spi/cocoa/AVKitSPI.h: As of iOS 9, AVPlayerViewControllerDelegate is a public protocol. Separate out WebKit-specific SPI into protocol
2954         AVPlayerViewControllerDelegate_WebKitOnly, which extends AVPlayerViewControllerDelegate. Also, the properties -[AVPlayerViewController allowsPictureInPicturePlayback] and -[AVPlayerViewController delegate] are public in iOS 9.
2955         * platform/spi/cocoa/pthreadSPI.h: Added.
2956         * platform/spi/ios/LaunchServicesSPI.h: Add more SPI.
2957         * platform/spi/ios/MediaPlayerSPI.h: Ignore deprecation warnings for UIPopoverController and UIActionSheet.
2958
2959 2015-09-29  Brady Eidson  <beidson@apple.com>
2960
2961         Followup to "Move WebKit2 AsyncTask to WebCore CrossThreadTask."
2962         https://bugs.webkit.org/show_bug.cgi?id=149651
2963
2964         Rubberstamped by Alex Christensen.
2965
2966         No new tests (No change in behavior).
2967
2968         * platform/CrossThreadTask.h: Now in WebCore, use the WebCore namespace.
2969
2970 2015-09-29  Brady Eidson  <beidson@apple.com>
2971
2972         Move WebKit2 AsyncTask to WebCore CrossThreadTask.
2973         https://bugs.webkit.org/show_bug.cgi?id=149651
2974
2975         Reviewed by Alex Christensen.
2976
2977         No new tests (No change in behavior).
2978         
2979         It will be needed in WebCore to support IndexedDB.
2980
2981         * WebCore.xcodeproj/project.pbxproj:
2982         * platform/CrossThreadTask.h: Renamed from Source/WebKit2/Shared/AsyncTask.h.
2983         (WebKit::CrossThreadTask::CrossThreadTask):
2984         (WebKit::CrossThreadTask::performTask):
2985         (WebKit::createCrossThreadTask):
2986
2987 2015-09-29  Wenson Hsieh  <wenson_hsieh@apple.com>
2988
2989         Snap offsets should update when style is programmatically changed
2990         https://bugs.webkit.org/show_bug.cgi?id=135964
2991         <rdar://problem/18162411>
2992
2993         Reviewed by Darin Adler.
2994
2995         Tests:  css3/scroll-snap/scroll-snap-style-changed-coordinates.html
2996                 css3/scroll-snap/scroll-snap-style-changed-repeat.html
2997
2998         Updating scroll snap style properties now programmatically updates the scroll snap container. Does not yet
2999         handle the case of reparented elements with scroll snap coordinates. Adds some plumbing the FrameView and
3000         RenderLayerCompositor to immediately update the scrolling coordinator when updating the FrameView due to
3001         style changes.
3002
3003         * page/FrameView.cpp:
3004         (WebCore::FrameView::updateScrollingCoordinatorScrollSnapProperties): Calls on the compositor to reupdate scroll snap
3005             properties on the FrameView.
3006         * page/FrameView.h:
3007         * page/scrolling/AsyncScrollingCoordinator.cpp: Sets snap offsets to an empty vector when appropriate.
3008         (WebCore::setStateScrollingNodeSnapOffsetsAsFloat): Ditto.
3009         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): Ditto.
3010         (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode): Ditto.
3011         (WebCore::AsyncScrollingCoordinator::updateScrollSnapPropertiesWithFrameView): Updates scroll snap properties
3012             from a given FrameView.
3013         * page/scrolling/AsyncScrollingCoordinator.h:
3014         * page/scrolling/ScrollingCoordinator.h:
3015         (WebCore::ScrollingCoordinator::updateScrollSnapPropertiesWithFrameView):
3016         * rendering/RenderLayerCompositor.cpp:
3017         (WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView): Updates the scrolling coordinator's
3018             scroll snap properties.
3019         * rendering/RenderLayerCompositor.h: Plumb scroll snap property updating to the FrameView.
3020         * rendering/RenderLayerModelObject.cpp: Checks for style changes and updates snap offsets when appropriate.
3021         (WebCore::scrollSnapContainerRequiresUpdateForStyleUpdate): Ditto.
3022         (WebCore::RenderLayerModelObject::styleDidChange): Ditto.
3023
3024 2015-09-29  Jer Noble  <jer.noble@apple.com>
3025
3026         REGRESSION: WebAudio user-gesture restriction is no longer lifted by touchstart event
3027         https://bugs.webkit.org/show_bug.cgi?id=149367
3028
3029         Reviewed by Eric Carlson.
3030
3031         Use processingUserGestureForMedia() rather than processingUserGesture(),
3032         as the former includes touchstart and the latter does not.
3033
3034         * Modules/webaudio/AudioContext.cpp:
3035         (WebCore::AudioContext::willBeginPlayback):
3036         (WebCore::AudioContext::willPausePlayback):
3037         * html/MediaElementSession.cpp:
3038         (WebCore::MediaElementSession::playbackPermitted):
3039         (WebCore::MediaElementSession::dataLoadingPermitted):
3040         (WebCore::MediaElementSession::fullscreenPermitted):
3041         (WebCore::MediaElementSession::showPlaybackTargetPicker):
3042
3043 2015-09-29  Ryosuke Niwa  <rniwa@webkit.org>
3044
3045         Update style/layout when a slot is added or removed
3046         https://bugs.webkit.org/show_bug.cgi?id=149593
3047
3048         Reviewed by Antti Koivisto.
3049
3050         Fixed the bug by forcing the render tree reconstruction on the shadow host when a slot is inserted or removed.
3051         We should optimize these reconstructions by only triggering them on the affected slot elements in the future.
3052
3053         Also fixed a bug that we were not invalidating the slot assignments when a default slot is introduced dynamically
3054         after the slot assignment algorithm had run.
3055
3056         Test (existing): fast/shadow-dom/shadow-layout-after-slot-changes.html
3057
3058         * dom/ShadowRoot.cpp:
3059         (WebCore::ShadowRoot::addSlotElementByName): Passes in ShadowRoot.
3060         (WebCore::ShadowRoot::removeSlotElementByName): Ditto.
3061         * dom/SlotAssignment.cpp:
3062         (WebCore::SlotAssignment::addSlotElementByName): Call setNeedsStyleRecalc.
3063         (WebCore::SlotAssignment::removeSlotElementByName): Call setNeedsStyleRecalc if the host is still alive since this
3064         function can be called while the host is being destructed in which case shadowRoot.host() would be nullptr.
3065         * dom/SlotAssignment.h:
3066
3067 2015-09-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3068
3069         Improve binding of JSBuiltinConstructor classes
3070         https://bugs.webkit.org/show_bug.cgi?id=149556
3071
3072         Reviewed by Darin Adler.
3073
3074         JSBuiltinConstructor classes no longer need definition of a DOM class.
3075         These classes no longer go through the JS wrapper cache.
3076         Removed code related to DOM class handling (m_impl, releaseImpl, WrapperOwner, toJS, ...)
3077         Updated creation code.
3078
3079         Refactoring of the binding generator code to simplify whether generating or not some methods.
3080
3081         Removed unneeded include of DOM class in JSXX.cpp (already done in JSXX.h)
3082
3083         Added new binding test to cover JSBuiltinConstructor keyword.
3084
3085         Covered by binding tests.
3086
3087         * bindings/js/JSDOMBinding.h:
3088         (WebCore::createJSBuiltin):
3089         (WebCore::DOMConstructorObject::createStructure):.
3090         * bindings/scripts/CodeGeneratorJS.pm:
3091         (NeedsImplementationClass):
3092         (ShouldGenerateToWrapped):
3093         (ShouldGenerateWrapperOwnerCode):
3094         (ShouldGenerateToJSDeclaration):
3095         (ShouldGenerateToJSImplementation):
3096         (GenerateHeader):
3097         (GenerateImplementation):
3098         (GenerateConstructorDefinition):
3099         (ComputeFunctionSpecial):.
3100         (UseJSBuiltins):.
3101         * bindings/scripts/test/GObject/WebKitDOMTestJSBuiltinConstructor.cpp: Added.
3102         (WebKit::kit):
3103         (WebKit::core):
3104         (WebKit::wrapTestJSBuiltinConstructor):
3105         (webkit_dom_test_js_builtin_constructor_finalize):
3106         (webkit_dom_test_js_builtin_constructor_constructor):
3107         (webkit_dom_test_js_builtin_constructor_class_init):
3108         (webkit_dom_test_js_builtin_constructor_init):
3109         * bindings/scripts/test/GObject/WebKitDOMTestJSBuiltinConstructor.h: Added.
3110         * bindings/scripts/test/GObject/WebKitDOMTestJSBuiltinConstructorPrivate.h: Added.
3111         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3112         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3113         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3114         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3115         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3116         * bindings/scripts/test/JS/JSTestException.cpp:
3117         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3118         * bindings/scripts/test/JS/JSTestInterface.cpp:
3119         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp: Added.
3120         (WebCore::JSTestJSBuiltinConstructorPrototype::create):
3121         (WebCore::JSTestJSBuiltinConstructorPrototype::createStructure):
3122         (WebCore::JSTestJSBuiltinConstructorPrototype::JSTestJSBuiltinConstructorPrototype):
3123         (WebCore::JSTestJSBuiltinConstructorConstructor::create):
3124         (WebCore::JSTestJSBuiltinConstructorConstructor::createStructure):
3125         (WebCore::JSTestJSBuiltinConstructorConstructor::constructJSTestJSBuiltinConstructor):
3126         (WebCore::JSTestJSBuiltinConstructorConstructor::JSTestJSBuiltinConstructorConstructor):
3127         (WebCore::JSTestJSBuiltinConstructorConstructor::finishCreation):
3128         (WebCore::JSTestJSBuiltinConstructorConstructor::getConstructData):
3129         (WebCore::JSTestJSBuiltinConstructorPrototype::finishCreation):
3130         (WebCore::JSTestJSBuiltinConstructor::JSTestJSBuiltinConstructor):
3131         (WebCore::JSTestJSBuiltinConstructor::createPrototype):
3132         (WebCore::JSTestJSBuiltinConstructor::getPrototype):
3133         (WebCore::JSTestJSBuiltinConstructor::destroy):
3134         (WebCore::JSTestJSBuiltinConstructor::~JSTestJSBuiltinConstructor):
3135         (WebCore::jsTestJSBuiltinConstructorConstructor):
3136         (WebCore::JSTestJSBuiltinConstructor::getConstructor):
3137         (WebCore::JSTestJSBuiltinConstructor::visitChildren):
3138         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h: Added.
3139         (WebCore::JSTestJSBuiltinConstructor::create):
3140         (WebCore::JSTestJSBuiltinConstructor::createStructure):
3141         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3142         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3143         * bindings/scripts/test/JS/JSTestNode.cpp:
3144         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
3145         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3146         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3147         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3148         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3149         * bindings/scripts/test/JS/JSattribute.cpp:
3150         * bindings/scripts/test/JS/JSreadonly.cpp:
3151         * bindings/scripts/test/ObjC/DOMTestJSBuiltinConstructor.h: Added.
3152         * bindings/scripts/test/ObjC/DOMTestJSBuiltinConstructor.mm: Added.
3153         (-[DOMTestJSBuiltinConstructor dealloc]):
3154         (-[DOMTestJSBuiltinConstructor finalize]):
3155         (core):
3156         (kit):
3157         * bindings/scripts/test/ObjC/DOMTestJSBuiltinConstructorInternal.h: Added.
3158         * bindings/scripts/test/TestJSBuiltinConstructor.idl: Added.
3159
3160 2015-09-29  Xabier Rodriguez Calvar  <calvaris@igalia.com>
3161
3162         [Streams API] [Win] Remove reference to dead CountQueuingStrategy.h
3163         https://bugs.webkit.org/show_bug.cgi?id=149623
3164
3165         Reviewed by Darin Adler.
3166
3167         No new tests needed.
3168
3169         * WebCore.vcxproj/WebCore.vcxproj.filters:
3170
3171 2015-09-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3172
3173         Build WebCore JS Builtins according the ENABLE flags
3174         https://bugs.webkit.org/show_bug.cgi?id=149624
3175
3176         Reviewed by Csaba Osztrogonác.
3177
3178         Created WebCoreJSBuiltins.cpp to include all JSXXBuiltins.cpp files with the right #ifdef.
3179         Added WebCoreJSBuiltins.cpp to CMake, win and mac build systems.
3180
3181         No change in behavior.
3182
3183         * CMakeLists.txt:
3184         * DerivedSources.cpp:
3185         * WebCore.vcxproj/WebCore.vcxproj:
3186         * WebCore.xcodeproj/project.pbxproj:
3187         * bindings/js/WebCoreJSBuiltins.cpp: Added.
3188
3189 2015-09-29  Javier Fernandez  <jfernandez@igalia.com>
3190
3191         [CSS Grid Layout] Flex tracks sizing alg must handle 0fr values
3192         https://bugs.webkit.org/show_bug.cgi?id=148944
3193
3194         Reviewed by Darin Adler.
3195
3196         We don't allow 0 as flexible size value, which is not following current
3197         specs; it just states that it must be a positive value. This patch
3198         adds such change in the parser but some additional logic must be added
3199         as well to handle 0 values during the flex tracks sizing algorithm.
3200
3201         The old algorithm didn't take 0 values into account, so there is the risk
3202         of division by zero. Additionally, it was not handling fraction values
3203         in the best way. The last versions of the spec changed this algorithm in
3204         order to handle fraction values so that they don't cause exponential
3205         grow of tracks using values bigger than 1.
3206
3207         This patch implements also such new algorithm, so we can deal not only
3208         with 0 values, but managing fraction values properly.
3209
3210         No new tests, just some additional test cases and some of them rebaselined.
3211
3212         * rendering/RenderGrid.cpp:
3213         (WebCore::normalizedFlexFraction):
3214         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
3215         (WebCore::RenderGrid::computeFlexFactorUnitSize): Added.
3216         (WebCore::RenderGrid::findFlexFactorUnitSize): Added.
3217         (WebCore::RenderGrid::GridTrackForNormalization): Deleted.
3218         (WebCore::RenderGrid::computeNormalizedFractionBreadth): Deleted.
3219         * rendering/RenderGrid.h:
3220
3221 2015-09-29  Csaba Osztrogonác  <ossy@webkit.org>
3222
3223         Fix the broken !ENABLE(STREAM_API) build
3224         https://bugs.webkit.org/show_bug.cgi?id=149525
3225
3226         Reviewed by Darin Adler.
3227
3228         * bindings/js/WebCoreJSClientData.h: Revert r190225.
3229
3230
3231 2015-09-16  Carlos Garcia Campos  <cgarcia@igalia.com>
3232
3233         printing does not use minimum page zoom factor
3234         https://bugs.webkit.org/show_bug.cgi?id=108507
3235
3236         Reviewed by Darin Adler.
3237
3238         * page/PrintContext.cpp:
3239         (WebCore::PrintContext::beginAndComputePageRectsWithPageSize):
3240         Helper function to share common code from numberOfPages() and
3241         spoolAllPagesWithBoundaries().
3242         (WebCore::PrintContext::numberOfPages): Use beginAndComputePageRectsWithPageSize().
3243         (WebCore::PrintContext::spoolAllPagesWithBoundaries): Use
3244         beginAndComputePageRectsWithPageSize() and don't flip the Y axis
3245         for non Cocoa platforms.
3246         * page/PrintContext.h:
3247
3248 2015-09-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3249
3250         Add support for WebIDL JSBuiltin attributes
3251         https://bugs.webkit.org/show_bug.cgi?id=149554
3252
3253         Reviewed by Darin Adler.
3254
3255         Covered by bindings tests.
3256
3257         * bindings/scripts/CodeGeneratorGObject.pm:
3258         (SkipAttribute): Disabled GObject binding generation of JSBuiltin attribute.
3259         * bindings/scripts/CodeGeneratorJS.pm:
3260         (GetAttributeGetterName): Handling of Builtin function to retrieve BuiltinGenerator.
3261         (GetAttributeSetterName): Ditto.
3262         (GenerateAttributesHashTable): Set JSBuiltin attributes as "Accessor | Builtin".
3263         (GenerateImplementation): Skip implementation for JSBuiltin attributes
3264         * bindings/scripts/test/JS/JSTestObj.cpp: Adding binding test for JSBuiltin attributes.
3265         * bindings/scripts/test/ObjC/DOMTestObj.h:
3266         * bindings/scripts/test/ObjC/DOMTestObj.mm:
3267         (-[DOMTestObj jsBuiltinAttribute]):
3268         (-[DOMTestObj setJsBuiltinAttribute:]):
3269         (-[DOMTestObj jsBuiltinReadOnlyAttribute]):
3270         * bindings/scripts/test/TestObj.idl: Ditto.
3271
3272 2015-09-28  Brent Fulgham  <bfulgham@apple.com>
3273
3274         [Win] Fix build after r190295.
3275
3276         * PlatformWin.cmake: Add missing Forwarding Header.
3277
3278 2015-09-28  Brady Eidson  <beidson@apple.com>
3279
3280         Add an IDB Server that can roundtrip a request back to the client.
3281         https://bugs.webkit.org/show_bug.cgi?id=149603
3282
3283         Reviewed by NOBODY (Build fix).
3284
3285         * Modules/indexeddb/IDBRequest.h: Remove unneeded #include, fixing the WK/WK2 builds.
3286
3287 2015-09-28  Brent Fulgham  <bfulgham@apple.com>
3288
3289         Expose 'geometryFlipped' state for debugging/logging purposes
3290         https://bugs.webkit.org/show_bug.cgi?id=149557
3291
3292         Reviewed by Simon Fraser.
3293
3294         No new tests: No new behavior.
3295
3296         * platform/graphics/ca/PlatformCALayer.h:
3297         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
3298         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
3299         (PlatformCALayerCocoa::geometryFlipped): Added.
3300         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
3301         (PlatformCALayerWin::geometryFlipped): Added.
3302         (printLayer): Log flipped state of geometry.
3303         * platform/graphics/ca/win/PlatformCALayerWin.h:
3304
3305 2015-09-28  Brady Eidson  <beidson@apple.com>
3306
3307         Add an IDB Server that can roundtrip a request back to the client.
3308         https://bugs.webkit.org/show_bug.cgi?id=149603
3309
3310         Reviewed by Alex Christensen.
3311
3312         Test: storage/indexeddb/modern/deletedatabase-request-event.html
3313
3314         This is a critical piece of IDB infrastructure that:
3315         - Puts a database client/server divide in place.
3316         - Client synchronously sends requests to the server, and asynchronously receives a response back from it.
3317         - Introduces a class structure that makes it easy for WebKit2 to add a thin layer to replace the 
3318           in-process server with an out-of-process server.
3319
3320         To allow for the most basic of tests, the "delete database" request is hard coded as always failing 
3321         with an indeterminate error.
3322
3323         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
3324         (WebCore::DOMWindowIndexedDatabase::indexedDB):
3325
3326         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
3327         (WebCore::IDBDatabaseIdentifier::debugString):
3328         * Modules/indexeddb/IDBDatabaseIdentifier.h:
3329
3330         * Modules/indexeddb/client/IDBConnectionToServer.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp.
3331         (WebCore::IDBClient::IDBConnectionToServer::create):
3332         (WebCore::IDBClient::IDBConnectionToServer::IDBConnectionToServer):
3333         (WebCore::IDBClient::IDBConnectionToServer::identifier):
3334         (WebCore::IDBClient::IDBConnectionToServer::deleteDatabase):
3335         (WebCore::IDBClient::IDBConnectionToServer::didDeleteDatabase):
3336
3337         * Modules/indexeddb/client/IDBConnectionToServer.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h.
3338         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h.
3339         (WebCore::IDBClient::IDBConnectionToServerDelegate::~IDBConnectionToServerDelegate):
3340
3341         * Modules/indexeddb/client/IDBFactoryImpl.cpp:
3342         (WebCore::IDBClient::IDBFactory::create):
3343         (WebCore::IDBClient::IDBFactory::IDBFactory):
3344         (WebCore::IDBClient::IDBFactory::openInternal):
3345         (WebCore::IDBClient::IDBFactory::deleteDatabase):
3346         * Modules/indexeddb/client/IDBFactoryImpl.h:
3347
3348         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
3349         (WebCore::IDBClient::IDBOpenDBRequest::createDeleteRequest):
3350         (WebCore::IDBClient::IDBOpenDBRequest::createOpenRequest):
3351         (WebCore::IDBClient::IDBOpenDBRequest::IDBOpenDBRequest):
3352         (WebCore::IDBClient::IDBOpenDBRequest::~IDBOpenDBRequest):
3353         (WebCore::IDBClient::IDBOpenDBRequest::requestCompleted):
3354         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
3355         (WebCore::IDBClient::IDBOpenDBRequest::databaseIdentifier):
3356         (WebCore::IDBClient::IDBOpenDBRequest::version):
3357         (WebCore::IDBClient::IDBOpenDBRequest::create): Deleted.
3358
3359         * Modules/indexeddb/client/IDBRequestImpl.cpp:
3360         (WebCore::IDBClient::IDBRequest::IDBRequest):
3361         (WebCore::IDBClient::IDBRequest::enqueueEvent):
3362         * Modules/indexeddb/client/IDBRequestImpl.h:
3363         (WebCore::IDBClient::IDBRequest::requestIdentifier):
3364
3365         * Modules/indexeddb/server/IDBConnectionToClient.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp.
3366         (WebCore::IDBServer::IDBConnectionToClient::create):
3367         (WebCore::IDBServer::IDBConnectionToClient::IDBConnectionToClient):
3368         (WebCore::IDBServer::IDBConnectionToClient::identifier):
3369         (WebCore::IDBServer::IDBConnectionToClient::didDeleteDatabase):
3370         * Modules/indexeddb/server/IDBConnectionToClient.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h.
3371         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h.
3372         (WebCore::IDBServer::IDBConnectionToClientDelegate::~IDBConnectionToClientDelegate):
3373
3374         * Modules/indexeddb/server/IDBServer.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp.
3375         (WebCore::IDBServer::IDBServer::create):
3376         (WebCore::IDBServer::IDBServer::IDBServer):
3377         (WebCore::IDBServer::IDBServer::registerConnection):
3378         (WebCore::IDBServer::IDBServer::unregisterConnection):
3379         (WebCore::IDBServer::IDBServer::deleteDatabase):
3380         * Modules/indexeddb/server/IDBServer.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h.
3381
3382         * Modules/indexeddb/shared/IDBError.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBDatabaseIdentifier.cpp.
3383         (WebCore::idbExceptionEntry):
3384         (WebCore::IDBError::IDBError):
3385         (WebCore::IDBError::operator=):
3386         (WebCore::IDBError::name):
3387         (WebCore::IDBError::message):
3388         * Modules/indexeddb/shared/IDBError.h: Copied from Source/WebCore/Modules/indexeddb/IDBDatabaseIdentifier.cpp.
3389         (WebCore::IDBError::IDBError):
3390         (WebCore::IDBError::isNull):
3391
3392         * Modules/indexeddb/shared/IDBRequestData.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp.
3393         (WebCore::IDBRequestData::IDBRequestData):
3394         * Modules/indexeddb/shared/IDBRequestData.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h.
3395         (WebCore::IDBRequestData::requestIdentifier):
3396         (WebCore::IDBRequestData::databaseIdentifier):
3397
3398         * Modules/indexeddb/shared/IDBRequestIdentifier.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp.
3399         (WebCore::nextRequestNumber):
3400         (WebCore::IDBRequestIdentifier::IDBRequestIdentifier):
3401         (WebCore::IDBRequestIdentifier::emptyValue):
3402         (WebCore::IDBRequestIdentifier::deletedValue):
3403         (WebCore::IDBRequestIdentifier::isHashTableDeletedValue):
3404         * Modules/indexeddb/shared/IDBRequestIdentifier.h: Added.
3405         (WebCore::IDBRequestIdentifier::isEmpty):
3406         (WebCore::IDBRequestIdentifier::hash):
3407         (WebCore::IDBRequestIdentifier::operator==):
3408         (WebCore::IDBRequestIdentifier::connectionIdentifier):
3409         (WebCore::IDBRequestIdentifierHash::hash):
3410         (WebCore::IDBRequestIdentifierHash::equal):
3411         (WebCore::IDBRequestIdentifierHashTraits::emptyValue):
3412         (WebCore::IDBRequestIdentifierHashTraits::isEmptyValue):
3413         (WebCore::IDBRequestIdentifierHashTraits::constructDeletedValue):
3414         (WebCore::IDBRequestIdentifierHashTraits::isDeletedValue):
3415
3416         * Modules/indexeddb/shared/IDBResultData.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp.
3417         (WebCore::IDBResultData::IDBResultData):
3418         * Modules/indexeddb/shared/IDBResultData.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h.
3419         (WebCore::IDBResultData::requestIdentifier):
3420         (WebCore::IDBResultData::error):
3421
3422         * Modules/indexeddb/shared/InProcessIDBServer.cpp: Added.
3423         (WebCore::InProcessIDBServer::create):
3424         (WebCore::InProcessIDBServer::InProcessIDBServer):
3425         (WebCore::InProcessIDBServer::identifier):
3426         (WebCore::InProcessIDBServer::connectionToServer):
3427         (WebCore::InProcessIDBServer::connectionToClient):
3428         (WebCore::InProcessIDBServer::deleteDatabase):
3429         (WebCore::InProcessIDBServer::didDeleteDatabase):
3430         * Modules/indexeddb/shared/InProcessIDBServer.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h.
3431
3432         * CMakeLists.txt:
3433         * WebCore.xcodeproj/project.pbxproj:
3434
3435         * loader/EmptyClients.cpp:
3436
3437         * page/DatabaseProvider.h:
3438
3439         * page/Page.cpp:
3440         (WebCore::Page::idbConnection):
3441         * page/Page.h:
3442
3443         * page/SecurityOriginData.cpp:
3444         (WebCore::SecurityOriginData::debugString):
3445         * page/SecurityOriginData.h:
3446
3447 2015-09-28  Ryosuke Niwa  <rniwa@webkit.org>
3448
3449         relatedNode should be retargeted respecting slots
3450         https://bugs.webkit.org/show_bug.cgi?id=149591
3451
3452         Reviewed by Antti Koivisto.
3453
3454         This patch retargets relatedNode with respect to shadow boundaries after r190214 as specified in
3455         https://w3c.github.io/webcomponents/spec/shadow/#retargeting-relatedtarget
3456
3457         Naively implementing the spec'ed behavior can result in O(n^2) behavior since we need to find the common tree scope
3458         ancestor for each target in the event path. This patch avoids this by implementing an O(1) incremental update step
3459         for when target's tree scope changes in the event path. See the description for moveToNewTreeScope below.
3460
3461         Test: fast/shadow-dom/event-with-related-target.html
3462
3463         * dom/EventContext.h: Replaced toMouseOrFocusEventContext by downcast<MouseOrFocusEventContext>.
3464         * dom/EventDispatcher.cpp:
3465         (WebCore::EventRelatedNodeResolver): Removed the code for relatedNode. This class is now only used for touch events.
3466         (WebCore::EventPath): Added m_event as a member variable.
3467
3468         (WebCore::RelatedNodeRetargeter): Added.
3469
3470         (WebCore::RelatedNodeRetargeter::RelatedNodeRetargeter): Does the initial retargeting of relatedNode. When the
3471         tree scope of relatedNode and the target are the same, we immediately exit without collecting ancestor tree scopes
3472         of relatedNode as an optimization. We also special case when the relatedNode and the target are in two different
3473         documents (relatedNode should be nullptr) and when one is in document and the other one is not in the document
3474         (relatedNode should be the host of the outermost shadow root). Otherwise we have to do the real work by collecting
3475         all tree scope ancestors and walking downwards from the document tree scope (note target and relatedNode share the
3476         same document scope here since we would have exited early otherwise).
3477
3478         (WebCore::RelatedNodeRetargeter::currentNode): Returned relatedNode retargeted for the current tree scope.
3479
3480         (WebCore::RelatedNodeRetargeter::moveToNewTreeScope): Moves to a new tree scope. If the original target and
3481         relatedNode were in different trees, there is nothing to be done. Note that we can only move out of a shadow root
3482         to its host or move into a slot so newTreeScope (current target's tree scope) and previousTreeScope (previous
3483         target's tree scope) must have a child-parent relationship.
3484
3485         If previousTreeScope did not contain the retargeted relatedNode, then neither can its child shadow trees. Thus,
3486         there is nothing to be done when moving into a slot in this case. If we're moving out of previousTreeScope, then
3487         newTreeScope may contain the retargeted relatedNode but that still doesn't require any work. So we exit early in
3488         both cases.
3489
3490         Otherwise (previousTreeScope contained retargeted relatedNode), if we're moving out of a child shadow root
3491         (previousTreeScope) then relatedNode should also move to previousTreeScope's shadow host since previousTreeScope
3492         is a direct-child shadow tree of newTreeScope and previousTreeScope's shadow host resides in newTreeScope.
3493
3494         If we're moving into a child shadow root via a slot, then there are three possibilities: relatedNode is in
3495         previousTreeScope, newTreeScope and its child shadow trees, or newTreeScope's sibling tree scopes and its children.
3496         If it is in previousTreeScope (m_lowestCommonAncestorIndex is zero) or in newTreeScope's sibling, then
3497         previousTreeScope is the lowest common tree scope ancestor so there is nothing to be done. If relatedNode is in
3498         newTreeScope, then the retargeted relatedNode is either the shadow host of the shadow tree that contains
3499         relatedNode or relatedNode itself.
3500
3501         (WebCore::RelatedNodeRetargeter::checkConsistency): Finds the retargeted relatedNode in the simplest way to verify
3502         the correctness of the algorithm. We can disable this consistency check if it slows down debug builds too much.
3503         (WebCore::RelatedNodeRetargeter::nodeInLowestCommonAncestor): Finds the 
3504         (WebCore::RelatedNodeRetargeter::collectTreeScopes):
3505         (WebCore::EventPath::setRelatedTarget): Rewritten using RelatedNodeRetargeter.
3506
3507 2015-09-28  Alex Christensen  <achristensen@webkit.org>
3508
3509         Build WK1 with CMake on Mac
3510         https://bugs.webkit.org/show_bug.cgi?id=149604
3511
3512         Reviewed by Chris Dumez.
3513
3514         * CMakeLists.txt:
3515         * PlatformMac.cmake:
3516         Make a list of IDL files for the ObjC bindings.
3517
3518 2015-09-28  Chris Dumez  <cdumez@apple.com>
3519
3520         Drop support for legacy EventException
3521         https://bugs.webkit.org/show_bug.cgi?id=149597
3522         <rdar://problem/22879795>
3523
3524         Reviewed by Sam Weinig.
3525
3526         Drop support for legacy EventException. Both Firefox and Chrome do not
3527         support it, and our implementation no longer throws such exceptions.
3528
3529         No new tests, already covered by existing test.
3530
3531         * CMakeLists.txt:
3532         * DerivedSources.cpp:
3533         * DerivedSources.make:
3534         * Modules/indexeddb/legacy/LegacyRequest.cpp:
3535         * Modules/indexeddb/legacy/LegacyTransaction.cpp:
3536         * Modules/websockets/WebSocket.cpp:
3537         * WebCore.vcxproj/WebCore.vcxproj:
3538         * WebCore.vcxproj/WebCore.vcxproj.filters:
3539         * WebCore.xcodeproj/project.pbxproj:
3540         * bindings/gobject/WebKitDOMPrivate.cpp:
3541         * bindings/js/JSExceptionBase.cpp:
3542         (WebCore::toExceptionBase): Deleted.
3543         * dom/DOMAllInOne.cpp:
3544         * dom/DOMExceptions.in:
3545         * dom/EventException.cpp: Removed.
3546         * dom/EventException.h:
3547         (WebCore::EventException::EventException): Deleted.
3548         * dom/EventException.idl:
3549         * dom/EventListenerMap.cpp:
3550         * dom/EventTarget.cpp:
3551         * dom/MessagePort.cpp:
3552         * dom/Node.cpp:
3553         * loader/appcache/DOMApplicationCache.cpp:
3554         * page/DOMWindow.cpp:
3555         * page/EventSource.cpp:
3556         * page/PerformanceUserTiming.h:
3557         * workers/AbstractWorker.cpp:
3558         * workers/Worker.cpp:
3559         * workers/WorkerGlobalScope.cpp:
3560         * xml/XMLHttpRequest.cpp:
3561         * xml/XMLHttpRequestUpload.cpp:
3562
3563 2015-09-28  Chris Dumez  <cdumez@apple.com>
3564
3565         Object.getOwnPropertyNames() does not return named properties
3566         https://bugs.webkit.org/show_bug.cgi?id=149562
3567         <rdar://problem/22879779>
3568
3569         Reviewed by Darin Adler.
3570
3571         Previously, Object.getOwnPropertyNames() did not return named properties
3572         for interfaces with named property getters. This patch adds support for
3573         this in the JS bindings generator and uses it for HTMLCollection only
3574         for now. Other interfaces will be taken care of independently.
3575
3576         Note that currently, even though the named properties are returned by
3577         Object.getOwnPropertyNames(), these properties are still not enumerated.
3578         This is because these are always unenumerable for existing DOM interfaces:
3579         - https://dom.spec.whatwg.org/#interface-htmlcollection
3580         - https://dom.spec.whatwg.org/#namednodemap
3581
3582         In the future, we may need to extend support if some interfaces require
3583         those to be enumerable.
3584
3585         Test: fast/dom/htmlcollection-getownpropertynames.html
3586
3587         * Modules/mediastream/RTCStatsResponse.cpp:
3588         (WebCore::WebCore::RTCStatsResponse::supportedPropertyNames):
3589         * Modules/mediastream/RTCStatsResponse.h:
3590         * bindings/scripts/CodeGeneratorJS.pm:
3591         (GenerateHeader):
3592         (GenerateImplementation):
3593         * css/StyleSheetList.cpp:
3594         (WebCore::StyleSheetList::supportedPropertyNames):
3595         * css/StyleSheetList.h:
3596         * dom/DOMNamedFlowCollection.cpp:
3597         (WebCore::DOMNamedFlowCollection::supportedPropertyNames):
3598         * dom/DOMNamedFlowCollection.h:
3599         * dom/NamedNodeMap.cpp:
3600         (WebCore::NamedNodeMap::supportedPropertyNames):
3601         * dom/NamedNodeMap.h:
3602         * html/HTMLCollection.cpp:
3603         (WebCore::HTMLCollection::supportedPropertyNames):
3604         * html/HTMLCollection.h:
3605         (WebCore::CollectionNamedElementCache::propertyNames):
3606         (WebCore::CollectionNamedElementCache::appendToIdCache):
3607         (WebCore::CollectionNamedElementCache::appendToNameCache):
3608         (WebCore::CollectionNamedElementCache::memoryCost):
3609         (WebCore::CollectionNamedElementCache::append):
3610         * plugins/DOMMimeTypeArray.cpp:
3611         (WebCore::DOMMimeTypeArray::supportedPropertyNames):
3612         * plugins/DOMMimeTypeArray.h:
3613         * plugins/DOMPlugin.cpp:
3614         (WebCore::DOMPlugin::supportedPropertyNames):
3615         * plugins/DOMPlugin.h:
3616         * plugins/DOMPluginArray.cpp:
3617         (WebCore::DOMPluginArray::supportedPropertyNames):
3618         * plugins/DOMPluginArray.h:
3619
3620 2015-09-28  Per Arne Vollan  <peavo@outlook.com>
3621
3622         [Curl] Deadlock when downloading.
3623         https://bugs.webkit.org/show_bug.cgi?id=149596
3624
3625         Reviewed by Alex Christensen.
3626
3627         Avoid grabbing the same lock twice.
3628
3629         * platform/network/curl/CurlDownload.cpp:
3630         (WebCore::CurlDownload::init):
3631         (WebCore::CurlDownload::addHeaders):
3632
3633 2015-09-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
3634
3635         An SVG inherits the container size of the previously drawn HTMLImageElement when drawing it on a canvas
3636         https://bugs.webkit.org/show_bug.cgi?id=148845
3637
3638         Reviewed by Darin Adler.
3639
3640         When drawing an SVG image on a canvas we need to make sure that the container
3641         size of the SVG is set to the image source size. If we do not do that, the
3642         previous container size will be used as the size of the image. When drawing
3643         it as HTMLImageElement, the renderer calls SVGImage::drawForContainer() which
3644         calls setContainerSize() and then calls draw(). This call ensures that the
3645         size is set correctly for cached images. But when drawing the SVGImage on
3646         CanvasRenderingContext2D, the SVGImage::draw() is called directly because
3647         it calls it through the base class method Image::draw().
3648         
3649         If the image.isSVGImage(), CanvasRenderingContext2D::drawImage() has to call
3650         SVGImage::setContainerSize() before calling Image::draw().
3651
3652         Test: svg/as-image/svg-cached-draw-canvas.html
3653
3654         * html/canvas/CanvasRenderingContext2D.cpp:
3655         (WebCore::CanvasRenderingContext2D::drawImage):
3656         Call SVGImage::setContainerSize() before calling Image::draw().
3657
3658 2015-09-27  Said Abou-Hallawa  <sabouhallawa@apple.com>
3659
3660         Rename all the variables and parameters of type HTMLImageElement in CanvasRenderingContext2D.cpp from 'image' to 'imageElement'
3661
3662         Reviewed by Darin Adler.
3663
3664         This does not change functionality in this file. It is a preparation for
3665         the fix of the https://bugs.webkit.org/show_bug.cgi?id=148845.
3666
3667         * html/canvas/CanvasRenderingContext2D.cpp:
3668         (WebCore::size):
3669         (WebCore::normalizeRect):
3670         (WebCore::CanvasRenderingContext2D::drawImageFromRect):
3671         (WebCore::CanvasRenderingContext2D::setAlpha):
3672         (WebCore::CanvasRenderingContext2D::createRadialGradient):
3673         (WebCore::CanvasRenderingContext2D::createPattern):
3674         (WebCore::CanvasRenderingContext2D::drawImage):
3675
3676 2015-09-27  Yusuke Suzuki  <utatane.tea@gmail.com>
3677
3678         [ES6] Implement ES6 Module loader hook stubs in WebCore
3679         https://bugs.webkit.org/show_bug.cgi?id=149574
3680
3681         Reviewed by Ryosuke Niwa.
3682
3683         In this patch, we implement the loader hooks in the WebCore side.
3684         Since the fetcher and actual evaluation code are separated from
3685         this patch, they become empty.
3686
3687         Here, WebCore implements 3 loader hooks.
3688
3689         1. resolve hook
3690
3691             Takes the module name and resolve it to the unique module key.
3692             In WebCore, we use URL as a module key.
3693             And for the inlined module tag (e.g. <script type="module">import ...</script>),
3694             we use the ES6 symbol as a module key.
3695             In WebCore, we take the module name like "./hello.js" and resolve it by using
3696             the URL of the importer module.
3697             This functionality is implemented in this patch.
3698
3699         2. fetch hook
3700
3701             Fetches the resource specified by the module key. In WebCore, the module key is
3702             URL. We use CachedResource loading system to load the resource of the modules.
3703             The actual code of the fetch hook will be implemented in the subsequent patch.
3704
3705         3. evaluate hook
3706
3707             This is additional hook to instrument the module's execution for the inspector.
3708             The actual code of the evaluate hook will be implemented in the subsequent patch.
3709
3710         In addition to that, we added required JSC forward headers for the module loader
3711         implementation.
3712
3713         * CMakeLists.txt:
3714         * ForwardingHeaders/runtime/JSInternalPromise.h: Added.
3715         * ForwardingHeaders/runtime/JSInternalPromiseDeferred.h: Added.
3716         * ForwardingHeaders/runtime/JSModuleRecord.h: Added.
3717         * ForwardingHeaders/runtime/Symbol.h: Added.
3718         * WebCore.vcxproj/WebCore.vcxproj:
3719         * WebCore.vcxproj/WebCore.vcxproj.filters:
3720         * WebCore.xcodeproj/project.pbxproj:
3721         * bindings/js/JSBindingsAllInOne.cpp:
3722         * bindings/js/JSDOMWindowBase.cpp:
3723         (WebCore::JSDOMWindowBase::moduleLoaderResolve):
3724         (WebCore::JSDOMWindowBase::moduleLoaderFetch):
3725         (WebCore::JSDOMWindowBase::moduleLoaderEvaluate):
3726         * bindings/js/JSDOMWindowBase.h:
3727         * bindings/js/JSModuleLoader.cpp: Added.
3728         (WebCore::JSModuleLoader::JSModuleLoader):
3729         (WebCore::JSModuleLoader::resolve):
3730         (WebCore::JSModuleLoader::fetch):
3731         (WebCore::JSModuleLoader::evaluate):
3732         * bindings/js/JSModuleLoader.h: Added.
3733         (WebCore::JSModuleLoader::document):
3734         * dom/Document.cpp:
3735         (WebCore::Document::Document):
3736         (WebCore::Document::~Document):
3737         * dom/Document.h:
3738         (WebCore::Document::moduleLoader):
3739
3740 2015-09-26  Hunseop Jeong  <hs85.jeong@samsung.com>
3741
3742         Use modern for-loops in WebCore/inspector.
3743         https://bugs.webkit.org/show_bug.cgi?id=149579
3744
3745         Reviewed by Darin Adler.
3746
3747         No new tests because there is no behavior change.
3748
3749         * inspector/DOMPatchSupport.cpp:
3750         (WebCore::DOMPatchSupport::diff):
3751         (WebCore::DOMPatchSupport::innerPatchChildren):
3752         (WebCore::DOMPatchSupport::removeChildAndMoveToNew):
3753         (WebCore::DOMPatchSupport::markNodeAsUsed):
3754         * inspector/InspectorCSSAgent.cpp:
3755         (WebCore::computePseudoClassMask):
3756         (WebCore::ChangeRegionOversetTask::timerFired):
3757         (WebCore::InspectorCSSAgent::getNamedFlowCollection):
3758         (WebCore::InspectorCSSAgent::resetPseudoStates):
3759         * inspector/InspectorDOMAgent.cpp:
3760         (WebCore::RevalidateStyleAttributeTask::timerFired):
3761         (WebCore::InspectorDOMAgent::releaseBackendNodeIds):
3762         (WebCore::InspectorDOMAgent::getEventListenersForNode):
3763         (WebCore::InspectorDOMAgent::getEventListeners):
3764         (WebCore::InspectorDOMAgent::performSearch):
3765         (WebCore::InspectorDOMAgent::styleAttributeInvalidated):
3766         * inspector/InspectorDOMDebuggerAgent.cpp:
3767         (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
3768         * inspector/InspectorDatabaseAgent.cpp:
3769         (WebCore::InspectorDatabaseAgent::enable):
3770         (WebCore::InspectorDatabaseAgent::disable):
3771         (WebCore::InspectorDatabaseAgent::getDatabaseTableNames):
3772         (WebCore::InspectorDatabaseAgent::databaseId):
3773         (WebCore::InspectorDatabaseAgent::findByFileName):
3774         * inspector/InspectorFrontendClientLocal.cpp:
3775         (WebCore::InspectorFrontendClientLocal::frontendLoaded):
3776         * inspector/InspectorFrontendHost.cpp:
3777         * inspector/InspectorIndexedDBAgent.cpp:
3778         * inspector/InspectorOverlay.cpp:
3779         (WebCore::buildRendererHighlight):
3780         (WebCore::buildObjectForHighlight):
3781         * inspector/InspectorPageAgent.cpp:
3782         (WebCore::InspectorPageAgent::getCookies):
3783         * inspector/InspectorReplayAgent.cpp:
3784         (WebCore::buildInspectorObjectForSession):
3785         (WebCore::InspectorReplayAgent::didCreateFrontendAndBackend):
3786         (WebCore::InspectorReplayAgent::willDestroyFrontendAndBackend):
3787         * inspector/InspectorResourceAgent.cpp:
3788         (WebCore::InspectorResourceAgent::willDestroyCachedResource):
3789         (WebCore::InspectorResourceAgent::willRecalculateStyle):
3790         * inspector/InspectorStyleSheet.cpp:
3791         (flattenSourceData):
3792         (WebCore::InspectorStyle::buildArrayForComputedStyle):
3793         (WebCore::InspectorStyle::populateAllProperties):
3794         (WebCore::selectorsFromSource):
3795         (WebCore::InspectorStyleSheet::ruleIndexByStyle):
3796         (WebCore::InspectorStyleSheet::buildArrayForRuleList):
3797         * inspector/InspectorWorkerAgent.cpp:
3798         (WebCore::InspectorWorkerAgent::createWorkerFrontendChannelsForExistingWorkers):
3799         (WebCore::InspectorWorkerAgent::destroyWorkerFrontendChannels):
3800         * inspector/NetworkResourcesData.cpp:
3801         (WebCore::NetworkResourcesData::removeCachedResource):
3802         (WebCore::NetworkResourcesData::clear):
3803         * inspector/PageRuntimeAgent.cpp:
3804         (WebCore::PageRuntimeAgent::reportExecutionContextCreation):
3805         * inspector/PageScriptDebugServer.cpp:
3806         (WebCore::PageScriptDebugServer::setJavaScriptPaused):
3807         * inspector/WebConsoleAgent.cpp:
3808         (WebCore::WebConsoleAgent::frameWindowDiscarded):
3809         * inspector/WebInjectedScriptManager.cpp:
3810         (WebCore::WebInjectedScriptManager::discardInjectedScriptsFor):
3811
3812 2015-09-25  Eric Carlson  <eric.carlson@apple.com>
3813
3814         Clean up user media request internal API
3815         https://bugs.webkit.org/show_bug.cgi?id=149527
3816
3817         Reviewed by Tim Horton.
3818
3819         No new tests, no functional change.
3820
3821         * Modules/mediastream/UserMediaRequest.cpp:
3822         (WebCore::UserMediaRequest::constraintsValidated): Use track persistent ID to create vectors
3823           as that is what the platform code needs to map to a capture device.
3824         (WebCore::UserMediaRequest::userMediaAccessGranted): m_chosenXXDeviceUID -> m_XXDeviceUIDAllowed.
3825           Use the device IDs to create the MediaStream. Switch audio/video parameter order.
3826         (WebCore::UserMediaRequest::didCreateStream): Don't assume constraints are valid.
3827         * Modules/mediastream/UserMediaRequest.h:
3828         (WebCore::UserMediaRequest::videoDeviceUIDs):
3829         (WebCore::UserMediaRequest::audioDeviceUIDs):
3830         (WebCore::UserMediaRequest::allowedVideoDeviceUID):
3831         (WebCore::UserMediaRequest::allowedAudioDeviceUID):
3832         (WebCore::UserMediaRequest::requiresAudio): Deleted.
3833         (WebCore::UserMediaRequest::requiresVideo): Deleted.
3834         (WebCore::UserMediaRequest::firstVideoDeviceUID): Deleted.
3835         (WebCore::UserMediaRequest::firstAudioDeviceUID): Deleted.
3836
3837         * platform/mediastream/mac/AVMediaCaptureSource.mm:
3838         (WebCore::AVMediaCaptureSource::AVMediaCaptureSource): Call setPersistentId.
3839
3840 2015-09-25  Antti Koivisto  <antti@apple.com>
3841
3842         Implement scoped styling for shadow DOM
3843         https://bugs.webkit.org/show_bug.cgi?id=149230
3844
3845         Reviewed by Ryosuke Niwa.
3846
3847         Test: fast/shadow-dom/css-scoping-shadow-with-rules-no-style-leak.html
3848
3849         * css/ElementRuleCollector.cpp:
3850         (WebCore::ElementRuleCollector::collectMatchingRules):
3851
3852             Only use special path here for user agent shadow trees.
3853
3854         * dom/AuthorStyleSheets.cpp:
3855         (WebCore::AuthorStyleSheets::AuthorStyleSheets):
3856         (WebCore::AuthorStyleSheets::removePendingSheet):
3857         (WebCore::AuthorStyleSheets::updateActiveStyleSheets):
3858
3859             Basic support for ShadowRoot scoped stylesheets.
3860
3861         * dom/AuthorStyleSheets.h:
3862         (WebCore::AuthorStyleSheets::activeStyleSheets):
3863         * dom/InlineStyleSheetOwner.cpp:
3864         (WebCore::InlineStyleSheetOwner::~InlineStyleSheetOwner):
3865         (WebCore::authorStyleSheetsForElement):
3866         (WebCore::InlineStyleSheetOwner::insertedIntoDocument):
3867         (WebCore::InlineStyleSheetOwner::removedFromDocument):
3868         (WebCore::InlineStyleSheetOwner::clearDocumentData):
3869         (WebCore::InlineStyleSheetOwner::childrenChanged):
3870         (WebCore::InlineStyleSheetOwner::createSheet):
3871         (WebCore::InlineStyleSheetOwner::isLoading):
3872         (WebCore::InlineStyleSheetOwner::sheetLoaded):
3873         (WebCore::InlineStyleSheetOwner::startLoadingDynamicSheet):
3874
3875             Basic support for ShadowRoot scoped inline stylesheets.
3876
3877         * dom/InlineStyleSheetOwner.h:
3878         (WebCore::InlineStyleSheetOwner::sheet):
3879         * dom/ShadowRoot.cpp:
3880         (WebCore::ShadowRoot::styleResolver):
3881
3882             Create and initialize ShadowRoot scoped style resolver.
3883
3884         (WebCore::ShadowRoot::resetStyleResolver):
3885         (WebCore::ShadowRoot::authorStyleSheets):
3886
3887             Collection of author stylesheets in the shadow tree.
3888
3889         (WebCore::ShadowRoot::updateStyle):
3890
3891             Trigger style recalc when stylesheets change.
3892
3893         (WebCore::ShadowRoot::cloneNode):
3894         * dom/ShadowRoot.h:
3895         (WebCore::ShadowRoot::resetStyleInheritance):
3896         * html/HTMLStyleElement.h:
3897         * svg/SVGStyleElement.h:
3898
3899 2015-09-25  Alex Christensen  <achristensen@webkit.org>
3900
3901         Clean up CMake build on Mac
3902         https://bugs.webkit.org/show_bug.cgi?id=149573
3903
3904         Reviewed by Chris Dumez.
3905
3906         * CMakeLists.txt:
3907         * PlatformEfl.cmake:
3908         * PlatformGTK.cmake:
3909         * PlatformMac.cmake:
3910         * platform/graphics/DisplayRefreshMonitor.cpp:
3911
3912 2015-09-25  Tim Horton  <timothy_horton@apple.com>
3913
3914         Scrolling a overflow: scroll region makes find overlay holes stick to the edge of the region
3915         https://bugs.webkit.org/show_bug.cgi?id=149572
3916         <rdar://problem/13093602>
3917
3918         Reviewed by Simon Fraser.
3919
3920         Test: fast/text/mark-matches-overflow-clip.html
3921
3922         * rendering/InlineTextBox.cpp:
3923         (WebCore::InlineTextBox::paintTextMatchMarker):
3924         Clip the rendered marker rect to the overflow rect.
3925
3926         * testing/Internals.cpp:
3927         (WebCore::Internals::dumpMarkerRectsForNode):
3928         * testing/Internals.h:
3929         * testing/Internals.idl:
3930         Add a internals function to dump the rendered rects for a marker.
3931
3932 2015-09-25  Alex Christensen  <achristensen@webkit.org>
3933
3934         [Win] Switch to CMake
3935         https://bugs.webkit.org/show_bug.cgi?id=148111
3936
3937         Reviewed by Brent Fulgham.
3938
3939         * WebCore.vcxproj/WebCore.proj:
3940
3941 2015-09-25  Beth Dakin  <bdakin@apple.com>
3942
3943         Clicking on a data detected item inside a form control always pops up a map 
3944         on force touch trackpad
3945         https://bugs.webkit.org/show_bug.cgi?id=149559
3946         -and corresponding-
3947         rdar://problem/22826796
3948
3949         Reviewed by Tim Horton.
3950
3951         The real bug here appears to be a bug in Lookup, but we can work around it. 
3952         For normal text, we call directly into Data Detectors for map results, and 
3953         that works fine. For text within form controls, we did not properly extract 
3954         the text for DD, so we sent it to Lookup instead, and Lookup has this bug 
3955         where they will pop open the map right away. If we properly extract the text 
3956         for form controls, then we can work around this bug.
3957
3958         * editing/mac/DataDetection.mm:
3959         (WebCore::detectItemAtPositionWithRange):
3960         (WebCore::DataDetection::detectItemAroundHitTestResult):
3961
3962 2015-09-25  Brady Eidson  <beidson@apple.com>
3963
3964         PassRefPtr<> to RefPtr<> conversion in legacy IndexedDB code.
3965         https://bugs.webkit.org/show_bug.cgi?id=149558
3966
3967         Reviewed by Beth Dakin.
3968
3969         No new tests (No behavior change.)
3970         
3971         This patch does not attempt to completely remove all PassRefPtr usage inside legacy IDB.
3972
3973         It just switches over all PassRefPtr usage at the top level IDB interfaces that 
3974         modern IDB is implementing.
3975
3976         The rest of the usage inside the legacy implementation can be dealt with later via `git rm`.
3977
3978         * Modules/indexeddb/IDBAny.h:
3979         * Modules/indexeddb/IDBCursor.h:
3980         * Modules/indexeddb/IDBDatabase.h:
3981         * Modules/indexeddb/IDBDatabaseError.h:
3982         * Modules/indexeddb/IDBFactory.h:
3983         * Modules/indexeddb/IDBIndex.h:
3984         * Modules/indexeddb/IDBObjectStore.h:
3985         * Modules/indexeddb/IDBRequest.h:
3986         * Modules/indexeddb/IDBTransaction.h:
3987         * Modules/indexeddb/client/IDBFactoryImpl.cpp:
3988         (WebCore::IDBClient::IDBFactory::getDatabaseNames):
3989         (WebCore::IDBClient::IDBFactory::open):
3990         (WebCore::IDBClient::IDBFactory::deleteDatabase):
3991         * Modules/indexeddb/client/IDBFactoryImpl.h:
3992         * Modules/indexeddb/client/IDBRequestImpl.cpp:
3993         (WebCore::IDBClient::IDBRequest::result):
3994         (WebCore::IDBClient::IDBRequest::error):
3995         (WebCore::IDBClient::IDBRequest::source):
3996         (WebCore::IDBClient::IDBRequest::transaction):
3997         * Modules/indexeddb/client/IDBRequestImpl.h:
3998         * Modules/indexeddb/legacy/LegacyAny.cpp:
3999         (WebCore::LegacyAny::createInvalid):
4000         (WebCore::LegacyAny::createNull):
4001         (WebCore::LegacyAny::createString):
4002         (WebCore::LegacyAny::domStringList):
4003         (WebCore::LegacyAny::idbCursor):
4004         (WebCore::LegacyAny::idbCursorWithValue):
4005         (WebCore::LegacyAny::idbDatabase):
4006         (WebCore::LegacyAny::idbFactory):
4007         (WebCore::LegacyAny::idbIndex):
4008         (WebCore::LegacyAny::idbObjectStore):
4009         (WebCore::LegacyAny::idbTransaction):
4010         (WebCore::LegacyAny::LegacyAny):
4011         * Modules/indexeddb/legacy/LegacyAny.h:
4012         (WebCore::LegacyAny::create):
4013         * Modules/indexeddb/legacy/LegacyCursor.cpp:
4014         (WebCore::LegacyCursor::update):
4015         (WebCore::LegacyCursor::deleteFunction):
4016         * Modules/indexeddb/legacy/LegacyCursor.h:
4017         * Modules/indexeddb/legacy/LegacyDatabase.cpp:
4018         (WebCore::LegacyDatabase::objectStoreNames):
4019         (WebCore::LegacyDatabase::createObjectStore):
4020         (WebCore::LegacyDatabase::transaction):
4021         * Modules/indexeddb/legacy/LegacyDatabase.h:
4022         * Modules/indexeddb/legacy/LegacyFactory.cpp:
4023         (WebCore::LegacyFactory::getDatabaseNames):
4024         (WebCore::LegacyFactory::open):
4025         (WebCore::LegacyFactory::deleteDatabase):
4026         * Modules/indexeddb/legacy/LegacyFactory.h:
4027         * Modules/indexeddb/legacy/LegacyIndex.cpp:
4028         (WebCore::Legacy