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