[iOS] Scrubber display is broken if the buffered range is empty
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-05-01  Dean Jackson  <dino@apple.com>
2
3         [iOS] Scrubber display is broken if the buffered range is empty
4         https://bugs.webkit.org/show_bug.cgi?id=144511
5
6         Reviewed by Eric Carlson.
7
8         Make sure that if video.buffered returns an empty list, we
9         still draw the scrubber background correctly.
10
11         * Modules/mediacontrols/mediaControlsiOS.js:
12         (ControllerIOS.prototype.drawTimelineBackground): Ensure that buffered
13         is always at least as big as the current time.
14
15 2015-05-01  Roger Fong  <roger_fong@apple.com>
16
17         Media control volume slider should be vertical to avoid flickering issues.
18         https://bugs.webkit.org/show_bug.cgi?id=144496.
19         <rdar://problem/20451328>
20
21         Reviewed by Darin Adler.
22
23         * Modules/mediacontrols/mediaControlsApple.css:
24         Resize and reposition the volume box so that it does not have to rotated via a transform.
25         (audio::-webkit-media-controls-panel):
26         (audio::-webkit-media-controls-panel .volume-box): Also set overflow: hidden so we can't interact
27              with the volume slider while the volume box is hidden.
28         (audio::-webkit-media-controls-panel .volume-box:active):
29         Rotate and position the volume slider via transforms. Make sure it's not transformed in the fullscreen controls.
30         (video::-webkit-media-controls-volume-slider):
31         (video:-webkit-full-screen::-webkit-media-controls-volume-slider):
32
33 2015-05-01  Brent Fulgham  <bfulgham@apple.com>
34
35         Expand test infrastructure to support scrolling tests (Part 4): Scroll Snap Support
36         https://bugs.webkit.org/show_bug.cgi?id=144482
37
38         Reviewed by Simon Fraser.
39
40         New tests will be landed in a second patch.
41
42         The new WheelEventTestTriggers do not work properly with scroll snap points, because some test deferral notifications
43         need to be triggered for state changes on the scrolling thread. This required the following changes:
44         1. A flag indicating that we want to know about WheelEvent state changes needed to be propagated to the scrolling thread,
45            so that tests could be deferred until Scrolling thread rubberband or scroll-snap animations had completed.
46         2. The ScrollingNodeID needed to be used for registering and clearing deferrals.
47         3. The scrolling thread needed a way to dispatch messages to the main thread indicating that we should (or should not)
48            defer tests due to scrolling actions.
49
50         Note that a future patch will extend this support to include the RemoteScrollingTree.
51
52         * page/WheelEventTestTrigger.cpp:
53         (WebCore::WheelEventTestTrigger::deferTestsForReason): Added some logging features.
54         (WebCore::WheelEventTestTrigger::removeTestDeferralForReason): Ditto.
55         (WebCore::dumpState): Helper function for logging test deferral state.
56         (WebCore::WheelEventTestTrigger::triggerTestTimerFired): Added some logging features.
57         * page/scrolling/AsyncScrollingCoordinator.cpp:
58         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): Make sure that the scrolling thread is
59         told that it needs to send scrolling state back to the main thread. Only do this if we are in testing mode.
60         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll): The scrollingNodeID should be
61         used as the identifier for this operation, not the page address.
62         (WebCore::AsyncScrollingCoordinator::deferTestsForReason): Added. receives messages from the scrolling thread
63         and notifies the testing infrastructure.
64         (WebCore::AsyncScrollingCoordinator::removeTestDeferralForReason): Ditto.
65         * page/scrolling/AsyncScrollingCoordinator.h:
66         * page/scrolling/ScrollingStateScrollingNode.cpp:
67         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode): When cloning the ScrollingStateScrollingNode,
68         include the testing mode state.
69         (WebCore::ScrollingStateScrollingNode::setExpectsWheelEventTestTrigger): Added.
70         * page/scrolling/ScrollingStateScrollingNode.h:
71         (WebCore::ScrollingStateScrollingNode::expectsWheelEventTestTrigger): Added.
72         * page/scrolling/ScrollingTree.h:
73         (WebCore::ScrollingTree::deferTestsForReason): Added stub.
74         (WebCore::ScrollingTree::removeTestDeferralForReason): Ditto.
75         * page/scrolling/ThreadedScrollingTree.cpp:
76         (WebCore::ThreadedScrollingTree::deferTestsForReason): Added. Dispatches messages from the scrolling thread to the
77         main thread.
78         (WebCore::ThreadedScrollingTree::removeTestDeferralForReason): Ditto.
79         * page/scrolling/ThreadedScrollingTree.h:
80         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
81         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
82         (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac): Initialize testing state flag.
83         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren): If the 'ExpectsWheelEventTestTrigger' flag is
84         set, update local state.
85         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent): If we are testing, and the wheel event should be handled
86         asynchronously, tell the testing infrastructure we need to wait for the thread state to sync.
87         (WebCore::ScrollingTreeFrameScrollingNodeMac::deferTestsForReason): Added. Notifies test system we need to defer tests
88         until we notify them. Also used by the ScrollController during animations.
89         (WebCore::ScrollingTreeFrameScrollingNodeMac::removeTestDeferralForReason): Ditto.
90         * platform/Logging.h:
91         * platform/ScrollAnimator.cpp:
92         (WebCore::ScrollAnimator::deferTestsForReason): Added. Used by ScrollController during animation. This updates the
93         testing infrastructure directly, since it is running in the same process and main thread.
94         (WebCore::ScrollAnimator::removeTestDeferralForReason): Ditto.
95         * platform/ScrollAnimator.h:
96         * platform/cocoa/ScrollController.h:
97         (WebCore::ScrollControllerClient::deferTestsForReason): Change client API.
98         (WebCore::ScrollControllerClient::removeTestDeferralForReason): Ditto.
99         (WebCore::ScrollControllerClient::testTrigger): Deleted.
100         * platform/cocoa/ScrollController.mm:
101         (WebCore::ScrollController::startSnapRubberbandTimer): Use new client API.
102         (WebCore::ScrollController::stopSnapRubberbandTimer): Ditto.
103         (WebCore::ScrollController::startScrollSnapTimer): Ditto.
104         (WebCore::ScrollController::stopScrollSnapTimer): Ditto.
105
106 2015-05-01  Joseph Pecoraro  <pecoraro@apple.com>
107
108         Inline some small methods instead of them being EXPORT'd and out of line
109         https://bugs.webkit.org/show_bug.cgi?id=144498
110
111         Reviewed by Darin Adler.
112
113         * page/Page.cpp:
114         (WebCore::Page::testTrigger): Deleted.
115         (WebCore::Page::clearTrigger): Deleted.
116         (WebCore::Page::expectsWheelEventTriggers): Deleted.
117         * page/Page.h:
118         (WebCore::Page::testTrigger):
119         (WebCore::Page::clearTrigger):
120         (WebCore::Page::expectsWheelEventTriggers):
121
122 2015-05-01  Dan Bernstein  <mitz@apple.com>
123
124         WebCore part of <rdar://problem/8636045> Back/forward navigation to an error page in Safari breaks the back-forward list
125         https://bugs.webkit.org/show_bug.cgi?id=144501
126
127         Reviewed by Darin Adler.
128
129         Test: TestWebKitAPI/Tests/WebKit2Cocoa/LoadAlternateHTMLString.mm
130
131         Normally, loading substitute data (such as an error page) creates a new back-forward list
132         item. FrameLoader has a mechanism that detects when a substitute data load occurs during
133         handling of a provisional load error and prevents the creation of a new back-forwards list
134         item in that case if the unreachable URL is the same as the failing provisional URL. This
135         mechanism was broken in WebKit2, where handling the provisional load error is asynchronous.
136
137         The fix is to capture some state (namely, the failing provisional URL) when dispatching the
138         load error and allow it to be restored when loading the substitute data.
139
140         * loader/FrameLoader.cpp:
141         (WebCore::FrameLoader::FrameLoader): Removed initialization of
142         m_delegateIsHandlingProvisionalLoadError.
143         (WebCore::FrameLoader::shouldReloadToHandleUnreachableURL): Instead of checking
144         m_delegateIsHandlingProvisionalLoadError and if true using the provisional document loader’s
145         URL, check m_provisionalLoadErrorBeingHandledURL.
146         (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Instead of checking and setting
147         m_delegateIsHandlingProvisionalLoadError, use m_provisionalLoadErrorBeingHandledURL.
148         * loader/FrameLoader.h:
149         (WebCore::FrameLoader::provisionalLoadErrorBeingHandledURL): Added this getter. The client
150         can call this from its override of dispatchDidFailProvisionalLoad and store the result.
151         (WebCore::FrameLoader::setProvisionalLoadErrorBeingHandledURL): Added this setter. The
152         client can call this prior to loading substitute data if it’s done as part of handling a
153         previously-dispatched didFailProvisionalLoad.
154
155 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
156
157         USE(...) macro should expect unprefixed variables
158         https://bugs.webkit.org/show_bug.cgi?id=144454
159
160         Reviewed by Daniel Bates.
161
162         * DerivedSources.make: Replace all occurrences WTF_USE with USE.
163         * PlatformEfl.cmake: Ditto.
164         * PlatformGTK.cmake: Ditto.
165         * bindings/objc/PublicDOMInterfaces.h: Ditto.
166         * config.h: Ditto.
167         * crypto/mac/SerializedCryptoKeyWrapMac.mm: Ditto.
168         * page/AlternativeTextClient.h: Ditto.
169         * platform/efl/FileSystemEfl.cpp: Ditto.
170         (WebCore::fileSystemRepresentation): Ditto.
171         * platform/graphics/cg/ImageBufferDataCG.h: Ditto.
172         * platform/graphics/cg/PDFDocumentImage.h: Ditto.
173         * platform/ios/wak/WAKAppKitStubs.h: Ditto.
174         * rendering/RenderLayerCompositor.cpp: Ditto.
175
176 2015-05-01  Myles C. Maxfield  <mmaxfield@apple.com>
177
178         [OS X] Text dilation parameters are not restored after being set
179         https://bugs.webkit.org/show_bug.cgi?id=144507
180         <rdar://problem/19446938>
181
182         Reviewed by Simon Fraser and Ned Holbrook.
183
184         Create a RAII class who is in charge of saving, applying, and restoring dilation parameters. Use this class
185         around our text drawing routines.
186
187         Note that this migrates our use of CTFontSetRenderingParameters() to CTFontSetRenderingStyle().
188
189         Test: fast/text/dilation-save-restore.html
190
191         * platform/graphics/cocoa/FontCascadeCocoa.mm:
192         (WebCore::RenderingStyleSaver::RenderingStyleSaver):
193         (WebCore::RenderingStyleSaver::~RenderingStyleSaver):
194         (WebCore::showGlyphsWithAdvances):
195         * platform/spi/cg/CoreGraphicsSPI.h:
196         * platform/spi/cocoa/CoreTextSPI.h:
197
198 2015-05-01  Commit Queue  <commit-queue@webkit.org>
199
200         Unreviewed, rolling out r183687.
201         https://bugs.webkit.org/show_bug.cgi?id=144505
202
203         Appears to have caused assertions (Requested by ap on
204         #webkit).
205
206         Reverted changeset:
207
208         "Media control volume slider is opaque."
209         https://bugs.webkit.org/show_bug.cgi?id=144470
210         http://trac.webkit.org/changeset/183687
211
212 2015-05-01  Jeremy Jones  <jeremyj@apple.com>
213
214         Stop using deprecated AVKit SPI for enter and exit fullscreen.
215         https://bugs.webkit.org/show_bug.cgi?id=144493
216
217         Reviewed by Jer Noble.
218
219         Replace 
220             -enterFullScreenWithCompletionHandler:
221             -exitFullScreenWithCompletionHandler:
222         with
223             -enterFullScreenAnimated:completionHandler:
224             -exitFullScreenAnimated:completionHandler:
225         
226         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
227         (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard):
228         (WebVideoFullscreenInterfaceAVKit::exitFullscreenInternal):
229         * platform/spi/cocoa/AVKitSPI.h:
230
231 2015-05-01  Roger Fong  <roger_fong@apple.com>
232
233         Media control volume slider is opaque.
234         https://bugs.webkit.org/show_bug.cgi?id=144470.
235         <rdar://problem/20770350>
236
237         Rubberstamped by Simon Fraser.
238
239         * Modules/mediacontrols/mediaControlsApple.css:
240         (audio::-webkit-media-controls-panel): 
241         Don't create a stacking context just for the controls.
242         Doing so causes the mix-blend-mode on the volume box to fail.
243
244 2015-05-01  Joanmarie Diggs  <jdiggs@igalia.com>
245
246         [GTK] REGRESSION(183368): It made editing tests assert
247         https://bugs.webkit.org/show_bug.cgi?id=144447
248
249         Reviewed by Chris Fleizach.
250
251         Don't notify platforms of editing actions of type EditActionUnspecified.
252         If we don't know what the action is, platform accessibility APIs certainly
253         won't.
254
255         Add AXTextEditTypeAttributesChange and AXTextAttributesChanged as catch-alls
256         for formatting changes. ATK lacks finely-grained signals through which to
257         specify which text attributes have changed. If other platforms have such
258         signals, new types can always be added.
259
260         Don't post an accessible replacement notification for AXTextEditTypeCut.
261         The notification is handled by DeleteSelectionCommand. It is possible for
262         white space to be inserted in preparation for a cut which was triggering
263         a not-reached assert, but insertion of whitespace in preparation for a
264         cut does not seem notification-worthy.
265
266         Treat AXTextEditTypeDictation the same as other insertion types (insert,
267         paste, typing) with respect to replacement notifications.
268
269         No new tests. The hundreds of editing tests that had been crashing seem sufficient.
270
271         * accessibility/AXObjectCache.cpp:
272         (WebCore::AXObjectCache::showIntent):
273         (WebCore::AXObjectCache::textChangeForEditType):
274         * accessibility/AXObjectCache.h:
275         * accessibility/AXTextStateChangeIntent.h:
276         * accessibility/atk/AXObjectCacheAtk.cpp:
277         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
278         * editing/AppendNodeCommand.cpp:
279         (WebCore::AppendNodeCommand::doApply):
280         (WebCore::AppendNodeCommand::doUnapply):
281         * editing/DeleteFromTextNodeCommand.cpp:
282         (WebCore::DeleteFromTextNodeCommand::doApply):
283         (WebCore::DeleteFromTextNodeCommand::doUnapply):
284         * editing/EditCommand.cpp:
285         (WebCore::EditCommand::applyEditType):
286         (WebCore::EditCommand::unapplyEditType):
287         * editing/InsertIntoTextNodeCommand.cpp:
288         (WebCore::InsertIntoTextNodeCommand::doApply):
289         (WebCore::InsertIntoTextNodeCommand::doUnapply):
290         * editing/InsertNodeBeforeCommand.cpp:
291         (WebCore::InsertNodeBeforeCommand::doApply):
292         (WebCore::InsertNodeBeforeCommand::doUnapply):
293         * editing/ReplaceInsertIntoTextNodeCommand.cpp:
294         (WebCore::ReplaceInsertIntoTextNodeCommand::notifyAccessibilityForTextChange):
295
296 2015-05-01  Brady Eidson  <beidson@apple.com>
297
298         Add API to disable meta refreshes.
299         <rdar://problem/20333198> and https://bugs.webkit.org/show_bug.cgi?id=144269
300
301         Reviewed by Alexey Proskuryakov.
302
303         Test: loader/meta-refresh-disabled.html
304
305         * dom/Document.cpp:
306         (WebCore::Document::processHttpEquiv): Bail early if Settings have meta refreshes disabled.
307         * page/Settings.in:
308
309 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
310
311         [Freetype] Properly support synthetic oblique in vertical text
312         https://bugs.webkit.org/show_bug.cgi?id=144492
313
314         Reviewed by Sergio Villar Senin.
315
316         No new tests. Covered by existing tests.
317
318         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
319         (WebCore::FontPlatformData::initializeWithFontFace): Skew vertical when using synthetic
320         oblique for vertical text.
321
322 2015-05-01  Joanmarie Diggs  <jdiggs@igalia.com>
323
324         AX: [ATK] REGRESSION: accessibility/canvas-fallback-content.html now crashes
325         https://bugs.webkit.org/show_bug.cgi?id=144481
326
327         Reviewed by Chris Fleizach.
328
329         Canvas fallback content is allowed to be focusable if the canvas is displayed
330         and visible. Update the style when creating an accessible object for a node in
331         a canvas subtree and before Element::isFocusable() gets called.
332
333         No new tests. The existing, crashing test no longer crashes.
334
335         * accessibility/AXObjectCache.cpp:
336         (WebCore::AXObjectCache::getOrCreate):
337
338 2015-05-01  Alex Christensen  <achristensen@webkit.org>
339
340         [Content Extensions] Add CombinedURLFilters debugging code.
341         https://bugs.webkit.org/show_bug.cgi?id=144491
342
343         Reviewed by Daniel Bates.
344
345         No change in behavior.
346
347         * contentextensions/CombinedURLFilters.cpp:
348         (WebCore::ContentExtensions::recursiveMemoryUsed):
349         (WebCore::ContentExtensions::CombinedURLFilters::memoryUsed):
350         (WebCore::ContentExtensions::prefixTreeVertexToString):
351         (WebCore::ContentExtensions::recursivePrint):
352         (WebCore::ContentExtensions::CombinedURLFilters::print):
353         (WebCore::ContentExtensions::CombinedURLFilters::addPattern):
354         (WebCore::ContentExtensions::generateNFAForSubtree):
355         (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
356         * contentextensions/CombinedURLFilters.h:
357         * contentextensions/NFA.cpp:
358         (WebCore::ContentExtensions::NFA::memoryUsed):
359         * contentextensions/NFA.h:
360         * contentextensions/Term.h:
361         (WebCore::ContentExtensions::quantifierToString):
362         (WebCore::ContentExtensions::Term::toString):
363
364 2015-05-01  Eric Carlson  <eric.carlson@apple.com>
365
366         Fix text track language selection logic
367         https://bugs.webkit.org/show_bug.cgi?id=144467
368
369         Reviewed by Brent Fulgham.
370
371         No new tests, media/track/track-language-preference.html was updated.
372
373         * html/HTMLMediaElement.cpp:
374         (WebCore::HTMLMediaElement::configureTextTrackGroup): Correct a minor style typo.
375         (WebCore::HTMLMediaElement::configureTextTrackDisplay): Update logging.
376
377         * page/CaptionUserPreferences.cpp:
378         (WebCore::CaptionUserPreferences::textTrackSelectionScore): Minor cleanup.
379         (WebCore::CaptionUserPreferences::textTrackLanguageSelectionScore): Give exact matches a
380         higher score.
381
382         * page/CaptionUserPreferencesMediaAF.cpp:
383         (WebCore::CaptionUserPreferencesMediaAF::textTrackSelectionScore): Update for 
384         indexOfBestMatchingLanguageInList change.
385
386         * platform/Language.cpp:
387         (WebCore::indexOfBestMatchingLanguageInList): Add parameter for exact match. Convert the
388         passed language to lower case as we do with the preferred languages.
389         * platform/Language.h:
390
391 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
392
393         [Freetype] Add support for the font-synthesis property
394         https://bugs.webkit.org/show_bug.cgi?id=144472
395
396         Reviewed by Sergio Villar Senin.
397
398         No new tests. This causes fast/css3-text/font-synthesis.html to pass
399         for WebKitGTK+.
400
401         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
402         (WebCore::FontPlatformData::FontPlatformData): Only use synthetic bold when the font description allows it.
403         (WebCore::FontPlatformData::initializeWithFontFace): Ditto for synthetic oblique.
404
405 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
406
407         [GTK] New CORS tests from r183280 fail on WebKitGTK+
408         https://bugs.webkit.org/show_bug.cgi?id=144469
409
410         Reviewed by Sergio Villar Senin.
411
412         No new tests. This causes failing tests to pass.
413
414         * platform/network/soup/ResourceHandleSoup.cpp:
415         (WebCore::doRedirect): Clear the origin header on cross-origin redirects.
416
417 2015-04-30  Alex Christensen  <achristensen@webkit.org>
418
419         Compile fix when using content extensions debugging code.
420
421         * contentextensions/ContentExtensionCompiler.cpp:
422         (WebCore::ContentExtensions::compileRuleList):
423         * contentextensions/ContentExtensionsDebugging.h:
424         * contentextensions/DFA.cpp:
425         (WebCore::ContentExtensions::printTransitions):
426         (WebCore::ContentExtensions::DFA::debugPrintDot):
427         * contentextensions/DFANode.h:
428         * contentextensions/NFA.cpp:
429         (WebCore::ContentExtensions::NFA::memoryUsed):
430         (WebCore::ContentExtensions::NFA::debugPrintDot):
431
432 2015-04-30  Dan Bernstein  <mitz@apple.com>
433
434         Fixed the build for <rdar://problem/20758514>
435
436         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
437         (WebCore::AudioSourceProviderAVFObjC::destroyMix): Don’t pass nil to
438         -[AVMutableAudioMix setInputParameters:].
439
440 2015-04-30  Daniel Bates  <dabates@apple.com>
441
442         Clean up: Remove unnecessary runtime computation of string length
443         https://bugs.webkit.org/show_bug.cgi?id=144483
444
445         Reviewed by Joseph Pecoraro.
446
447         Following <http://trac.webkit.org/changeset/183649>, WebCore::fullyQualifiedInfoTableName()
448         computes strlen() of the first string literal as part of concatenating two string literals.
449         It is sufficient to use sizeof() - 1 instead of strlen() to compute the length of the first
450         string literal because the size of the string literal is known at compile time.
451
452         * Modules/webdatabase/DatabaseBackendBase.cpp:
453         (WebCore::fullyQualifiedInfoTableName):
454
455 2015-04-30  Dean Jackson  <dino@apple.com>
456
457         Expose -apple-system as a font family
458         https://bugs.webkit.org/show_bug.cgi?id=144484
459         <rdar://problem/20767330>
460
461         Reviewed by Tim Horton.
462
463         Accept "-apple-system" for the font-family property, and
464         rename "-apple-system-font-monospaced-numbers" to
465         "-apple-system-monospaced-numbers".
466
467         Also change the media controls to use the new name.
468
469         Covered by existing tests and this new one:
470             fast/text/system-font-legacy-name.html
471
472         * Modules/mediacontrols/mediaControlsApple.css:
473         (audio::-webkit-media-controls-time-remaining-display):
474         * Modules/mediacontrols/mediaControlsiOS.css:
475         (::-webkit-media-controls):
476         (audio::-webkit-media-controls-time-remaining-display):
477         (audio::-webkit-media-controls-status-display):
478         * platform/graphics/ios/FontCacheIOS.mm: Add support for the new name.
479         (WebCore::createCTFontWithFamilyNameAndWeight):
480         * platform/graphics/mac/FontCacheMac.mm: Ditto.
481         (WebCore::fontWithFamily):
482
483 2015-04-30  Javier Fernandez  <jfernandez@igalia.com>
484
485         [CSS Grid Layout] overflow-position keyword for align and justify properties.
486         https://bugs.webkit.org/show_bug.cgi?id=144235
487
488         Reviewed by Sergio Villar Senin.
489
490         When the alignment subject is larger than the alignment container,
491         it will overflow. Some alignment modes, if honored in this
492         situation, may cause data loss; an overflow alignment mode can be
493         explicitly specified to avoid this.
494
495         This patch implements overflow-keyword handling for Grid Layout on
496         align-self and justify-self properties.
497
498         Test: fast/css-grid-layout/grid-align-justify-overflow.html
499
500         * rendering/RenderGrid.cpp:
501         (WebCore::computeOverflowAlignmentOffset):
502         (WebCore::RenderGrid::rowPositionForChild):
503         (WebCore::RenderGrid::columnPositionForChild):
504         (WebCore::RenderGrid::rowAxisPositionForChild): Deleted.
505         * rendering/style/RenderStyle.cpp:
506         (WebCore::resolveAlignmentData):
507         (WebCore::resolveJustificationData):
508         (WebCore::RenderStyle::resolveAlignment):
509         (WebCore::RenderStyle::resolveAlignmentOverflow):
510         (WebCore::RenderStyle::resolveJustification):
511         (WebCore::RenderStyle::resolveJustificationOverflow):
512         * rendering/style/RenderStyle.h:
513
514 2015-04-30  Jon Honeycutt  <jhoneycutt@apple.com>
515
516         Rebaseline bindings tests results after r183648.
517
518         Unreviewed.
519
520         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
521         (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage):
522         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
523         (WebCore::jsTestCustomNamedGetterPrototypeFunctionAnotherFunction):
524         * bindings/scripts/test/JS/JSTestInterface.cpp:
525         (WebCore::JSTestInterfaceConstructor::constructJSTestInterface):
526         (WebCore::setJSTestInterfaceConstructorImplementsStaticAttr):
527         (WebCore::setJSTestInterfaceImplementsStr2):
528         (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
529         (WebCore::setJSTestInterfaceSupplementalStr2):
530         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
531         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
532         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
533         (WebCore::JSTestNamedConstructorNamedConstructor::constructJSTestNamedConstructor):
534         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
535         (WebCore::setJSTestNondeterministicNondeterministicWriteableAttr):
536         (WebCore::setJSTestNondeterministicNondeterministicExceptionAttr):
537         (WebCore::setJSTestNondeterministicNondeterministicGetterExceptionAttr):
538         (WebCore::setJSTestNondeterministicNondeterministicSetterExceptionAttr):
539         * bindings/scripts/test/JS/JSTestObj.cpp:
540         (WebCore::setJSTestObjConstructorStaticStringAttr):
541         (WebCore::setJSTestObjStringAttr):
542         (WebCore::setJSTestObjReflectedStringAttr):
543         (WebCore::setJSTestObjReflectedURLAttr):
544         (WebCore::setJSTestObjReflectedCustomURLAttr):
545         (WebCore::setJSTestObjStringAttrWithGetterException):
546         (WebCore::setJSTestObjStringAttrWithSetterException):
547         (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
548         (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
549         (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
550         (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
551         (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
552         (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
553         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalString):
554         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined):
555         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullString):
556         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
557         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3):
558         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod11):
559         (WebCore::jsTestObjConstructorFunctionOverloadedMethod12):
560         (WebCore::jsTestObjPrototypeFunctionStrictFunction):
561         (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
562         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
563         (WebCore::JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors4):
564         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
565         (WebCore::JSTestTypedefsConstructor::constructJSTestTypedefs):
566         (WebCore::setJSTestTypedefsStringAttrWithGetterException):
567         (WebCore::setJSTestTypedefsStringAttrWithSetterException):
568         (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
569
570 2015-04-30  Simon Fraser  <simon.fraser@apple.com>
571
572         Fixed elements end up in the middle of the view with pageScale < 1
573         https://bugs.webkit.org/show_bug.cgi?id=144428
574         rdar://problem/20404982
575
576         Reviewed by Tim Horton.
577
578         When pageScale is < 1, we used fixed layout mode, and FrameView::fixedElementsLayoutRelativeToFrame()
579         returns true. However, the scrolling thread was calling the static scrollOffsetForFixedPosition()
580         hardcoding 'false' for this parameter.
581         
582         Fix by sending the value of fixedElementsLayoutRelativeToFrame over to the scrolling thread,
583         so we can use it when doing scrolling-thread fixed position stuff.
584
585         Not testable.
586
587         * page/scrolling/AsyncScrollingCoordinator.cpp:
588         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
589         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
590         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
591         (WebCore::ScrollingStateFrameScrollingNode::setFixedElementsLayoutRelativeToFrame):
592         * page/scrolling/ScrollingStateFrameScrollingNode.h:
593         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
594         (WebCore::ScrollingTreeFrameScrollingNode::ScrollingTreeFrameScrollingNode):
595         (WebCore::ScrollingTreeFrameScrollingNode::updateBeforeChildren):
596         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
597         (WebCore::ScrollingTreeFrameScrollingNode::fixedElementsLayoutRelativeToFrame):
598         (WebCore::ScrollingTreeFrameScrollingNode::shouldUpdateScrollLayerPositionSynchronously): Deleted.
599         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
600         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
601
602 2015-04-30  Beth Dakin  <bdakin@apple.com>
603
604         Remove invalid assertion from MouseEvent::create()
605         https://bugs.webkit.org/show_bug.cgi?id=144477
606
607         Reviewed by Tim Horton.
608
609         mouseforcechanged events and mouseforcewillbegin trigger this assertion. The 
610         assertion does not seem valuable, so rather than changing it, just remove it.
611         * dom/MouseEvent.cpp:
612         (WebCore::MouseEvent::create):
613
614 2015-04-30  Dean Jackson  <dino@apple.com>
615
616         -apple-system-font-monospaced-numbers doesn't work on iOS
617         https://bugs.webkit.org/show_bug.cgi?id=144478
618         <rdar://problem/20544940>
619
620         Reviewed by Brent Fulgham.
621
622         Make sure to start from the system font descriptor when
623         asking for a monospaced numeric alternate.
624
625         Test: platform/ios-simulator/fast/text/system-monospaced-numbers.html
626
627         * platform/graphics/ios/FontCacheIOS.mm:
628         (WebCore::createCTFontWithFamilyNameAndWeight):
629
630 2015-04-30  Oliver Hunt  <oliver@apple.com>
631
632         DOM bindings should not be using a reference type to point to a temporary object
633         https://bugs.webkit.org/show_bug.cgi?id=144474
634
635         Reviewed by Beth Dakin.
636
637         The DOM bindings will currently try and use a local reference to point
638         to a temporary object. This currently works as a by product of the compiler's
639         stack layout. This patch removes the dependency on undefined behaviour
640         by ensuring that we use a value rather than reference type.
641
642         * bindings/scripts/CodeGeneratorJS.pm:
643         (GenerateParametersCheck):
644         (GetNativeTypeForCallbacks):
645
646 2015-04-30  Brady Eidson  <beidson@apple.com>
647
648         Build fix after r183646 for less enlightened platforms.
649
650         Unreviewed.
651
652         * Modules/webdatabase/DatabaseBackendBase.cpp:
653         (WebCore::fullyQualifiedInfoTableName): Windows doesn’t have stpcpy :(
654
655 2015-04-30  Brady Eidson  <beidson@apple.com>
656
657         Javascript using WebSQL can create their own WebKit info table.
658         <rdar://problem/20688792> and https://bugs.webkit.org/show_bug.cgi?id=144466
659
660         Reviewed by Alex Christensen.
661
662         Test: storage/websql/alter-to-info-table.html
663
664         * Modules/webdatabase/DatabaseBackendBase.cpp:
665         (WebCore::DatabaseBackendBase::databaseInfoTableName): Return the info table name.
666         (WebCore::fullyQualifiedInfoTableName): Append "main." to the info table name.
667         (WebCore::DatabaseBackendBase::DatabaseBackendBase): Use the fully qualified name.
668         (WebCore::DatabaseBackendBase::performOpenAndVerify): Ditto.
669         (WebCore::DatabaseBackendBase::getVersionFromDatabase): Ditto.
670         (WebCore::DatabaseBackendBase::setVersionInDatabase): Ditto.
671
672 2015-04-30  Beth Dakin  <bdakin@apple.com>
673
674         Should choose UIScrollView indicatorStyle based on the document background color
675         https://bugs.webkit.org/show_bug.cgi?id=144473
676         -and corresponding-
677         rdar://problem/19897699
678
679         Reviewed by Simon Fraser.
680
681         Export this function.
682         * platform/graphics/Color.h:
683
684 2015-04-30  Brent Fulgham  <bfulgham@apple.com>
685
686         [Win] Allow WebKit to build without ANGLE support
687         https://bugs.webkit.org/show_bug.cgi?id=144459
688         <rdar://problem/20707307>
689
690         Reviewed by Dean Jackson.
691
692         * platform/graphics/GLContext.cpp: Use the ENABLE(GRAPHICS_CONTEXT_3D)
693         macro to avoid compiling this code if not using WEBGL/3D contexts.
694
695 2015-04-29  David Hyatt  <hyatt@apple.com>
696
697         Avoid containingBlock() calls when no writing mode flipping is needed.
698         https://bugs.webkit.org/show_bug.cgi?id=144407
699
700         Reviewed by Simon Fraser.
701
702         Add a bool to RenderView that indicates whether or not any flipped blocks have been
703         added to the view. Once tainted, the view just stays dirty forever. If no flipped
704         blocks are ever seen, we can then optimize away calls to containingBlock().
705
706         The motivation for this patch is to improve layer position updating, which makes many
707         calls to topLeftLocationOffset(), one of the functions that can be optimized by this
708         change.
709
710         * rendering/RenderBox.cpp:
711         (WebCore::RenderBox::layoutOverflowRectForPropagation):
712         * rendering/RenderBoxModelObject.cpp:
713         (WebCore::RenderBoxModelObject::updateFromStyle):
714         * rendering/RenderLayer.cpp:
715         (WebCore::RenderLayer::calculateClipRects):
716         * rendering/RenderLineBoxList.cpp:
717         (WebCore::RenderLineBoxList::rangeIntersectsRect):
718         * rendering/RenderView.cpp:
719         (WebCore::RenderView::RenderView):
720         * rendering/RenderView.h:
721
722 2015-04-29  Jer Noble  <jer.noble@apple.com>
723
724         Make GenericTaskQueue even more generic (and usable inside platform/)
725         https://bugs.webkit.org/show_bug.cgi?id=144414
726
727         Reviewed by Eric Carlson.
728
729         Templatize GenericTaskQueue so that it can be used from within platform/.
730
731         * CMakeLists.txt:
732         * WebCore.vcxproj/WebCore.vcxproj:
733         * WebCore.vcxproj/WebCore.vcxproj.filters:
734         * WebCore.xcodeproj/project.pbxproj:
735         * dom/GenericTaskQueue.cpp: Removed.
736         * html/HTMLMediaElement.h:
737         * platform/GenericTaskQueue.h: Renamed from Source/WebCore/dom/GenericTaskQueue.h.
738         (WebCore::TaskDispatcher::TaskDispatcher): Added default templatized class which just calls the parameter's postTask().
739         (WebCore::TaskDispatcher::postTask): Call context's postTask().
740         (WebCore::TaskDispatcher<Timer>::TaskDispatcher): Add a timer version which does not require a context.
741         (WebCore::TaskDispatcher<Timer>::postTask): Set the timer.
742         (WebCore::TaskDispatcher<Timer>::timerFired): Call the task.
743         (WebCore::GenericTaskQueue::GenericTaskQueue): Moved from .cpp.
744         (WebCore::GenericTaskQueue::enqueueTask): Ditto.
745         (WebCore::GenericTaskQueue::close): Ditto.
746         (WebCore::GenericTaskQueue::cancelAllTasks): Ditto.
747         (WebCore::GenericTaskQueue::hasPendingTasks): Ditto.
748
749 2015-04-29  Joseph Pecoraro  <pecoraro@apple.com>
750
751         Unreviewed build fix. WebCore has a weak symbol.
752
753         WebCore has a weak external symbol in it. A common cause of weak external
754         symbols is when an inline function is listed in the linker export file.
755         ERROR: symbol __ZNK7WebCore4Page25expectsWheelEventTriggersEv
756
757         * page/Page.cpp:
758         (WebCore::Page::expectsWheelEventTriggers):
759         * page/Page.h:
760         (WebCore::Page::expectsWheelEventTriggers): Deleted.
761
762 2015-04-29  Simon Fraser  <simon.fraser@apple.com>
763
764         Crash at WebCore::Document::absoluteRegionForEventTargets 
765         https://bugs.webkit.org/show_bug.cgi?id=144426
766         rdar://problem/20502166
767
768         Reviewed by Tim Horton.
769
770         When a frame had wheel event handlers, we would register the document itself
771         as a handler in its parent document. This is problematic, because there's not
772         code path that removes it when the frame is destroyed.
773         
774         It turns out we don't need to do this at all; the non-fast scrollable region
775         already takes handlers in subframes into account.
776
777         Tests: fast/events/wheelevent-in-frame.html
778                fast/events/wheelevent-in-reattached-frame.html
779
780         * dom/Document.cpp:
781         (WebCore::Document::didAddWheelEventHandler):
782         (WebCore::Document::didRemoveWheelEventHandler):
783
784 2015-04-29  Eric Carlson  <eric.carlson@apple.com>
785
786         Not all videos should automatically play to playback target
787         https://bugs.webkit.org/show_bug.cgi?id=144430
788         <rdar://problem/20718523>
789
790         Reviewed by Darin Adler.
791
792         * Modules/mediasession/WebMediaSessionManager.cpp:
793         (WebCore::WebMediaSessionManager::clientStateDidChange): Consider ExternalDeviceAutoPlayCandidate.
794         Minor cleanup.
795
796         * html/HTMLMediaElement.cpp:
797         (WebCore::HTMLMediaElement::mediaState): Set ExternalDeviceAutoPlayCandidate when a <video>
798         has a file with an audio track that does not loop.
799
800         * page/MediaProducer.h: Add ExternalDeviceAutoPlayCandidate.
801
802 2015-04-29  Joseph Pecoraro  <pecoraro@apple.com>
803
804         LiveNodeList may unexpectedly return an element for empty string
805         https://bugs.webkit.org/show_bug.cgi?id=144429
806
807         Reviewed by Darin Adler.
808
809         * dom/LiveNodeList.cpp:
810         (WebCore::LiveNodeList::namedItem):
811         Never return a result for an empty string.
812
813 2015-04-29  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
814
815         Remove PassRefPtr in SVGFEFooElement classes
816         https://bugs.webkit.org/show_bug.cgi?id=144425
817
818         Reviewed by Darin Adler.
819
820         As a step to use Ref instead of PassRefPtr, this patch purges PassRefPtr
821         in SVGFEFooElement.
822
823         No new tests, no behavior changes.
824
825         * css/RGBColor.cpp:
826         (WebCore::RGBColor::create):
827         * css/RGBColor.h:
828         * platform/graphics/filters/PointLightSource.h:
829         (WebCore::PointLightSource::create):
830         * platform/graphics/filters/SpotLightSource.h:
831         (WebCore::SpotLightSource::create):
832         * svg/SVGColor.cpp:
833         (WebCore::SVGColor::rgbColor):
834         * svg/SVGColor.h:
835         * svg/SVGFEDistantLightElement.cpp:
836         (WebCore::SVGFEDistantLightElement::lightSource):
837         * svg/SVGFEDistantLightElement.h:
838         * svg/SVGFELightElement.cpp:
839         (WebCore::SVGFELightElement::findLightSource):
840         * svg/SVGFELightElement.h:
841         * svg/SVGFEPointLightElement.cpp:
842         (WebCore::SVGFEPointLightElement::lightSource):
843         * svg/SVGFEPointLightElement.h:
844         * svg/SVGFESpotLightElement.cpp:
845         (WebCore::SVGFESpotLightElement::lightSource):
846         * svg/SVGFESpotLightElement.h:
847
848 2015-04-29  Dean Jackson  <dino@apple.com>
849
850         Create a named CSS property for system colors
851         https://bugs.webkit.org/show_bug.cgi?id=144423
852         <rdar://problem/20491011>
853
854         Reviewed by Tim Horton.
855
856         Test: fast/css/apple-system-colors.html
857
858         Expose the following values to CSS color properties:
859             -apple-system-blue
860             -apple-system-brown
861             -apple-system-gray
862             -apple-system-green
863             -apple-system-orange
864             -apple-system-pink
865             -apple-system-purple
866             -apple-system-red
867             -apple-system-yellow
868
869         On platforms other than OS X Yosemite and iOS, the
870         actual color values are undefined and become transparent
871         black. (In fact, not all are defined on iOS either.)
872
873         * WebCore.xcodeproj/project.pbxproj: Two new SPI header files.
874
875         * css/CSSParser.cpp:
876         (WebCore::CSSParser::validSystemColorValue): New helper function that
877         checks if a CSSValueID is between the two system color values. This
878         was being tested everywhere, which meant adding a new system color was
879         at risk of being ignored. It's a static method so it can be used
880         from the SVG CSS parser too.
881         (WebCore::validPrimitiveValueColor): Use the new helper.
882         (WebCore::CSSParser::parseValue): Ditto.
883         (WebCore::CSSParser::parseBackgroundColor): Ditto.
884         (WebCore::CSSParser::parseShadow): Ditto.
885         (WebCore::parseDeprecatedGradientColorStop): Ditto.
886         (WebCore::parseGradientColorOrKeyword): Ditto.
887         * css/CSSParser.h: New static helper function.
888
889         * css/CSSValueKeywords.in: Add the new CSS value keywords.
890
891         * css/SVGCSSParser.cpp:
892         (WebCore::validSystemControlColorValue): SVG has a restricted
893         set of system colors, so use the helper from CSSParser but with
894         an extra condition.
895         (WebCore::CSSParser::parseSVGValue): Use the helper.
896
897         * platform/spi/ios/UIColorSPI.h: Added.
898         * platform/spi/cocoa/NSColorSPI.h: Added.
899
900         * rendering/RenderThemeIOS.h: New systemColor override. Also add a cache for system colors.
901         * rendering/RenderThemeIOS.mm:
902         (WebCore::RenderThemeIOS::systemColor): Ask UIColor to provide the color values for the new CSS values.
903         * rendering/RenderThemeMac.mm:
904         (WebCore::RenderThemeMac::systemColor): Ditto.
905
906 2015-04-29  Commit Queue  <commit-queue@webkit.org>
907
908         Unreviewed, rolling out r183600.
909         https://bugs.webkit.org/show_bug.cgi?id=144432
910
911         New tests time out everywhere (Requested by ap on #webkit).
912
913         Reverted changeset:
914
915         "Crash at WebCore::Document::absoluteRegionForEventTargets"
916         https://bugs.webkit.org/show_bug.cgi?id=144426
917         http://trac.webkit.org/changeset/183600
918
919 2015-04-29  Joseph Pecoraro  <pecoraro@apple.com>
920
921         Unreviewed iOS build fix. Unused parameter no longer exists.
922
923         * page/scrolling/ScrollingCoordinator.cpp:
924         (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame):
925
926 2015-04-29  Simon Fraser  <simon.fraser@apple.com>
927
928         Crash at WebCore::Document::absoluteRegionForEventTargets 
929         https://bugs.webkit.org/show_bug.cgi?id=144426
930         rdar://problem/20502166
931
932         Reviewed by Tim Horton.
933
934         When a frame had wheel event handlers, we would register the document itself
935         as a handler in its parent document. This is problematic, because there's not
936         code path that removes it when the frame is destroyed.
937         
938         It turns out we don't need to do this at all; the non-fast scrollable region
939         already takes handlers in subframes into account.
940
941         Tests: fast/events/wheelevent-in-frame.html
942                fast/events/wheelevent-in-reattached-frame.html
943
944         * dom/Document.cpp:
945         (WebCore::Document::didAddWheelEventHandler):
946         (WebCore::Document::didRemoveWheelEventHandler):
947
948 2015-04-29  David Kilzer  <ddkilzer@apple.com>
949
950         Attempt #2: Switch QuickLook soft-linking to use QuickLookSoftLink.{h,mm}
951         <http://webkit.org/b/144362>
952
953         Reviewed by Andy Estes.
954
955         This patch switches soft-linking of QuickLook.framework to
956         QuickLookSoftLink.{h,mm} so that we stop exporting unintended
957         symbols.
958
959         No new tests since no change in behavior.
960
961         * WebCore.xcodeproj/project.pbxproj:
962         - Add QuickLookSoftLinking.{h,mm} to the project.
963
964         * platform/ios/QuickLookSoftLink.h: Added.
965         * platform/ios/QuickLookSoftLink.mm: Added.
966         * platform/mac/SoftLinking.h:
967         (SOFT_LINK_CLASS_FOR_HEADER): Add macro.
968         (SOFT_LINK_CLASS_FOR_SOURCE): Add macro.
969         (SOFT_LINK_POINTER_FOR_HEADER): Add macro.
970         (SOFT_LINK_POINTER_FOR_SOURCE): Add macro.
971
972         * platform/network/ios/QuickLook.h:
973         - Remove unused declarations.
974
975         * platform/network/ios/QuickLook.mm:
976         (WebCore::QLPreviewConverterClass): Deleted.
977         (WebCore::QLTypeCopyBestMimeTypeForFileNameAndMimeType): Deleted.
978         (WebCore::QLTypeCopyBestMimeTypeForURLAndMimeType): Deleted.
979         (WebCore::QLTypeCopyUTIForURLAndMimeType): Deleted.
980         - Remove SOFT_LINK macros and unused methods after switching to
981           new QuickLookSoftLink.{h,mm}.
982         (WebCore::QLPreviewGetSupportedMIMETypesSet):
983         - Switch to use NeverDestroyed<>.
984         (WebCore::registerQLPreviewConverterIfNeeded):
985         (createQLPreviewProtocol):
986         (WebCore::QLPreviewProtocol):
987         (WebCore::QuickLookHandle::QuickLookHandle):
988         (WebCore::QuickLookHandle::create):
989         (WebCore::QuickLookHandle::shouldCreateForMIMEType):
990         - Simplify code when using QuickLookSoftLink.h.
991
992         * platform/network/ios/WebCoreURLResponseIOS.mm:
993         - Include QuickLookSoftLink.h header.
994
995 2015-04-29  Simon Fraser  <simon.fraser@apple.com>
996
997         Compute the non-fast-scrollable region in main-document coordinates
998         https://bugs.webkit.org/show_bug.cgi?id=144420
999
1000         Reviewed by Tim Horton.
1001
1002         Compute the non-fast-scrollable region in document coordinates, to make it easier
1003         to reason about. Previously, it was document coordinates offset by top content inset.
1004
1005         * page/DebugPageOverlays.cpp:
1006         (WebCore::MouseWheelRegionOverlay::updateRegion): Traverse all frames to compute the wheel
1007         event handler region, mapping each to root view coords, and then mapping back into document
1008         coords at the end.
1009         (WebCore::NonFastScrollableRegionOverlay::updateRegion): No offset needed here; the
1010         overlay and region are both document coordinates.
1011         * page/FrameView.h: Make some mapping function overrides public, and expose widgetsInRenderTree().
1012         * page/Page.cpp:
1013         (WebCore::Page::nonFastScrollableRects): Remove frame argument.
1014         * page/Page.h:
1015         * page/PageOverlay.cpp:
1016         (WebCore::PageOverlay::bounds):
1017         (WebCore::PageOverlay::viewToOverlayOffset): Convenience function to map between
1018         view and overlay coordinates.
1019         * page/PageOverlay.h:
1020         * page/scrolling/AsyncScrollingCoordinator.cpp: New computeNonFastScrollableRegion() signature.
1021         (WebCore::AsyncScrollingCoordinator::updateNonFastScrollableRegion):
1022         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
1023         (WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText):
1024         * page/scrolling/ScrollingCoordinator.cpp:
1025         (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame): This function
1026         recurses on frames, computing an absolute (document-relative) region per frame. This
1027         removes the confusing offsetting through top content inset.
1028         Change how we get to plugins that want wheel events; we can't get from PluginViewBase
1029         to renderers, so use FrameView's list of Widgets, and their RenderWidgets. This fixes
1030         regions for transformed plugin-ins.
1031         For subframes, we get a region in the subframe's document coords. Map to that sub-frame,
1032         then to our frame, then to our document.
1033         (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegion): Wrapper that hides
1034         the recursive function.
1035         (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion): Deleted.
1036         * page/scrolling/ScrollingCoordinator.h:
1037         * page/scrolling/ScrollingTree.cpp:
1038         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously): Map the event point
1039         from view coordinates to document coordinates for testing against the non-fast region.
1040         We previously assert that the root note is a FrameScrolling node.
1041         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1042         (WebCore::ScrollingTreeFrameScrollingNode::viewToContentsOffset): Similar to ScrollView::viewToContents()
1043         for the scrolling tree.
1044         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1045         * testing/Internals.cpp:
1046         (WebCore::Internals::nonFastScrollableRects): No need for frame arg.
1047
1048 2015-04-29  Brent Fulgham  <bfulgham@apple.com>
1049
1050         Expand test infrastructure to support scrolling tests
1051         https://bugs.webkit.org/show_bug.cgi?id=143684
1052         <rdar://problem/20375516>
1053
1054         Reviewed by Simon Fraser.
1055
1056         Tested by various fast/scrolling and platform/mac-wk2/tiled-drawing/scrolling tests.
1057
1058         This series of changes adds a new singleton class, 'WheelEventTestTrigger', which encapsulates a
1059         function object to be fired when scroll events are finished. The object also keeps track of reasons
1060         why the test should not yet fire (e.g., 'rubberbanding' is active) so that tests do not incorrectly
1061         check rendering state in the middle of an animation.
1062
1063         Switch from the original WeakPtr design to ThreadSafeRefPtr, because WeakPtr cannot be shared
1064         across multiple threads.
1065
1066         * page/FrameView.cpp:
1067         (WebCore::FrameView::layout): Make sure ScrollAnimator knows about any active test trigger.
1068         (WebCore::FrameView::setScrollPosition): Ditto.
1069         (WebCore::FrameView::didAddScrollbar): Ditto.
1070         * page/MainFrame.cpp:
1071         (WebCore::MainFrame::testTrigger): Moved to Page.
1072         (WebCore::MainFrame::ensureTestTrigger): Ditto.
1073         * page/MainFrame.h:
1074         * page/Page.cpp:
1075         (WebCore::Page::testTrigger): Moved from MainFrame, and converted to use RefPtr.
1076         (WebCore::Page::ensureTestTrigger): Ditto.
1077         * page/Page.h:
1078         * page/WheelEventTestTrigger.cpp:
1079         (WebCore::WheelEventTestTrigger::WheelEventTestTrigger): Remove WeakPtr code.
1080         (WebCore::WheelEventTestTrigger::createWeakPtr): Deleted.
1081         * page/WheelEventTestTrigger.h:
1082         * page/mac/EventHandlerMac.mm:
1083         (WebCore::EventHandler::platformPrepareForWheelEvents): Make sure the scroll animator knows about
1084         any active test trigger object.
1085         * page/scrolling/AsyncScrollingCoordinator.cpp:
1086         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll): Notify WheelEventTestTrigger
1087         that the scrolling thread is synced with the main thread.
1088         * platform/ScrollAnimator.h: Hold a RefPtr to the WheelEventTestTrigger. 
1089         (WebCore::ScrollAnimator::ScrollAnimator::setWheelEventTestTrigger):
1090         * platform/cocoa/ScrollController.h:
1091         * platform/cocoa/ScrollController.mm:
1092         (WebCore::ScrollController::startSnapRubberbandTimer): Notify test trigger to hold tests until rubber band
1093         snapping is complete.
1094         (WebCore::ScrollController::stopSnapRubberbandTimer): Notify test trigger that rubber band snapping is done.
1095         (WebCore::ScrollController::startScrollSnapTimer): Notify test trigger to hold tests until scroll snapping
1096         is complete.
1097         (WebCore::ScrollController::stopScrollSnapTimer): Notify test trigger that scroll snapping is done.
1098         * platform/mac/ScrollAnimatorMac.mm:
1099         (WebCore::ScrollAnimatorMac::didBeginScrollGesture): Notify test trigger that a content scroll is in progress.
1100         (WebCore::ScrollAnimatorMac::didEndScrollGesture): Notify test trigger that a content scroll is finished.
1101         (WebCore::ScrollAnimatorMac::sendContentAreaScrolledSoon): Notify test trigger to hold tests until the content
1102         scrolling is complete.
1103         (WebCore::ScrollAnimatorMac::sendContentAreaScrolledTimerFired): Notify test trigger that content scrolling is done.
1104         * rendering/RenderBox.cpp:
1105         (WebCore::connectScrollAnimatorToTestTrigger): Helper function.
1106         (WebCore::RenderBox::setScrollLeft): Call 'connectScrollAnimatorToTestTrigger' to connect the ScrollAnimator
1107         to the WheelEventTestTrigger so that future scroll operations can notify the test infrastructure.
1108         (WebCore::RenderBox::setScrollTop): Ditto.
1109         * rendering/RenderLayer.cpp:
1110         (WebCore::RenderLayer::createScrollbar): Make sure the ScrollAnimator knows about any active test triggers.
1111         * rendering/RenderListBox.cpp:
1112         (WebCore::connectScrollAnimatorToTestTrigger): Helper function.
1113         (WebCore::RenderListBox::setScrollLeft): Call 'connectScrollAnimatorToTestTrigger' to connect the ScrollAnimator
1114         to the WheelEventTestTrigger so that future scroll operations can notify the test infrastructure.
1115         (WebCore::RenderListBox::setScrollTop): Ditto.
1116         (WebCore::RenderListBox::createScrollbar): Ditto.
1117         * testing/js/WebCoreTestSupport.cpp:
1118         (WebCoreTestSupport::monitorWheelEvents): Look for WheelEventTestTrigger in Page, rather than MainFrame.
1119         (WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Ditto.
1120
1121 2015-04-29  Javier Fernandez  <jfernandez@igalia.com>
1122
1123         [CSS Box Alignment] Unifying alignment data in a single class
1124         https://bugs.webkit.org/show_bug.cgi?id=144384
1125
1126         Reviewed by David Hyatt.
1127
1128         The new CSS Box Alignment specification introduces more complex
1129         values and syntax for defining alignment properties. Most of the
1130         alignment values were just keyword identifiers, but the new syntax
1131         allows different combinations of identifiers to determine the
1132         alignment behavior (eg. overflow-alignment keyword).
1133
1134         This patch wll help to implement later overflow handling and
1135         specially Content Dstribution alignment, the most complex case by
1136         far. It will be more consistent against style changes and repaint,
1137         snce we will have just one field to monitoring for value
1138         modfications.
1139
1140         No new tests, because no new functionality was added; it's just a
1141         code refactoring which is just expected to pass current tests.
1142
1143         * css/CSSComputedStyleDeclaration.cpp:
1144         (WebCore::resolveSelfAlignmentAuto):
1145         (WebCore::ComputedStyleExtractor::propertyValue):
1146         * css/CSSPropertyNames.in:
1147         * css/StyleBuilderConverter.h:
1148         (WebCore::StyleBuilderConverter::convertSelfOrDefaultAlignmentData):
1149         (WebCore::StyleBuilderConverter::convertSVGColor): Deleted.
1150         * css/StyleBuilderCustom.h:
1151         (WebCore::StyleBuilderCustom::applyInitialWebkitMaskImage): Deleted.
1152         (WebCore::StyleBuilderCustom::applyInheritWebkitMaskImage): Deleted.
1153         (WebCore::ApplyPropertyBorderImageModifier::applyInheritValue): Deleted.
1154         (WebCore::ApplyPropertyBorderImageModifier::applyInitialValue): Deleted.
1155         (WebCore::ApplyPropertyBorderImageModifier::applyValue): Deleted.
1156         (WebCore::ApplyPropertyBorderImageModifier::getValue): Deleted.
1157         (WebCore::ApplyPropertyBorderImageModifier::setValue): Deleted.
1158         (WebCore::StyleBuilderCustom::applyInheritLineHeight): Deleted.
1159         * css/StyleResolver.cpp:
1160         (WebCore::StyleResolver::adjustRenderStyle):
1161         * mathml/MathMLTextElement.cpp:
1162         (WebCore::MathMLTextElement::createElementRenderer):
1163         * rendering/RenderFlexibleBox.cpp:
1164         (WebCore::RenderFlexibleBox::styleDidChange):
1165         * rendering/RenderFullScreen.cpp:
1166         (WebCore::createFullScreenStyle):
1167         * rendering/RenderMenuList.cpp:
1168         (WebCore::RenderMenuList::adjustInnerStyle):
1169         * rendering/mathml/RenderMathMLRoot.cpp:
1170         (WebCore::RenderMathMLRoot::updateStyle):
1171         * rendering/mathml/RenderMathMLScripts.cpp:
1172         (WebCore::RenderMathMLScripts::fixAnonymousStyleForSubSupPair):
1173         (WebCore::RenderMathMLScripts::fixAnonymousStyles):
1174         * rendering/style/RenderStyle.cpp:
1175         (WebCore::RenderStyle::resolveAlignment):
1176         (WebCore::RenderStyle::resolveJustification):
1177         * rendering/style/RenderStyle.h:
1178         * rendering/style/StyleRareNonInheritedData.cpp:
1179         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
1180         (WebCore::StyleRareNonInheritedData::operator==):
1181         (WebCore::StyleRareNonInheritedData::contentDataEquivalent): Deleted.
1182         * rendering/style/StyleRareNonInheritedData.h:
1183         * rendering/style/StyleSelfAlignmentData.h: Added.
1184         (WebCore::StyleSelfAlignmentData::StyleSelfAlignmentData):
1185         (WebCore::StyleSelfAlignmentData::setPosition):
1186         (WebCore::StyleSelfAlignmentData::setPositionType):
1187         (WebCore::StyleSelfAlignmentData::setOverflow):
1188         (WebCore::StyleSelfAlignmentData::position):
1189         (WebCore::StyleSelfAlignmentData::positionType):
1190         (WebCore::StyleSelfAlignmentData::overflow):
1191         (WebCore::StyleSelfAlignmentData::operator==):
1192         (WebCore::StyleSelfAlignmentData::operator!=):
1193
1194 2015-04-29  Joseph Pecoraro  <pecoraro@apple.com>
1195
1196         NodeList has issues with Symbol and empty string
1197         https://bugs.webkit.org/show_bug.cgi?id=144310
1198
1199         Reviewed by Darin Adler.
1200
1201         Tests: fast/dom/StyleSheet/stylesheet-symbol-names.html
1202                fast/dom/dataset-name-getter-symbols.html
1203                fast/dom/named-items-with-empty-name.html
1204                fast/dom/named-items-with-symbol-name.html
1205                storage/domstorage/localstorage/named-items.html
1206
1207         Test different bindings objects with custom named setter
1208         and getter handlers. Ensure that they handle Symbol properties
1209         gracefully. Often times avoiding the string path.
1210
1211         * dom/StaticNodeList.cpp:
1212         (WebCore::StaticNodeList::namedItem):
1213         (WebCore::StaticElementList::namedItem):
1214         Better handle the empty string. It should not match an item.
1215
1216         * bindings/js/JSDOMBinding.h:
1217         (WebCore::propertyNameToString):
1218         In cases where we would use this, we should have handled
1219         Symbol properties.
1220
1221         (WebCore::propertyNameToAtomicString):
1222         For Symbols, use the unique string. This should result
1223         in no matches for a Symbol property.
1224
1225         * bindings/js/JSDOMStringMapCustom.cpp:
1226         (WebCore::JSDOMStringMap::getOwnPropertySlotDelegate):
1227         (WebCore::JSDOMStringMap::deleteProperty):
1228         (WebCore::JSDOMStringMap::putDelegate):
1229         * bindings/js/JSStorageCustom.cpp:
1230         (WebCore::JSStorage::canGetItemsForName):
1231         (WebCore::JSStorage::nameGetter):
1232         (WebCore::JSStorage::deleteProperty):
1233         (WebCore::JSStorage::putDelegate):
1234         * bindings/js/JSStyleSheetListCustom.cpp:
1235         (WebCore::JSStyleSheetList::canGetItemsForName):
1236         Treat Symbol properties as private properties. They just
1237         go directly through to the Object, and avoid the string
1238         getter/setter property path.
1239
1240 2015-04-29  Eric Carlson  <eric.carlson@apple.com>
1241
1242         [Mac] Register with device picker whenever a page has <video>
1243         https://bugs.webkit.org/show_bug.cgi?id=144408
1244
1245         Reviewed by Jer Noble.
1246
1247         * Modules/mediasession/WebMediaSessionManager.cpp:
1248         (WebCore::WebMediaSessionManager::setPlaybackTarget): Drive-by fix: don't tell a client to play
1249         to the target when it has not routes.
1250
1251         * html/HTMLMediaElement.cpp:
1252         (WebCore::HTMLMediaElement::mediaState): Set RequiresPlaybackTargetMonitoring whenever the 
1253         element is <video> with a video track that does not block wireless playback.
1254
1255 2015-04-29  Martin Robinson  <mrobinson@igalia.com>
1256
1257         [GTK] Add support for automatic hyphenation
1258         https://bugs.webkit.org/show_bug.cgi?id=44478
1259
1260         Reviewed by Carlos Garcia Campos.
1261
1262         No new tests. This patch unskips and updates results for existing hyphenation tests.
1263
1264         * PlatformGTK.cmake: Add the libhypen implementation to the source list.
1265         * platform/gtk/GtkUtilities.cpp:
1266         (WebCore::topLevelPath): Add this helper function taken from the test harness.
1267         (WebCore::getWebKitBuildDirectory): Ditto.
1268         * platform/gtk/GtkUtilities.h: Add function declarations for the helper functions.
1269         * platform/text/Hyphenation.cpp: Surround this implementation with !USE(LIBHYPHEN),
1270           so that it can still be shared.
1271         * platform/text/gtk/HyphenationLibHyphen.cpp: Added.
1272         (WebCore::extractLocaleFromDictionaryFilePath): Take in a dictionary filename and
1273         determine the locale that it covers.
1274         (WebCore::scanDirectoryForDicionaries): Look for all installed dictionaries as well
1275         as ones in the JHBuild root for testing.
1276         (WebCore::scanTestDictionariesDirectoryIfNecessary): Try to scan the dictionaries installed
1277         in the JHBuild root.
1278         (WebCore::availableLocales): Getter for global hash of installed dictionaries.
1279         (WebCore::canHyphenate): Added libhyphen implementation.
1280         (WebCore::HyphenationDictionary): Helper class that properly manages the memory of
1281         an open libhyphen dictionary. This is useful so that they can be stored in an MRU
1282         cache. This is a similar approach to the CoreFoundation implementation.
1283         (WebCore::AtomicStringKeyedMRUCache<RefPtr<HyphenationDictionary>>::createValueForNullKey): MRU cache
1284         helper.
1285         (WebCore::AtomicStringKeyedMRUCache<RefPtr<HyphenationDictionary>>::createValueForKey): Ditto.
1286         (WebCore::hyphenDictionaryCache): A cache for opened hyphenation dictionaries.
1287         (WebCore::countLeadingSpaces): Count leading spaces, since WebCore often passes words with them.
1288         (WebCore::lastHyphenLocation): Added libhyphen implementation.
1289
1290 2015-04-29  Myles C. Maxfield  <mmaxfield@apple.com>
1291
1292         Unreviewed build fix.
1293
1294         * platform/graphics/mac/FontCacheMac.mm:
1295         (WebCore::fontWithFamily):
1296
1297 2015-04-29  Eric Carlson  <eric.carlson@apple.com>
1298
1299         Some media tests assert after r183096
1300         https://bugs.webkit.org/show_bug.cgi?id=144098
1301
1302         Reviewed by Brent Fulgham.
1303
1304         Never assert when a MediaPlaybackTargetClient client calls one of the methods on Document
1305         after it has been unregistered. A media element unregisters itself when it is removed from the 
1306         document, but scripts can still run and modify state that results in a call to
1307         playbackTargetPickerClientStateDidChange. Remove the asserts instead of adding checks to
1308         the various call sites.
1309
1310         * dom/Document.cpp:
1311         (WebCore::Document::showPlaybackTargetPicker): Don't assert if the client has already
1312         been unregistered.
1313         (WebCore::Document::playbackTargetPickerClientStateDidChange): Ditto.
1314
1315 2015-04-29  Zalan Bujtas  <zalan@apple.com>
1316
1317         Simple line layout: Web process spins endlessly below layoutSimpleLines.
1318         https://bugs.webkit.org/show_bug.cgi?id=144403
1319         rdar://problem/20742783
1320
1321         Reviewed by Antti Koivisto.
1322
1323         When a text fragment overlaps multiple renderes and it does not fit the current line,
1324         we revert the text fragment iterator position so that the overlapping content
1325         gets processed again for the next line.
1326         However, TextFragmentIterator::revertToFragment() was reverting too much and
1327         we started processing old content all over again -> infinite loop.
1328
1329         This patch ensures that text fragment iterator is reverted to the right position.
1330
1331         Test: fast/text/simple-line-layout-wrapping-multiple-renderers-hang.html
1332
1333         * rendering/SimpleLineLayout.cpp:
1334         (WebCore::SimpleLineLayout::createLineRuns):
1335         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
1336         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToEndOfFragment):
1337         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment): Deleted.
1338         * rendering/SimpleLineLayoutTextFragmentIterator.h:
1339
1340 2015-04-29  Filip Pizlo  <fpizlo@apple.com>
1341
1342         JSTypeInfo should have an inline type flag to indicate of getCallData() has been overridden
1343         https://bugs.webkit.org/show_bug.cgi?id=144397
1344
1345         Reviewed by Andreas Kling.
1346
1347         If you override getCallData() and you want to be called a "function", then you need to use the
1348         new TypeOfShouldCallGetCallData flag.
1349
1350         * bindings/scripts/CodeGeneratorJS.pm:
1351         (GenerateHeader):
1352         * bridge/objc/objc_runtime.h:
1353         * bridge/runtime_method.h:
1354         * bridge/runtime_object.h:
1355
1356 2015-04-29  Commit Queue  <commit-queue@webkit.org>
1357
1358         Unreviewed, rolling out r183553 and r183561.
1359         https://bugs.webkit.org/show_bug.cgi?id=144406
1360
1361         broke the iOS build (Requested by thorton__ on #webkit).
1362
1363         Reverted changesets:
1364
1365         "Switch QuickLook soft-linking to use
1366         QuickLookSoftLink.{h,mm}"
1367         https://bugs.webkit.org/show_bug.cgi?id=144362
1368         http://trac.webkit.org/changeset/183553
1369
1370         "Unreviewed iOS build fix after r183553: fix declaration of
1371         QLPreviewScheme"
1372         http://trac.webkit.org/changeset/183561
1373
1374 2015-04-29  Antti Koivisto  <antti@apple.com>
1375
1376         ResourceLoadPriority should be enum class
1377         https://bugs.webkit.org/show_bug.cgi?id=144326
1378
1379         Reviewed by Darin Adler.
1380
1381         * html/HTMLLinkElement.cpp:
1382         (WebCore::HTMLLinkElement::process):
1383         * loader/LinkLoader.cpp:
1384         (WebCore::LinkLoader::loadLink):
1385         * loader/ResourceLoadScheduler.cpp:
1386         (WebCore::ResourceLoadScheduler::scheduleLoad):
1387         (WebCore::ResourceLoadScheduler::servePendingRequests):
1388         (WebCore::ResourceLoadScheduler::HostInformation::~HostInformation):
1389         (WebCore::ResourceLoadScheduler::HostInformation::priorityToIndex):
1390         (WebCore::ResourceLoadScheduler::HostInformation::schedule):
1391         (WebCore::ResourceLoadScheduler::HostInformation::remove):
1392         (WebCore::ResourceLoadScheduler::HostInformation::hasRequests):
1393         (WebCore::ResourceLoadScheduler::HostInformation::limitRequests):
1394         * loader/ResourceLoadScheduler.h:
1395         (WebCore::ResourceLoadScheduler::HostInformation::requestsPending):
1396
1397             Modernize ResourceLoadScheduler code a bit while switching to enum class.
1398
1399         * loader/cache/CachedResource.cpp:
1400         (WebCore::defaultPriorityForResourceType):
1401         * loader/cache/CachedResourceLoader.cpp:
1402         (WebCore::CachedResourceLoader::requestResource):
1403         * loader/icon/IconLoader.cpp:
1404         (WebCore::IconLoader::startLoading):
1405         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
1406         (WebCore::WebCoreAVFResourceLoader::startLoading):
1407         * platform/network/ResourceLoadPriority.h:
1408         (WebCore::operator++):
1409         (WebCore::operator--):
1410         * platform/network/ResourceRequestBase.cpp:
1411         (WebCore::ResourceRequestBase::adopt):
1412         (WebCore::ResourceRequestBase::copyData):
1413         (WebCore::ResourceRequestBase::cachePolicy):
1414         (WebCore::ResourceRequestBase::priority):
1415         (WebCore::ResourceRequestBase::setPriority):
1416         * platform/network/ResourceRequestBase.h:
1417
1418             Remove bitfields. ResourceRequests are not present in large enough numbers to require this kind of optimization.
1419             Use modern initialization syntax.
1420
1421         (WebCore::ResourceRequestBase::ResourceRequestBase):
1422         (WebCore::CrossThreadResourceRequestDataBase::CrossThreadResourceRequestDataBase): Deleted.
1423         * platform/network/cf/ResourceRequestCFNet.cpp:
1424         (WebCore::initializeMaximumHTTPConnectionCountPerHost):
1425         (WebCore::initializeHTTPConnectionSettingsOnStartup):
1426         * platform/network/cf/ResourceRequestCFNet.h:
1427         (WebCore::toResourceLoadPriority):
1428         (WebCore::toPlatformRequestPriority):
1429         * platform/network/soup/ResourceRequest.h:
1430         (WebCore::toSoupMessagePriority):
1431         * testing/Internals.cpp:
1432         (WebCore::stringToResourceLoadPriority):
1433
1434 2015-04-29  Myles C. Maxfield  <mmaxfield@apple.com>
1435
1436         [OS X] Use CTFontCreateForCSS instead of doing font search ourselves
1437         https://bugs.webkit.org/show_bug.cgi?id=132159
1438
1439         Reviewed by Darin Adler.
1440
1441         On platforms that support it, delegate font selection logic to the platform. Currently, this is
1442         only supported on Mac, using CTFontCreateForCSS().
1443
1444         This also changes the mechanism that enforces our font whitelist in our tests. We used to
1445         swizzle the implementations of NSFontManager methods. This patch migrates to using a whitelist of
1446         font family names instead.
1447
1448         Note that this patch is a work in progress, because it makes the following tests fail:
1449         fast/css/font-weight-1.html
1450         fast/forms/validation-message-appearance.html
1451         fast/forms/select/optgroup-rendering.html
1452
1453         No new tests, because there is no behavior change.
1454
1455         * platform/graphics/FontCache.h: Add a function to set the whitlist.
1456         * platform/graphics/mac/FontCacheMac.mm:
1457         (WebCore::fontWhitelist):
1458         (WebCore::FontCache::setFontWhitelist):
1459         (WebCore::toAppKitFontWeight):
1460         (WebCore::toCoreTextFontWeight):
1461         (WebCore::fontWithFamily): If ENABLE(PLATFORM_FONT_LOOKUP), use CTFontCreateForCSS().
1462         (WebCore::FontCache::createFontPlatformData):
1463         * platform/spi/cocoa/CoreTextSPI.h: Add signature for CTFontCreateForCSS().
1464
1465 2015-04-29  Jer Noble  <jer.noble@apple.com>
1466
1467         Unreviewed iOS build fix after r183553: fix declaration of QLPreviewScheme
1468
1469         * platform/ios/QuickLookSoftLink.mm:
1470
1471 2015-04-29  Eric Carlson  <eric.carlson@apple.com>
1472
1473         [Mac] Use new device picker menu API
1474         https://bugs.webkit.org/show_bug.cgi?id=144392
1475
1476         Reviewed by Jer Noble.
1477
1478         * Modules/mediasession/WebMediaSessionManager.cpp:
1479         (WebCore::WebMediaSessionManager::showPlaybackTargetPicker): Pass the route state to the picker.
1480         * platform/graphics/MediaPlaybackTargetPicker.h:
1481
1482         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
1483         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
1484         (WebCore::MediaPlaybackTargetPickerMac::MediaPlaybackTargetPickerMac):  m_deviceChangeTimer -> m_pendingActionTimer.
1485         (WebCore::MediaPlaybackTargetPickerMac::~MediaPlaybackTargetPickerMac): Ditto.
1486         (WebCore::MediaPlaybackTargetPickerMac::pendingActionTimerFired): Renamed from 
1487         outputeDeviceAvailabilityChangedTimerFired.
1488         (WebCore::MediaPlaybackTargetPickerMac::availableDevicesDidChange): Use addPendingAction.
1489         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): Call new picker API if it is
1490         available. New API returns true if a target is chosen, so call currentDeviceDidChange in that case.
1491         (WebCore::MediaPlaybackTargetPickerMac::addPendingAction): New.
1492         (WebCore::MediaPlaybackTargetPickerMac::currentDeviceDidChange): Make asynchronous because it 
1493         can now be called from showPlaybackTargetPicker.
1494         (WebCore::MediaPlaybackTargetPickerMac::outputeDeviceAvailabilityChangedTimerFired): Renamed
1495         pendingActionTimerFired.
1496
1497         * platform/spi/cocoa/AVKitSPI.h: Add new SPI.
1498
1499 2015-04-29  Antti Koivisto  <antti@apple.com>
1500
1501         Main resource loaded via 304 response becomes empty if reloaded by user
1502         https://bugs.webkit.org/show_bug.cgi?id=144386
1503
1504         Reviewed by Darin Adler.
1505
1506         Memory cache layer may make a main resource request conditional (add If-modified-since/If-none-match header).
1507         DocumentLoader stores the final ResourceRequest associated with document. If user triggered reload for
1508         conditionally loaded document DocumentLoader would include the same conditionals to the new request as well.
1509         Since these were not added by the memory cache it would pass any 304 response back to the DocumentLoader.
1510         However DocumentLoader has no code to handle 304 so we would end up with an empty document.
1511
1512         Test: http/tests/cache/main-resource-304-reload.html
1513
1514         * loader/DocumentLoader.cpp:
1515         (WebCore::DocumentLoader::startLoadingMainResource):
1516
1517             Ensure DocumentLoader doesn't issue conditional requests.
1518
1519 2015-04-28  Jer Noble  <jer.noble@apple.com>
1520
1521         Replace HTMLMediaElement's seek timer with a task queue.
1522         https://bugs.webkit.org/show_bug.cgi?id=144353
1523
1524         Reviewed by Eric Carlson.
1525
1526         No change in functionality, so no new tests added.
1527
1528         Replace a zero-length timer with an explicit task queue, backed by Document's postTask(). To
1529         make enqueued tasks cancellable, add a new GenericTaskQueue class modelled on
1530         GenericEventQueue which can cancel enqueued but not-yet-executed tasks.
1531
1532         * CMakeLists.txt:
1533         * WebCore.vcxproj/WebCore.vcxproj:
1534         * WebCore.vcxproj/WebCore.vcxproj.filters:
1535         * WebCore.xcodeproj/project.pbxproj:
1536         * dom/GenericTaskQueue.cpp: Added.
1537         (WebCore::GenericTaskQueue::GenericTaskQueue): Initialize ivars.
1538         (WebCore::GenericTaskQueue::enqueueTask): Wrap the task and pass it to the ScriptExecutionContext.
1539         (WebCore::GenericTaskQueue::close): Assert that the task queue will not accept any additional tasks.
1540         (WebCore::GenericTaskQueue::cancelAllTasks): Revoke outstanding weak pointers, thereby cancelling tasks.
1541         * dom/GenericTaskQueue.h: Added.
1542         (WebCore::GenericTaskQueue::hasPendingTasks):
1543         * html/HTMLMediaElement.cpp:
1544         (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize the task queue.
1545         (WebCore::HTMLMediaElement::~HTMLMediaElement): Close the task queue.
1546         (WebCore::HTMLMediaElement::seekWithTolerance): Post a task, rather than start a timer.
1547         (WebCore::HTMLMediaElement::seekTask): Renamed from seekTimerFired().
1548         (WebCore::HTMLMediaElement::seekTimerFired): Deleted.
1549         * html/HTMLMediaElement.h:
1550
1551 2015-04-28  David Kilzer  <ddkilzer@apple.com>
1552
1553         Switch QuickLook soft-linking to use QuickLookSoftLink.{h,mm}
1554         <http://webkit.org/b/144362>
1555
1556         Reviewed by Andy Estes.
1557
1558         This patch switches soft-linking of QuickLook.framework to
1559         QuickLookSoftLink.{h,mm} so that we stop exporting unintended
1560         symbols.
1561
1562         No new tests since no change in behavior.
1563
1564         * WebCore.xcodeproj/project.pbxproj:
1565         - Add QuickLookSoftLinking.{h,mm} to the project.
1566
1567         * platform/ios/QuickLookSoftLink.h: Added.
1568         * platform/ios/QuickLookSoftLink.mm: Added.
1569         * platform/mac/SoftLinking.h:
1570         (SOFT_LINK_CLASS_FOR_HEADER): Add macro.
1571         (SOFT_LINK_CLASS_FOR_SOURCE): Add macro.
1572
1573         * platform/network/ios/QuickLook.h:
1574         - Remove unused declarations.
1575
1576         * platform/network/ios/QuickLook.mm:
1577         (WebCore::QLPreviewConverterClass): Deleted.
1578         (WebCore::QLTypeCopyBestMimeTypeForFileNameAndMimeType): Deleted.
1579         (WebCore::QLTypeCopyBestMimeTypeForURLAndMimeType): Deleted.
1580         (WebCore::QLTypeCopyUTIForURLAndMimeType): Deleted.
1581         - Remove SOFT_LINK macros and unused methods after switching to
1582           new QuickLookSoftLink.{h,mm}.
1583         (WebCore::QLPreviewGetSupportedMIMETypesSet):
1584         - Switch to use NeverDestroyed<>.
1585         (WebCore::registerQLPreviewConverterIfNeeded):
1586         (createQLPreviewProtocol):
1587         (WebCore::QLPreviewProtocol):
1588         (WebCore::QuickLookHandle::QuickLookHandle):
1589         (WebCore::QuickLookHandle::create):
1590         (WebCore::QuickLookHandle::shouldCreateForMIMEType):
1591         - Simplify code when using QuickLookSoftLink.h.
1592
1593         * platform/network/ios/WebCoreURLResponseIOS.mm:
1594         - Include QuickLookSoftLink.h header.
1595
1596 2015-04-29  Darin Adler  <darin@apple.com>
1597
1598         [ES6] Implement Unicode code point escapes
1599         https://bugs.webkit.org/show_bug.cgi?id=144377
1600
1601         Reviewed by Antti Koivisto.
1602
1603         Test: js/unicode-escape-sequences.html
1604
1605         * css/CSSParser.cpp:
1606         (WebCore::CSSParser::parseEscape): Use ICU's UCHAR_MAX_VALUE instead of writing
1607         out 0x10FFFF; clearer this way. Also use our replacementCharacter instead of
1608         writing out 0xFFFD.
1609
1610         * html/parser/HTMLEntityParser.cpp:
1611         (WebCore::isAlphaNumeric): Deleted.
1612         (WebCore::HTMLEntityParser::legalEntityFor): Use ICU's UCHAR_MAX_VALUE and
1613         U_IS_SURROGATE instead of writing the code out. Didn't use U_IS_UNICODE_CHAR
1614         because that also includes U_IS_UNICODE_NONCHAR and thus would change behavior,
1615         but maye it's something we want to do in the future.
1616         (WebCore::HTMLEntityParser::consumeNamedEntity): Use isASCIIAlphanumeric instead
1617         of a the function in this file that does the same thing less efficiently.
1618
1619         * html/parser/InputStreamPreprocessor.h:
1620         (WebCore::InputStreamPreprocessor::processNextInputCharacter): Use
1621         replacementCharacter from CharacterNames.h instead of writing out 0xFFFd.
1622
1623         * xml/parser/CharacterReferenceParserInlines.h:
1624         (WebCore::consumeCharacterReference): Use ICU's UCHAR_MAX_VALUE instead of
1625         defining our own local highestValidCharacter constant.
1626
1627 2015-04-29  Martin Robinson  <mrobinson@igalia.com>
1628
1629         [CMake] [GTK] Organize and clean up unused CMake variables
1630         https://bugs.webkit.org/show_bug.cgi?id=144364
1631
1632         Reviewed by Gyuyoung Kim.
1633
1634         * PlatformGTK.cmake: Add variables specific to this project.
1635
1636 2015-04-29  Carlos Garcia Campos  <cgarcia@igalia.com>
1637
1638         REGRESSION(r182573): [GTK] The default context menu contains an empty item since r182573
1639         https://bugs.webkit.org/show_bug.cgi?id=144388
1640
1641         Reviewed by Brady Eidson.
1642
1643         There used to be a method in ContextMenuItem to check if share
1644         menu item was supported or not, but since r182573, there's a
1645         method to get the share menu item. If the returned menu item is
1646         null, it's not added to the menu, but we are not returning a null
1647         ContextMenu item even though we don't support share menu item.
1648
1649         * platform/gtk/ContextMenuItemGtk.cpp:
1650         (WebCore::ContextMenuItem::shareMenuItem): Return a null ContextMenuItem.
1651
1652 2015-04-29  Zan Dobersek  <zdobersek@igalia.com>
1653
1654         Switch to std::function<>, std::bind() in MediaPlayerPrivateAVFoundationObjC
1655         https://bugs.webkit.org/show_bug.cgi?id=144232
1656
1657         Reviewed by Darin Adler.
1658
1659         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1660         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): 
1661         Replace uses of WTF::Function<> and WTF::bind() with the STL alternatives.
1662
1663 2015-04-29  Hyungwook Lee  <hyungwook.lee@navercorp.com>
1664
1665         Fix crash in WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::setBlock().
1666         https://bugs.webkit.org/show_bug.cgi?id=140261
1667
1668         Reviewed by Darin Adler.
1669
1670         We need to check whether RenderObject is valid in RenderView::fooSubtreeSelection functions
1671         because invalid object has caused a crash. This patch adds isValidObjectForNewSelection(), and use it.
1672
1673         * rendering/RenderView.cpp:
1674         (WebCore::isValidObjectForNewSelection):
1675         (WebCore::RenderView::clearSubtreeSelection):
1676         (WebCore::RenderView::applySubtreeSelection):
1677
1678 2015-04-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1679
1680         Synchronous XMLHttpRequest should get access to AppCache resources stored as flat files
1681         https://bugs.webkit.org/show_bug.cgi?id=143711
1682
1683         Reviewed by Darin Adler.
1684
1685         This patch checks whether a substitute resource data is stored in memory or in file for synchronous loads.
1686         If data is stored in file, it reads the data through SharedBuffer::createWithContentsOfFile.
1687         This patch refactors some routines to replace Vector<char> by SharedBuffer to transmit response data.
1688
1689         Test: http/tests/appcache/simple-video-sync.html
1690
1691         * html/HTMLMediaElement.cpp:
1692         (WebCore::HTMLMediaElement::parseAttribute):
1693         * loader/DocumentThreadableLoader.cpp:
1694         (WebCore::DocumentThreadableLoader::loadRequest):
1695         * loader/FrameLoader.cpp:
1696         (WebCore::FrameLoader::loadResourceSynchronously):
1697         * loader/FrameLoader.h:
1698         * loader/appcache/ApplicationCacheHost.cpp:
1699         (WebCore::ApplicationCacheHost::maybeLoadResource):
1700         (WebCore::ApplicationCacheHost::createFileURL):
1701         (WebCore::ApplicationCacheHost::maybeLoadSynchronously):
1702         (WebCore::ApplicationCacheHost::maybeLoadFallbackSynchronously):
1703         * loader/appcache/ApplicationCacheHost.h:
1704         * xml/XSLTProcessorLibxslt.cpp:
1705         (WebCore::docLoaderFunc):
1706         * xml/parser/XMLDocumentParserLibxml2.cpp:
1707         (WebCore::openFunc):
1708
1709 2015-04-29  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1710
1711         Purge PassRefPtr from createSVGPathSegFoo factory functions
1712         https://bugs.webkit.org/show_bug.cgi?id=144374
1713
1714         Reviewed by Darin Adler.
1715
1716         Use Ref instead of PassRefPtr in createSVGPathSegFoo functions because
1717         those factory functions can't return null. Additionally let's remove unnecessary
1718         #include<PassRefPtr.h> there.
1719
1720         No new tests, no behavior changes.
1721
1722         * svg/SVGColor.cpp:
1723         (WebCore::SVGColor::cloneForCSSOM):
1724         * svg/SVGColor.h:
1725         * svg/SVGGlyphMap.h:
1726         (WebCore::GlyphMapNode::create):
1727         * svg/SVGPaint.cpp:
1728         (WebCore::SVGPaint::cloneForCSSOM):
1729         * svg/SVGPaint.h:
1730         * svg/SVGPathElement.cpp:
1731         (WebCore::SVGPathElement::createSVGPathSegClosePath):
1732         (WebCore::SVGPathElement::createSVGPathSegMovetoAbs):
1733         (WebCore::SVGPathElement::createSVGPathSegMovetoRel):
1734         (WebCore::SVGPathElement::createSVGPathSegLinetoAbs):
1735         (WebCore::SVGPathElement::createSVGPathSegLinetoRel):
1736         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicAbs):
1737         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicRel):
1738         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticAbs):
1739         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticRel):
1740         (WebCore::SVGPathElement::createSVGPathSegArcAbs):
1741         (WebCore::SVGPathElement::createSVGPathSegArcRel):
1742         (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalAbs):
1743         (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalRel):
1744         (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalAbs):
1745         (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalRel):
1746         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs):
1747         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel):
1748         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs):
1749         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel):
1750         * svg/SVGPathElement.h:
1751         * svg/SVGPathSegArcAbs.h:
1752         (WebCore::SVGPathSegArcAbs::create):
1753         * svg/SVGPathSegArcRel.h:
1754         (WebCore::SVGPathSegArcRel::create):
1755         * svg/SVGPathSegClosePath.h:
1756         (WebCore::SVGPathSegClosePath::create):
1757         * svg/SVGPathSegCurvetoCubicAbs.h:
1758         (WebCore::SVGPathSegCurvetoCubicAbs::create):
1759         * svg/SVGPathSegCurvetoCubicRel.h:
1760         (WebCore::SVGPathSegCurvetoCubicRel::create):
1761         * svg/SVGPathSegCurvetoCubicSmoothAbs.h:
1762         (WebCore::SVGPathSegCurvetoCubicSmoothAbs::create):
1763         * svg/SVGPathSegCurvetoCubicSmoothRel.h:
1764         (WebCore::SVGPathSegCurvetoCubicSmoothRel::create):
1765         * svg/SVGPathSegCurvetoQuadraticAbs.h:
1766         (WebCore::SVGPathSegCurvetoQuadraticAbs::create):
1767         * svg/SVGPathSegCurvetoQuadraticRel.h:
1768         (WebCore::SVGPathSegCurvetoQuadraticRel::create):
1769         * svg/SVGPathSegCurvetoQuadraticSmoothAbs.h:
1770         (WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::create):
1771         * svg/SVGPathSegCurvetoQuadraticSmoothRel.h:
1772         (WebCore::SVGPathSegCurvetoQuadraticSmoothRel::create):
1773         * svg/SVGPathSegLinetoAbs.h:
1774         (WebCore::SVGPathSegLinetoAbs::create):
1775         * svg/SVGPathSegLinetoHorizontalAbs.h:
1776         (WebCore::SVGPathSegLinetoHorizontalAbs::create):
1777         * svg/SVGPathSegLinetoHorizontalRel.h:
1778         (WebCore::SVGPathSegLinetoHorizontalRel::create):
1779         * svg/SVGPathSegLinetoRel.h:
1780         (WebCore::SVGPathSegLinetoRel::create):
1781         * svg/SVGPathSegLinetoVerticalAbs.h:
1782         (WebCore::SVGPathSegLinetoVerticalAbs::create):
1783         * svg/SVGPathSegLinetoVerticalRel.h:
1784         (WebCore::SVGPathSegLinetoVerticalRel::create):
1785         * svg/SVGPathSegMovetoAbs.h:
1786         (WebCore::SVGPathSegMovetoAbs::create):
1787         * svg/SVGPathSegMovetoRel.h:
1788         (WebCore::SVGPathSegMovetoRel::create):
1789         * svg/SVGViewSpec.h:
1790         (WebCore::SVGViewSpec::create):
1791         * svg/animation/SMILTimeContainer.h:
1792         (WebCore::SMILTimeContainer::create):
1793         * svg/animation/SVGSMILElement.cpp:
1794         (WebCore::ConditionEventListener::create):
1795         * svg/graphics/SVGImage.h:
1796         * svg/graphics/SVGImageForContainer.h:
1797         * svg/graphics/filters/SVGFilter.cpp:
1798         (WebCore::SVGFilter::create):
1799         * svg/graphics/filters/SVGFilter.h:
1800
1801 2015-04-28  Simon Fraser  <simon.fraser@apple.com>
1802
1803         Make a non-static version of FrameView::yPositionForRootContentLayer()
1804         https://bugs.webkit.org/show_bug.cgi?id=144375
1805
1806         Reviewed by Andy Estes.
1807
1808         There were two calls to the static FrameView::yPositionForRootContentLayer()
1809         which passed in all the arguments for the same FrameView. Make a member
1810         function for convenience.
1811
1812         * page/FrameView.cpp:
1813         (WebCore::FrameView::yPositionForRootContentLayer):
1814         * page/FrameView.h:
1815         * rendering/RenderLayerCompositor.cpp:
1816         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
1817
1818 2015-04-28  Ryuan Choi  <ryuan.choi@navercorp.com>
1819
1820         [CoordinatedGraphics] Merge TILED_BACKING_STORE guard with COORDINATED_GRAPHICS
1821         https://bugs.webkit.org/show_bug.cgi?id=143001
1822
1823         Reviewed by Gyuyoung Kim.
1824
1825         TiledBackingStore has only been used by Coordinated Graphics since Qt and WebKit1/Efl were dropped.
1826         So, this patch replaces USE(TILED_BACKING_STORE) with USE(COORDINATED_GRAPHICS) to merge the features.
1827
1828         In addition, this moves TiledBackingStore and related files from platform to platform/texmap/coordinated
1829         where other coordinated graphics files are located.
1830
1831         * CMakeLists.txt: Move TiledBackingStore.cpp because this is not common file.
1832         * PlatformEfl.cmake:
1833         * PlatformGTK.cmake:
1834         * WebCore.vcxproj/WebCore.vcxproj: Follow new location of TiledBackingStore* files.
1835         * WebCore.vcxproj/WebCore.vcxproj.filters:
1836         * loader/EmptyClients.h:
1837         * page/Chrome.cpp:
1838         * page/Chrome.h:
1839         * page/ChromeClient.h:
1840         * page/Frame.cpp:
1841         (WebCore::Frame::createView):
1842         * page/FrameView.cpp:
1843         (WebCore::FrameView::requestScrollPositionUpdate):
1844         * page/FrameView.h:
1845         * page/Page.cpp:
1846         (WebCore::Page::setPageScaleFactor):
1847         * platform/HostWindow.h:
1848         * platform/ScrollView.cpp:
1849         (WebCore::ScrollView::unscaledVisibleContentSizeIncludingObscuredArea):
1850         (WebCore::ScrollView::unscaledUnobscuredVisibleContentSize):
1851         (WebCore::ScrollView::visibleContentRectInternal):
1852         (WebCore::ScrollView::scrollTo):
1853         * platform/ScrollView.h:
1854         * platform/graphics/cairo/TileCairo.h: Removed because it is dead code since r169328
1855         * platform/graphics/texmap/coordinated/Tile.h: Renamed from Source/WebCore/platform/graphics/Tile.h.
1856         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp: Renamed from Source/WebCore/platform/graphics/TiledBackingStore.cpp.
1857         * platform/graphics/texmap/coordinated/TiledBackingStore.h: Renamed from Source/WebCore/platform/graphics/TiledBackingStore.h.
1858         * platform/graphics/texmap/coordinated/TiledBackingStoreBackend.h: Renamed from Source/WebCore/platform/graphics/TiledBackingStoreBackend.h.
1859         * platform/graphics/texmap/coordinated/TiledBackingStoreClient.h: Renamed from Source/WebCore/platform/graphics/TiledBackingStoreClient.h.
1860
1861 2015-04-28  Brent Fulgham  <bfulgham@apple.com>
1862
1863         REGRESSION(180076): [Mac, iOS] Correct possible null dereference in printing code
1864         https://bugs.webkit.org/show_bug.cgi?id=144366
1865         <rdar://problem/20533513>
1866
1867         Reviewed by Dean Jackson.
1868
1869         * rendering/RenderBlockFlow.cpp:
1870         (WebCore::needsAppleMailPaginationQuirk): Check if the document settings is a nullptr
1871         before attempting to dereference it. 
1872
1873 2015-04-28  Andreas Kling  <akling@apple.com>
1874
1875         Simplify DOM wrapper destruction, don't deref() in finalizers.
1876         <https://webkit.org/b/144183>
1877
1878         Reviewed by Darin Adler.
1879
1880         DOM JS bindings had two mechanisms to call deref() on the WebCore object,
1881         once through a weak finalizer, and once through the JSCell's regular destructor.
1882
1883         That was once believed to be an optimization, but these days the finalizer will
1884         run just moments before the destructor anyway, all in the same call stack.
1885         And more importantly, the finalizer is not guaranteed to run, for instance in the
1886         case where a Weak is assigned to after going dead, but before the WeakBlock
1887         has been swept by the incremental sweeper.
1888
1889         Simplify this by just removing the deref() from the generated finalizers.
1890         This makes it easier to reason about DOM wrapper destruction, and eliminates
1891         the awkward time window  where a DOM wrapper could have a null impl().
1892
1893         We could spend more time on figuring out a way to have finalizers manage the
1894         destruction of these wrappers, but that would require fundamental changes to
1895         our implementation of JSC::Weak pointers. It would allow us to make JSDOMWrapper
1896         destructor-less, and shrink each wrapper object by 1 pointer (the ClassInfo*.)
1897         However the risk:reward ratio does not seem justified at this point in time.
1898
1899         * bindings/scripts/CodeGeneratorJS.pm:
1900         (GenerateHeader):
1901         (GenerateImplementation):
1902         * bindings/js/JSCSSValueCustom.cpp:
1903         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1904         (WebCore::JSTestActiveDOMObject::~JSTestActiveDOMObject):
1905         (WebCore::JSTestActiveDOMObjectOwner::finalize):
1906         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
1907         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
1908         (WebCore::JSTestCustomNamedGetter::~JSTestCustomNamedGetter):
1909         (WebCore::JSTestCustomNamedGetterOwner::finalize):
1910         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
1911         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1912         (WebCore::JSTestEventConstructor::~JSTestEventConstructor):
1913         (WebCore::JSTestEventConstructorOwner::finalize):
1914         * bindings/scripts/test/JS/JSTestEventConstructor.h:
1915         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1916         (WebCore::JSTestEventTarget::~JSTestEventTarget):
1917         (WebCore::JSTestEventTargetOwner::finalize):
1918         * bindings/scripts/test/JS/JSTestEventTarget.h:
1919         * bindings/scripts/test/JS/JSTestException.cpp:
1920         (WebCore::JSTestException::~JSTestException):
1921         (WebCore::JSTestExceptionOwner::finalize):
1922         * bindings/scripts/test/JS/JSTestException.h:
1923         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1924         (WebCore::JSTestGenerateIsReachable::~JSTestGenerateIsReachable):
1925         (WebCore::JSTestGenerateIsReachableOwner::finalize):
1926         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
1927         * bindings/scripts/test/JS/JSTestInterface.cpp:
1928         (WebCore::JSTestInterface::~JSTestInterface):
1929         (WebCore::JSTestInterfaceOwner::finalize):
1930         * bindings/scripts/test/JS/JSTestInterface.h:
1931         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1932         (WebCore::JSTestMediaQueryListListener::~JSTestMediaQueryListListener):
1933         (WebCore::JSTestMediaQueryListListenerOwner::finalize):
1934         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
1935         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1936         (WebCore::JSTestNamedConstructor::~JSTestNamedConstructor):
1937         (WebCore::JSTestNamedConstructorOwner::finalize):
1938         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
1939         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1940         (WebCore::JSTestNondeterministic::~JSTestNondeterministic):
1941         (WebCore::JSTestNondeterministicOwner::finalize):
1942         * bindings/scripts/test/JS/JSTestNondeterministic.h:
1943         * bindings/scripts/test/JS/JSTestObj.cpp:
1944         (WebCore::JSTestObj::~JSTestObj):
1945         (WebCore::JSTestObjOwner::finalize):
1946         * bindings/scripts/test/JS/JSTestObj.h:
1947         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1948         (WebCore::JSTestOverloadedConstructors::~JSTestOverloadedConstructors):
1949         (WebCore::JSTestOverloadedConstructorsOwner::finalize):
1950         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
1951         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1952         (WebCore::JSTestSerializedScriptValueInterface::~JSTestSerializedScriptValueInterface):
1953         (WebCore::JSTestSerializedScriptValueInterfaceOwner::finalize):
1954         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
1955         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1956         (WebCore::JSTestTypedefs::~JSTestTypedefs):
1957         (WebCore::JSTestTypedefsOwner::finalize):
1958         * bindings/scripts/test/JS/JSTestTypedefs.h:
1959         * bindings/scripts/test/JS/JSattribute.cpp:
1960         (WebCore::JSattribute::~JSattribute):
1961         (WebCore::JSattributeOwner::finalize):
1962         * bindings/scripts/test/JS/JSattribute.h:
1963         * bindings/scripts/test/JS/JSreadonly.cpp:
1964         (WebCore::JSreadonly::~JSreadonly):
1965         (WebCore::JSreadonlyOwner::finalize):
1966         * bindings/scripts/test/JS/JSreadonly.h:
1967
1968 2015-04-28  Alex Christensen  <achristensen@webkit.org>
1969
1970         Build WinCairo without cygwin.
1971         https://bugs.webkit.org/show_bug.cgi?id=144365
1972
1973         Reviewed by Myles Maxfield.
1974
1975         * WebCore.vcxproj/WebCoreGeneratedWinCairo.make:
1976         Pass the CC executable to build-generated-files.pl like r182164.
1977         * WebCore.vcxproj/build-generated-files.pl:
1978         Default to 8 CPUs unless otherwise specified.
1979
1980 2015-04-28  Sam Weinig  <sam@webkit.org>
1981
1982         [Content Extensions] Process NFAs individually to avoid having all NFAs live at the same time
1983         https://bugs.webkit.org/show_bug.cgi?id=144363
1984
1985         Reviewed by Alex Christensen.
1986
1987         This brings dirty memory use when compiling our test content extension down from ~300MB to ~100MB.
1988
1989         * contentextensions/CombinedURLFilters.cpp:
1990         (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
1991         (WebCore::ContentExtensions::CombinedURLFilters::createNFAs): Deleted.
1992         * contentextensions/CombinedURLFilters.h:
1993         Replace function that creates a Vector of all the NFAs with one that allows incremental processing
1994         as they are created.
1995
1996         * contentextensions/ContentExtensionCompiler.cpp:
1997         (WebCore::ContentExtensions::addUniversalActionsToDFA):
1998         Extract code to add universal actions into a helper, since we need to call it in two places now.
1999
2000         (WebCore::ContentExtensions::compileRuleList):
2001         Adopt CombinedURLFilters::processNFAs. Now that we don't have a Vector of NFAs, we need to keep track
2002         of whether or not any NFAs were processed and if we are currently processing the first NFA so we can
2003         ensure that we have some bytecode generated event for empty rule sets, and that universal actions are
2004         placed on the first DFA.
2005
2006 2015-04-28  Timothy Horton  <timothy_horton@apple.com>
2007
2008         [TextIndicator] Yellow highlight takes too long to fade out on scroll
2009         https://bugs.webkit.org/show_bug.cgi?id=144358
2010         <rdar://problem/19451011>
2011
2012         Reviewed by Beth Dakin.
2013
2014         * page/TextIndicator.h:
2015         Add Lifetime and DismissalAnimation enums.
2016
2017         (WebCore::TextIndicator::contentImageWithHighlight):
2018         (WebCore::TextIndicator::contentImage):
2019         Fix style.
2020
2021         * page/mac/TextIndicatorWindow.h:
2022         * page/mac/TextIndicatorWindow.mm:
2023         (WebCore::TextIndicatorWindow::TextIndicatorWindow):
2024         (WebCore::TextIndicatorWindow::~TextIndicatorWindow):
2025         (WebCore::TextIndicatorWindow::clearTextIndicator):
2026         (WebCore::TextIndicatorWindow::setTextIndicator):
2027         (WebCore::TextIndicatorWindow::closeWindow):
2028         (WebCore::TextIndicatorWindow::startFadeOut):
2029         Rename m_startFadeOutTimer to m_temporaryTextIndicatorTimer (and related).
2030         This is just about temporary-lifetime TextIndicators, like the ones
2031         you get when the find-in-page UI is hidden but you hit Cmd-G.
2032
2033         Add clearTextIndicator, which takes a DismissalAnimation, providing
2034         clients an opportunity to avoid the normal fade-out animation, if it
2035         was going to happen.
2036
2037 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
2038
2039         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
2040         https://bugs.webkit.org/show_bug.cgi?id=144304
2041
2042         Reviewed by Geoffrey Garen.
2043
2044         Define ENABLE_JIT, enabled by default, instead of ENABLE_LLINT_C_LOOP, disabled by default.
2045
2046         * Configurations/FeatureDefines.xcconfig:
2047
2048 2015-04-28  Commit Queue  <commit-queue@webkit.org>
2049
2050         Unreviewed, rolling out r183514.
2051         https://bugs.webkit.org/show_bug.cgi?id=144359
2052
2053         It broke cloop test bots (Requested by mcatanzaro on #webkit).
2054
2055         Reverted changeset:
2056
2057         "Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT"
2058         https://bugs.webkit.org/show_bug.cgi?id=144304
2059         http://trac.webkit.org/changeset/183514
2060
2061 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
2062
2063         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
2064         https://bugs.webkit.org/show_bug.cgi?id=144304
2065
2066         Reviewed by Geoffrey Garen.
2067
2068         Define ENABLE_JIT, enabled by default, instead of ENABLE_LLINT_C_LOOP, disabled by default.
2069
2070         * Configurations/FeatureDefines.xcconfig:
2071
2072 2015-04-28  Zalan Bujtas  <zalan@apple.com>
2073
2074         Checkboxes on bugs.webkit.org are painted with stripes at some zoom levels.
2075         https://bugs.webkit.org/show_bug.cgi?id=144351
2076
2077         Reviewed by Simon Fraser.
2078
2079         This patch ensures that CG context is properly restored after painting dashed/dotted lines.
2080
2081         Test: fast/forms/checkbox-painting-with-hr.html
2082
2083         * platform/graphics/cg/GraphicsContextCG.cpp:
2084         (WebCore::GraphicsContext::drawLine):
2085
2086 2015-04-28  Simon Fraser  <simon.fraser@apple.com>
2087
2088         Provide contentsToView() and viewToContents() functions on ScrollView, and use them
2089         https://bugs.webkit.org/show_bug.cgi?id=144357
2090
2091         Reviewed by Tim Horton.
2092
2093         Too much code was consulting topContentInset() and headerHeight() directly. Replace
2094         with calls to new contentsToView() and viewToContents() functions, which wrap the
2095         exisiting documentScrollOffsetRelativeToViewOrigin().
2096         
2097         Use the new functions in FrameView and ScrollView coordinate mapping functions.
2098         
2099         No behavior change.
2100
2101         * page/FrameView.cpp:
2102         (WebCore::FrameView::convertFromRendererToContainingView):
2103         (WebCore::FrameView::convertFromContainingViewToRenderer):
2104         * platform/ScrollView.cpp:
2105         (WebCore::ScrollView::viewToContents):
2106         (WebCore::ScrollView::contentsToView):
2107         (WebCore::ScrollView::rootViewToContents):
2108         (WebCore::ScrollView::contentsToRootView):
2109         (WebCore::ScrollView::rootViewToTotalContents):
2110         (WebCore::ScrollView::windowToContents):
2111         (WebCore::ScrollView::contentsToWindow):
2112         * platform/ScrollView.h:
2113
2114 2015-04-28  Eric Carlson  <eric.carlson@apple.com>
2115
2116         [Mac] Simplify code to support media engines which do not support target playback
2117         https://bugs.webkit.org/show_bug.cgi?id=144332
2118
2119         Reviewed by Jer Noble.
2120
2121         * Modules/mediasession/WebMediaSessionManager.cpp:
2122         (WebCore::WebMediaSessionManager::externalOutputDeviceAvailableDidChange): Always make client
2123         callback, let them decide if it is significant or not.
2124
2125         * html/HTMLMediaElement.cpp:
2126         (WebCore::HTMLMediaElement::HTMLMediaElement): m_loadTimer -> m_pendingActionTimer.
2127         (WebCore::HTMLMediaElement::scheduleDelayedAction): Handle CheckPlaybackTargetCompatablity.
2128         (WebCore::HTMLMediaElement::scheduleNextSourceChild): m_loadTimer -> m_pendingActionTimer.
2129         (WebCore::HTMLMediaElement::loadTimerFired): Renamed pendingActionTimerFired.
2130         (WebCore::HTMLMediaElement::prepareForLoad): m_loadTimer -> m_pendingActionTimer.
2131         (WebCore::HTMLMediaElement::setDefaultPlaybackRate): Add logging.
2132         (WebCore::HTMLMediaElement::clearMediaPlayer): m_loadTimer -> m_pendingActionTimer.
2133         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsSupported): Removed.
2134         (WebCore::HTMLMediaElement::dispatchEvent): If a 'webkitcurrentplaybacktargetiswirelesschanged'
2135         event is dispatched when the current target is wireless but the media engine does not support
2136         wireless playback, tell the media engine not to play to the target.
2137         * html/HTMLMediaElement.h:
2138         * html/HTMLMediaElement.idl:
2139
2140         * html/HTMLMediaSession.cpp:
2141         (WebCore::HTMLMediaSession::showPlaybackTargetPicker): Drive-by fix to disallow audio-only files.
2142         (WebCore::HTMLMediaSession::currentPlaybackTargetIsSupported): Deleted.
2143         * html/HTMLMediaSession.h:
2144
2145         * platform/graphics/MediaPlayer.cpp:
2146         (WebCore::MediaPlayer::isCurrentPlaybackTargetSupported): Deleted.
2147         * platform/graphics/MediaPlayer.h:
2148         * platform/graphics/MediaPlayerPrivate.h:
2149
2150         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2151         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget): Use a RetainPtr
2152         to explicitly manage the lifetime of the temporary object.
2153         (WebCore::MediaPlayerPrivateAVFoundationObjC::isPlayingToWirelessPlaybackTarget): Ditto.
2154         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2155
2156         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2157         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setShouldPlayToPlaybackTarget):
2158         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetWireless):
2159         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetSupported): Deleted.
2160
2161         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
2162         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2163         (WebCore::MediaPlayerPrivateQTKit::setShouldPlayToPlaybackTarget):
2164         (WebCore::MediaPlayerPrivateQTKit::isCurrentPlaybackTargetWireless):
2165         (WebCore::MediaPlayerPrivateQTKit::isCurrentPlaybackTargetSupported): Deleted.
2166
2167 2015-04-28  Alex Christensen  <achristensen@webkit.org>
2168
2169         [Content Extensions] Use less memory for CombinedURLFilters.
2170         https://bugs.webkit.org/show_bug.cgi?id=144290
2171
2172         Reviewed by Andreas Kling.
2173
2174         * contentextensions/CombinedURLFilters.cpp:
2175         (WebCore::ContentExtensions::recursiveMemoryUsed):
2176         (WebCore::ContentExtensions::CombinedURLFilters::addPattern):
2177         (WebCore::ContentExtensions::generateNFAForSubtree):
2178         (WebCore::ContentExtensions::CombinedURLFilters::createNFAs):
2179         * contentextensions/NFA.cpp:
2180         (WebCore::ContentExtensions::NFA::memoryUsed):
2181         (WebCore::ContentExtensions::NFA::setActions):
2182         * contentextensions/NFA.h:
2183         * contentextensions/NFANode.h:
2184         * contentextensions/Term.h:
2185         (WebCore::ContentExtensions::Term::Term::generateGraph):
2186         (WebCore::ContentExtensions::Term::generateSubgraphForAtom):
2187         Use Vectors instead of HashTables in PrefixTreeVertex because the sets stay small and need to be more memory efficient.
2188
2189 2015-04-28  Brady Eidson  <beidson@apple.com>
2190
2191         Consolidate most "frame load" arguments into FrameLoadRequest.
2192         https://bugs.webkit.org/show_bug.cgi?id=144276
2193
2194         Reviewed by Alexey Proskuryakov.
2195
2196         No new tests (No change in behavior).
2197         
2198         This patch starts the long overdue process of wrangling the insane load methods in FrameLoader.
2199         
2200         Humble beginnings of this long process:
2201         - Put most of the various "frame load" arguments that are passed around within FrameLoader on FrameLoadRequest.
2202         - Get rid of the "easy" constructors of FrameLoadRequest, forcing users to actually think about what they're doing.
2203         - Change a private FrameLoader load method (urlSelected) to take a FrameLoadRequest instead of argument gobbledygook.
2204         - Change a public FrameLoader load methods (changeLocation) to take a FrameLoadRequest instead of gobbledygook.
2205         
2206         These cover the straightforward changes where it was easy to figure out what the values of the FrameLoadRequest
2207         arguments were from these various call sites.
2208         
2209         Further refactoring can be done in much smaller patches, handling fewer cases at a time. Little by little we will be
2210         able to reduce the number of "load" methods on FrameLoader and make sure that they mainly only take a FrameLoadRequest
2211         as an argument.
2212
2213         * inspector/InspectorFrontendClientLocal.cpp:
2214         (WebCore::InspectorFrontendClientLocal::openInNewTab):
2215         
2216         * inspector/InspectorPageAgent.cpp:
2217         (WebCore::InspectorPageAgent::navigate):
2218         
2219         * loader/FrameLoadRequest.cpp:
2220         (WebCore::FrameLoadRequest::FrameLoadRequest):
2221         * loader/FrameLoadRequest.h:
2222         (WebCore::FrameLoadRequest::FrameLoadRequest):
2223         (WebCore::FrameLoadRequest::lockHistory):
2224         (WebCore::FrameLoadRequest::lockBackForwardList):
2225         (WebCore::FrameLoadRequest::shouldSendReferrer):
2226         (WebCore::FrameLoadRequest::allowNavigationToInvalidURL):
2227         (WebCore::FrameLoadRequest::newFrameOpenerPolicy):
2228         (WebCore::FrameLoadRequest::shouldReplaceDocumentIfJavaScriptURL):
2229         
2230         * loader/FrameLoader.cpp:
2231         (WebCore::FrameLoader::changeLocation):
2232         (WebCore::FrameLoader::urlSelected):
2233         (WebCore::FrameLoader::loadFrameRequest):
2234         * loader/FrameLoader.h:
2235         
2236         * loader/NavigationScheduler.cpp:
2237         (WebCore::NavigationScheduler::scheduleLocationChange):
2238         
2239         * page/ContextMenuController.cpp:
2240         (WebCore::openNewWindow):
2241         (WebCore::ContextMenuController::contextMenuItemSelected):
2242         
2243         * page/DOMWindow.cpp:
2244         (WebCore::DOMWindow::createWindow):
2245
2246 2015-04-27  Myles C. Maxfield  <mmaxfield@apple.com>
2247
2248         [Mac] [iOS] Implement font-synthesis CSS property
2249         https://bugs.webkit.org/show_bug.cgi?id=144305
2250
2251         Reviewed by Andreas Kling.
2252
2253         This patch is fairly straightforward, though there are some particular pieces to the patch listed below.
2254
2255         The implementation of this font-synthesis CSS property lives inside FontCacheIOS and FontCacheMac. We already
2256         determine if we should synthesize bold and italics, this CSS property simply guards that decision.
2257
2258         Because FontCache interacts with FontDescriptions and not RenderStyles, this patch moves the source of truth
2259         regarding font-synthesis into FontDescription (from RenderStyle).
2260
2261         Test: fast/css3-text/font-synthesis.html
2262
2263         * css/CSSPropertyNames.in: Mark font-synthesis as a FontProperty, which means that the relevant state is kept
2264         inside FontDescription. This also means that the property must be marked as a "high priority" property, which
2265         is enforced by it existing at the top of CSSPropertyNames.in. The move to FontDescription must be done so that
2266         FontCacheIOS and FontCacheMac have access to the saved state.
2267         * css/CSSComputedStyleDeclaration.cpp:
2268         (WebCore::fontSynthesisFromStyle): Update to look for state in FontDescription instead of RenderStyle.
2269         * css/CSSSegmentedFontFace.cpp:
2270         (WebCore::CSSSegmentedFontFace::fontRanges): Guard the synthetic bold and synthic italic decision on the new
2271         FontSynthesis state inside FontDescription.
2272         * css/StyleBuilderConverter.h:
2273         (WebCore::StyleBuilderConverter::convertFontSynthesis): Moved from
2274         StyleBuilderCustom::applyValueFontSynthesis(). This is because of the updated options inside of
2275         CSSPropertyNames.in
2276         * css/StyleBuilderCustom.h:
2277         (WebCore::StyleBuilderCustom::applyValueFontSynthesis): Deleted.
2278         * platform/graphics/FontDescription.h:
2279         (WebCore::FontDescription::FontDescription): Moved from RenderStyle.
2280         (WebCore::FontDescription::fontSynthesis): Ditto.
2281         (WebCore::FontDescription::setFontSynthesis): Ditto.
2282         (WebCore::FontDescription::initialFontSynthesis): Ditto.
2283         (WebCore::FontDescription::operator==): Update to include new state.
2284         * platform/graphics/FontCache.h:
2285         (WebCore::FontDescriptionFontDataCacheKey::makeFlagKey): Make FontDescription hashes sensitive to the new
2286         state inside FontDescription.
2287         * platform/graphics/ios/FontCacheIOS.mm:
2288         (WebCore::FontCache::createFontPlatformData): Guard the synthetic bold and synthetic italic decision on the
2289         new FontSynthesis state inside FontDescription.
2290         * platform/graphics/mac/FontCacheMac.mm:
2291         (WebCore::FontCache::createFontPlatformData): Ditto.
2292         * platform/text/TextFlags.h: Move FontSynthesis type from RenderStyleConstants.
2293         * rendering/style/RenderStyle.h:
2294         (WebCore::RenderStyle::fontSynthesis): Moved to FontDescription.
2295         (WebCore::RenderStyle::setFontSynthesis): Ditto.
2296         (WebCore::RenderStyle::initialFontSynthesis): Ditto.
2297         * rendering/style/RenderStyleConstants.h: Moved FontSynthesis type to TextFlags.
2298         * rendering/style/StyleRareInheritedData.h: Remove state regarding font synthesis (moved to FontDescription)
2299
2300 2015-04-28  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2301
2302         SharedBuffer::copy is not computing the buffer size correctly when having m_dataArray
2303         https://bugs.webkit.org/show_bug.cgi?id=144321
2304
2305         Reviewed by Darin Adler.
2306
2307         Patch correctness covered by existing tests.
2308
2309         * platform/SharedBuffer.cpp:
2310         (WebCore::SharedBuffer::copy): Direct appending to m_dataArray and not using append method as this method updates the SharedBuffer size.
2311
2312 2015-04-28  Per Arne Vollan  <peavo@outlook.com>
2313
2314         [Curl] Memory leak.
2315         https://bugs.webkit.org/show_bug.cgi?id=144327
2316
2317         Reviewed by Brent Fulgham.
2318
2319         When a data url is loaded, the ResourceHandle is not released.
2320
2321         * platform/network/curl/ResourceHandleManager.cpp:
2322         (WebCore::ResourceHandleManager::startJob):
2323
2324 2015-04-28  Andy Estes  <aestes@apple.com>
2325
2326         Fix the Mavericks Debug build after r183467.
2327
2328         * platform/network/ResourceRequestBase.h:
2329         (WebCore::ResourceRequestBase::requester): Removed WEBCORE_EXPORT.
2330         (WebCore::ResourceRequestBase::setRequester): Ditto.
2331
2332 2015-04-28  Csaba Osztrogonác  <ossy@webkit.org>
2333
2334         Remove make-file-arrays.py
2335         https://bugs.webkit.org/show_bug.cgi?id=144324
2336
2337         Reviewed by Gyuyoung Kim.
2338
2339         * make-file-arrays.py: Removed.
2340
2341 2015-04-28  Antti Koivisto  <antti@apple.com>
2342
2343         Build fix.
2344
2345         * platform/network/ios/ResourceRequestIOS.mm:
2346         (WebCore::ResourceRequest::ResourceRequest):
2347
2348 2015-04-28  Antti Koivisto  <antti@apple.com>
2349
2350         Network Cache: Disk cache getting filled by YouTube video data
2351         https://bugs.webkit.org/show_bug.cgi?id=144259
2352
2353         Reviewed by Darin Adler.
2354
2355         MSE media is loaded via XHR and tends to eventually fill the cache.
2356
2357         YouTube serves the media chunks cacheable, however they are rarely (if ever) reused.
2358         We can reduce disk writes and keep more useful resources around by not caching them
2359
2360         Test: http/tests/cache/disk-cache/disk-cache-media.html
2361
2362         * loader/DocumentLoader.cpp:
2363         (WebCore::DocumentLoader::startLoadingMainResource):
2364
2365             Set the requester.
2366
2367         * loader/cache/CachedRawResource.cpp:
2368         (WebCore::CachedRawResource::CachedRawResource):
2369         * page/DiagnosticLoggingKeys.cpp:
2370         (WebCore::DiagnosticLoggingKeys::streamingMedia):
2371         * page/DiagnosticLoggingKeys.h:
2372         * platform/network/ResourceRequestBase.cpp:
2373         (WebCore::ResourceRequestBase::adopt):
2374         (WebCore::ResourceRequestBase::copyData):
2375         (WebCore::equalIgnoringHeaderFields):
2376         * platform/network/ResourceRequestBase.h:
2377         (WebCore::ResourceRequestBase::requester):
2378         (WebCore::ResourceRequestBase::setRequester):
2379
2380             Add requester type to the request object. Currently this is main resource, xhr or unspecified.
2381
2382         (WebCore::ResourceRequestBase::encodeWithoutPlatformData):
2383         (WebCore::ResourceRequestBase::decodeWithoutPlatformData):
2384         * platform/network/cf/ResourceRequest.h:
2385         (WebCore::ResourceRequest::deprecatedSetMainResourceRequest): Deleted.
2386         (WebCore::ResourceRequest::deprecatedIsMainResourceRequest): Deleted.
2387
2388             Replace this iOS only field with shared mechanism.
2389
2390         * platform/network/ios/QuickLook.mm:
2391         (WebCore::QuickLookHandle::create):
2392         * xml/XMLHttpRequest.cpp:
2393         (WebCore::XMLHttpRequest::createRequest):
2394
2395             Set the requester.
2396
2397 2015-04-28  Namhoon Kim  <nakim@ea.com>
2398
2399         Fix windows build error in WebCore related to bulk build.
2400         https://bugs.webkit.org/show_bug.cgi?id=144313
2401
2402         Reviewed by Csaba Osztrogonác.
2403
2404         No new tests because there is no behavior change.
2405
2406         * css/CSSAllInOne.cpp:
2407         * dom/DOMAllInOne.cpp:
2408
2409 2015-04-27  Simon Fraser  <simon.fraser@apple.com>
2410
2411         Eliminate styleDidChange with StyleDifferenceEqual when updates are actually necessary
2412         https://bugs.webkit.org/show_bug.cgi?id=144198
2413
2414         Followup: fix assertions seen in fullscreen and pseudo-element tests. These code
2415         paths set the style to the existing pointer, but with a SyntheticStyleChange.
2416         We have to avoid an early return in this case.
2417
2418         * rendering/RenderElement.cpp:
2419         (WebCore::RenderElement::setStyle):
2420
2421 2015-04-25  Simon Fraser  <simon.fraser@apple.com>
2422
2423         Eliminate styleDidChange with StyleDifferenceEqual when updates are actually necessary
2424         https://bugs.webkit.org/show_bug.cgi?id=144198
2425
2426         Reviewed by Darin Adler, Antti Koivisto.
2427         
2428         SyntheticStyleChange style recalcs are triggered for cases where behavior depends
2429         on state which is outside of RenderStyle; this includes triggering compositing for
2430         animations, for video and canvas, and for iframes with composited content.
2431         
2432         In these cases, we'd run through RenderElement::setStyle() and its fan-out, but
2433         with diff == StyleDifferenceEqual, and so be unable to determine if there
2434         is actual work to be done.
2435         
2436         This patch enforces the contract that the diff is never StyleDifferenceEqual if
2437         compositing or other work has to happen from setStyle(). This is achieved by
2438         passing in a 'hasSideEffects' flag, which causes the diff to become at least
2439         StyleDifferenceRecompositeLayer.
2440         
2441         RenderLayerCompositor::layerStyleChanged() can now safely early return
2442         if the diff is equal. Future patches will reduce redundant work even more.
2443
2444         Test: compositing/animation/no-style-recalc-during-accelerated-animation.html
2445
2446         * page/animation/AnimationBase.h:
2447         (WebCore::AnimationBase::animate): Returns a bool now if the state changed.
2448         (WebCore::AnimationBase::state):
2449         * page/animation/AnimationController.cpp:
2450         (WebCore::AnimationController::updateAnimations): bool out param which indicates
2451         whether any animations changed state.
2452         * page/animation/AnimationController.h:
2453         * page/animation/CompositeAnimation.cpp:
2454         (WebCore::CompositeAnimation::animate): If any transitions or animations changed
2455         state, set the animationStateChanged out param to true.
2456         * page/animation/CompositeAnimation.h:
2457         * page/animation/ImplicitAnimation.cpp:
2458         (WebCore::ImplicitAnimation::animate): Return true if the state changed.
2459         * page/animation/ImplicitAnimation.h:
2460         * page/animation/KeyframeAnimation.cpp:
2461         (WebCore::KeyframeAnimation::animate): Return true if the state changed.
2462         * page/animation/KeyframeAnimation.h:
2463         * rendering/RenderElement.cpp:
2464         (WebCore::RenderElement::adjustStyleDifference): We may enter here now with diff
2465         != StyleDifferenceEqual, but still need to do the check to see if layers changed.
2466         (WebCore::RenderElement::initializeStyle): When setting style for the first time,
2467         don't use StyleDifferenceEqual.
2468         (WebCore::RenderElement::setStyle): Additional flag to indicate whether this style
2469         change involves side effects. If the diff is equal but the flag is set, change
2470         the diff to StyleDifferenceRecompositeLayer (the "lowest" non-zero diff).
2471         * rendering/RenderElement.h:
2472         (WebCore::RenderElement::setAnimatableStyle): Pass true to setStyle() if hasSideEffects
2473         is true, or if animation state changed.
2474         * rendering/RenderLayer.cpp:
2475         (WebCore::RenderLayer::styleChanged): Pass the diff down.
2476         * rendering/RenderLayerCompositor.cpp:
2477         (WebCore::RenderLayerCompositor::layerStyleChanged): Return if the diff is equal.
2478         * rendering/RenderLayerCompositor.h:
2479         * rendering/style/RenderStyleConstants.h: StyleDifferenceNewStyle is used when
2480         setting style for the first time.
2481         * style/StyleResolveTree.cpp:
2482         (WebCore::Style::createRendererIfNeeded): Provide animationsChanged bool (which is unused).
2483         (WebCore::Style::resolveLocal): If the style change is synthetic, set the flag that
2484         says there are side-effects.
2485
2486 2015-04-27  Michael Catanzaro  <mcatanzaro@igalia.com>
2487
2488         [GTK] Add one single option to control all OpenGL-related options
2489         https://bugs.webkit.org/show_bug.cgi?id=144105
2490
2491         Reviewed by Martin Robinson.
2492
2493         Test WTF_USE_TEXTURE_MAPPER since USE_TEXTURE_MAPPER has been removed.
2494
2495         * PlatformGTK.cmake:
2496
2497 2015-04-27  Myles C. Maxfield  <mmaxfield@apple.com>
2498
2499         Consolidate one-line flag-related header files into TextFlags.h
2500         https://bugs.webkit.org/show_bug.cgi?id=144295
2501
2502         Reviewed by Tim Horton.
2503
2504         There were a collection of single-line header files throughout platform/ which contain
2505         single-line type declaractions of flags related to text layout & rendering. This patch
2506         consolidates all these single-line headers into TextFlags.h
2507
2508         No new tests because there is no behavior change.
2509
2510         * WebCore.vcxproj/WebCore.vcxproj:
2511         * WebCore.vcxproj/WebCore.vcxproj.filters:
2512         * WebCore.xcodeproj/project.pbxproj:
2513         * css/CSSFontFace.h:
2514         * css/CSSPrimitiveValueMappings.h:
2515         * loader/cache/CachedFont.h:
2516         * loader/cache/CachedTextTrack.h:
2517         * page/Settings.h:
2518         * platform/DragImage.h:
2519         * platform/graphics/FontDescription.h:
2520         * platform/graphics/FontOrientation.h: Removed.
2521         * platform/graphics/FontPlatformData.h:
2522         * platform/graphics/FontRenderingMode.h: Removed.
2523         * platform/graphics/FontSmoothingMode.h: Removed.
2524         * platform/graphics/FontTraitsMask.h: Removed.
2525         * platform/graphics/FontWidthVariant.h: Removed.
2526         * platform/graphics/TextRenderingMode.h: Removed.
2527         * platform/graphics/cairo/FontCustomPlatformData.h:
2528         * platform/graphics/freetype/FontPlatformData.h:
2529         * platform/graphics/mac/FontCustomPlatformData.h:
2530         * platform/graphics/win/FontCustomPlatformData.h:
2531         * platform/text/NonCJKGlyphOrientation.h: Removed.
2532         * platform/text/TextFlags.h:
2533         * rendering/TextPainter.h:
2534         * style/StyleFontSizeFunctions.h:
2535
2536 2015-04-27  Daniel Bates  <dabates@apple.com>
2537
2538         Form control may be associated with the wrong HTML Form element after form id change
2539         https://bugs.webkit.org/show_bug.cgi?id=133456
2540         <rdar://problem/17095055>
2541
2542         Reviewed by Andy Estes.
2543
2544         Fixes an issue where a form control may be associated with the wrong HTML Form element
2545         after the id of the HTML Form element associated with the form control is changed when
2546         there is more than one HTML Form element with the same id in the document. Specifically,
2547         a form control that has an HTML form attribute value X will always be associated with
2548         some HTML Form element f where f.id = X regardless of whether f.id is subsequently
2549         changed.
2550
2551         Tests: fast/forms/change-form-id-to-be-unique-then-submit-form.html
2552                fast/forms/change-form-id-to-be-unique.html
2553
2554         * dom/Element.cpp:
2555         (WebCore::Element::attributeChanged): Notify observers when the id of an element changed.
2556         (WebCore::Element::updateId): Added parameter NotifyObservers (defaults to NotifyObservers::Yes),
2557         as to whether we should notify observers of the id change.
2558         (WebCore::Element::updateIdForTreeScope): Ditto.
2559         (WebCore::Element::willModifyAttribute): Do not notify observers of the id change immediately. As
2560         indicated by the name of this method, we plan to modify the DOM attribute id of the element, but
2561         we have not actually modified it when this method is called. Instead we will notify observers
2562         in Element::attributeChanged(), which is called after the DOM attribute id is modified.
2563         (WebCore::Element::cloneAttributesFromElement): Ditto.
2564         * dom/Element.h: Defined enum class NotifyObservers.
2565         * dom/TreeScope.cpp:
2566         (WebCore::TreeScope::addElementById): Added boolean parameter notifyObservers (defaults to true)
2567         as to whether we should dispatch a notification to all observers.
2568         (WebCore::TreeScope::removeElementById): Ditto.
2569         * dom/TreeScope.h:
2570
2571 2015-04-27  Alex Christensen  <achristensen@webkit.org>
2572
2573         Reduce allocations and memory usage when compiling content extensions.
2574         https://bugs.webkit.org/show_bug.cgi?id=144277
2575
2576         Reviewed by Benjamin Poulain.
2577
2578         Covered by existing tests.
2579
2580         * contentextensions/Term.h:
2581         (WebCore::ContentExtensions::Term::CharacterSet::set):
2582         (WebCore::ContentExtensions::Term::CharacterSet::get):
2583         (WebCore::ContentExtensions::Term::CharacterSet::invert):
2584         (WebCore::ContentExtensions::Term::CharacterSet::inverted):
2585         (WebCore::ContentExtensions::Term::CharacterSet::bitCount):
2586         (WebCore::ContentExtensions::Term::CharacterSet::operator==):
2587         (WebCore::ContentExtensions::Term::CharacterSet::hash):
2588         (WebCore::ContentExtensions::Term::Term):
2589         (WebCore::ContentExtensions::Term::addCharacter):
2590         (WebCore::ContentExtensions::Term::isEndOfLineAssertion):
2591         (WebCore::ContentExtensions::Term::isUniversalTransition):
2592         (WebCore::ContentExtensions::Term::generateSubgraphForAtom):
2593         Use two uint64_t's instead of a BitVector with a capacity of 128 bits.
2594
2595 2015-04-27  Michael Catanzaro  <mcatanzaro@igalia.com>
2596
2597         Rename WTF_USE_3D_GRAPHICS to ENABLE_GRAPHICS_CONTEXT_3D
2598         https://bugs.webkit.org/show_bug.cgi?id=144193
2599
2600         Reviewed by Darin Adler.
2601
2602         * CMakeLists.txt:
2603         * platform/graphics/ANGLEWebKitBridge.cpp:
2604         * platform/graphics/FormatConverter.cpp:
2605         * platform/graphics/FormatConverter.h:
2606         * platform/graphics/GLContext.h:
2607         * platform/graphics/GraphicsContext3D.cpp:
2608         * platform/graphics/GraphicsContext3DPrivate.cpp:
2609         * platform/graphics/OpenGLShims.cpp:
2610         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
2611         * platform/graphics/cg/GraphicsContext3DCG.cpp:
2612         * platform/graphics/egl/GLContextEGL.cpp:
2613         * platform/graphics/egl/GLContextEGL.h:
2614         * platform/graphics/glx/GLContextGLX.cpp:
2615         * platform/graphics/glx/GLContextGLX.h:
2616         * platform/graphics/mac/GraphicsContext3DMac.mm:
2617         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
2618         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
2619         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
2620         * platform/graphics/opengl/GLPlatformContext.cpp:
2621         * platform/graphics/opengl/GLPlatformSurface.cpp:
2622         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
2623         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2624         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
2625         * platform/graphics/opengl/TemporaryOpenGLSetting.cpp:
2626         * platform/graphics/win/GraphicsContext3DWin.cpp:
2627
2628 2015-04-27  Jer Noble  <jer.noble@apple.com>
2629
2630         [iOS] Video not centered in element on retina devices
2631         https://bugs.webkit.org/show_bug.cgi?id=144274
2632
2633         Reviewed by Simon Fraser.
2634
2635         In r173702, a transform was added to the video layer (and a matching, inverse transform
2636         in the UIProcess), but this transform affects the position property of the video layer
2637         used to position the video content within the element bounds when their aspect ratios
2638         do not match.
2639
2640         To work around this problem, pre-apply the transform during -setPosition:.
2641
2642         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2643         (-[WebVideoContainerLayer setPosition:]):
2644
2645 2015-04-27  Jer Noble  <jer.noble@apple.com>
2646
2647         Add a setting & restriction which prevents non-interactivte playback of audible media elements.
2648         https://bugs.webkit.org/show_bug.cgi?id=143486
2649
2650         Reviewed by Eric Carlson.
2651
2652         Tests: media/audio-playback-restriction-autoplay.html
2653                media/audio-playback-restriction-play.html
2654
2655         To allow clients who want to allow non-user-interactive video-only playback, but still
2656         restrict playback of audible media elements, add a new setting and matching restriction
2657         which disallows playback of media elements containing audible characteristics.
2658
2659         * html/HTMLMediaElement.cpp:
2660         (WebCore::HTMLMediaElement::HTMLMediaElement): Set the RequireUserGestureForAudioRateChange
2661             restriction if the audioPlaybackRequiresUserGesture() setting is set.
2662         (WebCore::HTMLMediaElement::parseAttribute): Drive-by fix. Move the opening brace
2663             out of the #if, as this confuses the heck out of diff and makes all subsequent
2664             changes appear to be within HTMLMediaElement::parseAttribute.
2665         (WebCore::HTMLMediaElement::autoplay): Remove the restriction check from within autoplay().
2666             It is checked again immediately after every autoplay() call site.
2667         (WebCore::HTMLMediaElement::pauseInternal): Remove the iOS-only #if.
2668         (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): Check whether playback
2669             is permitted, and if not, pause.
2670         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): Ditto.
2671         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Ditto.
2672         * html/HTMLMediaSession.cpp:
2673         (WebCore::restrictionName): Since BehaviorRestrictions is a bitfield, check each bit
2674             individually.
2675         (WebCore::HTMLMediaSession::removeBehaviorRestriction): Handle RequireUserGestureForAudioRateChange.
2676         (WebCore::HTMLMediaSession::playbackPermitted): Check whether the element has audio and 
2677             audio playback is restricted, and return false if so.
2678         * html/HTMLMediaSession.h:
2679         * page/Settings.cpp:
2680         * page/Settings.in:
2681         * testing/Internals.cpp:
2682         (WebCore::Internals::setMediaSessionRestrictions): Added. 
2683         (WebCore::Internals::setMediaElementRestrictions): Added.
2684         * testing/Internals.h:
2685         * testing/Internals.idl:
2686
2687 2015-04-27  Jer Noble  <jer.noble@apple.com>
2688
2689         [WebAudio] AudioContext does not remove user-gesture restriction during resume()
2690         https://bugs.webkit.org/show_bug.cgi?id=144211
2691
2692         Reviewed by Eric Carlson.
2693
2694         Tests: webaudio/audiocontext-restriction-audiobuffersourcenode-start.html
2695                webaudio/audiocontext-restriction.html
2696
2697         Before the introduction of resume(), suspend(), and stop(), AudioContexts which required
2698         a user-gesture would start normally, but would effectively mute their outputs. Now that
2699         the AudioContext's state property is exposed to JavaScript, the AudioContext should stay
2700         in the "suspended" state until the user-gesture restriction is lifted.
2701
2702         Add a new method, willBeginPlayback() which checks and potentially clears the context's
2703         behavior restrictions before checking with the MediaSession. Call this new willBeginPlayback()
2704         method when the state would transition to "running".
2705
2706         Because they may be called before any nodes are created, make sure to call lazyInitialize()
2707         from within the JS-exposed resumePlayback(), suspendPlayback(), and stopPlayback() methods.
2708
2709         Instead of clearing the behavior restrictions directly, scheduled AudioNodes should instead
2710         call a new method nodeWillBeginPlayback(). Because existing sites will call AudioNode.start()
2711         inside a user-gesture handler to clear the user-gesture restriction, call startRendering()
2712         from nodeWillBeginPlayback(). But because we don't want AudioNode.start() to resume playback
2713         unconditionally, only do so when the user-gesture restriction is set.
2714
2715         Now that an AudioContext will not transition to "running" state without a user-gesture (if
2716         that restriction is set), there's no reason to check for that restriction from inside
2717         AudioDestinationNode.
2718
2719         Add some internal methods to set and clear AudioContext BehaviorRestrictions for testing purposes.
2720
2721         * Modules/webaudio/AudioBufferSourceNode.cpp:
2722         (WebCore::AudioBufferSourceNode::startPlaying):
2723         * Modules/webaudio/AudioContext.cpp:
2724         (WebCore::AudioContext::nodeWillBeginPlayback):
2725         (WebCore::AudioContext::willBeginPlayback):
2726         (WebCore::AudioContext::willPausePlayback):
2727         (WebCore::AudioContext::startRendering):
2728         (WebCore::AudioContext::suspendContext):
2729         (WebCore::AudioContext::resumeContext):
2730         (WebCore::AudioContext::closeContext):
2731         (WebCore::AudioContext::suspendPlayback):
2732         (WebCore::AudioContext::mayResumePlayback):
2733         * Modules/webaudio/AudioContext.h:
2734         (WebCore::AudioContext::behaviorRestrictions):
2735         (WebCore::AudioContext::userGestureRequiredForAudioStart):
2736         (WebCore::AudioContext::pageConsentRequiredForAudioStart):
2737         * Modules/webaudio/AudioDestinationNode.cpp:
2738         (WebCore::AudioDestinationNode::render):
2739         * Modules/webaudio/AudioScheduledSourceNode.cpp:
2740         (WebCore::AudioScheduledSourceNode::start):
2741         * testing/Internals.cpp:
2742         (WebCore::Internals::setAudioContextRestrictions):
2743         * testing/Internals.h:
2744         * testing/Internals.idl:
2745
2746 2015-04-27  Alexey Proskuryakov  <ap@apple.com>
2747
2748         Build fix.
2749
2750         * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
2751         Use -setObject:forKey:, not array subscript.
2752
2753 2015-04-27  Eric Carlson  <eric.carlson@apple.com>
2754
2755         WirelessTargetPicker should not be visible unless a file is playable
2756         https://bugs.webkit.org/show_bug.cgi?id=144271
2757         <rdar://problem/20712003>
2758
2759         Reviewed by Jer Noble.
2760
2761         * Modules/mediacontrols/mediaControlsApple.js:
2762         (Controller.prototype.isPlayable): New.
2763         (Controller.prototype.setStatusHidden): Call updateWirelessTargetAvailable.
2764         (Controller.prototype.updateWirelessTargetAvailable): Don't show the button until the
2765             status message has been hidden.
2766
2767 2015-04-22  Martin Robinson  <mrobinson@igalia.com>
2768
2769         [CMake] Autogenerate cmakeconfig.h.cmake
2770         https://bugs.webkit.org/show_bug.cgi?id=143997
2771
2772         Reviewed by Csaba Osztrogonác.
2773
2774         * PlatformGTK.cmake: Use the WTF_USE style variables, because those are the same
2775         as the ones exposed to the build.
2776
2777 2015-04-27  Zalan Bujtas  <zalan@apple.com>
2778
2779         Simple line layout: Wrong text offsetting when range does not start from the first renderer.
2780         https://bugs.webkit.org/show_bug.cgi?id=144167
2781         rdar://problem/20639857
2782
2783         Reviewed by Simon Fraser.
2784
2785         This patch ensures that TextIterator returns the right text when the input range starts
2786         from a sibling node.
2787
2788         TextIterator::m_previousTextLengthInFlow keeps track of the current node offset from the parent.
2789         It is required to map simple line layout runs to RenderText positions.
2790         This patch sets the offset value when the iteration start with a sibling node.
2791
2792         Test: fast/text/range-text-with-simple-line-layout.html
2793
2794         * editing/TextIterator.cpp:
2795         (WebCore::TextIterator::TextIterator):
2796         (WebCore::TextIterator::handleTextNode):
2797
2798 2015-04-27  Commit Queue  <commit-queue@webkit.org>
2799
2800         Unreviewed, rolling out r183393.
2801         https://bugs.webkit.org/show_bug.cgi?id=144272
2802
2803         Caused memory corruption detected by GuardMalloc (Requested by
2804         ap on #webkit).
2805
2806         Reverted changeset:
2807
2808         "Synchronous XMLHttpRequest should get access to AppCache
2809         resources stored as flat files"
2810         https://bugs.webkit.org/show_bug.cgi?id=143711
2811         http://trac.webkit.org/changeset/183393
2812
2813 2015-04-27  Per Arne Vollan  <peavo@outlook.com>
2814
2815         [Curl] Favicons loaded from disc cache are ignored.
2816         https://bugs.webkit.org/show_bug.cgi?id=143953
2817
2818         Reviewed by Alex Christensen.
2819
2820         When a favicon is loaded from the Curl disc cache, the icon data is thrown away.
2821         This happens because we give a 304 response, which makes the icon loader ignore
2822         the response. We can solve this by responding with 200 OK.
2823
2824         * platform/network/ResourceHandleInternal.h:
2825         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
2826         * platform/network/curl/CurlCacheManager.cpp:
2827         (WebCore::CurlCacheManager::didReceiveResponse):
2828         * platform/network/curl/ResourceHandleManager.cpp:
2829         (WebCore::headerCallback):
2830         (WebCore::ResourceHandleManager::initializeHandle):
2831
2832 2015-04-27  Brady Eidson  <beidson@apple.com>
2833
2834         Make 'enum NavigationType' be an enum class
2835         https://bugs.webkit.org/show_bug.cgi?id=144270
2836
2837         Reviewed by Alex Christensen.
2838
2839         No new tests (No change in behavior).
2840
2841         I’ll be adding a new NavigationType for bug 144269 so it makes sense to make this
2842         an enum class first.
2843
2844         * loader/FrameLoader.cpp:
2845         (WebCore::FrameLoader::load):
2846         (WebCore::FrameLoader::reload):
2847         (WebCore::FrameLoader::loadDifferentDocumentItem):
2848         * loader/FrameLoaderTypes.h:
2849
2850         * loader/NavigationAction.cpp:
2851         (WebCore::navigationType):
2852         (WebCore::NavigationAction::NavigationAction):
2853
2854         * loader/PolicyChecker.cpp:
2855         (WebCore::PolicyChecker::checkNavigationPolicy):
2856
2857         * page/PerformanceNavigation.cpp:
2858         (WebCore::PerformanceNavigation::type):
2859
2860 2015-04-27  Yoav Weiss  <yoav@yoav.ws>
2861
2862         Fix viewport units in Media Queries
2863         https://bugs.webkit.org/show_bug.cgi?id=144260
2864
2865         Reviewed by Darin Adler.
2866
2867         This patch makes sure that viewport units are considered "length units"
2868         in the context of Media Queries, by having MediaQueryExp use the unit logic
2869         that is in CSSPrimitiveValue.
2870         It does that by turning the relevant methods in CSSPrimitiveValue into static.
2871
2872         It also makes sure that the logic for "resolution units" is not maintained separately 
2873         in MediaQueryExp, to avoid similiar issues in the future with resolution units.
2874
2875         Test: fast/media/mq-viewport-units.html
2876
2877         * css/CSSPrimitiveValue.h:
2878         (WebCore::CSSPrimitiveValue::isViewportPercentageLength): Added a static variant.
2879         (WebCore::CSSPrimitiveValue::isLength): Added a static variant.
2880         (WebCore::CSSPrimitiveValue::isResolution): Added a static variant.
2881         * css/MediaQueryExp.cpp:
2882         (WebCore::featureWithValidPositiveLenghtOrNumber): Call CSSPrimitiveValue's length unit logic.
2883         (WebCore::featureWithValidDensity): Call CSSPrimitiveValue's resolution unit logic.
2884
2885 2015-04-27  Javier Fernandez  <jfernandez@igalia.com>
2886
2887         [CSS Grid Layout] Support for the justify-self and justify-items in grid layout
2888         https://bugs.webkit.org/show_bug.cgi?id=133280
2889
2890         Reviewed by David Hyatt.
2891
2892         Implementation of justify-self and justify-items properties for grid. It supports
2893         different writing-modes and direction. Margins, borders and paddings are also
2894         considered when computing the final position and stretched size.
2895
2896         This patch applies also a quite important refactoring of the alignment logic in
2897         order to share code between the two alignment dimensions, row-axis and column-axis.
2898
2899         Overflow handling is still missing and will be added later in a follow-up bug.
2900
2901         Tests: fast/css-grid-layout/grid-align-justify-margin-border-padding-vertical-lr.html
2902                fast/css-grid-layout/grid-align-justify-margin-border-padding-vertical-rl.html
2903                fast/css-grid-layout/grid-align-justify-margin-border-padding.html
2904                fast/css-grid-layout/justify-self-cell.html
2905
2906         * rendering/RenderGrid.cpp:
2907         (WebCore::RenderGrid::layoutGridItems):
2908         (WebCore::RenderGrid::columnAxisPositionForChild):
2909         (WebCore::RenderGrid::rowAxisPositionForChild):
2910         (WebCore::RenderGrid::rowPositionForChild):
2911         (WebCore::RenderGrid::columnPositionForChild):
2912         (WebCore::RenderGrid::findChildLogicalPosition):
2913         (WebCore::RenderGrid::allowedToStretchLogicalHeightForChild): Deleted.
2914         (WebCore::RenderGrid::needToStretchChildLogicalHeight): Deleted.
2915         (WebCore::RenderGrid::marginLogicalHeightForChild): Deleted.
2916         (WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching): Deleted.
2917         (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded): Deleted.
2918         * rendering/RenderGrid.h:
2919         * rendering/style/RenderStyle.cpp:
2920         (WebCore::RenderStyle::resolveJustification):
2921         * rendering/style/RenderStyle.h:
2922
2923 2015-04-27  Darin Adler  <darin@apple.com>
2924
2925         Crashes under IDBDatabase::closeConnection
2926         https://bugs.webkit.org/show_bug.cgi?id=141745
2927
2928         Reviewed by Alexey Proskuryakov.
2929
2930         * Modules/indexeddb/IDBDatabase.cpp:
2931         (WebCore::IDBDatabase::~IDBDatabase): Do the work of close/closeConnection without
2932         actually calling those functions.
2933         (WebCore::IDBDatabase::closeConnection): Protect the database so it's not destroyed
2934         in the middle of this function's execution.
2935
2936 2015-04-27  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
2937
2938         [Streams API] ReadableStream constructor start function should be able to close the stream
2939         https://bugs.webkit.org/show_bug.cgi?id=143363
2940
2941         Reviewed by Benjamin Poulain.
2942
2943         Implements https://streams.spec.whatwg.org/#close-readable-stream.
2944         When the "close" JS function is called, the stream is getting closed.
2945         The stream state is changed to close and if it has a reader, the reader gets closed as well:
2946         The reader resolves the closed promise and releases the stream.
2947
2948         Enabled the possibility to resolve a promise with any JS value.
2949         This is used to resolve closed promise with jsUndefined and will be used for read promises in
2950         the future as well, though of course it is not restricted to Streams.
2951
2952         Covered by reference tests that are now passing.
2953
2954         * Modules/streams/ReadableStream.h:
2955         * Modules/streams/ReadableStream.cpp:
2956         (WebCore::ReadableStream::changeStateToClosed): Called by the JS function 'close'.
2957         * Modules/streams/ReadableStreamReader.cpp:
2958         (WebCore::ReadableStreamReader::ReadableStreamReader): Initialized stream.
2959         (WebCore::ReadableStreamReader::initialize): Added to handle state change at constructor time
2960         in particular closed/errored state.
2961         (WebCore::ReadableStreamReader::releaseStream): Releases the stream.
2962         (WebCore::ReadableStreamReader::closed): Stores the promise callbacks and invokes success
2963         immediately if the stream is already closed.
2964         (WebCore::ReadableStreamReader::changeStateToClosed): Changes the internal state to closed,
2965         resolves the promise and releases the stream.
2966         * Modules/streams/ReadableStreamReader.h:
2967         (WebCore::ReadableStreamReader::State): Added.
2968         * bindings/js/JSDOMPromise.h:
2969         (WebCore::DeferredWrapper::resolve<JSC::JSValue>): Adds the ability to resolve a promise with
2970         a custom JS value.
2971         * bindings/js/JSReadableStreamControllerCustom.cpp:
2972         (WebCore::JSReadableStreamController::close): Not "notImplemented" anymore. Now it closes the
2973         stream.
2974         * bindings/js/JSReadableStreamReaderCustom.cpp:
2975         (WebCore::JSReadableStreamReader::closed): Resolves the promise with undefined.
2976
2977 2015-04-27  Csaba Osztrogonác  <ossy@webkit.org>
2978
2979         Fix the !ENABLE(CSS_GRID_LAYOUT) build after r183370
2980         https://bugs.webkit.org/show_bug.cgi?id=144255
2981
2982         Reviewed by Carlos Garcia Campos.
2983
2984         * rendering/RenderBox.cpp:
2985         (WebCore::RenderBox::computeLogicalHeight):
2986
2987 2015-04-27  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2988
2989         Synchronous XMLHttpRequest should get access to AppCache resources stored as flat files
2990         https://bugs.webkit.org/show_bug.cgi?id=143711
2991
2992         Reviewed by Darin Adler.
2993
2994         This patch checks whether a substitute resource data is stored in memory or in file for synchronous loads.
2995         If data is stored in file, it reads the data through SharedBuffer::createWithContentsOfFile.
2996         This patch refactors some routines to replace Vector<char> by SharedBuffer to transmit response data.
2997
2998         Test: http/tests/appcache/simple-video-sync.html
2999
3000         * html/HTMLMediaElement.cpp:
3001         (WebCore::HTMLMediaElement::parseAttribute):
3002         * loader/DocumentThreadableLoader.cpp:
3003         (WebCore::DocumentThreadableLoader::loadRequest):
3004         * loader/FrameLoader.cpp:
3005         (WebCore::FrameLoader::loadResourceSynchronously):
3006         * loader/FrameLoader.h:
3007         * loader/appcache/ApplicationCacheHost.cpp:
3008         (WebCore::ApplicationCacheHost::maybeLoadResource):
3009         (WebCore::ApplicationCacheHost::createFileURL):
3010         (WebCore::ApplicationCacheHost::maybeLoadSynchronously):
3011         (WebCore::ApplicationCacheHost::maybeLoadFallbackSynchronously):
3012         * loader/appcache/ApplicationCacheHost.h:
3013         * xml/XSLTProcessorLibxslt.cpp:
3014         (WebCore::docLoaderFunc):
3015         * xml/parser/XMLDocumentParserLibxml2.cpp:
3016         (WebCore::openFunc):
3017
3018 2015-04-24  Philippe Normand  <pnormand@igalia.com>
3019
3020         [JHBuild] Move to upstream OpenWebRTC
3021         https://bugs.webkit.org/show_bug.cgi?id=144145
3022
3023         Reviewed by Carlos Garcia Campos.
3024
3025         * platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp:
3026         (WebCore::initializeOpenWebRTC): Update with new owr_init API.
3027
3028 2015-04-17  Carlos Garcia Campos  <cgarcia@igalia.com>
3029
3030         [SOUP] Add initial implementation of NetworkProcess disk cache
3031         https://bugs.webkit.org/show_bug.cgi?id=143872
3032
3033         Reviewed by Martin Robinson.
3034
3035         Allow to create a GRefPtr for SoupBuffer. Even though SoupBuffer
3036         is not a GObject and has copy/free functions instead of ref/unref,
3037         it's internally refcounted, so we could use copy/free as
3038         ref/unref.
3039
3040         * PlatformGTK.cmake:
3041         * platform/network/soup/GRefPtrSoup.cpp: Added.
3042         (WTF::refGPtr):
3043         (WTF::derefGPtr):
3044         * platform/network/soup/GRefPtrSoup.h: Added.
3045
3046 2015-04-26  Manuel Rego Casasnovas  <rego@igalia.com>
3047
3048         [CSS Grid Layout] LayoutBox::hasDefiniteLogicalHeight() should consider abspos boxes as definite
3049         https://bugs.webkit.org/show_bug.cgi?id=144144
3050
3051         Reviewed by Darin Adler.
3052
3053         Change order in hasDefiniteLogicalHeight() ifs to consider definite
3054         absolutely positioned elements.
3055
3056         Test: fast/css-grid-layout/percent-track-breadths-regarding-container-size.html
3057
3058         * rendering/RenderBox.cpp:
3059         (WebCore::RenderBox::hasDefiniteLogicalHeight):
3060
3061 2015-04-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
3062
3063         SVGFilterBuilder should drive the builtin sourceAlpha from the passed sourceGraphic
3064         https://bugs.webkit.org/show_bug.cgi?id=144137
3065
3066         Reviewed by Darin Adler.
3067
3068         The SourceAlpha should be driven from the last applied FilterEffect. This
3069         will require the SourceAlpha FilterEffect to wrap a FilterEffect rather
3070         than just getting the SourceGraphic reference from FilterEffectRenderer.
3071
3072         This is based on the Blink patch:
3073         https://src.chromium.org/viewvc/blink?revision=194115&view=revision.
3074
3075         Test: svg/filters/sourceAlpha-input-filter-effect.html
3076         
3077         * platform/graphics/filters/SourceAlpha.cpp:
3078         (WebCore::SourceAlpha::create): Make SourceAlpha wraps a FilterEffect
3079         rather than a Filter.
3080         
3081         (WebCore::SourceAlpha::determineAbsolutePaintRect): Determine the paint
3082         rect from the wrapped FilterEffect.
3083         
3084         (WebCore::SourceAlpha::platformApplySoftware): Extract the alpha channel
3085         from the wrapped FilterEffect.
3086         
3087         (WebCore::SourceAlpha::SourceAlpha): 
3088         * platform/graphics/filters/SourceAlpha.h:
3089         (WebCore::SourceAlpha::SourceAlpha): Deleted.
3090         Reimplement the constructor of the SourceAlpha such that it wraps the
3091         sourceEffect in its inputEffects.
3092     
3093         * rendering/FilterEffectRenderer.cpp:
3094         (WebCore::FilterEffectRenderer::buildReferenceFilter): Delete the FIXME
3095         comment and do exactly what it said. This matches the implementation of
3096         Gecko and Blink.
3097         
3098         * rendering/svg/RenderSVGResourceFilter.cpp:
3099         (WebCore::RenderSVGResourceFilter::buildPrimitives):
3100         Delete the extra argument.
3101
3102         * svg/graphics/filters/SVGFilterBuilder.cpp:
3103         (WebCore::SVGFilterBuilder::SVGFilterBuilder):
3104         * svg/graphics/filters/SVGFilterBuilder.h: Drive the SourceAlpha from the
3105         passed source FilterEffect.
3106
3107         * platform/graphics/filters/FEBlend.cpp:
3108         * platform/graphics/filters/FEBlend.h:
3109         * platform/graphics/filters/FEColorMatrix.cpp:
3110         * platform/graphics/filters/FEColorMatrix.h:
3111         * platform/graphics/filters/FEComponentTransfer.cpp:
3112         * platform/graphics/filters/FEComponentTransfer.h:
3113         * platform/graphics/filters/FEComposite.cpp:
3114         * platform/graphics/filters/FEComposite.h:
3115         * platform/graphics/filters/FEConvolveMatrix.cpp:
3116         * platform/graphics/filters/FEConvolveMatrix.h:
3117         * platform/graphics/filters/FEDiffuseLighting.cpp:
3118         * platform/graphics/filters/FEDiffuseLighting.h:
3119         * platform/graphics/filters/FEDisplacementMap.cpp:
3120         * platform/graphics/filters/FEDisplacementMap.h:
3121         * platform/graphics/filters/FEDropShadow.cpp:
3122         * platform/graphics/filters/FEDropShadow.h:
3123         * platform/graphics/filters/FEFlood.cpp:
3124         * platform/graphics/filters/FEFlood.h:
3125         * platform/graphics/filters/FEGaussianBlur.cpp:
3126         * platform/graphics/filters/FEGaussianBlur.h:
3127         * platform/graphics/filters/FELighting.cpp:
3128         * platform/graphics/filters/FELighting.h:
3129         * platform/graphics/filters/FEMerge.cpp:
3130         * platform/graphics/filters/FEMerge.h:
3131         * platform/graphics/filters/FEMorphology.cpp:
3132         * platform/graphics/filters/FEMorphology.h:
3133         * platform/graphics/filters/FEOffset.cpp:
3134         * platform/graphics/filters/FEOffset.h:
3135         * platform/graphics/filters/FESpecularLighting.cpp:
3136         * platform/graphics/filters/FESpecularLighting.h:
3137         * platform/graphics/filters/FETile.cpp:
3138         * platform/graphics/filters/FETile.h:
3139         * platform/graphics/filters/FETurbulence.cpp:
3140         * platform/graphics/filters/FETurbulence.h:
3141         * platform/graphics/filters/Filter.h:
3142         * platform/graphics/filters/FilterEffect.cpp:
3143         * platform/graphics/filters/FilterEffect.h:
3144         * platform/graphics/filters/SourceGraphic.cpp:
3145         * platform/graphics/filters/SourceGraphic.h:
3146         * rendering/svg/RenderSVGResourceFilter.h:
3147         * rendering/svg/SVGRenderTreeAsText.cpp:
3148         Code clean up: Pointer to reference conversion. It starts by converting
3149         FilterEffect::m_filter from pointer to reference and it kept expanding.
3150         All the creations of FilterEffect were happening by passing "this" so
3151         passing "*this" did not require to check whether the pointer is nil.
3152
3153         * svg/SVGFEBlendElement.cpp:
3154         * svg/SVGFEBlendElement.h:
3155         * svg/SVGFEColorMatrixElement.cpp:
3156         * svg/SVGFEColorMatrixElement.h:
3157         * svg/SVGFEComponentTransferElement.cpp:
3158         * svg/SVGFEComponentTransferElement.h:
3159         * svg/SVGFECompositeElement.cpp:
3160         * svg/SVGFECompositeElement.h:
3161         * svg/SVGFEConvolveMatrixElement.cpp:
3162         * svg/SVGFEConvolveMatrixElement.h:
3163         * svg/SVGFEDiffuseLightingElement.cpp:
3164         * svg/SVGFEDiffuseLightingElement.h:
3165         * svg/SVGFEDisplacementMapElement.cpp:
3166         * svg/SVGFEDisplacementMapElement.h:
3167         * svg/SVGFEDropShadowElement.cpp:
3168         * svg/SVGFEDropShadowElement.h:
3169         * svg/SVGFEFloodElement.cpp:
3170         * svg/SVGFEFloodElement.h:
3171         * svg/SVGFEGaussianBlurElement.cpp:
3172         * svg/SVGFEGaussianBlurElement.h:
3173         * svg/SVGFEImageElement.cpp:
3174         * svg/SVGFEImageElement.h:
3175         * svg/SVGFEMergeElement.cpp:
3176         * svg/SVGFEMergeElement.h:
3177         * svg/SVGFEMorphologyElement.cpp:
3178         * svg/SVGFEMorphologyElement.h:
3179         * svg/SVGFEOffsetElement.cpp:
3180         * svg/SVGFEOffsetElement.h:
3181         * svg/SVGFESpecularLightingElement.cpp:
3182         * svg/SVGFESpecularLightingElement.h:
3183         * svg/SVGFETileElement.cpp:
3184         * svg/SVGFETileElement.h:
3185         * svg/SVGFETurbulenceElement.cpp:
3186         * svg/SVGFETurbulenceElement.h:
3187         * svg/SVGFilterPrimitiveStandardAttributes.h:
3188         * svg/graphics/filters/SVGFEImage.cpp:
3189         * svg/graphics/filters/SVGFEImage.h:
3190         Code clean up: Pointer to reference and PassRefPtr<> to RefPtr<> or Ref<>
3191         conversion.
3192
3193 2015-04-26  Darin Adler  <darin@apple.com>
3194
3195         REGRESSION (r174283): disabled default buttons use impossible-to-read white text on Mac
3196         https://bugs.webkit.org/show_bug.cgi?id=144237
3197
3198         Reviewed by Simon Fraser.
3199
3200         No test because DumpRenderTree and WebKitTestRunner don't have a good method
3201         for testing behaviors that are specific to active windows. That's the same reason
3202         that the change that caused this bug didn't come with a regression test.
3203
3204         * rendering/RenderTheme.cpp:
3205         (WebCore::RenderTheme::adjustStyle): Renamed "e" to "element". Added a comment to
3206         clarify the meaning of the setInsideDefaultButton function, and added an
3207         isDisabledFormControl check so it won't trigger on a disabled button.
3208         (WebCore::RenderTheme::systemColor): Moved CSSValueActivebuttontext into
3209         alphabetical order to match the rest of the switch statement ordering.
3210
3211         * rendering/RenderThemeMac.mm:
3212         (WebCore::RenderThemeMac::systemColor): Moved CSSValueActivebuttontext into
3213         alphabetical order to match the rest of the switch statement ordering. Also
3214         fixed its behavior on older versions of OS X; it should just return the same
3215         thing that CSSValueButtontext would return in that context.
3216
3217 2015-04-26  Yusuke Suzuki  <utatane.tea@gmail.com>
3218
3219         [ES6] Implement ES6 template literals
3220         https://bugs.webkit.org/show_bug.cgi?id=142691
3221
3222         Reviewed by Darin Adler.
3223
3224         Add ENABLE_ES6_TEMPLATE_LITERAL_SYNTAX compile time flag.
3225
3226         * Configurations/FeatureDefines.xcconfig:
3227
3228 2015-04-26  Javier Fernandez  <jfernandez@igalia.com>
3229
3230         [CSS Grid Layout] Support for align-self and align-items in grid layout
3231         https://bugs.webkit.org/show_bug.cgi?id=133225
3232
3233         Reviewed by Darin Adler.
3234
3235         Implementation of align-self and align-items properties for grid. It supports
3236         different writing-modes and direction. Margins, borders and paddings are also
3237         considered when computing the final position and stretched size.
3238
3239         Overflow handling is still missing and will be added when implemented row-axis
3240         alignment support.
3241
3242         Test: fast/css-grid-layout/grid-align.html
3243
3244         * rendering/RenderBox.cpp:
3245         (WebCore::RenderBox::computeLogicalHeight):
3246         * rendering/RenderGrid.cpp:
3247         (WebCore::RenderGrid::logicalContentHeightForChild):
3248         (WebCore::RenderGrid::layoutGridItems):
3249         (WebCore::computeOverflowAlignmentOffset):
3250         (WebCore::RenderGrid::endOfRowForChild):
3251         (WebCore::RenderGrid::startOfRowForChild):
3252         (WebCore::RenderGrid::centeredRowPositionForChild):
3253         (WebCore::marginWidthForChild):
3254         (WebCore::marginHeightForChild):
3255         (WebCore::RenderGrid::allowedToStretchLogicalHeightForChild):
3256         (WebCore::RenderGrid::needToStretchChildLogicalHeight):
3257         (WebCore::RenderGrid::marginLogicalHeightForChild):
3258         (WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching):
3259         (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
3260         (WebCore::RenderGrid::rowPositionForChild):
3261         (WebCore::RenderGrid::findChildLogicalPosition):
3262         (WebCore::RenderGrid::populateGridPositions): Deleted.
3263         * rendering/RenderGrid.h:
3264
3265 2015-04-26  Doug Russell  <d_russell@apple.com>
3266
3267         AX: richer text change notifications (142719)
3268         https://bugs.webkit.org/show_bug.cgi?id=142719
3269
3270         Reviewed by Darin Adler.
3271
3272         Richer accessibility value change notifications. Introduce AXTextEditType,
3273         postTextStateChangeNotification and postTextReplacementNotification to give assistive
3274         tech apps more reliable context for responding to changes in web content. Also implement
3275         a mechanism to post value changes in password form fields in coalesced ticks to thwart
3276         analyzing the cadence of changes.
3277
3278         Richer accessibility selection change notifications. Introduce AXTextStateChangeIntent,
3279         and an overload of postTextReplacementNotification to give assistive tech apps more
3280         reliable context for responding to changes in web content selection. Also block posting
3281         selection changes on password fields.
3282
3283         Tests: platform/mac/accessibility/input-replacevalue-userinfo.html
3284                platform/mac/accessibility/selection-change-userinfo.html
3285                platform/mac/accessibility/value-change-userinfo.html
3286
3287         * CMakeLists.txt:
3288         * WebCore.vcxproj/WebCore.vcxproj:
3289         * WebCore.vcxproj/WebCore.vcxproj.filters:
3290         * WebCore.xcodeproj/project.pbxproj:
3291         * accessibility/AXObjectCache.cpp:
3292         (WebCore::AXObjectCache::AXObjectCache):
3293         (WebCore::AXObjectCache::notificationPostTimerFired):
3294         (WebCore::AXObjectCache::passwordNotificationPostTimerFired):
3295         (WebCore::AXObjectCache::showIntent):
3296         (WebCore::AXObjectCache::setTextSelectionIntent):
3297         (WebCore::isPasswordFieldOrContainedByPasswordField):
3298         (WebCore::AXObjectCache::postTextStateChangeNotification):
3299         (WebCore::AXObjectCache::postTextReplacementNotification):
3300         (WebCore::AXObjectCache::enqueuePasswordValueChangeNotification):
3301         (WebCore::AXObjectCache::rootWebArea):
3302         (WebCore::AXObjectCache::textChangeForEditType):
3303         (WebCore::AXObjectCache::selectedChildrenChanged): Deleted.
3304         (WebCore::AXObjectCache::frameLoadingEventNotification): Deleted.
3305         * accessibility/AXObjectCache.h:
3306         (WebCore::AXObjectCache::postTextStateChangeNotification):
3307         (WebCore::AXObjectCache::postTextReplacementNotification):
3308         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
3309         (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
3310         (WebCore::AXObjectCache::textChangeForEditType):
3311         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
3312         (WebCore::AXObjectCache::computedObjectAttributeCache): Deleted.
3313         (WebCore::AXObjectCache::getOrCreate): Deleted.
3314         (WebCore::AXObjectCache::attachWrapper): Deleted.
3315         * accessibility/AXTextStateChangeIntent.h: Added.
3316         (WebCore::AXTextStateChangeIntent::AXTextStateChangeIntent):
3317         * accessibility/AccessibilityNodeObject.cpp:
3318         (WebCore::AccessibilityNodeObject::passwordFieldOrContainingPasswordField):
3319         * accessibility/AccessibilityNodeObject.h:
3320         * accessibility/AccessibilityObject.cpp:
3321         (WebCore::AccessibilityObject::isContainedByPasswordField):
3322         * accessibility/AccessibilityObject.h:
3323         (WebCore::AccessibilityObject::passwordFieldOrContainingPasswordField):
3324         (WebCore::AccessibilityObject::isPasswordField): Deleted.
3325         * accessibility/AccessibilityRenderObject.cpp:
3326         (WebCore::AccessibilityRenderObject::setSelectedTextRange):
3327         (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
3328         * accessibility/AccessibilityScrollView.h:
3329         * accessibility/atk/AXObjectCacheAtk.cpp:
3330         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
3331         * accessibility/ios/AXObjectCacheIOS.mm:
3332         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
3333         (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
3334         * accessibility/mac/AXObjectCacheMac.mm:
3335         (WebCore::AXObjectCache::setShouldRepostNotificationsForTests):
3336         (WebCore::AXPostNotificationWithUserInfo):
3337         (WebCore::AXObjectCache::postPlatformNotification):
3338         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
3339         (WebCore::textReplacementChangeDictionary):
3340         (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
3341         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
3342         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
3343         (+[WebAccessibilityObjectWrapperBase accessibilitySetShouldRepostNotifications:]):
3344         (-[WebAccessibilityObjectWrapperBase accessibilityPostedNotification:]):
3345         (arrayRemovingNonJSONTypes):
3346         (dictionaryRemovingNonJSONTypes):
3347         (-[WebAccessibilityObjectWrapperBase accessibilityPostedNotification:userInfo:]):
3348         * accessibility/mac/WebAccessibilityObjectWrapperMac.h:
3349         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3350         (textMarkerRangeFromVisiblePositions):
3351         (-[WebAccessibilityObjectWrapper textMarkerRangeFromVisiblePositions:endPosition:]):
3352         * editing/AppendNodeCommand.cpp:
3353         (WebCore::AppendNodeCommand::AppendNodeCommand):
3354         (WebCore::sendAXTextChangedIgnoringLineBreaks):
3355         (WebCore::AppendNodeCommand::doApply):
3356         (WebCore::AppendNodeCommand::doUnapply):
3357         * editing/AppendNodeCommand.h:
3358         (WebCore::AppendNodeCommand::create):
3359         * editing/ApplyStyleCommand.cpp:
3360         (WebCore::ApplyStyleCommand::ApplyStyleCommand):
3361         (WebCore::ApplyStyleCommand::applyBlockStyle): Deleted.
3362         * editing/ApplyStyleCommand.h:
3363         * editing/CompositeEditCommand.cpp:
3364         (WebCore::EditCommandComposition::unapplyEditType):
3365         (WebCore::CompositeEditCommand::CompositeEditCommand):
3366         (WebCore::CompositeEditCommand::apply):
3367         (WebCore::CompositeEditCommand::insertParagraphSeparator):
3368         (WebCore::CompositeEditCommand::insertNodeBefore):
3369         (WebCore::CompositeEditCommand::appendNode):
3370         (WebCore::CompositeEditCommand::removeNodePreservingChildren):
3371         (WebCore::CompositeEditCommand::insertTextIntoNode):
3372         (WebCore::CompositeEditCommand::deleteTextFromNode):
3373         (WebCore::CompositeEditCommand::replaceTextInNode):
3374         (WebCore::CompositeEditCommand::moveParagraphs):
3375         (WebCore::EditCommandComposition::getNodesInCommand): Deleted.
3376         (WebCore::CompositeEditCommand::applyStyle): Deleted.
3377         (WebCore::CompositeEditCommand::insertLineBreak): Deleted.
3378         (WebCore::CompositeEditCommand::insertNodeAt): Deleted.
3379         (WebCore::CompositeEditCommand::removeChildrenInRange): Deleted.
3380         (WebCore::CompositeEditCommand::inputText): Deleted.
3381         * editing/CompositeEditCommand.h:
3382         * editing/DeleteFromTextNodeCommand.cpp:
3383         (WebCore::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand):
3384         (WebCore::DeleteFromTextNodeCommand::doApply):
3385         (WebCore::DeleteFromTextNodeCommand::doUnapply):
3386         * editing/DeleteFromTextNodeCommand.h:
3387         (WebCore::DeleteFromTextNodeCommand::create):
3388         (WebCore::DeleteFromTextNodeCommand::deletedText):
3389         * editing/DeleteSelectionCommand.cpp:
3390         (WebCore::DeleteSelectionCommand::DeleteSelectionCommand):
3391         (WebCore::DeleteSelectionCommand::preservesTypingStyle): Deleted.
3392         * editing/DeleteSelectionCommand.h:
3393         (WebCore::DeleteSelectionCommand::create):
3394         * editing/DictationCommand.cpp:
3395         (WebCore::DictationCommand::insertTextRunWithoutNewlines):
3396         (WebCore::DictationCommand::insertParagraphSeparator):
3397         * editing/EditAction.h:
3398         * editing/EditCommand.cpp:
3399         (WebCore::EditCommand::EditCommand):
3400         (WebCore::EditCommand::editingAction):