Rename members of CanvasRenderingContext2D::State
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-09-04  Myles C. Maxfield  <mmaxfield@apple.com>
2
3         Rename members of CanvasRenderingContext2D::State
4         https://bugs.webkit.org/show_bug.cgi?id=148889
5
6         Reviewed by Tim Horton.
7
8         CanvasRenderingContext2D::State is a struct, so its members should not start with m_.
9
10         No new tests because there is no behavior change.
11
12         * html/canvas/CanvasRenderingContext2D.cpp:
13         (WebCore::CanvasRenderingContext2D::State::State):
14         (WebCore::CanvasRenderingContext2D::State::operator=):
15         (WebCore::CanvasRenderingContext2D::restore):
16         (WebCore::CanvasRenderingContext2D::setStrokeStyle):
17         (WebCore::CanvasRenderingContext2D::setFillStyle):
18         (WebCore::CanvasRenderingContext2D::lineWidth):
19         (WebCore::CanvasRenderingContext2D::setLineWidth):
20         (WebCore::CanvasRenderingContext2D::lineCap):
21         (WebCore::CanvasRenderingContext2D::setLineCap):
22         (WebCore::CanvasRenderingContext2D::lineJoin):
23         (WebCore::CanvasRenderingContext2D::setLineJoin):
24         (WebCore::CanvasRenderingContext2D::miterLimit):
25         (WebCore::CanvasRenderingContext2D::setMiterLimit):
26         (WebCore::CanvasRenderingContext2D::shadowOffsetX):
27         (WebCore::CanvasRenderingContext2D::setShadowOffsetX):
28         (WebCore::CanvasRenderingContext2D::shadowOffsetY):
29         (WebCore::CanvasRenderingContext2D::setShadowOffsetY):
30         (WebCore::CanvasRenderingContext2D::shadowBlur):
31         (WebCore::CanvasRenderingContext2D::setShadowBlur):
32         (WebCore::CanvasRenderingContext2D::shadowColor):
33         (WebCore::CanvasRenderingContext2D::setShadowColor):
34         (WebCore::CanvasRenderingContext2D::getLineDash):
35         (WebCore::CanvasRenderingContext2D::setLineDash):
36         (WebCore::CanvasRenderingContext2D::setWebkitLineDash):
37         (WebCore::CanvasRenderingContext2D::lineDashOffset):
38         (WebCore::CanvasRenderingContext2D::setLineDashOffset):
39         (WebCore::CanvasRenderingContext2D::applyLineDash):
40         (WebCore::CanvasRenderingContext2D::globalAlpha):
41         (WebCore::CanvasRenderingContext2D::setGlobalAlpha):
42         (WebCore::CanvasRenderingContext2D::globalCompositeOperation):
43         (WebCore::CanvasRenderingContext2D::setGlobalCompositeOperation):
44         (WebCore::CanvasRenderingContext2D::scale):
45         (WebCore::CanvasRenderingContext2D::rotate):
46         (WebCore::CanvasRenderingContext2D::translate):
47         (WebCore::CanvasRenderingContext2D::transform):
48         (WebCore::CanvasRenderingContext2D::setTransform):
49         (WebCore::CanvasRenderingContext2D::setStrokeColor):
50         (WebCore::CanvasRenderingContext2D::setFillColor):
51         (WebCore::CanvasRenderingContext2D::fillInternal):
52         (WebCore::CanvasRenderingContext2D::strokeInternal):
53         (WebCore::CanvasRenderingContext2D::clipInternal):
54         (WebCore::CanvasRenderingContext2D::isPointInPathInternal):
55         (WebCore::CanvasRenderingContext2D::isPointInStrokeInternal):
56         (WebCore::CanvasRenderingContext2D::clearRect):
57         (WebCore::CanvasRenderingContext2D::fillRect):
58         (WebCore::CanvasRenderingContext2D::strokeRect):
59         (WebCore::CanvasRenderingContext2D::setShadow):
60         (WebCore::CanvasRenderingContext2D::applyShadow):
61         (WebCore::CanvasRenderingContext2D::shouldDrawShadows):
62         (WebCore::CanvasRenderingContext2D::drawImage):
63         (WebCore::CanvasRenderingContext2D::transformAreaToDevice):
64         (WebCore::CanvasRenderingContext2D::rectContainsCanvas):
65         (WebCore::CanvasRenderingContext2D::compositeBuffer):
66         (WebCore::CanvasRenderingContext2D::didDraw):
67         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
68         (WebCore::CanvasRenderingContext2D::font):
69         (WebCore::CanvasRenderingContext2D::setFont):
70         (WebCore::CanvasRenderingContext2D::textAlign):
71         (WebCore::CanvasRenderingContext2D::setTextAlign):
72         (WebCore::CanvasRenderingContext2D::textBaseline):
73         (WebCore::CanvasRenderingContext2D::setTextBaseline):
74         (WebCore::CanvasRenderingContext2D::direction):
75         (WebCore::CanvasRenderingContext2D::setDirection):
76         (WebCore::CanvasRenderingContext2D::drawTextInternal):
77         (WebCore::CanvasRenderingContext2D::inflateStrokeRect):
78         (WebCore::CanvasRenderingContext2D::imageSmoothingEnabled):
79         (WebCore::CanvasRenderingContext2D::setImageSmoothingEnabled):
80         * html/canvas/CanvasRenderingContext2D.h:
81
82 2015-09-04  Myles C. Maxfield  <mmaxfield@apple.com>
83
84         Crash when font completes downloading after calling 2D canvas setText() multiple times
85         https://bugs.webkit.org/show_bug.cgi?id=148789
86
87         Reviewed by Darin Adler.
88
89         The CSSFontSelector has a list of clients, and when fonts complete downloading, these
90         clients get a call back. CanvasRenderingContext2D::State is one such of these clients. However,
91         the CSSFontSelector may be destroyed and recreated at any time. We were getting into a case
92         where multiple CSSFontSelectors were thinking that the same CanvasRenderingContext2D::State were
93         their client. When the CanvasRenderingContext2D::State was destroyed, it only unregistered
94         itself from one of the CSSFontSelectors, which means the CSSFontSelector left over has a dangling
95         pointer to it.
96
97         The solution is to implement a new helper class, FontProxy, to hold the
98         CanvasRenderingContext2D::State's font, and maintain the invariant that this object is always
99         registered to exactly one CSSFontSelector, and this CSSFontSelector is the one which is associated
100         with the FontProxy's FontCascade object. This patch maintains this invariant, as well as protecting
101         all access to the State's FontCascade object so no one can reach in and change it without going
102         through functions which maintain the invariant.
103
104         Test: fast/canvas/font-selector-crash.html
105
106         * css/CSSFontSelector.cpp:
107         (WebCore::CSSFontSelector::registerForInvalidationCallbacks):
108         (WebCore::CSSFontSelector::unregisterForInvalidationCallbacks):
109         (WebCore::CSSFontSelector::dispatchInvalidationCallbacks):
110         * css/CSSFontSelector.h:
111         * dom/Document.cpp:
112         (WebCore::Document::fontsNeedUpdate):
113         (WebCore::Document::fontSelector):
114         (WebCore::Document::clearStyleResolver):
115         * dom/Document.h:
116         * html/canvas/CanvasRenderingContext2D.cpp:
117         (WebCore::CanvasRenderingContext2D::State::State):
118         (WebCore::CanvasRenderingContext2D::State::operator=):
119         (WebCore::CanvasRenderingContext2D::FontProxy::~FontProxy):
120         (WebCore::CanvasRenderingContext2D::FontProxy::FontProxy):
121         (WebCore::CanvasRenderingContext2D::FontProxy::update):
122         (WebCore::CanvasRenderingContext2D::FontProxy::fontsNeedUpdate):
123         (WebCore::CanvasRenderingContext2D::FontProxy::initialize):
124         (WebCore::CanvasRenderingContext2D::FontProxy::fontMetrics):
125         (WebCore::CanvasRenderingContext2D::FontProxy::fontDescription):
126         (WebCore::CanvasRenderingContext2D::FontProxy::width):
127         (WebCore::CanvasRenderingContext2D::FontProxy::drawBidiText):
128         (WebCore::CanvasRenderingContext2D::font):
129         (WebCore::CanvasRenderingContext2D::setFont):
130         (WebCore::CanvasRenderingContext2D::measureText):
131         (WebCore::CanvasRenderingContext2D::drawTextInternal):
132         (WebCore::CanvasRenderingContext2D::State::~State): Deleted.
133         (WebCore::CanvasRenderingContext2D::State::fontsNeedUpdate): Deleted.
134         (WebCore::CanvasRenderingContext2D::accessFont): Deleted.
135         * html/canvas/CanvasRenderingContext2D.h:
136         * platform/graphics/FontSelector.h:
137
138 2015-09-04  Commit Queue  <commit-queue@webkit.org>
139
140         Unreviewed, rolling out r189386.
141         https://bugs.webkit.org/show_bug.cgi?id=148883
142
143         Made several event dispatch tests assert (Requested by ap on
144         #webkit).
145
146         Reverted changeset:
147
148         "dispatchEvent() should throw an InvalidStateError if the
149         event's initialized flag is not set"
150         https://bugs.webkit.org/show_bug.cgi?id=148800
151         http://trac.webkit.org/changeset/189386
152
153 2015-09-04  Joseph Pecoraro  <pecoraro@apple.com>
154
155         Web Inspector: Add tests for DOM highlight commands
156         https://bugs.webkit.org/show_bug.cgi?id=148786
157
158         Reviewed by Timothy Hatcher.
159
160         Tests: inspector/dom/hideHighlight.html
161                inspector/dom/highlightFrame.html
162                inspector/dom/highlightNode.html
163                inspector/dom/highlightQuad.html
164                inspector/dom/highlightRect.html
165
166         * inspector/InspectorDOMAgent.cpp:
167         (WebCore::InspectorDOMAgent::highlightNode):
168         (WebCore::InspectorDOMAgent::highlightFrame):
169         Include an error if a frame is not found.
170
171         * inspector/InspectorOverlay.cpp:
172         (WebCore::InspectorOverlay::highlightQuad):
173         Should have been checking the usePageCoordinates state of the incoming
174         highlight configuration, not the one that will be replaced.
175
176 2015-09-04  Csaba Osztrogonác  <ossy@webkit.org>
177
178         Remove unnecessary compiler guards from mm files
179         https://bugs.webkit.org/show_bug.cgi?id=148797
180
181         Reviewed by Dan Bernstein.
182
183         * bindings/objc/DOMInternal.mm:
184         * bridge/objc/objc_instance.mm:
185
186 2015-09-04  Eric Carlson  <eric.carlson@apple.com>
187
188         [mediacontrols] Test AirPlay picker button
189         https://bugs.webkit.org/show_bug.cgi?id=148836
190
191         Reviewed by Dean Jackson.
192
193         Test: media/controls/airplay-picker.html
194
195         * Modules/mediacontrols/mediaControlsApple.js:
196         (Controller.prototype.getCurrentControlsStatus.elements.forEach.):
197         (Controller.prototype.getCurrentControlsStatus):
198
199 2015-09-04  Chris Dumez  <cdumez@apple.com>
200
201         dispatchEvent() should throw an InvalidStateError if the event's initialized flag is not set
202         https://bugs.webkit.org/show_bug.cgi?id=148800
203         <rdar://problem/22565782>
204         <rdar://problem/22565485>
205
206         Reviewed by Geoffrey Garen.
207
208         dispatchEvent() should throw an InvalidStateError if the event's
209         initialized flag is not set or its dispatch flag is set, and should
210         allow dispatching events with an empty type as long as it is
211         initialized:
212         https://dom.spec.whatwg.org/#dom-eventtarget-dispatchevent (step 1)
213
214         Previously, WebKit relied on the event type being empty to throw a
215         UNSPECIFIED_EVENT_TYPE_ERR: DOM Events Exception 0. However, this
216         exception type is outdated and initializing Event.type to an empty
217         string is legal.
218
219         No new tests, already covered by existing tests that were rebaselined.
220
221         * dom/Event.cpp:
222         (WebCore::Event::Event):
223         (WebCore::Event::initEvent):
224         * dom/Event.h:
225         (WebCore::Event::isInitialized):
226         * dom/EventTarget.cpp:
227         (WebCore::EventTarget::dispatchEvent):
228
229 2015-09-04  Beth Dakin  <bdakin@apple.com>
230
231         Speculative build fix.
232
233         * platform/spi/mac/NSEventSPI.h:
234
235 2015-09-04  Brian Burg  <bburg@apple.com>
236
237         Web Inspector: InspectorController should support multiple frontend channels
238         https://bugs.webkit.org/show_bug.cgi?id=148538
239
240         Reviewed by Joseph Pecoraro.
241
242         No new tests, no behavior change from this patch. Teardown scenarios are
243         covered by existing protocol and inspector tests running under DRT and WKTR.
244
245         * ForwardingHeaders/inspector/InspectorFrontendRouter.h: Added.
246         * WebCore.vcxproj/WebCore.vcxproj:
247         * inspector/InspectorClient.h: Stop using forwarded types.
248         * inspector/InspectorController.cpp:
249         (WebCore::InspectorController::InspectorController):
250         (WebCore::InspectorController::inspectedPageDestroyed):
251         (WebCore::InspectorController::hasLocalFrontend):
252         (WebCore::InspectorController::hasRemoteFrontend):
253         (WebCore::InspectorController::connectFrontend):
254         (WebCore::InspectorController::disconnectFrontend):
255         (WebCore::InspectorController::disconnectAllFrontends): Added. Disconnects all
256         frontends and signals DisconnectReason::InspectedTargetDestroyed.
257
258         (WebCore::InspectorController::show):
259         (WebCore::InspectorController::close):
260         (WebCore::InspectorController::dispatchMessageFromFrontend):
261         * inspector/InspectorController.h: Add default value for isAutomaticInspection.
262         * inspector/InspectorDatabaseAgent.cpp:
263         * inspector/InspectorIndexedDBAgent.cpp:
264         * inspector/InspectorResourceAgent.cpp:
265         * inspector/WorkerInspectorController.cpp: Use a router with a singleton channel
266         that forwards messages over to the main page.
267
268         (WebCore::WorkerInspectorController::WorkerInspectorController):
269         (WebCore::WorkerInspectorController::connectFrontend):
270         (WebCore::WorkerInspectorController::disconnectFrontend):
271         (WebCore::WorkerInspectorController::dispatchMessageFromFrontend):
272         * inspector/WorkerInspectorController.h:
273         * page/PageDebuggable.cpp:
274         (WebCore::PageDebuggable::disconnect):
275         * page/PageDebuggable.h:
276         * testing/Internals.cpp: Clear the frontend client before disconnecting frontend channel.
277         (WebCore::Internals::openDummyInspectorFrontend):
278         (WebCore::Internals::closeDummyInspectorFrontend):
279
280 2015-09-04  Jer Noble  <jer.noble@apple.com>
281
282         [iOS] Enable media layout tests to run simultaneously by ignoring system-level interruptions
283         https://bugs.webkit.org/show_bug.cgi?id=148807
284
285         Reviewed by Eric Carlson.
286
287         Add an internal property that, when set, will cause system-level interruption notifications
288         (e.g., due to simultaneous media playback in separate processes) to be ignored by the
289         PlatformMediaSessionManager, and cause the media playback sessions to continue normally, if
290         inaudibly.
291
292         * platform/audio/PlatformMediaSessionManager.h:
293         (WebCore::PlatformMediaSessionManager::willIgnoreSystemInterruptions):
294         (WebCore::PlatformMediaSessionManager::setWillIgnoreSystemInterruptions):
295         * platform/audio/ios/MediaSessionManagerIOS.mm:
296         (-[WebMediaSessionHelper interruption:]):
297         (-[WebMediaSessionHelper applicationWillEnterForeground:]):
298         (-[WebMediaSessionHelper applicationDidBecomeActive:]):
299         (-[WebMediaSessionHelper applicationWillResignActive:]):
300         (-[WebMediaSessionHelper applicationDidEnterBackground:]):
301         * testing/Internals.cpp:
302         (WebCore::Internals::resetToConsistentState):
303
304 2015-09-04  Beth Dakin  <bdakin@apple.com>
305
306         Need to be able to test default behaviors on force click
307         https://bugs.webkit.org/show_bug.cgi?id=148758
308
309         Reviewed by Tim Horton.
310
311         WKTR needs access to this.
312         * platform/spi/mac/NSEventSPI.h:
313
314 2015-09-04  Dean Jackson  <dino@apple.com>
315
316         [mediacontrols] Test the ordering of elements in the controls panel
317         https://bugs.webkit.org/show_bug.cgi?id=148804
318         <rdar://problem/22579232>
319
320         Reviewed by Eric Carlson.
321
322         Add information about various controls elements to the status object.
323
324         Test: media/controls/elementOrder.html
325
326         * Modules/mediacontrols/mediaControlsApple.js:
327
328 2015-09-03  Dean Jackson  <dino@apple.com>
329
330         [mediacontrols] Expose bounding rectangles and computed style to testing
331         https://bugs.webkit.org/show_bug.cgi?id=148755
332         <rdar://problems/22567757>
333
334         Reviewed by Eric Carlson.
335
336         Expose more information on the internal objects to the testing
337         framework, in particular the bounding client rectangle for an
338         element as well as its computed style.
339
340         These new features are tested by media/controls/statusDisplay*.
341
342         * Modules/mediacontrols/mediaControlsApple.js:
343         (Controller.prototype.getCurrentControlsStatus): Rearrage things so
344         that it iterates over a list of objects, adding the common things
345         as well as any extra property values.
346
347 2015-09-04  Chris Dumez  <cdumez@apple.com>
348
349         Document.body should return the first body / frameset child of the html element
350         https://bugs.webkit.org/show_bug.cgi?id=148787
351         <rdar://problem/22566850>
352
353         Reviewed by Ryosuke Niwa.
354
355         Document.body should return the *first* body / frameset child of the html
356         element as per the specification:
357         https://html.spec.whatwg.org/multipage/dom.html#the-body-element-2
358
359         Chrome and Firefox both behave correctly. However, WebKit was prioritizing
360         frameset over body. This patch fixes this.
361
362         No new tests, already covered by existing test.
363
364         * dom/Document.cpp:
365         (WebCore::Document::bodyOrFrameset):
366
367 2015-09-04  Csaba Osztrogonác  <ossy@webkit.org>
368
369         Fix the !ENABLE(VIDEO) build after r189023
370         https://bugs.webkit.org/show_bug.cgi?id=148796
371
372         Reviewed by Eric Carlson.
373
374         * testing/Internals.idl:
375
376 2015-09-04  Ryosuke Niwa  <rniwa@webkit.org>
377
378         Range.isPointInRange check root node before verifying offset
379         https://bugs.webkit.org/show_bug.cgi?id=148776
380
381         isPointInRange should never throw WrongDocumentError
382         https://bugs.webkit.org/show_bug.cgi?id=148779
383
384         Reviewed by Darin Adler.
385
386         Fixed two bugs since they were inter-dependent on each other.
387
388         We use the same trick we used for comparePoint in r189327 to avoid O(n) operation in common cases
389         and return false when either calls to compareBoundaryPoints yields a WrongDocumentError.
390
391         No new tests since this is covered by an existing W3C test.
392
393         * dom/Range.cpp:
394         (WebCore::Range::isPointInRange):
395         (WebCore::Range::comparePoint):
396
397 2015-09-03  Commit Queue  <commit-queue@webkit.org>
398
399         Unreviewed, rolling out r189338.
400         https://bugs.webkit.org/show_bug.cgi?id=148785
401
402         Caused tons of crashes (Requested by cdumez on #webkit).
403
404         Reverted changeset:
405
406         "Web Inspector: InspectorController should support multiple
407         frontend channels"
408         https://bugs.webkit.org/show_bug.cgi?id=148538
409         http://trac.webkit.org/changeset/189338
410
411 2015-09-03  Brian Burg  <bburg@apple.com>
412
413         Web Inspector: InspectorController should support multiple frontend channels
414         https://bugs.webkit.org/show_bug.cgi?id=148538
415
416         Reviewed by Joseph Pecoraro.
417
418         No new tests, no behavior change from this patch. Teardown scenarios are
419         covered by existing protocol and inspector tests running under DRT and WKTR.
420
421         * ForwardingHeaders/inspector/InspectorFrontendRouter.h: Added.
422         * WebCore.vcxproj/WebCore.vcxproj:
423         * inspector/InspectorClient.h: Stop using forwarded types.
424         * inspector/InspectorController.cpp:
425         (WebCore::InspectorController::InspectorController):
426         (WebCore::InspectorController::inspectedPageDestroyed):
427         (WebCore::InspectorController::hasLocalFrontend):
428         (WebCore::InspectorController::hasRemoteFrontend):
429         (WebCore::InspectorController::connectFrontend):
430         (WebCore::InspectorController::disconnectFrontend):
431         (WebCore::InspectorController::disconnectAllFrontends): Added. Disconnects all
432         frontends and signals DisconnectReason::InspectedTargetDestroyed.
433
434         (WebCore::InspectorController::show):
435         (WebCore::InspectorController::close):
436         (WebCore::InspectorController::dispatchMessageFromFrontend):
437         * inspector/InspectorController.h: Add default value for isAutomaticInspection.
438         * inspector/InspectorDatabaseAgent.cpp:
439         * inspector/InspectorIndexedDBAgent.cpp:
440         * inspector/InspectorResourceAgent.cpp:
441         * inspector/WorkerInspectorController.cpp: Use a router with a singleton channel
442         that forwards messages over to the main page.
443
444         (WebCore::WorkerInspectorController::WorkerInspectorController):
445         (WebCore::WorkerInspectorController::connectFrontend):
446         (WebCore::WorkerInspectorController::disconnectFrontend):
447         (WebCore::WorkerInspectorController::dispatchMessageFromFrontend):
448         * inspector/WorkerInspectorController.h:
449         * page/PageDebuggable.cpp:
450         (WebCore::PageDebuggable::disconnect):
451         * page/PageDebuggable.h:
452         * testing/Internals.cpp: Clear the frontend client before disconnecting frontend channel.
453         (WebCore::Internals::openDummyInspectorFrontend):
454         (WebCore::Internals::closeDummyInspectorFrontend):
455
456 2015-09-03  Jinyoung Hur  <hur.ims@navercorp.com>
457
458         [Texmap] highp precision should be used conditionally for fragment shaders on OpenGL ES
459         https://bugs.webkit.org/show_bug.cgi?id=143993
460
461         Reviewed by Martin Robinson.
462
463         There are some GPUs that do not support the GL_OES_fragment_precision_high extension. (e.g., Mali-T624)
464         Therefore, highp precision should be used in shader fragments conditionally using a proper preprocessor,
465         GL_FRAGMENT_PRECISION_HIGH.
466         Without this patch, nothing will be displayed on the screen if the running platform doesn't support the
467         GL_OES_fragment_precision_high extension.
468
469         No new tests, covered by existing tests.
470
471         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
472
473 2015-09-03  Ryosuke Niwa  <rniwa@webkit.org>
474
475         Range.comparePoint shouldn't throw an exception if the range and the node are in the same detached tree
476         https://bugs.webkit.org/show_bug.cgi?id=148733
477
478         Reviewed by Chris Dumez.
479
480         Don't throw WRONG_DOCUMENT_ERR when refNode is not in the document. The new behavior matches DOM4 as well
481         as the behavior of Firefox. See https://dom.spec.whatwg.org/#dom-range-comparepoint
482
483         WRONG_DOCUMENT_ERR is still thrown by compareBoundaryPoints later in the function when the root nodes of
484         refNode and boundary points are different.
485
486         There is one subtlety here that we need to throw WRONG_DOCUMENT_ERR instead of INDEX_SIZE_ERR when refNode
487         and the boundary points don't share the same root node even if (refNode, offset) pair is invalid since
488         DOM4 spec checks the former condition first. We implement this behavior by first validating the offset
489         and then explicitly checking for the root node difference if the former check failed to avoid the latter
490         O(n) check in common cases.
491
492         Test: fast/dom/Range/range-comparePoint-detached-nodes.html
493
494         * dom/Range.cpp:
495         (WebCore::Range::comparePoint):
496
497 2015-09-03  Jer Noble  <jer.noble@apple.com>
498
499         [iOS] Playback does not pause when deselecting route and locking screen.
500         https://bugs.webkit.org/show_bug.cgi?id=148724
501
502         Reviewed by Eric Carlson.
503
504         When deselecting a route, the route change notification can be delayed for some amount
505         of time. If the screen is locked before the notification is fired, the PlatformMediaSessionManager
506         can refuse to pause the video when entering the background due to a wireless playback route
507         still being active.
508
509         When the media element transitions from having an active route to not having one (or vice versa),
510         re-run the interruption check. In order to correctly determine, when that occurs, whether
511         we are in an 'application background' state, cache that value to an ivar when handling
512         application{Will,Did}Enter{Background,Foreground}.
513
514         Because we only want to run this step during an actual transition between playing to a route ->
515         playing locally, cache the value of isPlayingToWirelessPlayback to another ivar, and only
516         inform the PlatformMediaSessionManager when that value actually changes.
517
518         * html/HTMLMediaElement.cpp:
519         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
520         * platform/audio/PlatformMediaSession.cpp:
521         (WebCore::PlatformMediaSession::isPlayingToWirelessPlaybackTargetChanged): Set or clear m_isPlayingToWirelessPlaybackTarget.
522         * platform/audio/PlatformMediaSession.h:
523         (WebCore::PlatformMediaSession::isPlayingToWirelessPlaybackTarget): Simple getter.
524         * platform/audio/PlatformMediaSessionManager.cpp:
525         (WebCore::PlatformMediaSessionManager::applicationWillEnterBackground): Set m_isApplicationInBackground.
526         (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground): Ditto.
527         (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground): Clear m_isApplicationInBackground.
528         (WebCore::PlatformMediaSessionManager::sessionIsPlayingToWirelessPlaybackTargetChanged): Run interruption
529             if application is in background.
530
531 2015-09-03  Brady Eidson  <beidson@apple.com>
532
533         Move SecurityOriginData from WK2 to WebCore.
534         https://bugs.webkit.org/show_bug.cgi?id=148739
535
536         Reviewed by Tim Horton.
537
538         This will be needed for upcoming IndexedDB work.
539
540         No new tests (No behavior change.)
541
542         * CMakeLists.txt:
543         * WebCore.xcodeproj/project.pbxproj:
544         
545         * page/SecurityOriginData.cpp: Renamed from Source/WebKit2/Shared/SecurityOriginData.cpp.
546         (WebCore::SecurityOriginData::fromSecurityOrigin):
547         (WebCore::SecurityOriginData::fromFrame):
548         (WebCore::SecurityOriginData::securityOrigin):
549         (WebCore::SecurityOriginData::isolatedCopy):
550         (WebCore::operator==):
551         * page/SecurityOriginData.h: Renamed from Source/WebKit2/Shared/SecurityOriginData.h.
552         (WebCore::SecurityOriginData::encode):
553         (WebCore::SecurityOriginData::decode):
554
555 2015-09-03  Zalan Bujtas  <zalan@apple.com>
556
557         New clang warns about boolean checks for |this| pointer in RenderObject debug methods
558         https://bugs.webkit.org/show_bug.cgi?id=136599
559
560         Remove unnecessary null checking.
561
562         Reviewed by David Kilzer.
563
564         Not testable.
565
566         * rendering/RenderObject.cpp:
567         (WebCore::RenderObject::showRenderObject): Deleted.
568         (WebCore::RenderObject::showRenderSubTreeAndMark): Deleted.
569
570 2015-09-03  Adenilson Cavalcanti  <cavalcantii@gmail.com>
571
572         Improve access specifier use in RenderObject
573         https://bugs.webkit.org/show_bug.cgi?id=148745
574
575         Reviewed by Myles C. Maxfield.
576
577         No new tests, no change in behavior.
578
579         * rendering/RenderObject.h:
580         (WebCore::RenderObject::setPreviousSibling):
581         (WebCore::RenderObject::setNextSibling):
582         (WebCore::RenderObject::isSetNeedsLayoutForbidden):
583         (WebCore::RenderObject::setNeedsLayoutIsForbidden):
584
585 2015-09-03  Alexey Proskuryakov  <ap@apple.com>
586
587         Test Russian ".рф" domain support
588         https://bugs.webkit.org/show_bug.cgi?id=148721
589
590         Reviewed by Darin Adler.
591
592         Test: fast/url/user-visible/rf.html
593
594         * html/URLUtils.h: Made this header file work with Objective-C.
595
596         * WebCore.xcodeproj/project.pbxproj:
597         * bindings/scripts/CodeGeneratorJS.pm:
598         * testing/Internals.cpp:
599         (WebCore::Internals::getCurrentMediaControlsStatusForElement):
600         (WebCore::Internals::userVisibleString):
601         * testing/Internals.h:
602         * testing/Internals.idl:
603         * testing/Internals.mm: Added.
604         (WebCore::Internals::userVisibleString):
605
606 2015-09-03  Chris Dumez  <cdumez@apple.com>
607
608         document.createEvent("eventname") should do a case-insensitive match on the event name
609         https://bugs.webkit.org/show_bug.cgi?id=148738
610         <rdar://problem/22558709>
611
612         Reviewed by Andreas Kling.
613
614         document.createEvent("eventname") should do a case-insensitive match on the event name:
615         https://dom.spec.whatwg.org/#dom-document-createevent
616
617         WebKit was doing a case-sensitive match. Firefox and Chrome match the specification.
618
619         No new tests, already covered by:
620         http/tests/w3c/dom/nodes/Document-createEvent.html (rebaselined)
621
622         * dom/make_event_factory.pl:
623         (generateImplementation):
624
625 2015-09-02  Ryosuke Niwa  <rniwa@webkit.org>
626
627         MutationObserver should accept attributeFilter, attributeOldValue, and characterDataOldValue on their own
628         https://bugs.webkit.org/show_bug.cgi?id=148716
629
630         Reviewed by Chris Dumez.
631
632         According to DOM4 [1], MutationObserver accepts characterDataOldValue, attributeOldValue and attributeFilter options
633         on their own when characterData and attributes options are omitted. It throws only when characterData and attributes
634         options are explicitly set to false.
635
636         Fixed our implementation accordingly. Existing tests as well as ones imported from W3C covers this.
637
638         [1] http://www.w3.org/TR/2015/WD-dom-20150618/#interface-mutationobserver
639
640         * dom/MutationObserver.cpp:
641         (WebCore::MutationObserver::observe):
642
643 2015-09-02  Andreas Kling  <akling@apple.com>
644
645         ScrollbarThemes should be returned by reference.
646         <https://webkit.org/b/147551>
647
648         Reviewed by Zalan Bujtas.
649
650         There's always a ScrollbarTheme of some type, so have ScrollbarTheme getters
651         return references all around.
652
653         * css/SelectorCheckerTestFunctions.h:
654         (WebCore::scrollbarMatchesDoubleButtonPseudoClass):
655         (WebCore::scrollbarMatchesSingleButtonPseudoClass):
656         (WebCore::scrollbarMatchesNoButtonPseudoClass):
657         * html/shadow/SpinButtonElement.cpp:
658         (WebCore::SpinButtonElement::startRepeatingTimer):
659         * page/PageOverlay.cpp:
660         (WebCore::PageOverlay::bounds):
661         * page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm:
662         (WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars):
663         * platform/ScrollView.cpp:
664         (WebCore::ScrollView::paintScrollCorner):
665         (WebCore::ScrollView::paintOverhangAreas):
666         * platform/ScrollableArea.cpp:
667         (WebCore::ScrollableArea::setScrollbarOverlayStyle):
668         * platform/Scrollbar.cpp:
669         (WebCore::Scrollbar::maxOverlapBetweenPages):
670         (WebCore::Scrollbar::Scrollbar):
671         (WebCore::Scrollbar::~Scrollbar):
672         (WebCore::Scrollbar::offsetDidChange):
673         (WebCore::Scrollbar::updateThumb):
674         (WebCore::Scrollbar::paint):
675         (WebCore::Scrollbar::autoscrollTimerFired):
676         (WebCore::thumbUnderMouse):
677         (WebCore::Scrollbar::autoscrollPressedPart):
678         (WebCore::Scrollbar::startTimerIfNeeded):
679         (WebCore::Scrollbar::moveThumb):
680         (WebCore::Scrollbar::setHoveredPart):
681         (WebCore::Scrollbar::setPressedPart):
682         (WebCore::Scrollbar::mouseMoved):
683         (WebCore::Scrollbar::mouseUp):
684         (WebCore::Scrollbar::mouseDown):
685         (WebCore::Scrollbar::setEnabled):
686         (WebCore::Scrollbar::isOverlayScrollbar):
687         * platform/Scrollbar.h:
688         (WebCore::Scrollbar::theme):
689         * platform/ScrollbarTheme.cpp:
690         (WebCore::ScrollbarTheme::theme):
691         * platform/ScrollbarTheme.h:
692         * platform/efl/ScrollbarThemeEfl.cpp:
693         (WebCore::ScrollbarTheme::nativeTheme):
694         * platform/gtk/ScrollbarThemeGtk.cpp:
695         (WebCore::ScrollbarTheme::nativeTheme):
696         * platform/ios/ScrollbarThemeIOS.mm:
697         (WebCore::ScrollbarTheme::nativeTheme):
698         * platform/mac/ScrollAnimatorMac.mm:
699         (macScrollbarTheme):
700         * platform/mac/ScrollbarThemeMac.mm:
701         (+[WebScrollbarPrefsObserver appearancePrefsChanged:]):
702         (+[WebScrollbarPrefsObserver behaviorPrefsChanged:]):
703         (WebCore::ScrollbarTheme::nativeTheme):
704         * platform/win/PopupMenuWin.cpp:
705         (WebCore::PopupMenuWin::calculatePositionAndSize):
706         (WebCore::AccessiblePopupMenu::accLocation):
707         (WebCore::AccessiblePopupMenu::accHitTest):
708         * platform/win/ScrollbarThemeSafari.cpp:
709         (WebCore::ScrollbarTheme::nativeTheme):
710         * platform/win/ScrollbarThemeWin.cpp:
711         (WebCore::ScrollbarTheme::nativeTheme):
712         * rendering/RenderBox.cpp:
713         (WebCore::RenderBox::hasVerticalScrollbarWithAutoBehavior):
714         (WebCore::RenderBox::hasHorizontalScrollbarWithAutoBehavior):
715         * rendering/RenderLayer.cpp:
716         (WebCore::cornerRect):
717         (WebCore::styleRequiresScrollbar):
718         (WebCore::styleDefinesAutomaticScrollbar):
719         * rendering/RenderScrollbar.cpp:
720         (WebCore::RenderScrollbar::updateScrollbarPart):
721         * rendering/RenderScrollbarPart.cpp:
722         (WebCore::calcScrollbarThicknessUsing):
723         (WebCore::RenderScrollbarPart::styleDidChange):
724         (WebCore::RenderScrollbarPart::imageChanged):
725         * rendering/RenderScrollbarTheme.cpp:
726         (WebCore::RenderScrollbarTheme::paintTickmarks):
727         * rendering/RenderScrollbarTheme.h:
728         * rendering/RenderTextControl.cpp:
729         (WebCore::RenderTextControl::scrollbarThickness):
730
731 2015-09-02  Ryosuke Niwa  <rniwa@webkit.org>
732
733         Node.textContent = undefined should be equivalent to textContent = ""
734         https://bugs.webkit.org/show_bug.cgi?id=148729
735
736         Reviewed by Darin Adler.
737
738         Assigning undefined to textContent should be equivalent to assigning an empty string to it like innerHTML.
739         This is because textContent is defined as an DOMString? attribute in DOM4 [1] and WebIDL defines ECMAScript
740         undefined to be treated as null for nullable types [2].
741
742         The new behavior matches that of Firefox and Chrome.
743
744         [1] https://dom.spec.whatwg.org/#node
745         [2] https://heycam.github.io/webidl/#es-nullable-type
746         
747         * dom/Node.idl:
748
749 2015-09-02  Alex Christensen  <achristensen@webkit.org>
750
751         Make bison grammar compatible with bison 2.1
752         https://bugs.webkit.org/show_bug.cgi?id=148731
753
754         Reviewed by Tim Horton.
755
756         * css/CSSGrammar.y.in:
757         * xml/XPathGrammar.y:
758         Move all union fields to one union so bison 2.1 generates equivalent output.
759
760 2015-09-02  Dean Jackson  <dino@apple.com>
761
762         Add some Houdini specs to the features list
763         https://bugs.webkit.org/show_bug.cgi?id=148722
764         <rdar://problem/22545319>
765
766         Reviewed by Eric Carlson.
767
768         Add the two CSS Houdini specs that have some actual
769         content to the features list: custom painting and
770         custom property registration.
771
772         * features.json:
773
774 2015-09-02  Brady Eidson  <beidson@apple.com>
775
776         Import W3C IndexedDB tests.
777         https://bugs.webkit.org/show_bug.cgi?id=148713
778
779         Reviewed by Tim Horton' rubber stamp.
780
781         Tests: imported/w3c/indexeddb/*
782
783         * Modules/indexeddb/IDBDatabase.cpp:
784         (WebCore::IDBDatabase::onVersionChange): Remove invalid assert - version goes back to 0 when initial
785           versionChange transaction is aborted.
786
787 2015-09-02  Dean Jackson  <dino@apple.com>
788
789         Separate WebGL 1 and WebGL 2 in the features file.
790
791         Unreviewed.
792
793         * features.json:
794
795 2015-09-02  Dean Jackson  <dino@apple.com>
796
797         Reset the status label when the media is playable
798         https://bugs.webkit.org/show_bug.cgi?id=148704
799         <rdar://problem/22541939>
800
801         Reviewed by Eric Carlson.
802
803         Flakiness on the bots uncovered a situation where we
804         hide the status label but left it with incorrect content.
805
806         Covered by the existing statusDisplay test.
807
808         * Modules/mediacontrols/mediaControlsApple.js:
809         (Controller.prototype.updateStatusDisplay): Only set to loading if we're not yet playable.
810
811 2015-09-02  Chris Fleizach  <cfleizach@apple.com>
812
813         AX: WebKit does not expose max/min value of <progress> element
814         https://bugs.webkit.org/show_bug.cgi?id=148707
815
816         Reviewed by Mario Sanchez Prada.
817
818         Allow native progress indicator elements to report min/max values by rewriting special
819         case code for ARIA progress bars.
820
821         Test: accessibility/mac/progress-element-min-max.html
822
823         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
824         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
825
826 2015-09-02  Hyemi Shin  <hyemi.sin@samsung.com>
827
828         [GStreamer] Simplify linking pads in AudioDestination and correct old comment.
829         https://bugs.webkit.org/show_bug.cgi?id=148702
830
831         Reviewed by Philippe Normand.
832
833         Simplify linking src pad of webkitAudioSrc and sink pad of audioConvert
834         to one line because implementation changed not to use seperate function
835         to complete building rest of pipelines.
836         Correct old comment also there is no more wavparse element.
837
838         No new tests, no behavior change.
839
840         * platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
841         (WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer):
842
843 2015-09-02  Chris Dumez  <cdumez@apple.com>
844
845         document.createProcessingInstruction() does not behave according to specification
846         https://bugs.webkit.org/show_bug.cgi?id=148710
847
848         Reviewed by Ryosuke Niwa.
849
850         document.createProcessingInstruction() does not behave according to
851         specification:
852         https://dom.spec.whatwg.org/#dom-document-createprocessinginstruction
853
854         The following changes were made in this patch to match the specification
855         and the behavior of Firefox / Chrome:
856         1. document.createProcessingInstruction() now works for HTML documents.
857         2. Throw an InvalidCharacterError if the data contains "?>" (step 2 of spec)
858
859         No new tests, already covered by existing tests that are rebaselined in
860         this patch.
861
862         * dom/Document.cpp:
863         (WebCore::Document::createProcessingInstruction):
864
865 2015-09-02  Chris Dumez  <cdumez@apple.com>
866
867         http/tests/w3c/dom/nodes/Element-matches.html is flaky
868         https://bugs.webkit.org/show_bug.cgi?id=148615
869
870         Reviewed by Ryosuke Niwa.
871
872         Several newly-imported w3c tests were flaky due to the :target
873         pseudo-class selectors sometimes giving different results. The
874         issue seems to be that this type of selector relies on the
875         Document::cssTarget() element to do the matching. We update
876         this cssTarget Element in FrameView's scrollToFragment() /
877         scrollToAnchor(). This is called from
878         scrollToFragmentWithParentBoundary() which is called by
879         FrameLoader's finishedParsing() and loadInSameDocument().
880
881         In the first one, it is called *after* calling checkComplete()
882         which fires the onload event. However, in the second method,
883         it is called *before*. This patch updates finishedParsing()
884         so that scrollToFragmentWithParentBoundary() is called *before*
885         firing the onload event, consistently with loadInSameDocument().
886         This makes sure that JavaScript executed in an onload event
887         handler will get accurate results for :target pseudo-class
888         selectors.
889
890         No new tests, covered by:
891         http/tests/w3c/dom/nodes/Element-matches.html
892         http/tests/w3c/dom/nodes/ParentNode-querySelector-All-xhtml.xhtml
893
894         * loader/FrameLoader.cpp:
895         (WebCore::FrameLoader::finishedParsing):
896
897 2015-09-02  Zan Dobersek  <zdobersek@igalia.com>
898
899         Construct default winding string arguments in CanvasRenderingContext2D from ASCIILiteral objects
900         https://bugs.webkit.org/show_bug.cgi?id=148441
901
902         Reviewed by Darin Adler.
903
904         * html/canvas/CanvasRenderingContext2D.h: Use ASCIILiteral objects to construct
905         the default values for the winding arguments. This will avoid copying the string
906         data every time the methods are invoked with the default argument value.
907
908 2015-09-02  Carlos Garcia Campos  <cgarcia@igalia.com>
909
910         Unreviewed. Fix GObject DOM bindings API breaks after r189182.
911
912         Several methods are no longer raising exceptions after
913         r189182. Add them to the list, but also handle the case where the
914         methods are called inside the class, to add the nullptr parameter
915         for the GError.
916
917         * bindings/scripts/CodeGeneratorGObject.pm:
918         (GenerateProperty):
919         (FunctionUsedToRaiseException):
920
921 2015-09-01  Ryosuke Niwa  <rniwa@webkit.org>
922
923         Rename ShadowRoot::hostElement to shadowRoot::host to match the latest spec
924         https://bugs.webkit.org/show_bug.cgi?id=148694
925
926         Address the review comments by Chris.
927
928         * dom/Element.cpp:
929         (WebCore::Element::removeShadowRoot):
930         * dom/Node.cpp:
931         (WebCore::Node::shadowHost):
932         * dom/ShadowRoot.cpp:
933         (WebCore::ShadowRoot::ShadowRoot):
934         * dom/ShadowRoot.h:
935
936 2015-09-01  Zalan Bujtas  <zalan@apple.com>
937
938         Recompute maximum outline size only when outline changes.
939         https://bugs.webkit.org/show_bug.cgi?id=148576
940
941         Reviewed by Andreas Kling.
942
943         We should only recompute the cached maximum outline size when
944         either the outline size (offset/width) or the style (from or to
945         auto) changes.
946         Setting 'outline-style: auto' can change the final outline width as 'auto' triggers
947         the focus ring mode. In this mode, we ignore outline-width and use the platform default value instead.  
948
949         Covered by existing test cases.
950
951         * rendering/RenderElement.cpp:
952         (WebCore::RenderElement::computeMaxOutlineSize):
953         (WebCore::RenderElement::styleWillChange):
954         (WebCore::RenderElement::initializeStyle): Deleted.
955         (WebCore::RenderElement::setStyle): Deleted.
956         * rendering/RenderElement.h:
957
958 2015-09-01  Chris Dumez  <cdumez@apple.com>
959
960         Range API should throw a TypeError for null Node parameters
961         https://bugs.webkit.org/show_bug.cgi?id=148692
962
963         Reviewed by Ryosuke Niwa.
964
965         Range API should throw a TypeError for null Node parameters. We currently
966         throw a NotFoundError.
967
968         As per the DOM specification, the Node arguments are not optional nor
969         nullable [1]:
970         https://dom.spec.whatwg.org/#range
971
972         Therefore, as per the Web IDL specification, we should throw a TypeError
973         if the Node parameter is null or missing:
974         https://heycam.github.io/webidl/#es-interface (step 1).
975
976         [1] https://heycam.github.io/webidl/#es-nullable-type
977
978         No new tests, covered by existing tests which have been
979         rebaselined.
980
981         * dom/Range.cpp:
982         (WebCore::Range::setStart):
983         (WebCore::Range::setEnd):
984         (WebCore::Range::isPointInRange):
985         (WebCore::Range::comparePoint):
986         (WebCore::Range::compareNode):
987         (WebCore::Range::compareBoundaryPoints):
988         (WebCore::Range::intersectsNode):
989         (WebCore::Range::insertNode):
990         (WebCore::Range::setStartAfter):
991         (WebCore::Range::setEndBefore):
992         (WebCore::Range::setEndAfter):
993         (WebCore::Range::selectNode):
994         (WebCore::Range::selectNodeContents):
995         (WebCore::Range::surroundContents):
996         (WebCore::Range::setStartBefore):
997         Set the Exception code to TypeError instead of NOT_FOUND_ERR if
998         the Node parameter is null.
999
1000         * dom/Range.idl:
1001         Stop marking the Node parameters as optional. They are not optional in
1002         the specification and they are not really optional in our implementation.
1003         Previously, if the Node parameter was missing, we would call the
1004         implementation with a null pointer and the implementation would throw a
1005         NotFoundError. Now that they are mandatory, the bindings will directly
1006         throw a TypeError (as per the Web IDL spec) if the Node parameter is
1007         missing. However, if the JavaScript explicitely passes null or undefined,
1008         the implementation will still be called with a null pointer (because
1009         our bindings generator does not distinguish nullable / non-nullable
1010         parameters). For this reason, we still need to handle null pointers on
1011         the implementation side.
1012
1013 2015-09-01  Ryosuke Niwa  <rniwa@webkit.org>
1014
1015         Rename ShadowRoot::hostElement to shadowRoot::host to match the latest spec
1016         https://bugs.webkit.org/show_bug.cgi?id=148694
1017
1018         Reviewed by Chris Dumez.
1019
1020         Renamed ShadowRoot::hostElement to ShadowRoot::host to match the latest shadow DOM spec.
1021         This will help us implementing shadow DOM in near future.
1022
1023         * dom/ContainerNodeAlgorithms.cpp:
1024         (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoDocument):
1025         (WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromDocument):
1026         * dom/Element.cpp:
1027         (WebCore::Element::addShadowRoot):
1028         (WebCore::Element::removeShadowRoot):
1029         * dom/EventDispatcher.cpp:
1030         (WebCore::EventRelatedNodeResolver::moveToParentOrShadowHost):
1031         (WebCore::EventRelatedNodeResolver::findHostOfTreeScopeInTargetTreeScope):
1032         (WebCore::shouldEventCrossShadowBoundary):
1033         (WebCore::EventPath::EventPath):
1034         * dom/Node.cpp:
1035         (WebCore::Node::shadowHost):
1036         (WebCore::Node::deprecatedShadowAncestorNode):
1037         (WebCore::Node::parentOrShadowHostElement):
1038         * dom/NodeRenderingTraversal.cpp:
1039         (WebCore::NodeRenderingTraversal::traverseParent):
1040         * dom/ShadowRoot.cpp:
1041         (WebCore::ShadowRoot::setInnerHTML):
1042         (WebCore::ShadowRoot::setResetStyleInheritance):
1043         * dom/ShadowRoot.h:
1044         (WebCore::Node::parentOrShadowHostNode):
1045         * dom/Text.cpp:
1046         (WebCore::isSVGShadowText):
1047         * dom/TreeScope.cpp:
1048         (WebCore::TreeScope::focusedElement):
1049         * html/shadow/ContentDistributor.cpp:
1050         (WebCore::ContentDistributor::ensureDistribution):
1051         * html/shadow/InsertionPoint.cpp:
1052         (WebCore::InsertionPoint::insertedInto):
1053         (WebCore::InsertionPoint::removedFrom):
1054         * page/DragController.cpp:
1055         (WebCore::asFileInput):
1056         * page/EventHandler.cpp:
1057         (WebCore::EventHandler::handleMousePressEvent):
1058         * page/FocusController.cpp:
1059         (WebCore::FocusNavigationScope::owner):
1060         * rendering/RenderLayer.cpp:
1061         (WebCore::rendererForScrollbar):
1062         * style/StyleResolveTree.cpp:
1063         (WebCore::Style::attachShadowRoot):
1064         (WebCore::Style::resolveShadowTree):
1065         * svg/SVGElement.cpp:
1066         (WebCore::SVGElement::correspondingUseElement):
1067
1068 2015-09-01  Chris Dumez  <cdumez@apple.com>
1069
1070         NodeFilter should be a callback interface
1071         https://bugs.webkit.org/show_bug.cgi?id=148415
1072
1073         Reviewed by Geoffrey Garen.
1074
1075         NodeFilter is now a callback interface, instead of a regular interface,
1076         as per the DOM specification:
1077         https://dom.spec.whatwg.org/#interface-nodefilter
1078
1079         One major difference is that TreeWalker.filter / NodeIterator is
1080         supposed to be a Function / Object (passed by JavaScript), but it was a
1081         JSNodeFilter wrapper in WebKit. Also, window.NodeFilter is not supposed
1082         to have a prototype property.
1083
1084         This behavior is consistent with Firefox. However, Chrome still has its
1085         own NodeFilter wrapper.
1086
1087         Tests:
1088         http/tests/w3c/dom/traversal/NodeIterator-expected.html (rebaselined)
1089         http/tests/w3c/dom/traversal/TreeWalker.html (rebaselined)
1090
1091         * CMakeLists.txt:
1092         * WebCore.vcxproj/WebCore.vcxproj:
1093         * WebCore.vcxproj/WebCore.vcxproj.filters:
1094         * WebCore.xcodeproj/project.pbxproj:
1095         Add / Remove files to the project files.
1096
1097         * dom/NodeFilterCondition.cpp:
1098         (WebCore::NodeFilterCondition::acceptNode):
1099         * dom/NodeFilterCondition.h:
1100         * bindings/gobject/GObjectNodeFilterCondition.cpp:
1101         (WebCore::GObjectNodeFilterCondition::acceptNode):
1102         * bindings/gobject/GObjectNodeFilterCondition.h:
1103         * bindings/objc/ObjCNodeFilterCondition.h:
1104         * bindings/objc/ObjCNodeFilterCondition.mm:
1105         (WebCore::ObjCNodeFilterCondition::acceptNode):
1106         Drop ExecState parameter as it is not used.
1107
1108         * bindings/gobject/WebKitDOMNodeFilter.cpp:
1109         (WebKit::core):
1110         Use NativeNodeFilter type instead of NodeFilter. NodeFilter is now
1111         a pure interface with 2 subclasses: NativeNodeFilter for the native
1112         bindings and JSNodeFilter for the JS bindings.
1113
1114         * bindings/js/JSBindingsAllInOne.cpp:
1115         Drop JSNodeFilterCondition.cpp as it was removed.
1116
1117         * bindings/js/JSCallbackData.cpp:
1118         (WebCore::JSCallbackData::invokeCallback):
1119         Throw a TypeError if the callback object being invoked is not callable
1120         and does not have a callable property with the expected name. There
1121         are several layout tests covering this (including w3c ones). Previously,
1122         NodeFilter was not using the generic JSCallbackData and the exception
1123         throwing was in JSNodeFilterCondition::acceptNode() instead.
1124
1125         * bindings/js/JSNodeFilterCondition.cpp: Removed.
1126         * bindings/js/JSNodeFilterCondition.h: Removed.
1127         Drop this class. JSNodeFilter / JSNodeFilterCustom now basically take
1128         care of all this.
1129
1130         * bindings/js/JSNodeFilterCustom.cpp:
1131         (WebCore::JSNodeFilter::acceptNode):
1132         Complete rewrite. This file is now only used to provide a custom
1133         implementation for JSNodeFilter::acceptNode(). The code is similar to
1134         what was previously done in JSNodeFilterCondition::acceptNode().
1135         There are several reasons we need custom bindings here:
1136         - The bindings generator does not handle yet callback functions
1137           returning anything else than a boolean.
1138         - The specification clearly states that we need to rethrow exceptions
1139           thrown by the callback function. However, the default behavior of
1140           our bindings is to simply report the exception.
1141
1142         * bindings/scripts/CodeGeneratorGObject.pm:
1143         Only skip functions that have parameters that are callback *functions*,
1144         not callback *interfaces*. Callback interfaces are very similar to
1145         interfaces and the generator is able to handle them. This change was
1146         needed for the GTK bindings generator would no longer generate bindings
1147         for Document.createNodeIterator() / Document.createTreeWalker(), now
1148         that NodeFilter is a callback interface instead of a regular interface.
1149
1150         * bindings/scripts/CodeGeneratorJS.pm:
1151         (GenerateCallbackHeader):
1152         (GenerateCallbackImplementation):
1153         Generate a toJS() function for callback interfaces as well. Previously,
1154         we would only generate those for regular interfaces. This is needed
1155         because NodeFilter is now a callback interface and it is exposed to
1156         JS via NodeIterator.filter / TreeWalker.filter. The implementation
1157         merely returns the callback object / function inside the JSCalbackData
1158         so the JS gets back the object / function it passed in.
1159
1160         * bindings/scripts/CodeGeneratorObjC.pm:
1161         Tweak the ObjC bindings generator to use NativeNodeFilter class instead
1162         of NodeFilter as NodeFilter is now a pure interfaces. Native bindings
1163         are now expected to use the NativeNodeFilter subclass instead.
1164
1165         * bindings/scripts/test/JS/JSTestCallback.cpp:
1166         * bindings/scripts/test/JS/JSTestCallback.h:
1167         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
1168         * bindings/scripts/test/JS/JSTestCallbackFunction.h:
1169         Rebaseline bindings tests now that we generate toJS() functions for
1170         callback functions / interfaces.
1171
1172         * dom/DOMAllInOne.cpp:
1173         Drop NodeFilter.cpp as it was removed.
1174
1175         * dom/NativeNodeFilter.cpp: Added.
1176         * dom/NativeNodeFilter.h: Added.
1177         Introduce new NativeNodeFilter class which subclasses the NodeFilter
1178         interface and is used by native bindings. Its accept() implementation
1179         uses NodeFilterCondition object internally to filter the nodes instead
1180         of a JS callback.
1181
1182         * dom/NodeFilter.cpp: Removed.
1183         * dom/NodeFilter.h:
1184         Make NodeFilter a pure interface. Its previous code is now either in
1185         NativeNodeFilter of JSNodeFilter.
1186
1187         * dom/NodeFilter.idl:
1188         Make NodeFilter a callback interface instead of a regular interface,
1189         as per the DOM specification. Also have its accept() operation return
1190         an unsigned short instead of a short to match the specification.
1191         The ObjC version still returns a short though for backward
1192         compatibility.
1193
1194         * dom/NodeFilterCondition.cpp:
1195         (WebCore::NodeFilterCondition::acceptNode):
1196         * dom/NodeFilterCondition.h:
1197
1198         * dom/NodeIterator.cpp:
1199         * dom/NodeIterator.h:
1200         * dom/NodeIterator.idl:
1201         * dom/Traversal.cpp:
1202         * dom/Traversal.h:
1203         * dom/TreeWalker.cpp:
1204         * dom/TreeWalker.h:
1205         * dom/TreeWalker.idl:
1206         Stop passing ExecState to TreeWalker / NodeIterator functions. It no
1207         longer seems to be needed as we now use the JSCallbackData abstraction
1208         for invoking JS.
1209
1210 2015-09-01  Chris Dumez  <cdumez@apple.com>
1211
1212         Range.insersectsNode(node) is supposed to return true if node.parent is null
1213         https://bugs.webkit.org/show_bug.cgi?id=148687
1214
1215         Reviewed by Ryosuke Niwa.
1216
1217         Range.insersectsNode(node) is supposed to return true if node.parent is
1218         null:
1219         https://dom.spec.whatwg.org/#dom-range-intersectsnode (step 3)
1220
1221         Previously, WebKit would throw a NotFoundError, apparently to match
1222         Firefox's behavior. However, these days, Firefox complies with the
1223         specification and returns true here.
1224
1225         No new tests, already covered by:
1226         http/tests/w3c/dom/ranges/Range-intersectsNode.html (rebaselined)
1227
1228         * dom/Range.cpp:
1229         (WebCore::Range::intersectsNode):
1230
1231 2015-09-01  Brian Burg  <bburg@apple.com>
1232
1233         Web Inspector: tighten up lifetimes for InspectorController-owned objects; add brace initializers to agents
1234         https://bugs.webkit.org/show_bug.cgi?id=148612
1235
1236         Reviewed by Joseph Pecoraro.
1237
1238         Both InjectedScriptManager and AgentRegistry (thus all agents) are
1239         owned by [Worker]InspectorController. So, use references.
1240
1241         InstrumentingAgents is morally owned by InspectorController as well, but
1242         must be a Ref for now since instrumentation cookies take a strong reference.
1243
1244         Add brace initalizers for scalar and pointer members in agent classes.
1245
1246         No new tests, no behavior change.
1247
1248         * inspector/InspectorApplicationCacheAgent.cpp:
1249         (WebCore::InspectorApplicationCacheAgent::InspectorApplicationCacheAgent):
1250         (WebCore::InspectorApplicationCacheAgent::willDestroyFrontendAndBackend):
1251         (WebCore::InspectorApplicationCacheAgent::enable):
1252         * inspector/InspectorApplicationCacheAgent.h:
1253         * inspector/InspectorCSSAgent.cpp:
1254         (WebCore::InspectorCSSAgent::InspectorCSSAgent):
1255         (WebCore::InspectorCSSAgent::enable):
1256         (WebCore::InspectorCSSAgent::disable):
1257         * inspector/InspectorCSSAgent.h:
1258         * inspector/InspectorConsoleInstrumentation.h:
1259         (WebCore::InspectorInstrumentation::addMessageToConsole):
1260         (WebCore::InspectorInstrumentation::consoleCount):
1261         (WebCore::InspectorInstrumentation::startProfiling):
1262         (WebCore::InspectorInstrumentation::stopProfiling):
1263         * inspector/InspectorController.cpp:
1264         (WebCore::InspectorController::InspectorController):
1265         (WebCore::InspectorController::connectFrontend):
1266         (WebCore::InspectorController::disconnectFrontend):
1267         (WebCore::InspectorController::disconnectAllFrontends):
1268         * inspector/InspectorController.h:
1269         * inspector/InspectorDOMAgent.cpp:
1270         (WebCore::InspectorDOMAgent::InspectorDOMAgent):
1271         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
1272         (WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend):
1273         (WebCore::InspectorDOMAgent::focusNode):
1274         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
1275         (WebCore::InspectorDOMAgent::nodeForObjectId):
1276         (WebCore::InspectorDOMAgent::resolveNode):
1277         * inspector/InspectorDOMAgent.h:
1278         * inspector/InspectorDOMDebuggerAgent.cpp:
1279         (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
1280         (WebCore::InspectorDOMDebuggerAgent::~InspectorDOMDebuggerAgent):
1281         (WebCore::InspectorDOMDebuggerAgent::debuggerWasEnabled):
1282         (WebCore::InspectorDOMDebuggerAgent::disable):
1283         * inspector/InspectorDOMDebuggerAgent.h:
1284         * inspector/InspectorDOMStorageAgent.cpp:
1285         (WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
1286         (WebCore::InspectorDOMStorageAgent::~InspectorDOMStorageAgent):
1287         * inspector/InspectorDOMStorageAgent.h:
1288         * inspector/InspectorDatabaseAgent.cpp:
1289         (WebCore::InspectorDatabaseAgent::InspectorDatabaseAgent):
1290         (WebCore::InspectorDatabaseAgent::~InspectorDatabaseAgent):
1291         * inspector/InspectorDatabaseAgent.h:
1292         * inspector/InspectorIndexedDBAgent.cpp:
1293         (WebCore::InspectorIndexedDBAgent::InspectorIndexedDBAgent):
1294         (WebCore::InspectorIndexedDBAgent::requestData):
1295         * inspector/InspectorIndexedDBAgent.h:
1296         * inspector/InspectorInstrumentation.cpp:
1297         (WebCore::InspectorInstrumentation::instrumentingAgentsForPage):
1298         (WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope):
1299         * inspector/InspectorInstrumentation.h:
1300         (WebCore::InspectorInstrumentation::mouseDidMoveOverElement):
1301         (WebCore::InspectorInstrumentation::scriptsEnabled):
1302         (WebCore::InspectorInstrumentation::didScroll):
1303         (WebCore::InspectorInstrumentation::markResourceAsCached):
1304         (WebCore::InspectorInstrumentation::didLoadResourceFromMemoryCache):
1305         (WebCore::InspectorInstrumentation::willRunJavaScriptDialog):
1306         (WebCore::InspectorInstrumentation::sessionCreated):
1307         (WebCore::InspectorInstrumentation::sessionLoaded):
1308         (WebCore::InspectorInstrumentation::sessionModified):
1309         (WebCore::InspectorInstrumentation::segmentCreated):
1310         (WebCore::InspectorInstrumentation::segmentCompleted):
1311         (WebCore::InspectorInstrumentation::segmentLoaded):
1312         (WebCore::InspectorInstrumentation::segmentUnloaded):
1313         (WebCore::InspectorInstrumentation::captureStarted):
1314         (WebCore::InspectorInstrumentation::captureStopped):
1315         (WebCore::InspectorInstrumentation::playbackStarted):
1316         (WebCore::InspectorInstrumentation::playbackPaused):
1317         (WebCore::InspectorInstrumentation::playbackFinished):
1318         (WebCore::InspectorInstrumentation::playbackHitPosition):
1319         * inspector/InspectorLayerTreeAgent.cpp:
1320         (WebCore::InspectorLayerTreeAgent::InspectorLayerTreeAgent):
1321         (WebCore::InspectorLayerTreeAgent::enable):
1322         (WebCore::InspectorLayerTreeAgent::disable):
1323         (WebCore::InspectorLayerTreeAgent::layersForNode):
1324         (WebCore::InspectorLayerTreeAgent::idForNode):
1325         * inspector/InspectorLayerTreeAgent.h:
1326         * inspector/InspectorPageAgent.cpp:
1327         (WebCore::InspectorPageAgent::InspectorPageAgent):
1328         (WebCore::InspectorPageAgent::timestamp):
1329         (WebCore::InspectorPageAgent::enable):
1330         (WebCore::InspectorPageAgent::disable):
1331         (WebCore::InspectorPageAgent::frameStartedLoading):
1332         (WebCore::InspectorPageAgent::snapshotNode):
1333         * inspector/InspectorPageAgent.h:
1334         * inspector/InspectorReplayAgent.cpp:
1335         (WebCore::InspectorReplayAgent::InspectorReplayAgent):
1336         (WebCore::InspectorReplayAgent::didCreateFrontendAndBackend):
1337         (WebCore::InspectorReplayAgent::willDestroyFrontendAndBackend):
1338         * inspector/InspectorReplayAgent.h:
1339         * inspector/InspectorResourceAgent.cpp:
1340         (WebCore::InspectorResourceAgent::InspectorResourceAgent):
1341         (WebCore::InspectorResourceAgent::~InspectorResourceAgent):
1342         (WebCore::InspectorResourceAgent::timestamp):
1343         (WebCore::InspectorResourceAgent::enable):
1344         (WebCore::InspectorResourceAgent::disable):
1345         * inspector/InspectorResourceAgent.h:
1346         * inspector/InspectorTimelineAgent.cpp:
1347         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
1348         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
1349         (WebCore::InspectorTimelineAgent::internalStart):
1350         (WebCore::InspectorTimelineAgent::internalStop):
1351         (WebCore::InspectorTimelineAgent::timestamp):
1352         (WebCore::InspectorTimelineAgent::startFromConsole):
1353         (WebCore::InspectorTimelineAgent::willCallFunction):
1354         (WebCore::InspectorTimelineAgent::willEvaluateScript):
1355         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
1356         * inspector/InspectorTimelineAgent.h:
1357         * inspector/InspectorWebAgentBase.h:
1358         (WebCore::InspectorAgentBase::InspectorAgentBase):
1359         * inspector/InspectorWorkerAgent.cpp:
1360         (WebCore::InspectorWorkerAgent::InspectorWorkerAgent):
1361         (WebCore::InspectorWorkerAgent::~InspectorWorkerAgent):
1362         * inspector/InspectorWorkerAgent.h:
1363         * inspector/InstrumentingAgents.cpp:
1364         (WebCore::InstrumentingAgents::InstrumentingAgents): Deleted.
1365         * inspector/InstrumentingAgents.h:
1366         (WebCore::InstrumentingAgents::create):
1367         * inspector/PageConsoleAgent.cpp:
1368         (WebCore::PageConsoleAgent::PageConsoleAgent):
1369         (WebCore::PageConsoleAgent::addInspectedNode):
1370         * inspector/PageConsoleAgent.h:
1371         * inspector/PageDebuggerAgent.cpp:
1372         (WebCore::PageDebuggerAgent::PageDebuggerAgent):
1373         (WebCore::PageDebuggerAgent::enable):
1374         (WebCore::PageDebuggerAgent::disable):
1375         (WebCore::PageDebuggerAgent::injectedScriptForEval):
1376         * inspector/PageDebuggerAgent.h:
1377         * inspector/PageRuntimeAgent.cpp:
1378         (WebCore::PageRuntimeAgent::PageRuntimeAgent):
1379         (WebCore::PageRuntimeAgent::injectedScriptForEval):
1380         (WebCore::PageRuntimeAgent::notifyContextCreated):
1381         * inspector/PageRuntimeAgent.h:
1382         * inspector/WebConsoleAgent.cpp:
1383         (WebCore::WebConsoleAgent::WebConsoleAgent):
1384         (WebCore::WebConsoleAgent::frameWindowDiscarded):
1385         (WebCore::WebConsoleAgent::didFinishXHRLoading):
1386         (WebCore::WebConsoleAgent::didReceiveResponse):
1387         (WebCore::WebConsoleAgent::didFailLoading):
1388         * inspector/WebConsoleAgent.h:
1389         * inspector/WebDebuggerAgent.cpp:
1390         (WebCore::WebDebuggerAgent::WebDebuggerAgent):
1391         (WebCore::WebDebuggerAgent::enable):
1392         (WebCore::WebDebuggerAgent::disable):
1393         * inspector/WebDebuggerAgent.h:
1394         * inspector/WorkerConsoleAgent.cpp:
1395         (WebCore::WorkerConsoleAgent::WorkerConsoleAgent):
1396         * inspector/WorkerConsoleAgent.h:
1397         * inspector/WorkerDebuggerAgent.cpp:
1398         (WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent):
1399         (WebCore::WorkerDebuggerAgent::injectedScriptForEval):
1400         * inspector/WorkerDebuggerAgent.h:
1401         * inspector/WorkerInspectorController.cpp:
1402         (WebCore::WorkerInspectorController::WorkerInspectorController):
1403         * inspector/WorkerInspectorController.h:
1404         * inspector/WorkerRuntimeAgent.cpp:
1405         (WebCore::WorkerRuntimeAgent::WorkerRuntimeAgent):
1406         (WebCore::WorkerRuntimeAgent::injectedScriptForEval):
1407         * inspector/WorkerRuntimeAgent.h:
1408
1409 2015-09-01  Jinyoung Hur  <hur.ims@navercorp.com>
1410
1411         [Cairo][WebGL] Upload the accelerated canvas as a texture by copying via GPU directly
1412         https://bugs.webkit.org/show_bug.cgi?id=148631
1413
1414         Reviewed by Dean Jackson.
1415
1416         When an accelerated canvas needs to be uploaded as a gl texture, it would be better to copy it to 
1417         texture directly via GPU using glCopyTexImage2D. 
1418         Note that GPU copy can not always be enabled because, with premultiplyAlpha and flipY unpack option,
1419         it seems hard to be implemented in a way of direct GPU copy.
1420
1421         No new tests because there is no behavior change.
1422
1423         * html/canvas/WebGLRenderingContextBase.cpp:
1424         (WebCore::WebGLRenderingContextBase::texImage2D):
1425         * platform/graphics/ImageBuffer.cpp:
1426         (WebCore::ImageBuffer::copyToPlatformTexture):
1427         * platform/graphics/ImageBuffer.h:
1428         * platform/graphics/cairo/ImageBufferCairo.cpp:
1429         (WebCore::ImageBuffer::copyToPlatformTexture):
1430
1431 2015-08-31  Dean Jackson  <dino@apple.com>
1432
1433         [mediacontrols] Add tests for the status display label
1434         https://bugs.webkit.org/show_bug.cgi?id=148656
1435         <rdar://problem/22509779>
1436
1437         Reviewed by Eric Carlson.
1438
1439         Export the StatusDisplay element and its current content.
1440
1441         Tests: media/controls/statusDisplay.html
1442                media/controls/statusDisplayBad.html
1443
1444         * Modules/mediacontrols/mediaControlsApple.js:
1445         (Controller.prototype.getCurrentControlsStatus):
1446
1447 2015-08-31  Dean Jackson  <dino@apple.com>
1448
1449         [mediacontrols] Add a test for the show controls button
1450         https://bugs.webkit.org/show_bug.cgi?id=148655
1451         <rdar://problem/22509688>
1452
1453         Reviewed by Eric Carlson.
1454
1455         We'll add a list of control elements to the status object,
1456         so we can query the state of buttons, etc. Begin with the
1457         Show Controls button (used for accessibility).
1458
1459         There are also some drive-by whitespace changes.
1460
1461         Test: media/controls/showControlsButton.html
1462
1463         * Modules/mediacontrols/mediaControlsApple.js:
1464         (Controller.prototype.get idiom): Differentiate between iOS and
1465         OS X. This isn't necessary at the moment, but will come in
1466         handy later.
1467         (Controller.prototype.createControls): Whitespace.
1468         (Controller.prototype.getCurrentControlsStatus): Add the information
1469         on the Show Controls button.
1470         * Modules/mediacontrols/mediaControlsiOS.js:
1471         (ControllerIOS.prototype.get idiom):
1472
1473 2015-09-01  Joseph Pecoraro  <pecoraro@apple.com>
1474
1475         Possible CFArray leak in MediaPlayerPrivateAVFoundationCF.cpp
1476         https://bugs.webkit.org/show_bug.cgi?id=148668
1477
1478         Reviewed by Eric Carlson.
1479
1480         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1481         (WebCore::mimeTypeCache): Deleted.
1482         (WebCore::avfMIMETypes):
1483         Fix the leak in avfMIMETypes. Consolidate on the single implementation.
1484         Note that avfMIMETypes lowercased the inputs and mimeTypeCache did not,
1485         but we now match MediaPlayerPrivateAVFoundationObjC which has one version
1486         that lowercased inputs as well.
1487
1488         (WebCore::MediaPlayerPrivateAVFoundationCF::getSupportedTypes):
1489         (WebCore::MediaPlayerPrivateAVFoundationCF::supportsType):
1490         (WebCore::MediaPlayerPrivateAVFoundationCF::supportsKeySystem):
1491         Convert to th enew verison.
1492
1493 2015-09-01  Javier Fernandez  <jfernandez@igalia.com>
1494
1495         [CSS Grid Layout] Layout is wrong for flex factor sum between 0 and 1
1496         https://bugs.webkit.org/show_bug.cgi?id=148645
1497
1498         Reviewed by Darin Adler.
1499
1500         This patch ensures that we don't normalize the individual tracks
1501         to fill the space. More precisely, when we sum up the flexes, that
1502         tells us how many "units" of flex need to fit into the free
1503         space. We then figure out what size to assign to the flex unit
1504         based on that, and send that back to the individual items, sizing
1505         them appropriately to their flex value.
1506
1507         This way we get flex fraction values applied correctly so they fill
1508         the available space in the indicated proportion. This approach has
1509         an additional advantage of dealing with division by 0 when reducing
1510         automatically the flex value.
1511
1512         Test: fast/css-grid-layout/flex-factor-sum-less-than-1.html
1513
1514         * rendering/RenderGrid.cpp:
1515         (WebCore::RenderGrid::computeNormalizedFractionBreadth):
1516
1517 2015-08-31  Commit Queue  <commit-queue@webkit.org>
1518
1519         Unreviewed, rolling out r189198.
1520         https://bugs.webkit.org/show_bug.cgi?id=148670
1521
1522         "Caused http/tests/navigation/anchor-frames-same-origin.html
1523         to fail on WebKit1" (Requested by cdumez on #webkit).
1524
1525         Reverted changeset:
1526
1527         "http/tests/w3c/dom/nodes/Element-matches.html is flaky"
1528         https://bugs.webkit.org/show_bug.cgi?id=148615
1529         http://trac.webkit.org/changeset/189198
1530
1531 2015-08-31  Joseph Pecoraro  <pecoraro@apple.com>
1532
1533         Remove unused #define
1534         https://bugs.webkit.org/show_bug.cgi?id=148667
1535
1536         Reviewed by Benjamin Poulain.
1537
1538         * platform/network/cf/ResourceResponseCFNet.cpp:
1539
1540 2015-08-31  Chris Dumez  <cdumez@apple.com>
1541
1542         Range API is throwing wrong exception type
1543         https://bugs.webkit.org/show_bug.cgi?id=148648
1544
1545         Reviewed by Ryosuke Niwa.
1546
1547         The RangeException type does not exist in the latest DOM specification.
1548         Instead, the Range API is throwing regular DOMExceptions [1]:
1549         https://dom.spec.whatwg.org/#range
1550
1551         The error codes also differ. RangeException.INVALID_NODE_TYPE_ERR (2)
1552         is replaced with DOMException.INVALID_NODE_TYPE_ERR (24).
1553         RangeException.BAD_BOUNDARYPOINTS_ERR (1) is replaced by
1554         DOMException.INVALID_STATE_ERR (11), as per:
1555         https://dom.spec.whatwg.org/#dom-range-surroundcontents (step 1).
1556
1557         This patch aligns WebKit's behavior with the specification and with
1558         other browsers (tested Firefox and Chrome).
1559
1560         [1] https://heycam.github.io/webidl/#dfn-DOMException
1561
1562         No new tests, covered by existing tests (rebaselined):
1563         http/tests/w3c/dom/ranges/Range-comparePoint.html
1564         http/tests/w3c/dom/ranges/Range-isPointInRange.html
1565         http/tests/w3c/dom/ranges/Range-selectNode.html
1566         http/tests/w3c/dom/ranges/Range-set.html
1567         http/tests/w3c/dom/ranges/Range-surroundContents.html
1568
1569         * CMakeLists.txt:
1570         * DerivedSources.cpp:
1571         * DerivedSources.make:
1572         * WebCore.vcxproj/WebCore.vcxproj:
1573         * WebCore.vcxproj/WebCore.vcxproj.filters:
1574         * WebCore.xcodeproj/project.pbxproj:
1575         * bindings/js/JSExceptionBase.cpp:
1576         (WebCore::toExceptionBase): Deleted.
1577         * dom/DOMAllInOne.cpp:
1578         * dom/DOMExceptions.in:
1579         * dom/Range.cpp:
1580         (WebCore::Range::insertNode):
1581         (WebCore::Range::checkNodeWOffset):
1582         (WebCore::Range::checkNodeBA):
1583         (WebCore::Range::selectNode):
1584         (WebCore::Range::selectNodeContents):
1585         (WebCore::Range::surroundContents):
1586         * dom/RangeException.cpp: Removed.
1587         * dom/RangeException.h: Removed.
1588         * dom/RangeException.idl: Removed.
1589
1590 2015-08-31  Yusuke Suzuki  <utatane.tea@gmail.com>
1591
1592         [ES6] Introduce ModuleProgramExecutable families and compile Module code to bytecode
1593         https://bugs.webkit.org/show_bug.cgi?id=148581
1594
1595         Reviewed by Saam Barati.
1596
1597         Add the ModuleProgramExecutable case.
1598
1599         * testing/Internals.cpp:
1600         (WebCore::Internals::parserMetaData):
1601
1602 2015-08-31  Brent Fulgham  <bfulgham@apple.com>
1603
1604         [Win] WebKit cannot load pages based on "file://" URLs
1605         https://bugs.webkit.org/show_bug.cgi?id=148596
1606         <rdar://problem/22432585>
1607
1608         Reviewed by Dean Jackson.
1609
1610         * platform/URL.cpp:
1611         (WebCore::URL::URL): Work around bug that causes this assertion to fire on
1612         the Apple Windows build.
1613         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
1614         (WebCore::adjustMIMETypeIfNecessary): Added. If the URL is for a local file,
1615         determine the MIME type based on extension. Otherwise use the default MIME type.
1616         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse): If
1617         the CFURLResponse has no MIME type, call 'adjustMIMETypeIfNecessary'.
1618
1619 2015-08-31  Chris Dumez  <cdumez@apple.com>
1620
1621         http/tests/w3c/dom/nodes/Element-matches.html is flaky
1622         https://bugs.webkit.org/show_bug.cgi?id=148615
1623
1624         Reviewed by Ryosuke Niwa.
1625
1626         Several newly-imported w3c tests were flaky due to the :target
1627         pseudo-class selectors sometimes giving different results. The
1628         issue seems to be that this type of selector relies on the
1629         Document::cssTarget() element to do the matching. We update
1630         this cssTarget Element in FrameView's scrollToFragment() /
1631         scrollToAnchor(). This is called from
1632         scrollToFragmentWithParentBoundary() which is called by
1633         FrameLoader's finishedParsing() and loadInSameDocument().
1634
1635         In the first one, it is called *after* calling checkComplete()
1636         which fires the onload event. However, in the second method,
1637         it is called *before*. This patch updates finishedParsing()
1638         so that scrollToFragmentWithParentBoundary() is called *before*
1639         firing the onload event, consistently with loadInSameDocument().
1640         This makes sure that JavaScript executed in an onload event
1641         handler will get accurate results for :target pseudo-class
1642         selectors.
1643
1644         No new tests, covered by:
1645         http/tests/w3c/dom/nodes/Element-matches.html
1646         http/tests/w3c/dom/nodes/ParentNode-querySelector-All-xhtml.xhtml
1647
1648         * loader/FrameLoader.cpp:
1649         (WebCore::FrameLoader::finishedParsing):
1650
1651 2015-08-31  Yusuke Suzuki  <utatane.tea@gmail.com>
1652
1653         The error handler of ReadableJSStream should own stream object
1654         https://bugs.webkit.org/show_bug.cgi?id=148653
1655
1656         Reviewed by Sam Weinig.
1657
1658         ReadableJSStream's m_errorFunction does not own the readable stream.
1659         So when this error callback is executed asynchronously through Promises,
1660         the stream could be already destroyed.
1661         The fulfill callback which is jointly configured with this error callback
1662         owns the stream. However, when the promise is rejected, the following things
1663         occur.
1664
1665         1. Promise clears the fulfill handlers immediately.
1666         2. queue the reject handlers to the microtask queue.
1667         3. When draining the microtasks, the rejected handler will be executed.
1668
1669         At the time of 2 or 3, the references to the fulfill handlers are already discarded.
1670         So when GC occurs at the time of 2 or 3, it will collect the fulfill handlers and the
1671         stream object owned by the fulfill handlers even if the error callback will touch the
1672         stream object later.
1673
1674         Before r189124, this fault does not occur. This is because the std::function in the
1675         fulfill handler is not destroyed before that patch. Since the std::function owns the
1676         stream object, the std::function and the stream object were leaked and never destroyed.
1677         After that patch, the std::function in the fulfill handler becomes destroyed. And it
1678         makes this fault happen.
1679
1680         In this patch, we separate the error callback from the stream object. Previously, the
1681         error callback resides in the stream object as the member. To avoid the cyclic references,
1682         this error callback did not own the stream object. But this causes this fault.
1683         Instead of caching the error callback in the stream object, we always create the error
1684         callback, when it is needed. The created error callback owns the stream object as well as
1685         the fulfill callbacks owns the stream object.
1686
1687         No behavior change.
1688
1689         * bindings/js/ReadableJSStream.cpp:
1690         (WebCore::createGenericErrorRejectedFunction):
1691         (WebCore::ReadableJSStream::doStart):
1692         (WebCore::ReadableJSStream::doPull):
1693         (WebCore::ReadableJSStream::ReadableJSStream): Deleted.
1694         * bindings/js/ReadableJSStream.h:
1695
1696 2015-08-26  Andy Estes  <aestes@apple.com>
1697
1698         [Content Filtering] Determine navigation and content policy before continuing to filter a load
1699         https://bugs.webkit.org/show_bug.cgi?id=148506
1700
1701         Reviewed by Brady Eidson.
1702
1703         Prior to this change, ContentFilter would hide from DocumentLoader all CachedRawResourceClient callbacks until
1704         a decision was made, then replay the missed callbacks. This approach interacted poorly with some features of
1705         the loader, notably appcache and downloads. In the case of appcache, DocumentLoader might not have a chance to
1706         check for substitute data until the original load has finished, wasting bandwidth, and might receive duplicate
1707         or out-of-order callbacks. In the case of downloads, it would often be too late to convert the existing
1708         connection to a download, leading to restarted downloads or outright failures.
1709
1710         Bandaids were put in place for these issues in r188150, r188486, and r188851 to fix crashes or serious
1711         regressions in behavior, but these weren't complete fixes. They did not solve any of the duplicate data loading
1712         problems, and they did not make downloads work reliably in all cases.
1713
1714         This patch rolls out the bandaids (but keeps their tests) and replaces them with a more robust fix. Instead of
1715         hiding callbacks from DocumentLoader, ContentFilter now delivers willSendRequest(), redirectReceived(), and
1716         responseReceived() to DocumentLoader immediately, and cancels filtering if DocumentLoader decides to ignore the
1717         load, download it, or load substitute data. ContentFilter continues to buffer incoming data to prevent partial
1718         rendering of blocked content.
1719
1720         The existing tests for r188150 and r188851 were kept, the test for r188486 was rewritten to be specific to
1721         content filtering, and new tests were added to cover the case where ContentFilter is still undecided after a
1722         load finishes.
1723
1724         Tests: contentfiltering/allow-never.html
1725                contentfiltering/block-never.html
1726                ContentFiltering.AllowDownloadAfterAddData
1727                ContentFiltering.AllowDownloadAfterFinishedAddingData
1728                ContentFiltering.AllowDownloadAfterRedirect
1729                ContentFiltering.AllowDownloadAfterResponse
1730                ContentFiltering.AllowDownloadAfterWillSendRequest
1731                ContentFiltering.AllowDownloadNever
1732                ContentFiltering.BlockDownloadAfterAddData
1733                ContentFiltering.BlockDownloadAfterFinishedAddingData
1734                ContentFiltering.BlockDownloadAfterRedirect
1735                ContentFiltering.BlockDownloadAfterResponse
1736                ContentFiltering.BlockDownloadAfterWillSendRequest
1737                ContentFiltering.BlockDownloadNever
1738
1739         * bindings/js/JSMockContentFilterSettingsCustom.cpp:
1740         (WebCore::JSMockContentFilterSettings::decisionPoint): Taught to handle DecisionPoint::Never, and rewrote to
1741         not need a set of const uint8_ts that mirror the DecisionPoint enum.
1742         (WebCore::JSMockContentFilterSettings::setDecisionPoint): Ditto.
1743         (WebCore::toJSValue): Rewrote to not need a set of const uint8_ts that mirror the Decision enum.
1744         (WebCore::toDecision): Ditto.
1745         * loader/ContentFilter.cpp:
1746         (WebCore::ContentFilter::createIfEnabled): Renamed from createIfNeeded, and changed to take a DocumentLoader&
1747         instead of a DecisionFunction.
1748         (WebCore::ContentFilter::ContentFilter):
1749         (WebCore::ContentFilter::responseReceived): If m_state != Blocked after filtering, call DocumentLoader::responseReceived().
1750         (WebCore::ContentFilter::dataReceived): If m_state == Allowed after filtering, deliver buffered data to DocumentLoader.
1751         If no filtering was necessary, call DocumentLoader::dataReceived() directly.
1752         (WebCore::ContentFilter::redirectReceived): If m_state != Blocked after filtering, call DocumentLoader::redirectReceived().
1753         (WebCore::ContentFilter::notifyFinished): If an error occured, call DocumentLoader::notifyFinished() immediately and return.
1754         If m_state != Blocked after filtering, deliver buffered data to DocumentLoader and call DocumentLoader::notifyFinished().
1755         If no filtering was necessary and m_state != Blocked, call DocumentLoader::notifyFinished() directly.
1756         (WebCore::ContentFilter::didDecide): Called DocumentLoader::contentFilterDidDecide() instead of m_decisionFunction().
1757         (WebCore::ContentFilter::deliverResourceData): Added a helper function to deliver buffered data to DocumentLoader.
1758         (WebCore::ContentFilter::createIfNeeded): Renamed to createIfEnabled().
1759         * loader/ContentFilter.h:
1760         * loader/DocumentLoader.cpp:
1761         (WebCore::DocumentLoader::DocumentLoader):
1762         (WebCore::DocumentLoader::willSendRequest): Stopped asserting that redirectResponse is null and made it part of
1763         the if condition instead, since willSendRequest() will now be called on redirects when there is an active ContentFilter.
1764         (WebCore::DocumentLoader::startLoadingMainResource): Called becomeMainResourceClient() instead of becomeMainResourceClientIfFilterAllows().
1765         (WebCore::DocumentLoader::becomeMainResourceClient): Renamed from becomeMainResourceClientIfFilterAllows().
1766         Only called ContentFilter::startFilteringMainResource() if the filter state is Initialized, since ContentFilter
1767         might have already made a decision in willSendRequest().
1768         (WebCore::DocumentLoader::contentFilterDidDecide): Stopped deleting m_contentFilter, since it will continue to deliver callbacks
1769         even after making a decision. Fixed a bug where we were creating two copies of ContentFilter's replacement data.
1770         (WebCore::DocumentLoader::syntheticRedirectReceived): Deleted.
1771         (WebCore::DocumentLoader::becomeMainResourceClientIfFilterAllows): Renamed to becomeMainResourceClient().
1772         * loader/DocumentLoader.h:
1773         * loader/EmptyClients.h:
1774         * loader/FrameLoaderClient.h:
1775         * loader/ResourceLoader.cpp:
1776         (WebCore::ResourceLoader::willSendRequestInternal): Removed part of r188851.
1777         * loader/SubresourceLoader.cpp:
1778         (WebCore::SubresourceLoader::didReceiveResponse): Removed part of r188486.
1779         * loader/SubresourceLoader.h:
1780         * loader/cache/CachedRawResource.cpp:
1781         (WebCore::CachedRawResource::didAddClient): Removed part of r188150.
1782         * loader/cache/CachedRawResourceClient.h:
1783         (WebCore::CachedRawResourceClient::syntheticRedirectReceived): Removed part of r188150.
1784         * testing/MockContentFilterSettings.h: Defined DecisionPoint::Never.
1785         * testing/MockContentFilterSettings.idl: Defined DECISION_POINT_NEVER.
1786
1787 2015-08-31  Chris Dumez  <cdumez@apple.com>
1788
1789         Unreviewed, rebaseline bindings tests after r189184.
1790
1791 2015-08-31  Chris Dumez  <cdumez@apple.com>
1792
1793         NodeFilter.SHOW_ALL has wrong value on 32-bit
1794         https://bugs.webkit.org/show_bug.cgi?id=148602
1795
1796         Reviewed by Geoffrey Garen.
1797
1798         NodeFilter.SHOW_ALL has wrong value on 32-bit. This is because
1799         NodeFilter.SHOW_ALL is an unsigned long whose value is 0xFFFFFFFF but
1800         our bindings code is casting it to an intptr_t type which is not wide
1801         enough on 32-bit.
1802
1803         No new tests, already covered by fast/dom/node-filter-interface.html
1804         which is now unskipped on Windows / 32bit.
1805
1806         * bindings/scripts/CodeGeneratorJS.pm:
1807         (GenerateHashTableValueArray):
1808         Generate extra curly brackets to initialize the new union member.
1809         Also cast to long long the constant instead of intptr_t.
1810
1811         * dom/NodeFilter.h:
1812         Explicitly mark the enum underlying type to be an unsigned long
1813         to make sure it can hold the value for SHOW_ALL on all platforms.
1814         On Windows, it seems the default underlying type is an int for
1815         e.g.
1816
1817 2015-08-31  Chris Dumez  <cdumez@apple.com>
1818
1819         Range.detach() / NodeIterator.detach() should be no-ops as per the latest DOM specification
1820         https://bugs.webkit.org/show_bug.cgi?id=148454
1821
1822         Reviewed by Ryosuke Niwa.
1823
1824         Range.detach() / NodeIterator.detach() should be no-ops as per the
1825         latest DOM specification:
1826         - https://dom.spec.whatwg.org/#dom-range-detach
1827         - https://dom.spec.whatwg.org/#dom-nodeiterator-detach
1828
1829         These are already no-ops in Firefox:
1830         - https://bugzilla.mozilla.org/show_bug.cgi?id=702948
1831         - https://bugzilla.mozilla.org/show_bug.cgi?id=823549
1832
1833         and Chrome:
1834         - https://src.chromium.org/viewvc/blink?revision=173010&view=revision
1835         - https://src.chromium.org/viewvc/blink?revision=172768&view=revision
1836
1837         Tests: fast/dom/Range/range-detach-noop.html
1838                fast/dom/node-iterator-detach-noop.html
1839
1840         * accessibility/AccessibilityObject.cpp:
1841         (WebCore::AccessibilityObject::selectText):
1842         (WebCore::AccessibilityObject::stringForVisiblePositionRange):
1843         (WebCore::AccessibilityObject::lengthForVisiblePositionRange):
1844         * accessibility/atk/WebKitAccessibleUtil.cpp:
1845         (selectionBelongsToObject):
1846         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1847         (-[WebAccessibilityObjectWrapper arrayOfTextForTextMarkers:attributed:]):
1848         (-[WebAccessibilityObjectWrapper _convertToNSRange:]):
1849         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1850         (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:]):
1851         (-[WebAccessibilityObjectWrapper _convertToNSRange:]):
1852         * bindings/scripts/CodeGeneratorGObject.pm:
1853         (FunctionUsedToRaiseException):
1854         * dom/DocumentMarkerController.cpp:
1855         (WebCore::DocumentMarkerController::addMarker):
1856         (WebCore::DocumentMarkerController::addTextMatchMarker):
1857         (WebCore::DocumentMarkerController::addDictationPhraseWithAlternativesMarker):
1858         (WebCore::DocumentMarkerController::addDictationResultMarker):
1859         (WebCore::DocumentMarkerController::removeMarkers):
1860         (WebCore::DocumentMarkerController::markersInRange):
1861         (DocumentMarkerController::setMarkersActive):
1862         (DocumentMarkerController::hasMarkers):
1863         (DocumentMarkerController::clearDescriptionOnMarkersIntersectingRange):
1864         * dom/NodeIterator.cpp:
1865         (WebCore::NodeIterator::nextNode):
1866         (WebCore::NodeIterator::previousNode):
1867         (WebCore::NodeIterator::detach):
1868         (WebCore::NodeIterator::NodeIterator): Deleted.
1869         (WebCore::NodeIterator::nodeWillBeRemoved): Deleted.
1870         (WebCore::NodeIterator::updateForNodeRemoval): Deleted.
1871         * dom/NodeIterator.h:
1872         (WebCore::NodeIterator::nextNode):
1873         (WebCore::NodeIterator::previousNode):
1874         * dom/NodeIterator.idl:
1875         * dom/Range.cpp:
1876         (WebCore::Range::commonAncestorContainer):
1877         (WebCore::Range::setStart):
1878         (WebCore::Range::setEnd):
1879         (WebCore::Range::collapse):
1880         (WebCore::Range::isPointInRange):
1881         (WebCore::Range::comparePoint):
1882         (WebCore::Range::compareNode):
1883         (WebCore::Range::compareBoundaryPoints):
1884         (WebCore::Range::boundaryPointsValid):
1885         (WebCore::Range::deleteContents):
1886         (WebCore::Range::processContents):
1887         (WebCore::Range::processContentsBetweenOffsets):
1888         (WebCore::Range::processAncestorsAndTheirSiblings):
1889         (WebCore::Range::extractContents):
1890         (WebCore::Range::cloneContents):
1891         (WebCore::Range::insertNode):
1892         (WebCore::Range::toString):
1893         (WebCore::Range::text):
1894         (WebCore::Range::createContextualFragment):
1895         (WebCore::Range::detach):
1896         (WebCore::Range::cloneRange):
1897         (WebCore::Range::surroundContents):
1898         (WebCore::Range::checkDeleteExtract):
1899         (WebCore::Range::containedByReadOnly):
1900         (WebCore::Range::firstNode):
1901         (WebCore::Range::shadowRoot):
1902         (WebCore::Range::pastLastNode):
1903         (WebCore::Range::absoluteTextRects):
1904         (WebCore::Range::absoluteTextQuads):
1905         (WebCore::Range::collectSelectionRects):
1906         (WebCore::Range::formatForDebugger):
1907         (WebCore::Range::contains):
1908         (WebCore::rangesOverlap):
1909         (WebCore::Range::getBorderAndTextQuads):
1910         (WebCore::Range::boundingRectInternal):
1911         (showTree):
1912         (WebCore::checkForDifferentRootContainer): Deleted.
1913         (WebCore::lengthOfContentsInNode): Deleted.
1914         (WebCore::Range::processNodes): Deleted.
1915         (WebCore::Range::checkNodeWOffset): Deleted.
1916         (WebCore::Range::checkNodeBA): Deleted.
1917         (WebCore::Range::setStartAfter): Deleted.
1918         (WebCore::Range::setEndBefore): Deleted.
1919         (WebCore::Range::setEndAfter): Deleted.
1920         (WebCore::Range::selectNode): Deleted.
1921         (WebCore::intervalsSufficientlyOverlap): Deleted.
1922         (WebCore::coalesceSelectionRects): Deleted.
1923         (WebCore::areRangesEqual): Deleted.
1924         (WebCore::boundaryTextNodesSplit): Deleted.
1925         (WebCore::Range::textNodeSplit): Deleted.
1926         (WebCore::Range::expand): Deleted.
1927         * dom/Range.h:
1928         (WebCore::Range::startContainer):
1929         (WebCore::Range::endContainer):
1930         (WebCore::Range::collapsed):
1931         (WebCore::Range::commonAncestorContainer):
1932         * dom/Range.idl:
1933         * editing/AlternativeTextController.cpp:
1934         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
1935         (WebCore::AlternativeTextController::handleAlternativeTextUIResult):
1936         (WebCore::AlternativeTextController::markReversed):
1937         (WebCore::AlternativeTextController::markCorrection):
1938         (WebCore::AlternativeTextController::recordSpellcheckerResponseForModifiedCorrection):
1939         (WebCore::AlternativeTextController::applyDictationAlternative):
1940         * editing/EditingStyle.cpp:
1941         (WebCore::EditingStyle::styleAtSelectionStart):
1942         * editing/Editor.cpp:
1943         (WebCore::Editor::canDeleteRange):
1944         (WebCore::Editor::shouldDeleteRange):
1945         (WebCore::Editor::advanceToNextMisspelling):
1946         (WebCore::Editor::markMisspellingsOrBadGrammar):
1947         (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
1948         (WebCore::correctSpellcheckingPreservingTextCheckingParagraph):
1949         (WebCore::Editor::markAndReplaceFor):
1950         (WebCore::Editor::changeBackToReplacedString):
1951         (WebCore::Editor::firstRectForRange):
1952         (WebCore::Editor::rangeOfString):
1953         (WebCore::Editor::countMatchesForText):
1954         (WebCore::Editor::scanRangeForTelephoneNumbers):
1955         (WebCore::isFrameInRange): Deleted.
1956         * editing/EditorCommand.cpp:
1957         (WebCore::expandSelectionToGranularity):
1958         (WebCore::unionDOMRanges):
1959         * editing/FormatBlockCommand.cpp:
1960         (WebCore::FormatBlockCommand::elementForFormatBlockCommand):
1961         * editing/FrameSelection.cpp:
1962         (WebCore::FrameSelection::setSelectedRange):
1963         (WebCore::FrameSelection::wordOffsetInRange):
1964         (WebCore::FrameSelection::spaceFollowsWordInRange):
1965         (WebCore::FrameSelection::selectionAtDocumentStart): Deleted.
1966         * editing/MarkupAccumulator.cpp:
1967         (WebCore::MarkupAccumulator::appendText):
1968         * editing/SpellChecker.cpp:
1969         (WebCore::SpellCheckRequest::SpellCheckRequest):
1970         (WebCore::SpellChecker::isCheckable):
1971         * editing/SpellingCorrectionCommand.cpp:
1972         (WebCore::SpellingCorrectionCommand::SpellingCorrectionCommand):
1973         * editing/TextCheckingHelper.cpp:
1974         (WebCore::expandToParagraphBoundary):
1975         (WebCore::TextCheckingParagraph::offsetTo):
1976         (WebCore::TextCheckingParagraph::offsetAsRange):
1977         (WebCore::TextCheckingHelper::findFirstMisspelling):
1978         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
1979         (WebCore::TextCheckingHelper::findFirstGrammarDetail):
1980         (WebCore::TextCheckingHelper::isUngrammatical):
1981         (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange):
1982         * editing/TextIterator.cpp:
1983         (WebCore::TextIterator::TextIterator):
1984         (WebCore::TextIterator::node):
1985         (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
1986         (WebCore::CharacterIterator::range):
1987         (WebCore::characterSubrange):
1988         (WebCore::BackwardsCharacterIterator::range):
1989         (WebCore::TextIterator::rangeFromLocationAndLength):
1990         (WebCore::TextIterator::getLocationAndLengthFromRange):
1991         (WebCore::collapsedToBoundary):
1992         (WebCore::findPlainText):
1993         (WebCore::BackwardsCharacterIterator::BackwardsCharacterIterator): Deleted.
1994         (WebCore::BackwardsCharacterIterator::advance): Deleted.
1995         (WebCore::plainText): Deleted.
1996         * editing/VisibleUnits.cpp:
1997         (WebCore::previousBoundary):
1998         * editing/cocoa/HTMLConverter.mm:
1999         (HTMLConverter::_processText):
2000         (HTMLConverter::_traverseNode):
2001         (HTMLConverter::_traverseFooterNode):
2002         (HTMLConverterCaches::cacheAncestorsOfStartToBeConverted):
2003         (WebCore::editingAttributedStringFromRange):
2004         * editing/mac/EditorMac.mm:
2005         (WebCore::Editor::adjustedSelectionRange):
2006         * editing/markup.cpp:
2007         (WebCore::StyledMarkupAccumulator::renderedText):
2008         (WebCore::StyledMarkupAccumulator::stringValueForRange):
2009         (WebCore::highestAncestorToWrapMarkup):
2010         (WebCore::createMarkupInternal):
2011         (WebCore::createFullMarkup):
2012         (WebCore::urlToMarkup): Deleted.
2013         * loader/archive/cf/LegacyWebArchive.cpp:
2014         (WebCore::LegacyWebArchive::create):
2015         * page/ContextMenuController.cpp:
2016         (WebCore::ContextMenuController::contextMenuItemSelected):
2017         * page/DOMSelection.cpp:
2018         (WebCore::DOMSelection::deleteFromDocument):
2019         (WebCore::DOMSelection::containsNode):
2020         * page/TextIndicator.cpp:
2021         (WebCore::TextIndicator::createWithRange):
2022         * page/ios/FrameIOS.mm:
2023         (WebCore::Frame::indexCountOfWordPrecedingSelection):
2024         (WebCore::Frame::wordsInCurrentParagraph):
2025         * platform/win/PasteboardWin.cpp:
2026         (WebCore::Pasteboard::writeRangeToDataObject):
2027         (WebCore::Pasteboard::writeSelection):
2028         * rendering/RenderNamedFlowThread.cpp:
2029         (WebCore::RenderNamedFlowThread::getRanges):
2030         * rendering/RenderObject.cpp:
2031         (WebCore::RenderObject::absoluteBoundingBoxRectForRange):
2032
2033 2015-08-31  Myles C. Maxfield  <mmaxfield@apple.com>
2034
2035         [Cocoa] Unify showGlyphsWithAdvances
2036         https://bugs.webkit.org/show_bug.cgi?id=148565
2037
2038         Reviewed by Dean Jackson.
2039
2040         None of the fonts created for WebKit have the renderingMode of
2041         NSFontAntialiasedIntegerAdvancementsRenderingMode and are already printer fonts.
2042
2043         No new tests because there is no behavior change.
2044
2045         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2046         (WebCore::setCGFontRenderingMode):
2047         (WebCore::FontCascade::drawGlyphs):
2048
2049 2015-08-31  Tim Horton  <timothy_horton@apple.com>
2050
2051         iOS WebKit2 find-in-page doesn't support multi-line results, is often blank
2052         https://bugs.webkit.org/show_bug.cgi?id=148599
2053         <rdar://problem/17914031>
2054
2055         Reviewed by Beth Dakin.
2056
2057         * editing/FrameSelection.cpp:
2058         (WebCore::FrameSelection::getClippedVisibleTextRectangles):
2059         (WebCore::FrameSelection::getTextRectangles):
2060         * editing/FrameSelection.h:
2061         * page/TextIndicator.cpp:
2062         (WebCore::initializeIndicator):
2063         * page/TextIndicator.h:
2064         Make it possible to create a TextIndicator that isn't clipped to the visible rect,
2065         because iOS find-in-page TextIndicators persist while scrolling the page,
2066         and are already constrained to the document rect anyway.
2067
2068 2015-08-31  Michael Catanzaro  <mcatanzaro@igalia.com>
2069
2070         [Freetype] FontCache::strengthOfFirstAlias leaks an FcPattern
2071         https://bugs.webkit.org/show_bug.cgi?id=148624
2072
2073         Reviewed by Martin Robinson.
2074
2075         Using the normal RefPtr constructor causes the FcPattern to be reffed one extra time. Even
2076         though the FcPattern is intentionally leaked to FcFontSetAdd down below, the FcPattern has
2077         its own refcount and now it's screwed up. Just completely stop using RefPtr for these
2078         FcPatterns, since the potential for confusion regarding leakRef combined with Fontconfig
2079         refcounting far outweighs the benefit of using a smart pointer.
2080
2081         * platform/graphics/freetype/FontCacheFreeType.cpp:
2082         (WebCore::strengthOfFirstAlias):
2083
2084 2015-08-31  Javier Fernandez  <jfernandez@igalia.com>
2085
2086         [CSS Grid Layout] auto-margins alignment does not work for heights
2087         https://bugs.webkit.org/show_bug.cgi?id=148071
2088
2089         Reviewed by Sergio Villar Senin.
2090
2091         We still had pending to align grid items horizontally via auto-margins
2092         alignment. We already landed a patch in r188582 to implement the
2093         column-axis alignment and this patch implements the expected behavior in
2094         the row-axis.
2095
2096         This patch also removes the logic in RenderBox, so we reduce grid related
2097         code dependencies in the general layout logic. We can do that because this
2098         patch manages that in the layoutGridItems function by resetting grid item's
2099         margin and logicalTop (if it does not need to perform a layout, which it
2100         would do the job anyway).
2101
2102         No new tests, we just need to adapt some cases of the ones we already have.
2103
2104         * rendering/RenderBox.cpp:
2105         (WebCore::RenderBox::styleDidChange): Deleted.
2106         (WebCore::RenderBox::willBeRemovedFromTree): Deleted.
2107         (WebCore::RenderBox::updateFromStyle): Deleted.
2108         * rendering/RenderGrid.cpp:
2109         (WebCore::RenderGrid::layoutGridItems):
2110         (WebCore::RenderGrid::resetAutoMarginsAndLogicalTopInColumnAxis):
2111         (WebCore::RenderGrid::updateAutoMarginsInRowAxisIfNeeded):
2112         (WebCore::RenderGrid::updateAutoMarginsInColumnAxisIfNeeded):
2113         (WebCore::RenderGrid::hasAutoMarginsInRowAxis): Deleted.
2114         * rendering/RenderGrid.h:
2115
2116 2015-08-31  Alexey Proskuryakov  <ap@apple.com>
2117
2118         Build fix.
2119
2120         * page/EventHandler.h:
2121         (WebCore::EventHandler::immediateActionStage): Don't export an inline function,
2122         to avoid "weak external symbol" errors.
2123
2124 2015-08-31  Enrica Casucci  <enrica@apple.com>
2125
2126         Incorrect cursor movement for U+26F9, U+1F3CB with variations.
2127         https://bugs.webkit.org/show_bug.cgi?id=148629
2128         rdar://problem/22492366
2129
2130         Reviewed by Ryosuke Niwa.
2131
2132         Updating text break iterator rules to correctly handle those two emoji with variations.
2133
2134         * platform/text/TextBreakIterator.cpp:
2135         (WebCore::cursorMovementIterator):
2136
2137 2015-07-31  Sergio Villar Senin  <svillar@igalia.com>
2138
2139         [css-grid] Grid containers reporting wrong preferred widths
2140         https://bugs.webkit.org/show_bug.cgi?id=147486
2141
2142         Reviewed by Darin Adler.
2143
2144         RenderGrid used to have its own overwritten version of
2145         computePreferredLogicalWidths() because we didn't have an
2146         implementation of computeIntrinsicLogicalWidths(). That
2147         implementation was not as complete as RenderBlock's because it
2148         was not taking into account min/max-width restrictions.
2149
2150         Provided that computeIntrinsicLogicalWidths() has been there
2151         for some time we can safelly kill our overwrite and use
2152         RenderBlock's version which addresses all the FIXMEs we had in
2153         our code.
2154
2155         * rendering/RenderGrid.cpp:
2156         * rendering/RenderGrid.h:
2157
2158 2015-08-31  Sungmann Cho  <sungmann.cho@navercorp.com>
2159
2160         Fix the WinCairo build after landing of webkit.org/b/148561.
2161         https://bugs.webkit.org/show_bug.cgi?id=148627
2162
2163         Reviewed by Myles C. Maxfield.
2164
2165         No new tests, no behavior change.
2166
2167         * platform/graphics/win/ImageCairoWin.cpp:
2168         (WebCore::BitmapImage::getHBITMAPOfSize):
2169         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2170         (WebCore::MediaPlayerPrivateMediaFoundation::paint):
2171         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2172
2173 2015-08-31  Antti Koivisto  <antti@apple.com>
2174
2175         REGRESSION (r188820): fast/dom/HTMLObjectElement/object-as-frame.html is flaky
2176         https://bugs.webkit.org/show_bug.cgi?id=148533
2177
2178         Reviewed by Chris Dumez.
2179
2180         <object> element may cause document load event fire too early. By making data URL
2181         loading faster r188820 made this condition more likely to trigger in this test.
2182
2183         * loader/SubframeLoader.cpp:
2184         (WebCore::SubframeLoader::loadSubframe):
2185
2186             Post-parsing style recalc may trigger loads for <object> elements. If all other loads have already
2187             completed this may cause load event to fire synchronously from the initial empty document construction.
2188
2189             Fix by preventing load events during subframe initialization. They will be fired if needed by the
2190             subsequent explicit call to FrameLoader::checkCompleted.
2191
2192 2015-08-30  Ryuan Choi  <ryuan.choi@navercorp.com>
2193
2194         [CoordinatedGraphics] Remove unnecessary two virtual methods from TiledBackingStoreClient
2195         https://bugs.webkit.org/show_bug.cgi?id=147137
2196
2197         Reviewed by Gyuyoung Kim.
2198
2199         tiledBackingStoreContentsRect() and tiledBackingStoreVisibleRect() are not
2200         necessary because CoordinatedGraphicsLayer can pass them directly if needed.
2201         This patch removes them in order to simplify code flow between TiledBackingStore
2202         and CoordinatedGraphicsLayer.
2203
2204         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2205         (WebCore::CoordinatedGraphicsLayer::imageBackingVisible):
2206         (WebCore::CoordinatedGraphicsLayer::adjustContentsScale):
2207         (WebCore::clampToContentsRectIfRectIsInfinite):
2208         (WebCore::CoordinatedGraphicsLayer::transformedVisibleRect):
2209         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
2210         (WebCore::CoordinatedGraphicsLayer::tiledBackingStoreContentsRect): Deleted.
2211         (WebCore::CoordinatedGraphicsLayer::tiledBackingStoreVisibleRect): Deleted.
2212         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2213         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
2214         (WebCore::TiledBackingStore::createTilesIfNeeded):
2215         (WebCore::TiledBackingStore::coverageRatio):
2216         (WebCore::TiledBackingStore::visibleAreaIsCovered):
2217         Used TiledBackingStore's m_visibleRect and m_rect, cached and scaled values for
2218         visibleRect, contentsRect.
2219         (WebCore::TiledBackingStore::createTiles):
2220         (WebCore::TiledBackingStore::removeAllNonVisibleTiles):
2221         (WebCore::TiledBackingStore::coverWithTilesIfNeeded): Renamed to createTilesIfNeeded.
2222         (WebCore::TiledBackingStore::visibleRect): Deleted. nobody used.
2223         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
2224         * platform/graphics/texmap/coordinated/TiledBackingStoreClient.h:
2225         (WebCore::TiledBackingStoreClient::tiledBackingStoreHasPendingTileCreation):
2226         Removed default implementation.
2227
2228 2015-08-29  Jessie Berlin  <berlin@apple.com>
2229
2230         El Capitan build fix.
2231
2232         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2233         (WebCore::FontCascade::drawGlyphs):
2234
2235 2015-08-29  Chris Fleizach  <cfleizach@apple.com>
2236
2237         AX: When navigating the elements of a scrollable element with VoiceOver, the scrollTop() position of the element does not permanently change
2238         https://bugs.webkit.org/show_bug.cgi?id=125720
2239
2240         Reviewed by Daniel Bates.
2241
2242         The scrollToVisible code did not account for scrollable elements that are larger than their viewports.
2243         First, we need to pass the sub-focus up the scroll chain (otherwise we'll scroll some parent to y=0).
2244         Second, we should try to center the focus within the viewport, rather than positioning at the bottom for a 
2245         better experience.
2246
2247         This change was adapted from Blink r183926:
2248         https://src.chromium.org/viewvc/blink?view=rev&revision=183926
2249
2250         Tests: accessibility/scroll-to-global-point-iframe-nested.html
2251                accessibility/scroll-to-global-point-iframe.html
2252                accessibility/scroll-to-global-point-main-window.html
2253                accessibility/scroll-to-global-point-nested.html
2254                accessibility/scroll-to-make-visible-div-overflow.html
2255                accessibility/scroll-to-make-visible-iframe.html
2256                accessibility/scroll-to-make-visible-nested-2.html
2257                accessibility/scroll-to-make-visible-nested.html
2258                accessibility/scroll-to-make-visible-with-subfocus.html
2259
2260         * accessibility/AccessibilityObject.cpp:
2261         (WebCore::computeBestScrollOffset):
2262         (WebCore::AccessibilityObject::isOnscreen):
2263         (WebCore::AccessibilityObject::scrollToMakeVisibleWithSubFocus):
2264         (WebCore::AccessibilityObject::scrollToGlobalPoint):
2265         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2266         (-[WebAccessibilityObjectWrapper accessibilityScrollToVisible]):
2267         (-[WebAccessibilityObjectWrapper _accessibilityScrollToMakeVisibleWithSubFocus:]):
2268         (-[WebAccessibilityObjectWrapper _accessibilityScrollToGlobalPoint:]):
2269         (-[WebAccessibilityObjectWrapper accessibilityPerformAction:]):
2270
2271 2015-08-28  Myles C. Maxfield  <mmaxfield@apple.com>
2272
2273         Migrate GraphicsContexts from pointers to references
2274         https://bugs.webkit.org/show_bug.cgi?id=148561
2275
2276         Reviewed by Tim Horton.
2277
2278         We were using GraphicsContext*s throughout our rendering code. However,
2279         these contexts can't be nullptr. This patch migrates users to
2280         GraphicsContext&s.
2281
2282         This is a purely mechanical change.
2283
2284         No new tests because there is no behavior change.
2285
2286         * css/CSSFilterImageValue.cpp:
2287         (WebCore::CSSFilterImageValue::image):
2288         * editing/Editor.cpp:
2289         (WebCore::Editor::countMatchesForText):
2290         * editing/FrameSelection.cpp:
2291         (WebCore::FrameSelection::paintCaret):
2292         (WebCore::CaretBase::paintCaret):
2293         (WebCore::DragCaretController::paintDragCaret):
2294         * editing/FrameSelection.h:
2295         * html/HTMLCanvasElement.cpp:
2296         (WebCore::HTMLCanvasElement::paint):
2297         (WebCore::HTMLCanvasElement::createImageBuffer):
2298         (WebCore::HTMLCanvasElement::drawingContext):
2299         * html/HTMLCanvasElement.h:
2300         * html/HTMLVideoElement.cpp:
2301         (WebCore::HTMLVideoElement::paintCurrentFrameInContext):
2302         * html/HTMLVideoElement.h:
2303         * html/canvas/CanvasRenderingContext2D.cpp:
2304         (WebCore::CanvasRenderingContext2D::drawImage):
2305         (WebCore::drawImageToContext):
2306         (WebCore::CanvasRenderingContext2D::fullCanvasCompositedDrawImage):
2307         (WebCore::CanvasRenderingContext2D::drawTextInternal):
2308         * html/canvas/WebGLRenderingContextBase.cpp:
2309         (WebCore::WebGLRenderingContextBase::drawImageIntoBuffer):
2310         * inspector/InspectorOverlay.cpp:
2311         (WebCore::InspectorOverlay::paint):
2312         * page/FrameSnapshotting.cpp:
2313         (WebCore::snapshotFrameRect):
2314         * page/FrameView.cpp:
2315         (WebCore::FrameView::paintScrollCorner):
2316         (WebCore::FrameView::paintScrollbar):
2317         (WebCore::FrameView::paintControlTints):
2318         (WebCore::FrameView::willPaintContents):
2319         (WebCore::FrameView::didPaintContents):
2320         (WebCore::FrameView::paintContents):
2321         (WebCore::FrameView::paintContentsForSnapshot):
2322         (WebCore::FrameView::paintOverhangAreas):
2323         (WebCore::FrameView::adjustPageHeightDeprecated):
2324         * page/FrameView.h:
2325         * page/PrintContext.cpp:
2326         (WebCore::PrintContext::spoolPage):
2327         (WebCore::PrintContext::spoolRect):
2328         * page/win/FrameCGWin.cpp:
2329         (WebCore::drawRectIntoContext):
2330         (WebCore::imageFromRect):
2331         * platform/ScrollView.cpp:
2332         (WebCore::ScrollView::paintScrollCorner):
2333         (WebCore::ScrollView::paintScrollbar):
2334         (WebCore::ScrollView::paintScrollbars):
2335         (WebCore::ScrollView::paintPanScrollIcon):
2336         (WebCore::ScrollView::paint):
2337         (WebCore::ScrollView::paintOverhangAreas):
2338         (WebCore::ScrollView::calculateAndPaintOverhangAreas):
2339         * platform/ScrollView.h:
2340         * platform/Scrollbar.cpp:
2341         (WebCore::Scrollbar::paint):
2342         * platform/Scrollbar.h:
2343         * platform/ScrollbarTheme.h:
2344         (WebCore::ScrollbarTheme::paintScrollCorner):
2345         (WebCore::ScrollbarTheme::defaultPaintScrollCorner):
2346         (WebCore::ScrollbarTheme::paintOverhangAreas):
2347         * platform/ScrollbarThemeComposite.cpp:
2348         (WebCore::ScrollbarThemeComposite::paintScrollCorner):
2349         (WebCore::ScrollbarThemeComposite::paintOverhangAreas):
2350         * platform/ScrollbarThemeComposite.h:
2351         * platform/Theme.cpp:
2352         (WebCore::Theme::drawNamedImage):
2353         * platform/Theme.h:
2354         (WebCore::Theme::paint):
2355         * platform/Widget.h:
2356         * platform/cocoa/ThemeCocoa.cpp:
2357         (WebCore::fitContextToBox):
2358         (WebCore::ThemeCocoa::drawNamedImage):
2359         * platform/cocoa/ThemeCocoa.h:
2360         * platform/efl/WidgetEfl.cpp:
2361         (WebCore::Widget::paint):
2362         * platform/graphics/BitmapImage.cpp:
2363         (WebCore::BitmapImage::drawPattern):
2364         * platform/graphics/BitmapImage.h:
2365         * platform/graphics/CrossfadeGeneratedImage.cpp:
2366         (WebCore::drawCrossfadeSubimage):
2367         (WebCore::CrossfadeGeneratedImage::drawCrossfade):
2368         (WebCore::CrossfadeGeneratedImage::draw):
2369         (WebCore::CrossfadeGeneratedImage::drawPattern):
2370         * platform/graphics/CrossfadeGeneratedImage.h:
2371         * platform/graphics/FontCascade.cpp:
2372         (WebCore::FontCascade::drawText):
2373         (WebCore::FontCascade::drawEmphasisMarks):
2374         (WebCore::FontCascade::drawSimpleText):
2375         (WebCore::FontCascade::drawEmphasisMarksForSimpleText):
2376         (WebCore::FontCascade::drawGlyphBuffer):
2377         * platform/graphics/FontCascade.h:
2378         * platform/graphics/GeneratedImage.h:
2379         * platform/graphics/GradientImage.cpp:
2380         (WebCore::GradientImage::draw):
2381         (WebCore::GradientImage::drawPattern):
2382         * platform/graphics/GradientImage.h:
2383         * platform/graphics/GraphicsContext.cpp:
2384         (WebCore::GraphicsContext::drawText):
2385         (WebCore::GraphicsContext::drawGlyphs):
2386         (WebCore::GraphicsContext::drawEmphasisMarks):
2387         (WebCore::GraphicsContext::drawBidiText):
2388         (WebCore::GraphicsContext::drawImage):
2389         (WebCore::GraphicsContext::drawTiledImage):
2390         (WebCore::GraphicsContext::drawImageBuffer):
2391         (WebCore::GraphicsContext::clipToImageBuffer):
2392         (WebCore::GraphicsContext::createCompatibleBuffer):
2393         (WebCore::GraphicsContext::isCompatibleWithBuffer):
2394         * platform/graphics/GraphicsContext.h:
2395         * platform/graphics/GraphicsContext3D.h:
2396         * platform/graphics/Image.cpp:
2397         (WebCore::Image::fillWithSolidColor):
2398         (WebCore::Image::draw):
2399         (WebCore::Image::drawTiled):
2400         * platform/graphics/Image.h:
2401         (WebCore::Image::drawFrameMatchingSourceSize):
2402         * platform/graphics/ImageBuffer.cpp:
2403         (WebCore::ImageBuffer::createCompatibleBuffer):
2404         * platform/graphics/ImageBuffer.h:
2405         * platform/graphics/MediaPlayer.cpp:
2406         (WebCore::MediaPlayer::paint):
2407         (WebCore::MediaPlayer::paintCurrentFrameInContext):
2408         * platform/graphics/MediaPlayer.h:
2409         * platform/graphics/MediaPlayerPrivate.h:
2410         (WebCore::MediaPlayerPrivateInterface::paintCurrentFrameInContext):
2411         * platform/graphics/NamedImageGeneratedImage.cpp:
2412         (WebCore::NamedImageGeneratedImage::draw):
2413         (WebCore::NamedImageGeneratedImage::drawPattern):
2414         * platform/graphics/NamedImageGeneratedImage.h:
2415         * platform/graphics/ShadowBlur.cpp:
2416         (WebCore::ShadowBlur::adjustBlurRadius):
2417         (WebCore::ShadowBlur::calculateLayerBoundingRect):
2418         (WebCore::ShadowBlur::drawShadowBuffer):
2419         (WebCore::ShadowBlur::drawRectShadow):
2420         (WebCore::ShadowBlur::drawInsetShadow):
2421         (WebCore::ShadowBlur::drawRectShadowWithoutTiling):
2422         (WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
2423         (WebCore::ShadowBlur::drawInsetShadowWithTiling):
2424         (WebCore::ShadowBlur::drawRectShadowWithTiling):
2425         (WebCore::ShadowBlur::drawLayerPieces):
2426         (WebCore::ShadowBlur::blurAndColorShadowBuffer):
2427         (WebCore::ShadowBlur::beginShadowLayer):
2428         (WebCore::ShadowBlur::endShadowLayer):
2429         * platform/graphics/ShadowBlur.h:
2430         * platform/graphics/TextRun.h:
2431         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
2432         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2433         (WebCore::MediaPlayerPrivateAVFoundationCF::paintCurrentFrameInContext):
2434         (WebCore::MediaPlayerPrivateAVFoundationCF::paint):
2435         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
2436         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2437         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2438         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext):
2439         (WebCore::MediaPlayerPrivateAVFoundationObjC::paint):
2440         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator):
2441         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
2442         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2443         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2444         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paint):
2445         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paintCurrentFrameInContext):
2446         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
2447         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2448         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paint):
2449         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
2450         * platform/graphics/cairo/BitmapImageCairo.cpp:
2451         (WebCore::BitmapImage::draw):
2452         * platform/graphics/cairo/FontCairo.cpp:
2453         (WebCore::drawGlyphsToContext):
2454         (WebCore::drawGlyphsShadow):
2455         (WebCore::FontCascade::drawGlyphs):
2456         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
2457         (WebCore::FontCascade::drawComplexText):
2458         (WebCore::FontCascade::drawEmphasisMarksForComplexText):
2459         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2460         (WebCore::drawPathShadow):
2461         (WebCore::fillCurrentCairoPath):
2462         (WebCore::shadowAndFillCurrentCairoPath):
2463         (WebCore::shadowAndStrokeCurrentCairoPath):
2464         (WebCore::GraphicsContext::fillPath):
2465         (WebCore::GraphicsContext::strokePath):
2466         (WebCore::GraphicsContext::fillRect):
2467         (WebCore::GraphicsContext::strokeRect):
2468         (WebCore::GraphicsContext::platformFillRoundedRect):
2469         (WebCore::GraphicsContext::fillRectWithRoundedHole):
2470         * platform/graphics/cairo/ImageBufferCairo.cpp:
2471         (WebCore::ImageBuffer::context):
2472         (WebCore::ImageBuffer::clip):
2473         (WebCore::ImageBuffer::draw):
2474         (WebCore::ImageBuffer::drawPattern):
2475         (WebCore::ImageBuffer::toDataURL):
2476         * platform/graphics/cairo/ImageCairo.cpp:
2477         (WebCore::Image::drawPattern):
2478         * platform/graphics/cairo/PlatformContextCairo.cpp:
2479         (WebCore::PlatformContextCairo::drawSurfaceToContext):
2480         * platform/graphics/cairo/PlatformContextCairo.h:
2481         * platform/graphics/cg/BitmapImageCG.cpp:
2482         (WebCore::BitmapImage::draw):
2483         * platform/graphics/cg/GraphicsContext3DCG.cpp:
2484         (WebCore::GraphicsContext3D::paintToCanvas):
2485         * platform/graphics/cg/GraphicsContextCG.cpp:
2486         (WebCore::GraphicsContext::fillRect):
2487         (WebCore::GraphicsContext::platformFillRoundedRect):
2488         (WebCore::GraphicsContext::fillRectWithRoundedHole):
2489         * platform/graphics/cg/ImageBufferCG.cpp:
2490         (WebCore::ImageBuffer::ImageBuffer):
2491         (WebCore::ImageBuffer::context):
2492         (WebCore::ImageBuffer::flushContext):
2493         (WebCore::ImageBuffer::copyNativeImage):
2494         (WebCore::ImageBuffer::draw):
2495         (WebCore::ImageBuffer::drawPattern):
2496         (WebCore::ImageBuffer::clip):
2497         (WebCore::ImageBuffer::getUnmultipliedImageData):
2498         (WebCore::ImageBuffer::getPremultipliedImageData):
2499         (WebCore::ImageBuffer::putByteArray):
2500         (WebCore::ImageBuffer::toDataURL):
2501         * platform/graphics/cg/ImageCG.cpp:
2502         (WebCore::Image::drawPattern):
2503         * platform/graphics/cg/PDFDocumentImage.cpp:
2504         (WebCore::PDFDocumentImage::cacheParametersMatch):
2505         (WebCore::transformContextForPainting):
2506         (WebCore::PDFDocumentImage::updateCachedImageIfNeeded):
2507         (WebCore::PDFDocumentImage::draw):
2508         (WebCore::applyRotationForPainting):
2509         (WebCore::PDFDocumentImage::drawPDFPage):
2510         * platform/graphics/cg/PDFDocumentImage.h:
2511         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2512         (WebCore::showLetterpressedGlyphsWithAdvances):
2513         (WebCore::showGlyphsWithAdvances):
2514         (WebCore::FontCascade::drawGlyphs):
2515         (WebCore::FontCascade::drawComplexText):
2516         (WebCore::FontCascade::drawEmphasisMarksForComplexText):
2517         * platform/graphics/efl/ImageBufferEfl.cpp:
2518         (WebCore::ImageBuffer::toDataURL):
2519         * platform/graphics/filters/FEBlend.cpp:
2520         (WebCore::FEBlend::platformApplySoftware):
2521         * platform/graphics/filters/FEColorMatrix.cpp:
2522         (WebCore::FEColorMatrix::platformApplySoftware):
2523         * platform/graphics/filters/FEComposite.cpp:
2524         (WebCore::FEComposite::platformApplySoftware):
2525         * platform/graphics/filters/FEDropShadow.cpp:
2526         (WebCore::FEDropShadow::platformApplySoftware):
2527         * platform/graphics/filters/FEFlood.cpp:
2528         (WebCore::FEFlood::platformApplySoftware):
2529         * platform/graphics/filters/FEMerge.cpp:
2530         (WebCore::FEMerge::platformApplySoftware):
2531         * platform/graphics/filters/FEOffset.cpp:
2532         (WebCore::FEOffset::platformApplySoftware):
2533         * platform/graphics/filters/FETile.cpp:
2534         (WebCore::FETile::platformApplySoftware):
2535         * platform/graphics/filters/FilterEffect.cpp:
2536         (WebCore::FilterEffect::createImageBufferResult): Deleted.
2537         * platform/graphics/filters/SourceAlpha.cpp:
2538         (WebCore::SourceAlpha::platformApplySoftware):
2539         * platform/graphics/filters/SourceGraphic.cpp:
2540         (WebCore::SourceGraphic::platformApplySoftware):
2541         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2542         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
2543         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2544         * platform/graphics/mac/GraphicsContextMac.mm:
2545         (WebCore::GraphicsContext::drawLineForDocumentMarker):
2546         * platform/graphics/mac/IconMac.mm:
2547         (WebCore::Icon::paint):
2548         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
2549         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2550         (WebCore::MediaPlayerPrivateQTKit::paintCurrentFrameInContext):
2551         (WebCore::MediaPlayerPrivateQTKit::paint):
2552         * platform/graphics/mac/PDFDocumentImageMac.mm:
2553         (WebCore::PDFDocumentImage::drawPDFPage):
2554         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2555         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
2556         * platform/graphics/texmap/BitmapTexture.cpp:
2557         (WebCore::BitmapTexture::updateContents):
2558         * platform/graphics/win/FontCGWin.cpp:
2559         (WebCore::FontCascade::drawGlyphs):
2560         * platform/graphics/win/FontWin.cpp:
2561         (WebCore::FontCascade::drawComplexText):
2562         (WebCore::FontCascade::drawEmphasisMarksForComplexText):
2563         * platform/graphics/win/IconWin.cpp:
2564         (WebCore::Icon::paint):
2565         * platform/graphics/win/ImageCGWin.cpp:
2566         (WebCore::BitmapImage::getHBITMAPOfSize):
2567         (WebCore::BitmapImage::drawFrameMatchingSourceSize):
2568         * platform/graphics/win/ImageCairoWin.cpp:
2569         (WebCore::BitmapImage::getHBITMAPOfSize):
2570         (WebCore::BitmapImage::drawFrameMatchingSourceSize):
2571         * platform/graphics/win/LocalWindowsContext.h:
2572         (WebCore::LocalWindowsContext::LocalWindowsContext):
2573         (WebCore::LocalWindowsContext::~LocalWindowsContext):
2574         * platform/gtk/WidgetGtk.cpp:
2575         (WebCore::Widget::paint):
2576         * platform/ios/WidgetIOS.mm:
2577         (WebCore::Widget::paint):
2578         * platform/mac/DragImageMac.mm:
2579         (WebCore::drawAtPoint):
2580         * platform/mac/LocalCurrentGraphicsContext.h:
2581         (WebCore::ContextContainer::ContextContainer):
2582         * platform/mac/LocalCurrentGraphicsContext.mm:
2583         (WebCore::LocalCurrentGraphicsContext::LocalCurrentGraphicsContext):
2584         (WebCore::LocalCurrentGraphicsContext::~LocalCurrentGraphicsContext):
2585         (WebCore::LocalCurrentGraphicsContext::cgContext):
2586         * platform/mac/ScrollbarThemeMac.mm:
2587         (WebCore::ScrollbarThemeMac::paint):
2588         * platform/mac/ThemeMac.h:
2589         * platform/mac/ThemeMac.mm:
2590         (WebCore::paintToggleButton):
2591         (WebCore::paintButton):
2592         (WebCore::paintStepper):
2593         (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
2594         (WebCore::ThemeMac::paint):
2595         * platform/mac/WidgetMac.mm:
2596         (WebCore::Widget::paint):
2597         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
2598         (WebCore::MockMediaPlayerMediaSource::paint):
2599         * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
2600         * platform/win/PopupMenuWin.cpp:
2601         (WebCore::PopupMenuWin::paint):
2602         * platform/win/ScrollbarThemeWin.cpp:
2603         (WebCore::ScrollbarThemeWin::paintTrackPiece):
2604         (WebCore::ScrollbarThemeWin::paintButton):
2605         (WebCore::ScrollbarThemeWin::paintThumb):
2606         * platform/win/WebCoreTextRenderer.cpp:
2607         (WebCore::doDrawTextAtPoint):
2608         * platform/win/WidgetWin.cpp:
2609         (WebCore::Widget::paint):
2610         * rendering/EllipsisBox.cpp:
2611         (WebCore::EllipsisBox::paint):
2612         (WebCore::EllipsisBox::paintSelection):
2613         * rendering/EllipsisBox.h:
2614         * rendering/FilterEffectRenderer.cpp:
2615         (WebCore::FilterEffectRenderer::inputContext):
2616         (WebCore::FilterEffectRendererHelper::applyFilterEffect):
2617         * rendering/FilterEffectRenderer.h:
2618         * rendering/ImageQualityController.cpp:
2619         (WebCore::ImageQualityController::shouldPaintAtLowQuality):
2620         * rendering/ImageQualityController.h:
2621         * rendering/InlineFlowBox.cpp:
2622         (WebCore::InlineFlowBox::paintFillLayer):
2623         (WebCore::InlineFlowBox::paintBoxDecorations):
2624         (WebCore::InlineFlowBox::paintMask):
2625         * rendering/InlineTextBox.cpp:
2626         (WebCore::InlineTextBox::paint):
2627         * rendering/PaintInfo.h:
2628         (WebCore::PaintInfo::PaintInfo):
2629         (WebCore::PaintInfo::context):
2630         (WebCore::PaintInfo::setContext):
2631         (WebCore::PaintInfo::applyTransform):
2632         * rendering/RenderBlock.cpp:
2633         (WebCore::RenderBlock::paint):
2634         (WebCore::RenderBlock::paintCaret):
2635         (WebCore::RenderBlock::paintObject):
2636         (WebCore::RenderBlock::paintSelection):
2637         (WebCore::clipOutPositionedObjects):
2638         (WebCore::RenderBlock::blockSelectionGap):
2639         (WebCore::RenderBlock::logicalLeftSelectionGap):
2640         (WebCore::RenderBlock::logicalRightSelectionGap):
2641         * rendering/RenderBlockFlow.cpp:
2642         (WebCore::RenderBlockFlow::paintColumnRules):
2643         (WebCore::RenderBlockFlow::clipOutFloatingObjects):
2644         * rendering/RenderBox.cpp:
2645         (WebCore::RenderBox::determineBackgroundBleedAvoidance):
2646         (WebCore::RenderBox::paintBoxDecorations):
2647         (WebCore::RenderBox::paintMask):
2648         (WebCore::RenderBox::paintClippingMask):
2649         (WebCore::RenderBox::paintMaskImages):
2650         (WebCore::RenderBox::paintFillLayers):
2651         (WebCore::RenderBox::pushContentsClip):
2652         (WebCore::RenderBox::popContentsClip):
2653         * rendering/RenderBox.h:
2654         * rendering/RenderBoxModelObject.cpp:
2655         (WebCore::RenderBoxModelObject::shouldPaintAtLowQuality):
2656         (WebCore::RenderBoxModelObject::clipRoundedInnerRect):
2657         (WebCore::applyBoxShadowForBackground):
2658         (WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
2659         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
2660         (WebCore::RenderBoxModelObject::paintNinePieceImage):
2661         (WebCore::RenderBoxModelObject::paintOneBorderSide):
2662         (WebCore::RenderBoxModelObject::paintBorderSides):
2663         (WebCore::RenderBoxModelObject::paintTranslucentBorderSides):
2664         (WebCore::RenderBoxModelObject::paintBorder):
2665         (WebCore::RenderBoxModelObject::drawBoxSideFromPath):
2666         (WebCore::RenderBoxModelObject::clipBorderSidePolygon):
2667         (WebCore::RenderBoxModelObject::clipBorderSideForComplexInnerPath):
2668         (WebCore::RenderBoxModelObject::paintBoxShadow):
2669         (WebCore::RenderBoxModelObject::shouldAntialiasLines):
2670         * rendering/RenderBoxModelObject.h:
2671         * rendering/RenderDetailsMarker.cpp:
2672         (WebCore::RenderDetailsMarker::paint):
2673         * rendering/RenderElement.cpp:
2674         (WebCore::RenderElement::paintFocusRing):
2675         (WebCore::RenderElement::paintOutline):
2676         * rendering/RenderEmbeddedObject.cpp:
2677         (WebCore::RenderEmbeddedObject::paintSnapshotImage):
2678         (WebCore::drawReplacementArrow):
2679         (WebCore::RenderEmbeddedObject::paintReplaced):
2680         * rendering/RenderFieldset.cpp:
2681         (WebCore::RenderFieldset::paintBoxDecorations):
2682         * rendering/RenderFileUploadControl.cpp:
2683         (WebCore::RenderFileUploadControl::paintObject):
2684         * rendering/RenderFrameSet.cpp:
2685         (WebCore::RenderFrameSet::paintColumnBorder):
2686         (WebCore::RenderFrameSet::paintRowBorder):
2687         * rendering/RenderHTMLCanvas.cpp:
2688         (WebCore::RenderHTMLCanvas::paintReplaced):
2689         * rendering/RenderImage.cpp:
2690         (WebCore::RenderImage::paintReplaced):
2691         (WebCore::RenderImage::paintAreaElementFocusRing):
2692         (WebCore::RenderImage::paintIntoRect):
2693         * rendering/RenderImage.h:
2694         * rendering/RenderInline.cpp:
2695         (WebCore::RenderInline::paintOutline):
2696         (WebCore::RenderInline::paintOutlineForLine):
2697         * rendering/RenderInline.h:
2698         * rendering/RenderLayer.cpp:
2699         (WebCore::RenderLayer::beginTransparencyLayers):
2700         (WebCore::RenderLayer::paintOverflowControls):
2701         (WebCore::RenderLayer::paintScrollCorner):
2702         (WebCore::RenderLayer::drawPlatformResizerImage):
2703         (WebCore::RenderLayer::paintResizer):
2704         (WebCore::RenderLayer::paint):
2705         (WebCore::RenderLayer::paintOverlayScrollbars):
2706         (WebCore::RenderLayer::clipToRect):
2707         (WebCore::RenderLayer::restoreClip):
2708         (WebCore::RenderLayer::paintLayer):
2709         (WebCore::RenderLayer::paintLayerContentsAndReflection):
2710         (WebCore::RenderLayer::setupFontSubpixelQuantization):
2711         (WebCore::RenderLayer::setupClipPath):
2712         (WebCore::RenderLayer::hasFilterThatIsPainting):
2713         (WebCore::RenderLayer::setupFilters):
2714         (WebCore::RenderLayer::applyFilters):
2715         (WebCore::RenderLayer::paintFixedLayersInNamedFlows):
2716         (WebCore::RenderLayer::paintLayerContents):
2717         (WebCore::RenderLayer::paintLayerByApplyingTransform):
2718         (WebCore::RenderLayer::paintList):
2719         (WebCore::RenderLayer::paintTransformedLayerIntoFragments):
2720         (WebCore::RenderLayer::paintBackgroundForFragments):
2721         (WebCore::RenderLayer::paintForegroundForFragments):
2722         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
2723         (WebCore::RenderLayer::paintOutlineForFragments):
2724         (WebCore::RenderLayer::paintMaskForFragments):
2725         (WebCore::RenderLayer::paintChildClippingMaskForFragments):
2726         (WebCore::RenderLayer::paintOverflowControlsForFragments):
2727         (WebCore::RenderLayer::calculateClipRects):
2728         * rendering/RenderLayer.h:
2729         * rendering/RenderLayerBacking.cpp:
2730         (WebCore::RenderLayerBacking::paintIntoLayer):
2731         (WebCore::RenderLayerBacking::paintContents):
2732         * rendering/RenderLayerBacking.h:
2733         * rendering/RenderLayerCompositor.cpp:
2734         (WebCore::paintScrollbar):
2735         (WebCore::RenderLayerCompositor::paintContents):
2736         * rendering/RenderListBox.cpp:
2737         (WebCore::RenderListBox::paintScrollbar):
2738         (WebCore::RenderListBox::paintItemForeground):
2739         (WebCore::RenderListBox::paintItemBackground):
2740         * rendering/RenderListMarker.cpp:
2741         (WebCore::RenderListMarker::paint):
2742         * rendering/RenderMediaControls.cpp:
2743         (WebCore::getUnzoomedRectAndAdjustCurrentContext):
2744         (WebCore::RenderMediaControls::paintMediaControlsPart):
2745         * rendering/RenderMultiColumnSet.cpp:
2746         (WebCore::RenderMultiColumnSet::paintColumnRules):
2747         * rendering/RenderObject.cpp:
2748         (WebCore::RenderObject::addPDFURLRect):
2749         * rendering/RenderReplaced.cpp:
2750         (WebCore::RenderReplaced::paint):
2751         * rendering/RenderReplica.cpp:
2752         (WebCore::RenderReplica::paint):
2753         * rendering/RenderScrollbar.cpp:
2754         (WebCore::RenderScrollbar::paint):
2755         (WebCore::RenderScrollbar::paintPart):
2756         * rendering/RenderScrollbar.h:
2757         * rendering/RenderScrollbarPart.cpp:
2758         (WebCore::RenderScrollbarPart::paintIntoRect):
2759         * rendering/RenderScrollbarPart.h:
2760         * rendering/RenderScrollbarTheme.cpp:
2761         (WebCore::RenderScrollbarTheme::paintScrollCorner):
2762         (WebCore::RenderScrollbarTheme::paintScrollbarBackground):
2763         (WebCore::RenderScrollbarTheme::paintTrackBackground):
2764         (WebCore::RenderScrollbarTheme::paintTrackPiece):
2765         (WebCore::RenderScrollbarTheme::paintButton):
2766         (WebCore::RenderScrollbarTheme::paintThumb):
2767         * rendering/RenderScrollbarTheme.h:
2768         * rendering/RenderSnapshottedPlugIn.cpp:
2769         (WebCore::RenderSnapshottedPlugIn::paintSnapshot):
2770         * rendering/RenderTable.cpp:
2771         (WebCore::RenderTable::paintBoxDecorations):
2772         * rendering/RenderTableCell.cpp:
2773         (WebCore::RenderTableCell::paintCollapsedBorders):
2774         (WebCore::RenderTableCell::paintBackgroundsBehindCell):
2775         * rendering/RenderTableSection.cpp:
2776         (WebCore::RenderTableSection::paintRowGroupBorder):
2777         (WebCore::RenderTableSection::paintRowGroupBorderIfRequired):
2778         * rendering/RenderTheme.cpp:
2779         (WebCore::RenderTheme::paint):
2780         (WebCore::RenderTheme::paintBorderOnly):
2781         (WebCore::RenderTheme::paintDecorations):
2782         (WebCore::RenderTheme::paintSliderTicks):
2783         * rendering/RenderThemeEfl.cpp:
2784         (WebCore::RenderThemeEfl::paintThemePart):
2785         * rendering/RenderThemeGtk.cpp:
2786         (WebCore::paintToggle):
2787         (WebCore::renderButton):
2788         (WebCore::RenderThemeGtk::paintMenuList):
2789         (WebCore::RenderThemeGtk::paintTextField):
2790         (WebCore::paintGdkPixbuf):
2791         (WebCore::RenderThemeGtk::paintSearchFieldResultsDecorationPart):
2792         (WebCore::RenderThemeGtk::paintSearchFieldCancelButton):
2793         (WebCore::RenderThemeGtk::paintCapsLockIndicator):
2794         (WebCore::RenderThemeGtk::paintSliderTrack):
2795         (WebCore::RenderThemeGtk::paintSliderThumb):
2796         (WebCore::RenderThemeGtk::paintProgressBar):
2797         (WebCore::paintSpinArrowButton):
2798         (WebCore::RenderThemeGtk::paintMediaButton):
2799         (WebCore::RenderThemeGtk::paintMediaFullscreenButton):
2800         (WebCore::RenderThemeGtk::paintMediaMuteButton):
2801         (WebCore::RenderThemeGtk::paintMediaPlayButton):
2802         (WebCore::RenderThemeGtk::paintMediaSeekBackButton):
2803         (WebCore::RenderThemeGtk::paintMediaSeekForwardButton):
2804         (WebCore::RenderThemeGtk::paintMediaToggleClosedCaptionsButton):
2805         (WebCore::RenderThemeGtk::paintMediaSliderTrack):
2806         (WebCore::RenderThemeGtk::paintMediaSliderThumb):
2807         (WebCore::RenderThemeGtk::paintMediaVolumeSliderTrack):
2808         * rendering/RenderThemeGtk.h:
2809         * rendering/RenderThemeIOS.h:
2810         * rendering/RenderThemeIOS.mm:
2811         (WebCore::RenderThemeIOS::addRoundedBorderClip):
2812         (WebCore::RenderThemeIOS::paintCheckboxDecorations):
2813         (WebCore::RenderThemeIOS::paintRadioDecorations):
2814         (WebCore::RenderThemeIOS::paintTextFieldDecorations):
2815         (WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
2816         (WebCore::RenderThemeIOS::paintSliderTrack):
2817         (WebCore::RenderThemeIOS::paintSliderThumbDecorations):
2818         (WebCore::RenderThemeIOS::paintProgressBar):
2819         (WebCore::RenderThemeIOS::paintPushButtonDecorations):
2820         (WebCore::RenderThemeIOS::paintFileUploadIconDecorations):
2821         * rendering/RenderThemeMac.mm:
2822         (WebCore::RenderThemeMac::paintTextField):
2823         (WebCore::RenderThemeMac::paintTextArea):
2824         (WebCore::RenderThemeMac::paintMenuList):
2825         (WebCore::RenderThemeMac::paintMeter):
2826         (WebCore::RenderThemeMac::paintProgressBar):
2827         (WebCore::RenderThemeMac::paintMenuListButtonGradients):
2828         (WebCore::RenderThemeMac::paintMenuListButtonDecorations):
2829         (WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
2830         (WebCore::RenderThemeMac::paintSliderTrack):
2831         (WebCore::RenderThemeMac::paintSliderThumb):
2832         (WebCore::RenderThemeMac::paintSearchField):
2833         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
2834         (WebCore::RenderThemeMac::paintSearchFieldResultsDecorationPart):
2835         (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
2836         (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
2837         (WebCore::RenderThemeMac::paintImageControlsButton):
2838         (WebCore::RenderThemeMac::paintAttachment):
2839         * rendering/RenderThemeSafari.cpp:
2840         (WebCore::RenderThemeSafari::paintCheckbox):
2841         (WebCore::RenderThemeSafari::paintRadio):
2842         (WebCore::RenderThemeSafari::paintButton):
2843         (WebCore::RenderThemeSafari::paintTextField):
2844         (WebCore::RenderThemeSafari::paintCapsLockIndicator):
2845         (WebCore::RenderThemeSafari::paintTextArea):
2846         (WebCore::RenderThemeSafari::paintMenuList):
2847         (WebCore::RenderThemeSafari::paintMenuListButtonGradients):
2848         (WebCore::RenderThemeSafari::paintMenuListButtonDecorations):
2849         (WebCore::RenderThemeSafari::paintSliderTrack):
2850         (WebCore::RenderThemeSafari::paintSliderThumb):
2851         (WebCore::RenderThemeSafari::paintSearchField):
2852         (WebCore::RenderThemeSafari::paintSearchFieldCancelButton):
2853         (WebCore::RenderThemeSafari::paintSearchFieldResultsDecorationPart):
2854         (WebCore::RenderThemeSafari::paintSearchFieldResultsButton):
2855         * rendering/RenderThemeWin.cpp:
2856         (WebCore::drawControl):
2857         (WebCore::RenderThemeWin::paintButton):
2858         (WebCore::RenderThemeWin::paintInnerSpinButton):
2859         (WebCore::RenderThemeWin::paintTextField):
2860         (WebCore::RenderThemeWin::paintMenuList):
2861         (WebCore::RenderThemeWin::paintMenuListButtonDecorations):
2862         (WebCore::RenderThemeWin::paintSliderTrack):
2863         (WebCore::RenderThemeWin::paintSliderThumb):
2864         (WebCore::RenderThemeWin::paintSearchFieldCancelButton):
2865         (WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart):
2866         (WebCore::RenderThemeWin::paintSearchFieldResultsButton):
2867         (WebCore::RenderThemeWin::paintMeter):
2868         * rendering/RenderVideo.cpp:
2869         (WebCore::RenderVideo::paintReplaced):
2870         * rendering/RenderView.cpp:
2871         (WebCore::RenderView::paint):
2872         (WebCore::RenderView::paintBoxDecorations):
2873         * rendering/RenderWidget.cpp:
2874         (WebCore::RenderWidget::paintContents):
2875         (WebCore::RenderWidget::paint):
2876         * rendering/RootInlineBox.cpp:
2877         (WebCore::RootInlineBox::lineSelectionGap):
2878         * rendering/SimpleLineLayoutFunctions.cpp:
2879         (WebCore::SimpleLineLayout::paintFlow):
2880         * rendering/mathml/RenderMathMLBlock.cpp:
2881         (WebCore::RenderMathMLBlock::paint):
2882         * rendering/mathml/RenderMathMLFraction.cpp:
2883         (WebCore::RenderMathMLFraction::paint):
2884         * rendering/mathml/RenderMathMLMenclose.cpp:
2885         (WebCore::RenderMathMLMenclose::paint):
2886         * rendering/mathml/RenderMathMLOperator.cpp:
2887         (WebCore::RenderMathMLOperator::paintGlyph):
2888         (WebCore::RenderMathMLOperator::fillWithVerticalExtensionGlyph):
2889         (WebCore::RenderMathMLOperator::fillWithHorizontalExtensionGlyph):
2890         (WebCore::RenderMathMLOperator::paint):
2891         * rendering/mathml/RenderMathMLRadicalOperator.cpp:
2892         (WebCore::RenderMathMLRadicalOperator::paint):
2893         * rendering/mathml/RenderMathMLRoot.cpp:
2894         (WebCore::RenderMathMLRoot::paint):
2895         * rendering/shapes/Shape.cpp:
2896         (WebCore::Shape::createRasterShape):
2897         * rendering/style/NinePieceImage.cpp:
2898         (WebCore::NinePieceImage::paint):
2899         * rendering/style/NinePieceImage.h:
2900         * rendering/svg/RenderSVGContainer.cpp:
2901         (WebCore::RenderSVGContainer::paint):
2902         * rendering/svg/RenderSVGEllipse.cpp:
2903         (WebCore::RenderSVGEllipse::fillShape):
2904         (WebCore::RenderSVGEllipse::strokeShape):
2905         * rendering/svg/RenderSVGEllipse.h:
2906         * rendering/svg/RenderSVGForeignObject.cpp:
2907         (WebCore::RenderSVGForeignObject::paint):
2908         * rendering/svg/RenderSVGImage.cpp:
2909         (WebCore::RenderSVGImage::paint):
2910         (WebCore::RenderSVGImage::paintForeground):
2911         * rendering/svg/RenderSVGPath.cpp:
2912         (WebCore::useStrokeStyleToFill):
2913         (WebCore::RenderSVGPath::strokeShape):
2914         * rendering/svg/RenderSVGPath.h:
2915         * rendering/svg/RenderSVGRect.cpp:
2916         (WebCore::RenderSVGRect::fillShape):
2917         (WebCore::RenderSVGRect::strokeShape):
2918         * rendering/svg/RenderSVGRect.h:
2919         * rendering/svg/RenderSVGResourceClipper.cpp:
2920         (WebCore::RenderSVGResourceClipper::applyResource):
2921         (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
2922         (WebCore::RenderSVGResourceClipper::applyClippingToContext):
2923         (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
2924         * rendering/svg/RenderSVGResourceClipper.h:
2925         * rendering/svg/RenderSVGResourceFilter.cpp:
2926         (WebCore::RenderSVGResourceFilter::applyResource):
2927         * rendering/svg/RenderSVGResourceGradient.cpp:
2928         (WebCore::createMaskAndSwapContextForTextGradient):
2929         (WebCore::clipToTextMask):
2930         (WebCore::RenderSVGResourceGradient::applyResource):
2931         * rendering/svg/RenderSVGResourceMarker.cpp:
2932         (WebCore::RenderSVGResourceMarker::applyViewportClip):
2933         (WebCore::RenderSVGResourceMarker::draw):
2934         * rendering/svg/RenderSVGResourceMasker.cpp:
2935         (WebCore::RenderSVGResourceMasker::applyResource):
2936         (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
2937         * rendering/svg/RenderSVGResourcePattern.cpp:
2938         (WebCore::RenderSVGResourcePattern::postApplyResource):
2939         (WebCore::RenderSVGResourcePattern::createTileImage):
2940         * rendering/svg/RenderSVGResourceSolidColor.cpp:
2941         (WebCore::RenderSVGResourceSolidColor::postApplyResource):
2942         * rendering/svg/RenderSVGRoot.cpp:
2943         (WebCore::RenderSVGRoot::paintReplaced):
2944         * rendering/svg/RenderSVGShape.cpp:
2945         (WebCore::RenderSVGShape::fillShape):
2946         (WebCore::RenderSVGShape::strokeShape):
2947         (WebCore::RenderSVGShape::fillStrokeMarkers):
2948         (WebCore::RenderSVGShape::paint):
2949         * rendering/svg/RenderSVGShape.h:
2950         * rendering/svg/RenderSVGText.cpp:
2951         (WebCore::RenderSVGText::paint):
2952         * rendering/svg/RenderSVGViewportContainer.cpp:
2953         (WebCore::RenderSVGViewportContainer::applyViewportClip):
2954         * rendering/svg/SVGInlineFlowBox.cpp:
2955         (WebCore::SVGInlineFlowBox::paintSelectionBackground):
2956         (WebCore::SVGInlineFlowBox::paint):
2957         * rendering/svg/SVGInlineTextBox.cpp:
2958         (WebCore::SVGInlineTextBox::paintSelectionBackground):
2959         (WebCore::SVGInlineTextBox::paint):
2960         (WebCore::SVGInlineTextBox::prepareGraphicsContextForTextPainting):
2961         (WebCore::SVGInlineTextBox::paintDecoration):
2962         (WebCore::SVGInlineTextBox::paintDecorationWithStyle):
2963         (WebCore::SVGInlineTextBox::paintTextWithShadows):
2964         (WebCore::SVGInlineTextBox::paintText):
2965         * rendering/svg/SVGInlineTextBox.h:
2966         * rendering/svg/SVGRenderingContext.cpp:
2967         (WebCore::SVGRenderingContext::~SVGRenderingContext):
2968         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
2969         (WebCore::SVGRenderingContext::createImageBuffer):
2970         (WebCore::SVGRenderingContext::clipToImageBuffer):
2971         (WebCore::SVGRenderingContext::bufferForeground):
2972         (WebCore::SVGRenderingContext::renderSubtreeToImageBuffer): Deleted.
2973         * rendering/svg/SVGRenderingContext.h:
2974         * rendering/svg/SVGRootInlineBox.cpp:
2975         (WebCore::SVGRootInlineBox::paint):
2976         * rendering/svg/SVGTextRunRenderingContext.cpp:
2977         (WebCore::SVGTextRunRenderingContext::drawSVGGlyphs):
2978         * rendering/svg/SVGTextRunRenderingContext.h:
2979         * svg/graphics/SVGImage.cpp:
2980         (WebCore::SVGImage::drawForContainer):
2981         (WebCore::SVGImage::drawPatternForContainer):
2982         (WebCore::SVGImage::draw):
2983         * svg/graphics/SVGImage.h:
2984         * svg/graphics/SVGImageForContainer.cpp:
2985         (WebCore::SVGImageForContainer::draw):
2986         (WebCore::SVGImageForContainer::drawPattern):
2987         * svg/graphics/SVGImageForContainer.h:
2988         * svg/graphics/filters/SVGFEImage.cpp:
2989         (WebCore::FEImage::platformApplySoftware):
2990
2991 2015-08-28  Alexey Proskuryakov  <ap@apple.com>
2992
2993         Update bindings test results after
2994         https://bugs.webkit.org/show_bug.cgi?id=148591
2995
2996         JSCallbackData::invokeCallback() should return the Exception to the caller
2997
2998         * bindings/scripts/test/JS/JSTestCallback.cpp:
2999         (WebCore::JSTestCallback::callbackWithNoParam):
3000         (WebCore::JSTestCallback::callbackWithArrayParam):
3001         (WebCore::JSTestCallback::callbackWithSerializedScriptValueParam):
3002         (WebCore::JSTestCallback::callbackWithStringList):
3003         (WebCore::JSTestCallback::callbackWithBoolean):
3004         (WebCore::JSTestCallback::callbackRequiresThisToPass):
3005         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
3006         (WebCore::JSTestCallbackFunction::callbackWithNoParam):
3007         (WebCore::JSTestCallbackFunction::callbackWithArrayParam):
3008         (WebCore::JSTestCallbackFunction::callbackWithSerializedScriptValueParam):
3009         (WebCore::JSTestCallbackFunction::callbackWithStringList):
3010         (WebCore::JSTestCallbackFunction::callbackWithBoolean):
3011         (WebCore::JSTestCallbackFunction::callbackRequiresThisToPass):
3012
3013 2015-08-28  Chris Dumez  <cdumez@apple.com>
3014
3015         JSCallbackData::invokeCallback() should return the Exception to the caller
3016         https://bugs.webkit.org/show_bug.cgi?id=148591
3017
3018         Reviewed by Mark Lam.
3019
3020         JSCallbackData::invokeCallback() calls a callback function. If this
3021         function throws an exception, it will report it and clear it on the VM.
3022         However, in the case of NodeFilter, the DOM specification clearly states
3023         that we are supposed to rethrow the exception [1].
3024
3025         Once way to support this is to have JSCallbackData::invokeCallback()
3026         return the Exception to the caller and let the caller decide what to do
3027         with it (i.e. report it or rethrow it).
3028
3029         There is no actual behavior change in this patch. This slight
3030         refactoring is in preparation for Bug 148415.
3031
3032         [1] https://dom.spec.whatwg.org/#traversal
3033
3034         Some more context at:
3035         https://www.w3.org/Bugs/Public/show_bug.cgi?id=17713#c16
3036
3037         * bindings/js/JSCallbackData.cpp:
3038         (WebCore::JSCallbackData::invokeCallback):
3039         * bindings/js/JSCallbackData.h:
3040         * bindings/js/JSCustomSQLStatementErrorCallback.cpp:
3041         (WebCore::JSSQLStatementErrorCallback::handleEvent):
3042         * bindings/scripts/CodeGeneratorJS.pm:
3043         (GenerateCallbackImplementation):
3044
3045 2015-08-28  Bem Jones-Bey  <bjonesbe@adobe.com>
3046
3047         [CSS Shapes] Remove unused CSSBasicShape::m_referenceBox
3048         https://bugs.webkit.org/show_bug.cgi?id=148588
3049
3050         Reviewed by Zoltan Horvath.
3051
3052         At some point, the code was refactored to no longer store the
3053         referenceBox in CSSBasicShape; however, it looks like this code
3054         wasn't cleaned up. This patch rectifies this.
3055
3056         This is based on a Blink patch by Timothy Loh.
3057
3058         No new tests, removing unused code.
3059
3060         * css/CSSBasicShapes.cpp:
3061         (WebCore::buildCircleString):
3062         (WebCore::CSSBasicShapeCircle::cssText):
3063         (WebCore::CSSBasicShapeCircle::equals):
3064         (WebCore::buildEllipseString):
3065         (WebCore::CSSBasicShapeEllipse::cssText):
3066         (WebCore::CSSBasicShapeEllipse::equals):
3067         (WebCore::buildPolygonString):
3068         (WebCore::CSSBasicShapePolygon::cssText):
3069         (WebCore::CSSBasicShapePolygon::equals):
3070         (WebCore::buildInsetString):
3071         (WebCore::CSSBasicShapeInset::cssText):
3072         * css/CSSBasicShapes.h:
3073         (WebCore::CSSBasicShape::referenceBox): Deleted.
3074         (WebCore::CSSBasicShape::setReferenceBox): Deleted.
3075
3076 2015-08-28  Eric Carlson  <eric.carlson@apple.com>
3077
3078         [Mac] Restructure WebMediaSessionManager for testing
3079         https://bugs.webkit.org/show_bug.cgi?id=148593
3080
3081         Reviewed by Jer Noble.
3082
3083         No new tests, no functional change.
3084
3085         * Modules/mediasession/WebMediaSessionManager.cpp:
3086         (WebCore::mediaProducerStateString): Add some missing states.
3087         (WebCore::webMediaSessionManagerOverride): New.
3088         (WebCore::WebMediaSessionManager::singleton): New.
3089         (WebCore::WebMediaSessionManager::setWebMediaSessionManagerOverride): New, will allow runtime
3090           registration of a mock manager.
3091         * Modules/mediasession/WebMediaSessionManager.h:
3092
3093         * platform/graphics/avfoundation/WebMediaSessionManagerMac.cpp:
3094         (WebCore::WebMediaSessionManager::platformManager): Renamed from singleton.
3095         (WebCore::WebMediaSessionManagerMac::singleton): Deleted.
3096         * platform/graphics/avfoundation/WebMediaSessionManagerMac.h:
3097
3098 2015-08-28  Jer Noble  <jer.noble@apple.com>
3099
3100         [iOS] Add WebKit/WebKit2 settings to control automatic data loading
3101         https://bugs.webkit.org/show_bug.cgi?id=148579
3102
3103         Reviewed by Anders Carlsson.
3104
3105         Move the automatic and metadata restrictions from PlatformMediaSessionManager (where access
3106         to Settings is unavailable) to MediaElementSession (where it is available). Add properties
3107         to Settings so that clients can control this behavior at runtime. Move these restrictions
3108         between the two Internals functions which can set them for testing purposes.
3109
3110         * html/HTMLMediaElement.cpp:
3111         (WebCore::HTMLMediaElement::HTMLMediaElement):
3112         * html/MediaElementSession.cpp:
3113         (WebCore::MediaElementSession::effectivePreloadForElement):
3114         * html/MediaElementSession.h:
3115         * platform/audio/PlatformMediaSessionManager.h:
3116         * platform/audio/ios/MediaSessionManagerIOS.mm:
3117         (WebCore::MediaSessionManageriOS::resetRestrictions): Deleted.
3118         * testing/Internals.cpp:
3119         (WebCore::Internals::setMediaElementRestrictions):
3120         (WebCore::Internals::setMediaSessionRestrictions): Deleted.
3121
3122 2015-08-28  Yusuke Suzuki  <utatane.tea@gmail.com>
3123
3124         Move std::function from JSFunction into NativeStdFunctionCell to correctly destroy the heap allocated std::function
3125         https://bugs.webkit.org/show_bug.cgi?id=148262
3126
3127         Reviewed by Filip Pizlo.
3128
3129         No behavior change.
3130
3131         Change JSFunction::create to JSNativeStdFunction::create to explicitly create the JSNativeStdFunction with the C++ lambda.
3132
3133         * ForwardingHeaders/runtime/JSNativeStdFunction.h: Added.
3134         * bindings/js/ReadableJSStream.cpp:
3135         (WebCore::createStartResultFulfilledFunction):
3136         (WebCore::createPullResultFulfilledFunction):
3137         (WebCore::createCancelResultFulfilledFunction):
3138         (WebCore::createCancelResultRejectedFunction):
3139         (WebCore::ReadableJSStream::ReadableJSStream):
3140
3141 2015-08-28  Sukolsak Sakshuwong  <sukolsak@gmail.com>
3142
3143         Create WebAssembly functions
3144         https://bugs.webkit.org/show_bug.cgi?id=148373
3145
3146         Reviewed by Filip Pizlo.
3147
3148         No new tests, because it is a function rename.
3149
3150         * testing/Internals.cpp:
3151         (WebCore::Internals::parserMetaData):
3152
3153 2015-08-28  Jer Noble  <jer.noble@apple.com>
3154
3155         [iOS] Make the AllowsInlineMediaPlayback preference work in WebKit / WebKit2.
3156         https://bugs.webkit.org/show_bug.cgi?id=147512
3157
3158         Reviewed by Anders Carlsson.
3159
3160         Updated existing tests to use the Setting rather than the Behavior Restriction.
3161
3162         Get rid of the sessionRestrictsInlineVideoPlayback() method and the InlineVideoPlaybackRestricted
3163         restriction. Instead, just use the allowsInlineMediaPlayback() setting, and require
3164         WebKit and WebKitLegacy clients to initialize the setting appropriately.
3165
3166         * html/MediaElementSession.cpp:
3167         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback): Deleted.
3168         * page/Settings.cpp: Add a new inlineMediaPlaybackRequiresPlaysInlineAttribute setting.
3169         * page/Settings.in: Ditto.
3170         * platform/audio/PlatformMediaSessionManager.cpp:
3171         (WebCore::PlatformMediaSessionManager::sessionRestrictsInlineVideoPlayback): Deleted.
3172         * platform/audio/PlatformMediaSessionManager.h:
3173         * platform/audio/ios/MediaSessionManagerIOS.mm:
3174         (WebCore::MediaSessionManageriOS::resetRestrictions): Deleted.
3175         * testing/InternalSettings.cpp:
3176         (WebCore::InternalSettings::Backup::Backup): Backup the allowsInlineMediaPlayback() setting value.
3177         (WebCore::InternalSettings::Backup::restoreTo): Restore same.
3178         (WebCore::InternalSettings::setAllowsInlineMediaPlayback): Set allowsInlineMediaPlayback().
3179         * testing/InternalSettings.h:
3180         * testing/InternalSettings.idl:
3181         * testing/Internals.cpp:
3182         (WebCore::Internals::setMediaSessionRestrictions): Deleted.
3183
3184 2015-08-28  Eric Carlson  <eric.carlson@apple.com>
3185
3186         Media Session: MediaSession.releaseSession() renamed to deactivate()
3187         https://bugs.webkit.org/show_bug.cgi?id=148578
3188
3189         Reviewed by Jer Noble.
3190
3191         No new tests, media/session/releasing-sessions.html was updated for the change.
3192
3193         * Modules/mediasession/MediaSession.cpp:
3194         (WebCore::MediaSession::deactivate): Renamed from releaseSession.
3195         (WebCore::MediaSession::releaseSession): Deleted.
3196         * Modules/mediasession/MediaSession.h:
3197         * Modules/mediasession/MediaSession.idl:
3198
3199         * html/HTMLMediaElement.cpp:
3200         (WebCore::HTMLMediaElement::setSession): releaseSession -> deactivate.
3201
3202 2015-08-28  Joseph Pecoraro  <pecoraro@apple.com>
3203
3204         Web Inspector: Separate creating a style sheet from adding a new rule in the protocol
3205         https://bugs.webkit.org/show_bug.cgi?id=148502
3206
3207         Reviewed by Timothy Hatcher.
3208
3209         Tests: inspector/css/createStyleSheet.html
3210                inspector/css/manager-preferredInspectorStyleSheetForFrame.html
3211
3212         * inspector/InspectorCSSAgent.h:
3213         Allow for multiple inspector style sheets per document.
3214
3215         * inspector/InspectorCSSAgent.cpp:
3216         (WebCore::InspectorCSSAgent::createStyleSheet):
3217         (WebCore::InspectorCSSAgent::createInspectorStyleSheetForDocument): Added.
3218         (WebCore::InspectorCSSAgent::viaInspectorStyleSheet): Deleted.
3219         Extract and generalize creating a via-inspector stylesheet here.
3220
3221         (WebCore::InspectorCSSAgent::addRule):
3222         Lookup stylesheet to add a rule to via the provided stylesheet id.
3223
3224         (WebCore::InspectorCSSAgent::bindStyleSheet):
3225         (WebCore::InspectorCSSAgent::detectOrigin):
3226         Update to account for a list of stylesheets per document instead of one.
3227
3228         * inspector/InspectorStyleSheet.cpp:
3229         (WebCore::InspectorStyleSheet::addRule):
3230         (WebCore::InspectorStyleSheetForInlineStyle::setStyleText):
3231
3232 2015-08-28  Timothy Horton  <timothy_horton@apple.com>
3233
3234         [Mac] Right-clicking on GIFs spins the UI process for a while
3235         https://bugs.webkit.org/show_bug.cgi?id=148566
3236         <rdar://problem/22460854>
3237
3238         Reviewed by Brady Eidson.
3239
3240         * platform/ContextMenuItem.h:
3241         Properly mark this as Mac-only. It's only implemented in ContextMenuItemMac.
3242
3243         * platform/mac/ContextMenuItemMac.mm:
3244         (WebCore::ContextMenuItem::shareMenuItem):
3245         Take a NSImage directly, so we don't have to round-trip through BitmapImage,
3246         which can be lossy and expensive.
3247
3248 2015-08-28  Brady Eidson  <beidson@apple.com>
3249
3250         Use new CFNetwork cookie jar SPI only on El Capitan.
3251         https://bugs.webkit.org/show_bug.cgi?id=148574 and rdar://problem/22460752
3252
3253         Reviewed by David Kilzer.
3254
3255         * platform/network/mac/CookieJarMac.mm:
3256         (WebCore::setCookiesFromDOM): Use OS X version to decide which API/SPI to use.
3257         * platform/spi/cf/CFNetworkSPI.h: Forward declare the SPI
3258
3259 2015-08-27  Myles C. Maxfield  <mmaxfield@apple.com>
3260
3261         [Cocoa] Draw fonts at their native sizes instead of scaling a 1pt font
3262         https://bugs.webkit.org/show_bug.cgi?id=146045
3263
3264         Reviewed by Darin Adler.
3265
3266         In his WWDC talk[1], Antonio Cavedoni describes how painting a font at a particular point size
3267         may yield different visual results than painting a font at a 1pt size into a scaled context.
3268         However, this is something that we currently do in WebKit. This patch migrates from this
3269         behavior to instead drawing text at the appropriate point size.
3270
3271         [1] https://developer.apple.com/videos/wwdc/2015/?id=804
3272
3273         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3274         (WebCore::FontCascade::drawGlyphs):
3275
3276 2015-08-27  Zalan Bujtas  <zalan@apple.com>
3277
3278         Tiny cleanup in RenderLayer::enclosingCompositingLayerForRepaint()
3279         https://bugs.webkit.org/show_bug.cgi?id=148541
3280
3281         Reviewed by Tim Horton.
3282
3283         No change in functionality.
3284
3285         * rendering/RenderLayer.cpp:
3286         (WebCore::compositingContainer):
3287         (WebCore::compositedWithOwnBackingStore):
3288         (WebCore::RenderLayer::enclosingCompositingLayer):
3289         (WebCore::RenderLayer::enclosingCompositingLayerForRepaint):
3290         (WebCore::RenderLayer::enclosingFilterRepaintLayer):
3291         (WebCore::RenderLayer::clippingRootForPainting):
3292         * rendering/RenderLayer.h:
3293         * rendering/RenderLayerBacking.cpp:
3294         (WebCore::descendantLayerPaintsIntoAncestor):
3295
3296 2015-08-27  Commit Queue  <commit-queue@webkit.org>
3297
3298         Unreviewed, rolling out r189079.
3299         https://bugs.webkit.org/show_bug.cgi?id=148555
3300
3301         broke the build (Requested by jessieberlin on #webkit).
3302
3303         Reverted changeset:
3304
3305         "Create WebAssembly functions"
3306         https://bugs.webkit.org/show_bug.cgi?id=148373
3307         http://trac.webkit.org/changeset/189079
3308
3309 2015-08-27  Sukolsak Sakshuwong  <sukolsak@gmail.com>
3310
3311         Create WebAssembly functions
3312         https://bugs.webkit.org/show_bug.cgi?id=148373
3313
3314         Reviewed by Geoffrey Garen.
3315
3316         No new tests because it's a function rename.
3317
3318         * testing/Internals.cpp:
3319         (WebCore::Internals::parserMetaData):
3320
3321 2015-08-27  Chris Dumez  <cdumez@apple.com>
3322
3323         A WebIDL callback interface is allowed to have constants
3324         https://bugs.webkit.org/show_bug.cgi?id=148449
3325
3326         Reviewed by Geoffrey Garen.
3327
3328         Our JS bindings generator is now able to:
3329         1. Handle IDL constants [1] on a callback interfaces [2] and generate
3330            a DOMConstructorObject subclass with static properties for
3331            these constants [3].
3332         2. Generate a property on the global object for callback interfaces
3333            that have constants and do not have the [NoInterfaceObject] IDL
3334            extended attribute [4].
3335
3336         This is a pre-requirement for Bug 148415 as NodeFilter [5] has constants
3337         and should be a callback interface. Once NodeFilter is ported to be
3338         a callback interface, the JS still needs to be able to access
3339         window.NodeFilter.SHOW_ALL for e.g.
3340
3341         [1] https://heycam.github.io/webidl/#dfn-constant
3342         [2] https://heycam.github.io/webidl/#dfn-callback-interface
3343         [3] https://heycam.github.io/webidl/#NoInterfaceObject
3344         [4] https://heycam.github.io/webidl/#es-interfaces
3345         [5] https://dom.spec.whatwg.org/#interface-nodefilter
3346
3347         * bindings/scripts/CodeGeneratorJS.pm:
3348         (GenerateCallbackHeader):
3349         (GenerateCallbackImplementation):
3350         (GenerateConstructorHelperMethods):
3351         (ConstructorHasProperties): Deleted.
3352         * bindings/scripts/preprocess-idls.pl:
3353         (getInterfaceExtendedAttributesFromIDL):
3354         (interfaceHasConstantAttribute):
3355         * bindings/scripts/test/GObject/WebKitDOMTestCallback.h:
3356         * bindings/scripts/test/JS/JSTestCallback.cpp:
3357         (WebCore::JSTestCallbackConstructor::create):
3358         (WebCore::JSTestCallbackConstructor::createStructure):
3359         (WebCore::JSTestCallbackConstructor::JSTestCallbackConstructor):
3360         (WebCore::JSTestCallbackConstructor::finishCreation):
3361         (WebCore::JSTestCallback::getConstructor):
3362         * bindings/scripts/test/JS/JSTestCallback.h:
3363         * bindings/scripts/test/ObjC/DOMTestCallback.h:
3364         * bindings/scripts/test/TestCallback.idl:
3365
3366 2015-08-27  Chris Dumez  <cdumez@apple.com>
3367
3368         Range.compareBoundaryPoints() should throw a NotSupportedError for invalid compareHow values
3369         https://bugs.webkit.org/show_bug.cgi?id=148483
3370
3371         Reviewed by Geoffrey Garen.
3372
3373         Range.compareBoundaryPoints() should throw a NotSupportedError for
3374         invalid compareHow values:
3375         https://dom.spec.whatwg.org/#dom-range-compareboundarypoints (step 1)
3376
3377         Firefox and Chrome conform to the specification already.
3378
3379         Previously, WebKit would not throw and simply cast the value to our
3380         internal CompareHow enum type. This patch aligns WebKit's behavior with
3381         the DOM specificaiton and other browsers.
3382
3383         W3C test suite:
3384         http://w3c-test.org/dom/ranges/Range-compareBoundaryPoints.html
3385
3386         Test: fast/dom/Range/compareBoundaryPoints-compareHow-exception.html
3387
3388         * bindings/scripts/CodeGenerator.pm:
3389         * bindings/scripts/CodeGeneratorGObject.pm:
3390         * bindings/scripts/CodeGeneratorJS.pm:
3391         * bindings/scripts/CodeGeneratorObjC.pm:
3392         Drop CompareHow special casing from bindings generator as we now use
3393         unsigned short instead in the IDL.
3394
3395         * dom/Range.cpp:
3396         (WebCore::Range::compareBoundaryPointsForBindings):
3397         * dom/Range.h:
3398         * dom/Range.idl:
3399         Use "unsigned short" type instead of WebCore's CompareHow for the
3400         parameter, as per the specification. On implementation side, we
3401         now validate the compareHow value before casting it to a CompareHow
3402         enum type. If the value is not value, we throw and abort early.
3403
3404 2015-08-27  Joseph Pecoraro  <pecoraro@apple.com>
3405
3406         Page does not update when <link> media attribute changes to no longer apply to page
3407         https://bugs.webkit.org/show_bug.cgi?id=148392
3408
3409         Reviewed by Antti Koivisto.
3410
3411         Test: fast/css/link-media-attr.html
3412
3413         * html/HTMLLinkElement.cpp:
3414         (WebCore::HTMLLinkElement::parseAttribute):
3415         When the media attribute changes, recalculate styles if the link is not disabled.
3416
3417 2015-08-27  Zalan Bujtas  <zalan@apple.com>
3418
3419         Simple line layout: Text jumps sometimes on naughty strings page
3420         https://bugs.webkit.org/show_bug.cgi?id=148399
3421         rdar://problem/22212568
3422
3423         Reviewed by Antti Koivisto.
3424
3425         The x position we set for tab characters during painting should
3426         be the same as if it was set by the inline box tree painting.