Consolidate logic for calculating scrollbar page step size
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2014-08-06  Brent Fulgham  <bfulgham@apple.com>
2
3         Consolidate logic for calculating scrollbar page step size
4         https://bugs.webkit.org/show_bug.cgi?id=135670
5
6         Reviewed by Simon Fraser.
7
8         Consolidate the calculation of the scroll step size into a single place.
9         Improve the handling of sub-pixel layout behavior by performing proper
10         rounding on the fractional scroll ranges.
11
12         * editing/EditorCommand.cpp:
13         (WebCore::verticalScrollDistance): Switch to Scrollbar::pageStep method.
14         * platform/ScrollAnimator.cpp:
15         (WebCore::ScrollAnimator::handleWheelEvent): Ditto.
16         * platform/ScrollView.cpp:
17         (WebCore::ScrollView::updateScrollbars): Ditto.
18         * platform/Scrollbar.h:
19         (WebCore::Scrollbar::pageStep): Added.
20         (WebCore::Scrollbar::pageStepDelta): Added.
21         * rendering/RenderLayer.cpp:
22         (WebCore::RenderLayer::updateScrollbarsAfterLayout): Switch to Scrollbar method.
23
24 2014-08-06  Brian J. Burg  <burg@cs.washington.edu>
25
26         Web Replay: dispatch timing information should be stored out-of-line in a replay segment
27         https://bugs.webkit.org/show_bug.cgi?id=135295
28
29         Reviewed by Timothy Hatcher.
30
31         We need to save a timestamp for each event loop input so that replay can
32         simulate the original user and network delays. Currently that timestamp
33         is stored on each EventLoopInput instance.
34
35         This patch stores timestamp data in a separate vector attached to the segment.
36         The event loop input class is now immutable, and new auxiliary data can be added
37         without adding members to the EventLoopInput class.
38
39         As part of the refactoring, InputCursors now keep a reference to the relevant
40         session segment instead of a reference to their input storage. InputCursors can
41         be created directly, instead of through ReplaySessionSegment.
42
43         No new tests. No behavior was changed.
44
45         * inspector/InspectorReplayAgent.cpp:
46         (WebCore::buildInspectorObjectForInput): Don't send the timestamp with the input.
47         (WebCore::buildInspectorObjectForSegment):
48         * inspector/protocol/Replay.json: Remove optional timestamp field for ReplayInput.
49         * replay/CapturingInputCursor.cpp:
50         (WebCore::CapturingInputCursor::CapturingInputCursor):
51         (WebCore::CapturingInputCursor::create):
52         (WebCore::CapturingInputCursor::storeInput): Save event loop input timings here.
53         * replay/CapturingInputCursor.h:
54         * replay/EventLoopInput.h:
55         (WebCore::EventLoopInputBase::EventLoopInputBase): Deleted.
56         (WebCore::EventLoopInputBase::timestamp): Deleted.
57         (WebCore::EventLoopInputBase::setTimestamp): Deleted.
58         * replay/EventLoopInputDispatcher.cpp: Use a struct for dispatch information.
59         (WebCore::EventLoopInputDispatcher::EventLoopInputDispatcher):
60         (WebCore::EventLoopInputDispatcher::dispatchInputSoon):
61         (WebCore::EventLoopInputDispatcher::dispatchInput):
62         * replay/EventLoopInputDispatcher.h:
63         * replay/FunctorInputCursor.h:
64         (WebCore::FunctorInputCursor::forEachInputInQueue):
65         (WebCore::FunctorInputCursor::FunctorInputCursor):
66         * replay/ReplayController.cpp:
67         (WebCore::ReplayController::createSegment):
68         (WebCore::ReplayController::loadSegmentAtIndex):
69         (WebCore::ReplayController::unloadSegment): Deleted.
70         (WebCore::ReplayController::startPlayback): Deleted.
71         * replay/ReplaySessionSegment.cpp:
72         (WebCore::ReplaySessionSegment::createCapturingCursor): Deleted.
73         (WebCore::ReplaySessionSegment::createReplayingCursor): Deleted.
74         (WebCore::ReplaySessionSegment::createFunctorCursor): Deleted.
75         * replay/ReplaySessionSegment.h:
76         (WebCore::ReplaySessionSegment::storage):
77         (WebCore::ReplaySessionSegment::eventLoopTimings):
78         * replay/ReplayingInputCursor.cpp:
79         (WebCore::ReplayingInputCursor::ReplayingInputCursor):
80         (WebCore::ReplayingInputCursor::create):
81         (WebCore::ReplayingInputCursor::uncheckedLoadInput):
82         (WebCore::ReplayingInputCursor::loadEventLoopInput): Added. This method collates
83         and returns the next event loop input with its associated dispatch information.
84         * replay/ReplayingInputCursor.h:
85
86 2014-08-06  Tim Horton  <timothy_horton@apple.com>
87
88         Document-relative overlays disappear after doing page-cache navigations
89         https://bugs.webkit.org/show_bug.cgi?id=135669
90         <rdar://problem/17929171>
91
92         Reviewed by Simon Fraser.
93
94         * rendering/RenderLayerCompositor.cpp:
95         (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
96         When navigating from one page to another, the document-relative overlay
97         layer is moved from the layer tree of the RenderLayerCompositor of the
98         first RenderView to the layer tree of the RenderLayerCompositor of the
99         new RenderView, upon layer tree construction.
100         When going "back" via a page cache navigation, we don't rebuild the
101         layer tree, and just assume that it is in a valid state.
102         However, the document-relative overlay layer was *moved*, and as such,
103         needs to be moved back. To do this, reattach the document-relative
104         overlay layer whenever the root layer attachment of a RenderLayerCompositor
105         changes, which will happen in the right order when going back to a cached page.
106
107 2014-08-06  Filip Pizlo  <fpizlo@apple.com>
108
109         Merge r171389, r171495, r171508, r171510, r171605, r171606, r171611, r171614, r171763 from ftlopt.
110
111     2014-08-06  Mark Hahnenberg  <mhahnenberg@apple.com>
112     
113             Refactor our current implementation of for-in
114             https://bugs.webkit.org/show_bug.cgi?id=134142
115     
116             Reviewed by Filip Pizlo.
117     
118             No new tests.
119     
120             This patch splits for-in loops into three distinct parts:
121     
122             - Iterating over the indexed properties in the base object.
123             - Iterating over the Structure properties in the base object.
124             - Iterating over any other enumerable properties for that object and any objects in the prototype chain.
125      
126             It does this by emitting these explicit loops in bytecode, using a new set of bytecodes to 
127             support the various operations required for each loop.
128     
129             * bindings/js/JSDOMWindowCustom.cpp:
130             (WebCore::JSDOMWindow::getEnumerableLength):
131             (WebCore::JSDOMWindow::getStructurePropertyNames):
132             (WebCore::JSDOMWindow::getGenericPropertyNames):
133             * bindings/scripts/CodeGeneratorJS.pm:
134             (GenerateHeader):
135             * bridge/runtime_array.cpp:
136             (JSC::RuntimeArray::getOwnPropertyNames):
137     
138 2014-08-06  Alexey Proskuryakov  <ap@apple.com>
139
140         REGRESSION (WebKit2): iOS Safari default encoding doesn't follow system language
141         https://bugs.webkit.org/show_bug.cgi?id=135667
142         <rdar://problem/17862892>
143
144         Reviewed by Anders Carlsson.
145
146         Moved a function that computes default encoding from WebKit to WebCore, so that
147         it could be shared with WebKit2.
148
149         * WebCore.exp.in:
150         * platform/ios/WebCoreSystemInterfaceIOS.mm:
151         * platform/mac/WebCoreSystemInterface.h:
152         * platform/mac/WebCoreSystemInterface.mm:
153         * platform/text/TextEncodingRegistry.cpp:
154         (WebCore::defaultTextEncodingNameForSystemLanguage):
155         * platform/text/TextEncodingRegistry.h:
156
157 2014-08-06  Andreas Kling  <akling@apple.com>
158
159         Remove unused RenderBox::reflectionBox().
160         <https://webkit.org/b/135661>
161
162         Reviewed by Antti Koivisto.
163
164         * rendering/RenderBox.cpp:
165         (WebCore::RenderBox::reflectionBox): Deleted.
166         * rendering/RenderBox.h:
167
168 2014-08-06  Brian J. Burg  <burg@cs.washington.edu>
169
170         Web Inspector: convert ReplayManager to a promise-based API
171         https://bugs.webkit.org/show_bug.cgi?id=135249
172
173         Reviewed by Timothy Hatcher.
174
175         Fix some assertions to match ReplayController's preconditions.
176
177         * inspector/InspectorReplayAgent.cpp:
178         (WebCore::InspectorReplayAgent::replayToPosition):
179         (WebCore::InspectorReplayAgent::replayToCompletion):
180
181 2014-08-05  Brent Fulgham  <bfulgham@apple.com>
182
183         [Mac] Unable to scroll to bottom of nested scrollable areas
184         https://bugs.webkit.org/show_bug.cgi?id=135637
185         <rdar://problem/17910241>
186
187         Reviewed by Zalan Bujtas.
188
189         Test: platform/mac/fast/scrolling/scroll-latched-nested-div.html
190
191         Avoid truncating the fractional portion of scroll ranges.
192
193         * rendering/RenderLayer.cpp:
194         (WebCore::RenderLayer::updateScrollbarsAfterLayout): Round
195         the LayoutUnit values for scroll width and height rather than
196         truncating.
197
198 2014-08-06  Andy Estes  <aestes@apple.com>
199
200         [iOS] QuickLook returns an invalid MIME type for some documents
201         https://bugs.webkit.org/show_bug.cgi?id=135651
202
203         Reviewed by David Kilzer.
204
205         r172151 ensured that we ignore QuickLook delegate messages after an error, but neglected to do so for
206         connectionDidFinishLoading:. Do not call ResourceLoader::didFinishLoading() if an error has occurred.
207
208         * platform/network/ios/QuickLook.mm:
209         (-[WebResourceLoaderQuickLookDelegate connectionDidFinishLoading:]):
210
211 2014-08-06  Commit Queue  <commit-queue@webkit.org>
212
213         Unreviewed, rolling out r172155.
214         https://bugs.webkit.org/show_bug.cgi?id=135659
215
216         ChangeLog and commit message are wrong (Requested by estes on
217         #webkit).
218
219         Reverted changeset:
220
221         "Unreviewed, rolling out r172145."
222         https://bugs.webkit.org/show_bug.cgi?id=135657
223         http://trac.webkit.org/changeset/172155
224
225 2014-07-28  Myles C. Maxfield  <mmaxfield@apple.com>
226
227         Unreviewed build fix
228
229         * rendering/TextPainter.cpp: Used incorrect variable name
230  
231 2014-08-06  Commit Queue  <commit-queue@webkit.org>
232
233         Unreviewed, rolling out r172145.
234         https://bugs.webkit.org/show_bug.cgi?id=135657
235
236         caused 1 API test to fail (Requested by zalan on #webkit).
237
238         Reverted changeset:
239
240         "Cleanup InlineTextBox::paintSelection and
241         ::localSelectionRect."
242         https://bugs.webkit.org/show_bug.cgi?id=135631
243         http://trac.webkit.org/changeset/172145
244
245 2014-07-28  Myles C. Maxfield  <mmaxfield@apple.com>
246
247         Text-shadow with (0, 0) offset and radius = 0 is ugly
248         https://bugs.webkit.org/show_bug.cgi?id=135357
249
250         Reviewed by Darin Adler.
251
252         Instead, check for this kind of shadow and don't draw it.
253
254         Test: fast/text/empty-shadow.html
255
256         * rendering/TextPainter.cpp:
257         (WebCore::isEmptyShadow): Does a shadow match these criteria?
258         (WebCore::paintTextWithShadows): If so, don't draw it.
259
260 2014-08-06  Andy Estes  <aestes@apple.com>
261
262         [iOS] QuickLook returns an invalid MIME type for some documents
263         https://bugs.webkit.org/show_bug.cgi?id=135651
264
265         Reviewed by David Kilzer.
266
267         In some cases QuickLook indicates a failure by returning a nil MIME type in -[QLPreviewConverter previewResponse]
268         rather than calling connection:didFailWithError:. Calling ResourceLoader::didReceiveResponse() with a response
269         containing a nil MIME type leads to a crash.
270
271         Stop loading the resource and display an error page if QuickLook cannot provide a MIME type for the converted response.
272
273         No new tests. QuickLook is not testable from WebKit.
274
275         * platform/network/ios/QuickLook.mm:
276         (-[WebResourceLoaderQuickLookDelegate _sendDidReceiveResponseIfNecessary]): Called ResourceLoader::didFail() if
277         MIME type was nil. Called ResourceLoader::didReceiveResponse() otherwise.
278         (-[WebResourceLoaderQuickLookDelegate connection:didReceiveDataArray:]): Called -_sendDidReceiveResponseIfNecessary.
279         (-[WebResourceLoaderQuickLookDelegate connection:didReceiveData:lengthReceived:]): Ditto.
280         (-[WebResourceLoaderQuickLookDelegate connection:didFailWithError:]): Ditto.
281
282 2014-08-06  Radu Stavila  <stavila@adobe.com>
283
284         REGRESSION (r163382): Overflow hidden for inner elements breaks blurring
285         https://bugs.webkit.org/show_bug.cgi?id=135318
286
287         Reviewed by Zalan Bujtas.
288
289         For elements with border radius, clipping must be applied using clipRoundedRect.
290         This regressed in r163382, when normal clipping started being applied also
291         for elements having border radius.
292
293         Test: fast/filter-image/clipped-filter.html
294
295         * rendering/RenderLayer.cpp:
296         (WebCore::RenderLayer::clipToRect):
297         (WebCore::RenderLayer::restoreClip):
298
299 2014-08-06  Zalan Bujtas  <zalan@apple.com>
300
301         Cleanup InlineTextBox::paintSelection and ::localSelectionRect.
302         https://bugs.webkit.org/show_bug.cgi?id=135631
303
304         Reviewed by Darin Adler.
305
306         Covered by existing tests.
307
308         * rendering/InlineTextBox.cpp: Ideally these 2 functions should share some more code.
309         (WebCore::InlineTextBox::localSelectionRect): Local coordinates should not be snapped/enclosed.
310         This change could potentially break some selections. Should that be the case, they need to be addressed
311         separately.
312         (WebCore::InlineTextBox::paint):
313         (WebCore::InlineTextBox::paintSelection): Minor cleanup.
314         * rendering/InlineTextBox.h:
315
316 2014-08-06  Carlos Garcia Campos  <cgarcia@igalia.com>
317
318         [GTK] Be able to disable gtk2 dependency
319         https://bugs.webkit.org/show_bug.cgi?id=135505
320
321         Reviewed by Gustavo Noronha Silva.
322
323         Do not build WebCorePlatformGTK2 when ENABLE_PLUGIN_PROCESS_GTK2
324         is OFF.
325
326         * PlatformGTK.cmake:
327
328 2014-08-06  Mark Lam  <mark.lam@apple.com>
329
330         Gardening: fix bindings test breakage for for r170564 merged in r172129.
331         <https://webkit.org/b/134333>
332
333         Not reviewed.
334
335         No new tests.
336
337         * bindings/scripts/test/JS/JSTestEventTarget.h:
338         (WebCore::JSTestEventTarget::create):
339
340 2014-08-06  Ryuan Choi  <ryuan.choi@samsung.com>
341
342         Unreviewed typo correction.
343
344         * bindings/scripts/CodeGeneratorJS.pm: removed unnecessary space.
345         (GenerateImplementation):
346
347 2014-08-05  James Craig  <jcraig@apple.com>
348
349         Web Inspector: AXI: Add label string once AccessibilityObject::computedLabel() is available
350         https://bugs.webkit.org/show_bug.cgi?id=129940
351
352         Reviewed by Chris Fleizach.
353
354         Test: inspector-protocol/dom/getAccessibilityPropertiesForNode-expected.txt
355
356         * accessibility/AccessibilityObject.cpp: Fixed crash.
357         (WebCore::AccessibilityObject::accessibilityComputedLabel): 
358         * accessibility/AccessibilityObject.h: Method name update.
359         * inspector/InspectorDOMAgent.cpp: New support for getting Node label from AccessibilityObject.
360         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
361
362 2014-07-29  Filip Pizlo  <fpizlo@apple.com>
363
364         Merge r170564, r170571, r170604, r170628, r170672, r170680, r170724, r170728, r170729, r170819, r170821, r170836, r170855, r170860, r170890, r170907, r170929, r171052, r171106, r171152, r171153, r171214 from ftlopt.
365
366     2014-07-01  Mark Lam  <mark.lam@apple.com>
367     
368             [ftlopt] DebuggerCallFrame::scope() should return a DebuggerScope.
369             <https://webkit.org/b/134420>
370     
371             Reviewed by Geoffrey Garen.
372     
373             No new tests.
374     
375             * ForwardingHeaders/debugger/DebuggerCallFrame.h: Removed.
376             - This is not in use.  Hence, we can remove it.
377             * bindings/js/ScriptController.cpp:
378             (WebCore::ScriptController::attachDebugger):
379             - We should acquire the JSLock before modifying a JS global object.
380     
381     2014-06-25  Filip Pizlo  <fpizlo@apple.com>
382     
383             [ftlopt] If a CodeBlock is jettisoned due to a watchpoint then it should be possible to figure out something about that watchpoint
384             https://bugs.webkit.org/show_bug.cgi?id=134333
385     
386             Reviewed by Geoffrey Garen.
387     
388             No new tests because no change in behavior.
389     
390             * bindings/scripts/CodeGeneratorJS.pm:
391             (GenerateHeader):
392     
393 2014-08-05  Ryuan Choi  <ryuan.choi@samsung.com>
394
395         Build break since r172093
396         https://bugs.webkit.org/show_bug.cgi?id=135636
397
398         Reviewed by Gyuyoung Kim.
399
400         Since r172093, AbstractView.idl is added in CMake Build but CodeGeneratorJS.pm does not take care of it.
401
402         No new tests required, no new functionality.
403
404         * bindings/scripts/CodeGeneratorJS.pm:
405         (ShouldGenerateToJSDeclaration):
406         (ShouldGenerateToJSImplementation):
407         (GetImplClassName): Added to rename implClassName to DOMWindow if interface name is AbstractView.
408         (GenerateHeader):
409         (GenerateImplementation):
410
411 2014-08-05  Nikos Andronikos  <nikos.andronikos-webkit@cisra.canon.com.au>
412
413         [CG] strokeRect does not honor lineJoin
414         https://bugs.webkit.org/show_bug.cgi?id=132948
415
416         Reviewed by Darin Adler.
417
418         Replaced use of CGContextStrokeRectWithWidth convenience function with explicit 
419         call to CGContextAddRect and CGContextStrokePath.  The convenience functions
420         CGContextStrokeRect and CGContextStrokeRectWithWidth fail to apply some attributes
421         (e.g. stroke join) of the graphics state in certain cases.
422
423         Test: fast/canvas/canvas-strokeRect-lineJoin.html
424
425         * platform/graphics/cg/GraphicsContextCG.cpp:
426         (WebCore::GraphicsContext::strokeRect):
427
428 2014-08-05  Brent Fulgham  <bfulgham@apple.com>
429
430         [Win] Build attempts to use ANGLE when not building WebGL.
431         https://bugs.webkit.org/show_bug.cgi?id=135630
432         <rdar://problem/135630>
433
434         Unreviewed build fix.
435
436         * platform/graphics/win/GraphicsContext3DWin.cpp: Move #include of GraphicsContext3D.h
437         inside USE(3D_GRAPHICS) guard.
438
439 2014-08-05  Simon Fraser  <simon.fraser@apple.com>
440
441         [iOS WK2] Crash going back on a specific tumblr blog (under ScrollingStateTree::removeNodeAndAllDescendants)
442         https://bugs.webkit.org/show_bug.cgi?id=135629
443         <rdar://problem/17802174>
444
445         Reviewed by Tim Horton.
446         
447         In r170198 I added an "orphan scrolling nodes" code path that sets aside subtrees
448         of scrolling nodes into an m_orphanedSubframeNodes map, which keeps them alive until
449         they get reparented or destroyed. The nodes in that subtree remain in m_stateNodeMap,
450         which holds raw pointers to them.
451         
452         However, ScrollingStateTree::commit() can clear m_orphanedSubframeNodes, which is
453         sometimes non-empty at this point. When that happened, we would destroy nodes which
454         were still referenced by m_stateNodeMap, with the result that a later query for the
455         same nodeID would hand back a pointer to a deleted object.
456         
457         Fix by calling recursiveNodeWillBeRemoved() on nodes in the m_orphanedSubframeNodes
458         before clearing it, which removes them and all their descendants from the state node map.
459
460         Test: platform/mac-wk2/tiled-drawing/scrolling/frames/orphaned-subtree.html
461
462         * page/scrolling/ScrollingStateTree.cpp:
463         (WebCore::ScrollingStateTree::clear):
464         (WebCore::ScrollingStateTree::commit):
465
466 2014-08-05  Peyton Randolph  <prandolph@apple.com>
467
468         Add the ability to force text to render in white, not just black
469         https://bugs.webkit.org/show_bug.cgi?id=135625
470
471         Reviewed by Beth Dakin.
472
473         This patch introduces PaintBehaviorForceWhiteText, a complement to PaintBehaviorForceBlackText. If
474         a client specifies both PaintBehaviorForceWhiteText and PaintBehaviorForceBlackText, the text will be
475         painted black.
476
477         No new tests.
478
479         * rendering/EllipsisBox.cpp:
480         (WebCore::EllipsisBox::paint): Use the forced text color to paint the text if requested.
481         * rendering/InlineTextBox.cpp:
482         (WebCore::InlineTextBox::paint): Disable the text shadow if a text color has been forced.
483         * rendering/PaintInfo.h:
484         (WebCore::PaintInfo::forceTextColor): 
485         Return true iff the client has requested to force a black or white text color.
486         (WebCore::PaintInfo::forceWhiteText):
487         Return true iff forcing white text has been requested.
488         (WebCore::PaintInfo::forcedTextColor): 
489         Return the forced text color. Currently only white and black are supported.
490         * rendering/PaintPhase.h:
491         * rendering/RenderLayer.cpp:
492         (WebCore::RenderLayer::paintLayerContents): Remove the forceBlackText-related code as it is redundant.
493         (WebCore::RenderLayer::paintForegroundForFragments): 
494         Remove forceBlackText parameter and infer the correct behavior from the given paint behavior.
495         * rendering/RenderLayer.h:
496         * rendering/TextPaintStyle.cpp:
497         (WebCore::computeTextPaintStyle): Use the forced text color if available.
498         (WebCore::computeTextSelectionPaintStyle): Use the forced text color if available.
499
500 2014-08-05  Alex Christensen  <achristensen@webkit.org>
501
502         More work on CMake.
503         https://bugs.webkit.org/show_bug.cgi?id=135620
504
505         Reviewed by Reviewed by Laszlo Gombos.
506
507         * CMakeLists.txt:
508         Added missing idls.
509         * PlatformMac.cmake:
510         Added additional include directories and source files.
511         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
512         * css/makeSelectorPseudoElementsMap.py:
513         The Windows distribution of gperf doesn't like single quotes for its key-positions parameters.
514         * page/Chrome.h:
515         Compile fix.
516
517 2014-08-05  Brian J. Burg  <burg@cs.washington.edu>
518
519         Web Inspector: ReplayManager shouldn't assume replay status when the inspector is opened
520         https://bugs.webkit.org/show_bug.cgi?id=135212
521
522         Reviewed by Timothy Hatcher.
523
524         The frontend should be able to introspect the session and segment state machines,
525         currently loaded segment and session identifiers, and replay position.
526
527         * inspector/InspectorReplayAgent.cpp:
528         (WebCore::buildInspectorObjectForSessionState): Added.
529         (WebCore::buildInspectorObjectForSegmentState): Added.
530         (WebCore::InspectorReplayAgent::currentReplayState): Added.
531         * inspector/InspectorReplayAgent.h:
532         * inspector/protocol/Replay.json: Add currentReplayState query command.
533         * replay/ReplayController.h: Add some accessors.
534
535 2014-08-05  Dean Jackson  <dino@apple.com>
536
537         [iOS] Media controls layout incorrectly in RTL content
538         https://bugs.webkit.org/show_bug.cgi?id=135621
539         <rdar://problem/17849206>
540
541         Reviewed by Eric Carlson.
542
543         Media controls should always layout in LTR mode, even when the
544         page content is RTL. There already was a rule to do this on
545         non-iOS systems, but it wasn't getting included for iOS.
546         In this case I put the rule on the composited parent of the
547         controls in order to maintain the padding of the control panel.
548         This should still leave the captions unaffected.
549
550         * Modules/mediacontrols/mediaControlsiOS.css:
551         (video::-webkit-media-controls-panel-composited-parent): Add direction: ltr.
552
553 2014-08-05  Brian J. Burg  <burg@cs.washington.edu>
554
555         Web Replay: rename protocol methods for getting replay session/segment data
556         https://bugs.webkit.org/show_bug.cgi?id=135618
557
558         Reviewed by Timothy Hatcher.
559
560         * inspector/InspectorReplayAgent.cpp:
561         (WebCore::InspectorReplayAgent::getSessionData):
562         (WebCore::InspectorReplayAgent::getSegmentData):
563         (WebCore::InspectorReplayAgent::getSerializedSession): Deleted.
564         (WebCore::InspectorReplayAgent::getSerializedSegment): Deleted.
565         * inspector/InspectorReplayAgent.h:
566         * inspector/protocol/Replay.json:
567
568 2014-08-05  Antti Koivisto  <antti@apple.com>
569
570         REGRESSION: Extremely flashy scrolling while a page is still loading (because of flush throttling)
571         https://bugs.webkit.org/show_bug.cgi?id=135603
572         <rdar://problem/17876385>
573         
574         This hit ASSERT(frame().isMainFrame()) in FrameView::updateLayerFlushThrottling
575         running scrollbars/scrollbar-iframe-click-does-not-blur-content.html and a few other tests.
576
577         * page/FrameView.cpp:
578         (WebCore::FrameView::setWasScrolledByUser): Only invoke updateLayerFlushThrottling for the main frame.
579
580 2014-08-05  Peyton Randolph  <prandolph@apple.com>
581
582         Rename MAC_LONG_PRESS feature flag to LONG_MOUSE_PRESS.
583         https://bugs.webkit.org/show_bug.cgi?id=135276
584
585         Reviewed by Beth Dakin.
586
587         No new tests. Just a compiler flag.
588
589         * Configurations/FeatureDefines.xcconfig:
590
591 2014-08-05  Dean Jackson  <dino@apple.com>
592
593         [Media iOS] Ensure there is a nice default fallback for missing wireless target names
594         https://bugs.webkit.org/show_bug.cgi?id=135488
595         <rdar://problem/17879156>
596
597         Reviewed by Antoine Quint.
598
599         Antoine found me on iMessage to tell me I'm an idiot and that I've
600         forgotten how to write JavaScript. Embarrassingly, this code is what
601         I originally had, but then second-guessed myself.
602
603         * Modules/mediacontrols/mediaControlsiOS.js:
604         (ControllerIOS.prototype.updateWirelessPlaybackStatus): No need for the local
605         variable or conditional statement, since null and "" both evaluate as false.
606
607 2014-08-05  Antti Koivisto  <antti@apple.com>
608
609         REGRESSION: Extremely flashy scrolling while a page is still loading (because of flush throttling)
610         https://bugs.webkit.org/show_bug.cgi?id=135603
611         <rdar://problem/17876385>
612
613         Reviewed by Andreas Kling.
614
615         * page/FrameView.cpp:
616         (WebCore::determineLayerFlushThrottleState):
617         
618             Disable throttling after user has scrolled the page.
619             This is consistent with the speculative tiling. It also gets enabled on first scroll.
620
621         (WebCore::FrameView::setWasScrolledByUser):
622
623 2014-08-05  Martin Hodovan  <mhodovan.u-szeged@partner.samsung.com>
624
625         ASSERTION FAILED: name[0] == '@' && length >= 2 in WebCore::CSSParser::detectAtToken
626         https://bugs.webkit.org/show_bug.cgi?id=134632
627
628         At-rules must consist of at least two characters: the '@' symbol followed by
629         an identifier name. The failure of this condition makes the assertion fail.
630
631         The length of an at-rule is currently calculated by pointer arithmetic on
632         the 'result' pointer, which is expected to be set to the end of the at-rule
633         identifier by the WebCore::*CSSTokenizer::parseIdentifier method.
634         If the at-rule token is a sequence of 8-bit-only characters then
635         'result' will point correctly at the end of the identifier. However, if
636         the at-rule contains a 16-bit Unicode escape then 'result' will not be
637         updated correctly anymore, hence it cannot be used for length calculation.
638         The patch makes the parseIdentifier bump the result pointer even in the 16-bit slow case.
639
640         Patch by Renata Hodovan, backported from Chromium: https://codereview.chromium.org/241053002
641
642         Reviewed by Darin Adler.
643
644         Test: fast/css/atrule-with-escape-character-crash.html
645
646         * css/CSSParser.cpp:
647         (WebCore::CSSParser::realLex):
648
649 2014-08-04  Andy Estes  <aestes@apple.com>
650
651         [iOS] The raw bytes of an iWork document's PDF preview are displayed rather than the PDF itself
652         https://bugs.webkit.org/show_bug.cgi?id=135596
653
654         Reviewed by David Kilzer.
655
656         Some iWork documents contain pre-rendered PDF previews. When WebKit asks QuickLook to convert such a document,
657         QuickLook will return this PDF as the converted response. However, until WebKit has sent the document's data to
658         QuickLook, -[QLPreviewConverter previewResponse] will misleadingly tell WebKit that the converted resource will
659         be of type 'text/html'. This leads WebKit to render the PDF preview as HTML.
660
661         Instead of querying QLPreviewConverter for the previewResponse before we've sent it any data, postpone calling
662         ResourceLoader::didReceiveResponse until we've begun to receive data via the QLPreviewConverter delegate. At
663         that point -[QLPreviewConverter previewResponse] will have the correct MIME type and we can call didReceiveResponse.
664
665         No new tests. QuickLook is not testable from WebKit.
666
667         * platform/network/ios/QuickLook.mm:
668         (-[WebResourceLoaderQuickLookDelegate connection:didReceiveDataArray:]): If didReceiveResponse has yet to be
669         called, call it now with QuickLookHandle::nsResponse().
670         (-[WebResourceLoaderQuickLookDelegate connection:didReceiveData:lengthReceived:]): Ditto.
671         (-[WebResourceLoaderQuickLookDelegate connection:didFailWithError:]): Ditto.
672         (-[WebResourceLoaderQuickLookDelegate connectionDidFinishLoading:]): Assert that didReceiveResponse has been called.
673         (-[WebResourceLoaderQuickLookDelegate clearHandle]): Cleared the raw pointer to QuickLookHandle.
674         (WebCore::QuickLookHandle::create): Pointed WebResourceLoaderQuickLookDelegate's quickLookHandle property to
675         the newly created QuickLookHandle.
676
677 2014-08-05  Renata Hodovan  <rhodovan.u-szeged@partner.samsung.com>
678
679         Fixing calc() parameter parsing in cubic-bezier functions
680         https://bugs.webkit.org/show_bug.cgi?id=135605
681
682         Reviewed by Andreas Kling.
683
684         Before this patch, calc values in cubic-bezier functions weren't being read correctly
685         since they were handled as simple floats.
686
687         This is a backport of my fix in Blink: https://codereview.chromium.org/369313002/
688
689         Test: css3/calc/cubic-bezier-with-multiple-calcs-crash.html.html
690
691         * css/CSSParser.cpp:
692         (WebCore::CSSParser::parseCubicBezierTimingFunctionValue):
693
694 2014-08-05  Jer Noble  <jer.noble@apple.com>
695
696         [MSE] Seeking occasionally causes many frames to be displayed in "fast forward" mode
697         https://bugs.webkit.org/show_bug.cgi?id=135422
698
699         Reviewed by Eric Carlson.
700
701         Three related fixes:
702
703         In reenqueueMediaForTime(), update TrackBuffer.lastEnqueuedPresentationTime when we flush
704         samples, so that the next time samples are re-enqueued, the starting point for re-enqueueing
705         is correct.
706
707         In sourceBufferPrivateDidReceiveSample(), do not add samples to the decode queue
708         if they are before the current media time.
709
710         When a seek is pending, but samples for the new time is not yet present in the SourceBuffer,
711         the SourceBufferPrivate may signal that it's ready for new samples through the
712         sourceBufferPrivateDidBecomeReadyForMoreSamples() method. In this situation, we should not
713         continue to provideMediaData(), as that will append samples from the prior-to-seeking media
714         timeline. Since the timeline may have moved forward due to the seek, a decoder may decide to
715         display those frames as quickly as possible (the "fast forward" behavior) in order to catch
716         up to the new current time.
717
718         If a re-enqueue is pending, don't provide media data in response to being notified that the
719         SourceBufferPrivate is ready for more samples. Wait until samples for the new current time
720         are appended.
721
722         Also, don't provide media data if we are waiting for a seek to complete.
723
724         * Modules/mediasource/MediaSource.h:
725         (WebCore::MediaSource::isSeeking): Convenience method.
726         * Modules/mediasource/SourceBuffer.cpp:
727         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
728         (WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples):
729         (WebCore::SourceBuffer::reenqueueMediaForTime):
730
731 2014-08-05  Chris Fleizach  <cfleizach@apple.com>
732
733         AX: Select text activity should return replaced text instead of previously selected text
734         https://bugs.webkit.org/show_bug.cgi?id=135595
735
736         Reviewed by Mario Sanchez Prada.
737
738         When the select activity API is used to replace text, the replacement string should be returned instead of the old selected text.
739
740         Updated existing test: platform/mac/accessibility/select-text.html
741
742         * accessibility/AccessibilityObject.cpp:
743         (WebCore::AccessibilityObject::selectText):
744
745 2014-08-04  Chris Fleizach  <cfleizach@apple.com>
746
747         AX: Select activity behavior does not work when an existing range is already selected
748         https://bugs.webkit.org/show_bug.cgi?id=135579
749
750         Reviewed by Mario Sanchez Prada.
751
752         If you have an existing range selected, and try to apply a select and replace operation, like capitalize,
753         searching for that range will fail because it skips the currently selected range.
754
755         For these cases, it seems the best way is to start the search from the start position, rather than relying on the
756         entire range.
757
758         Updated existing test: platform/mac/accessibility/select-text.html
759
760         * accessibility/AccessibilityObject.cpp:
761         (WebCore::AccessibilityObject::selectText):
762
763 2014-08-04  Jer Noble  <jer.noble@apple.com>
764
765         [MSE][Mac] Seeking past buffered range will not resume playback when seek completes.
766         https://bugs.webkit.org/show_bug.cgi?id=135591
767
768         Reviewed by Eric Carlson.
769
770         If a seek is delayed due to seeking into an unbuffered area, playback will not be restarted
771         at that point. Instead, playback must resume when enough media data has been added, and
772         the MediaSource indicates the seek should complete.
773
774         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
775         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekCompleted):
776
777 2014-08-04  Jer Noble  <jer.noble@apple.com>
778
779         [MSE] Videos will report a stall when within 1 frame-duration before the end of a movie.
780         https://bugs.webkit.org/show_bug.cgi?id=135586
781
782         Reviewed by Eric Carlson.
783
784         Under certain circumstances, videos which are within 1/24 seconds before the end of a media stream when
785         monitorSourceBuffers() is called will fail the hasFutureTime() check. This is because hasFutureTime()
786         checks whether enough media is buffered to play back at least some time in the future, but when the
787         current time is close to the duration, not enough data is buffered to satisfy that check.
788
789         Add some logic which will break out early when the SourceBuffer has buffered up to and including the
790         media's duration, and return that the buffer indeed hasFutureTime() available.
791
792         * Modules/mediasource/SourceBuffer.cpp:
793         (WebCore::SourceBuffer::hasFutureTime):
794
795 2014-08-04  Benjamin Poulain  <benjamin@webkit.org>
796
797         Simplify the StyleInvalidation mode of rule collection
798         https://bugs.webkit.org/show_bug.cgi?id=135521
799
800         Reviewed by Antti Koivisto.
801
802         There are two branches where StyleInvalidation code is removed:
803         -Pseudo elements for shadow dom elements.
804         -Pseudo elements without dom tree counterpart.
805
806         The first can never be hit because StyleInvalidationAnalysis does a complete invalidation
807         when there is any shadow dom styling involved in the stylesheets.
808
809         Even if that branch was hit, not failing on custom pseudo elements would be equivalent
810         to ignoring those pseudo elements from the Selector. By doing so, we would match elements
811         that do not have shadow dom and invalidate pretty much everything.
812
813         Unlike pseudo elements without real elements, shadow dom elements are not matched separately with a different
814         context, thus we could generalize StyleInvalidationAnalysis to handle this case.
815
816
817         The second case handle pseudo elements that do not have a real element. That case no longer need to be handled
818         separately at the filter time, it has become a special case of SelectorChecker::match() after everything else
819         has matched.
820
821         The only condition for this to work is that the Context's pseudoId must be NOPSEUDO. This is the case
822         in practice since matching specific pseudo types would be a waste of time. ElementRuleCollector::collectMatchingRules()
823         has a new assertion to enforce that.
824
825         Test: fast/css/stylesheet-change-updates-pseudo-elements.html
826
827         * css/ElementRuleCollector.cpp:
828         (WebCore::ElementRuleCollector::collectMatchingRules):
829         * css/SelectorChecker.cpp:
830         (WebCore::SelectorChecker::matchRecursively):
831         * cssjit/SelectorCompiler.cpp:
832         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateRequestedPseudoElementEqualsToSelectorPseudoElement):
833
834 2014-08-04  Benjamin Poulain  <benjamin@webkit.org>
835
836         Add a flag for the CSS Selectors level 4 implementation
837         https://bugs.webkit.org/show_bug.cgi?id=135535
838
839         Reviewed by Andreas Kling.
840
841         * Configurations/FeatureDefines.xcconfig:
842
843 2014-08-04  Chris Fleizach  <cfleizach@apple.com>
844
845         AX: add AccessibilityObject::computedLabelString() for WebAXI
846         https://bugs.webkit.org/show_bug.cgi?id=129939
847
848         Reviewed by Mario Sanchez Prada.
849
850         Provide a method that the WebKit Inspector can call in order to 
851         display an accessible name for an AX node.
852
853         * accessibility/AccessibilityObject.cpp:
854         (WebCore::AccessibilityObject::accessibilityComputedLabel):
855         * accessibility/AccessibilityObject.h:
856
857 2014-08-04  Tim Horton  <timothy_horton@apple.com>
858
859         Lots of crashes in WebKit1 after r172013.
860         https://bugs.webkit.org/show_bug.cgi?id=135582
861         <rdar://problem/17837636>
862
863         Reviewed by Enrica Casucci.
864
865         * editing/SelectionRectGatherer.cpp:
866         (WebCore::SelectionRectGatherer::addRect):
867         (WebCore::SelectionRectGatherer::addGapRects):
868         Don't try to do local-to-absolute coordinate conversion if we don't have
869         a repaint container, which happens a lot in WebKit1.
870
871 2014-08-04  Alex Christensen  <achristensen@webkit.org>
872
873         Progress towards CMake on Mac.
874         https://bugs.webkit.org/show_bug.cgi?id=135528
875
876         Reviewed by Gyuyoung Kim.
877
878         * PlatformMac.cmake: Added.
879
880 2014-08-04  Tim Horton  <timothy_horton@apple.com>
881
882         Selection services menu dropdown is in the wrong place when selecting some text on Yelp
883         https://bugs.webkit.org/show_bug.cgi?id=135582
884         <rdar://problem/17837636>
885
886         Reviewed by Simon Fraser.
887
888         * editing/SelectionRectGatherer.cpp:
889         (WebCore::SelectionRectGatherer::addRect):
890         (WebCore::SelectionRectGatherer::addGapRects):
891         (WebCore::SelectionRectGatherer::addRects): Deleted.
892         Rename addRects to addGapRects for clarity.
893         Map rects and gapRects to absolute RenderView coordinates so that
894         they are in a form WebKit2 can use. Previously they were sometimes
895         relative to a different repaint container, but that information was
896         lost when moving through SelectionRectGatherer.
897
898         Ideally we would keep selection rects as full quads instead of rects
899         for more of their life, but that problem is much deeper than just SelectionRectGatherer.
900
901         * editing/SelectionRectGatherer.h:
902         Add a comment clarifying the coordinate space of the stored selection rects.
903
904         * rendering/RenderView.cpp:
905         (WebCore::RenderView::applySubtreeSelection):
906         Rename addRects to addGapRects for clarity.
907
908 2014-08-04  Bem Jones-Bey  <bjonesbe@adobe.com>
909
910         [CSS Shapes] shape-margin not respected when it extends beyond an explicitly set margin
911         https://bugs.webkit.org/show_bug.cgi?id=135308
912
913         Reviewed by Dean Jackson.
914
915         When a zero height line is supplied and the image shape extends into
916         the margin box (only possible when a shape-margin is supplied), then
917         only an empty interval was being returned. This patch makes it
918         properly return the interval for the line in question.
919
920         Test: fast/shapes/shape-outside-floats/shape-outside-image-shape-margin.html
921
922         * rendering/shapes/RasterShape.cpp:
923         (WebCore::RasterShape::getExcludedIntervals): Handle the zero height
924         line case.
925
926 2014-08-04  Zalan Bujtas  <zalan@apple.com>
927
928         Subpixel rendering: InlineTextBox mistakenly rounds offset value before painting.
929         https://bugs.webkit.org/show_bug.cgi?id=135470
930
931         Reviewed by Simon Fraser.
932
933         This patch removes the premature paint offset adjustment for inlines. Premature snapping
934         could alter the final painting coordinates and push content to wrong positions.
935
936         This patch also enforces WebCore's pixel snapping strategy (round) on text painting.
937         It ensures that text positioning is in sync with other painting related operations including
938         clipping, box decorations etc. Underlying graphics libraries can take different directions on
939         text snapping, for example CG ceils text coordinates vertically (in horizontal context,
940         with the current settings). It can lead to undesired side effects.
941
942         Test: fast/inline/hidpi-inline-selection-leaves-gap.html
943
944         * rendering/InlineTextBox.cpp:
945         (WebCore::InlineTextBox::paint):
946         * rendering/RenderLayer.cpp:
947         (WebCore::RenderLayer::calculateClipRects): wrong direction used at r171896.
948         * rendering/SimpleLineLayoutFunctions.cpp: we don't paint vertical content here.
949         (WebCore::SimpleLineLayout::paintFlow):
950
951 2014-08-04  Jer Noble  <jer.noble@apple.com>
952
953         Unreviewed, rolling out r171992, r171995, & r172000.
954
955         The cumulative effect of those revisions was to cause decoding errors when switching resolutions on YouTube.
956
957         Reverted changesets:
958
959         https://bugs.webkit.org/show_bug.cgi?id=135422 / http://trac.webkit.org/changeset/171992
960         https://bugs.webkit.org/show_bug.cgi?id=135424 / http://trac.webkit.org/changeset/171995
961         https://bugs.webkit.org/show_bug.cgi?id=135572 / http://trac.webkit.org/changeset/172000
962
963 2014-08-04  Joseph Pecoraro  <pecoraro@apple.com>
964
965         Always clear ConsoleClient when Page/WindowShell is destroyed
966         https://bugs.webkit.org/show_bug.cgi?id=135569
967
968         Reviewed by Mark Lam.
969
970         * bindings/js/ScriptController.cpp:
971         (WebCore::ScriptController::~ScriptController):
972         Whenever a window shell goes away, clear the console client.
973         We did this in clearWindowShell but not before destroying.
974
975 2014-08-04  Chris Fleizach  <cfleizach@apple.com>
976
977         AX: isWordEndMatch should allow for multiple word selections
978         https://bugs.webkit.org/show_bug.cgi?id=135573
979
980         Reviewed by Mario Sanchez Prada.
981
982         isWordEndMatch was searching from the beginning of the selected range, which meant
983         that if the result was multiple words, we'd reject the result. 
984         Instead, we should search from the end of the range, so that we encompass all words.
985
986         Modified existing test: platform/mac/accessibility/select-text-should-match-whole-words.html
987
988         * editing/TextIterator.cpp:
989         (WebCore::SearchBuffer::isWordEndMatch):
990
991 2014-08-04  Chris Fleizach  <cfleizach@apple.com>
992
993         AX: Secure text fields need to support Search parameterized attributes
994         https://bugs.webkit.org/show_bug.cgi?id=135568
995
996         Reviewed by Mario Sanchez Prada.
997  
998         Secure text fields still need to support the fast searching that WebKit exposes, even though they don't support
999         other parameterized attributes.
1000   
1001         Test: platform/mac/accessibility/secure-text-field-supports-fast-search.html
1002
1003         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1004         (-[WebAccessibilityObjectWrapper accessibilityParameterizedAttributeNames]):
1005
1006 2014-08-04  Jer Noble  <jer.noble@apple.com>
1007
1008         [MSE] Further fixes for "fast forward" playback after seeking in YouTube behavior.
1009         https://bugs.webkit.org/show_bug.cgi?id=135572
1010
1011         Reviewed by Eric Carlson.
1012
1013         Two related fixes:
1014
1015         In reenqueueMediaForTime(), update TrackBuffer.lastEnqueuedPresentationTime when we flush samples, so that
1016         the next time samples are re-enqueued, the starting point for re-enqueueing is correct.
1017
1018         In sourceBufferPrivateDidReceiveSample(), do not add samples to the decode queue if they are before the
1019         current media time.
1020
1021         * Modules/mediasource/SourceBuffer.cpp:
1022         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
1023         (WebCore::SourceBuffer::reenqueueMediaForTime):
1024
1025 2014-08-04  Matt Baker  <mattbaker@apple.com>
1026
1027         Web Inspector: All-caps CSS properties are not shown in Computed pane
1028         https://bugs.webkit.org/show_bug.cgi?id=133700
1029
1030         Reviewed by Timothy Hatcher.
1031
1032         * inspector/InspectorStyleSheet.cpp:
1033         (WebCore::InspectorStyle::styleWithProperties):
1034
1035 2014-08-04  Chris Fleizach  <cfleizach@apple.com>
1036
1037         AX: SelectText functionality always selects text after current selection even if closer selection is behind it
1038         https://bugs.webkit.org/show_bug.cgi?id=135546
1039
1040         Reviewed by Mario Sanchez Prada.
1041
1042         Logic was incorrect for comparing ranges found before the current selection.
1043         ASSERT was incorrect for allowed ranges. We need to allow ranges that are right at the boundaries of our found ranges.
1044
1045         Extended existing test: platform/mac/accessibility/select-text.html
1046
1047         * accessibility/AccessibilityObject.cpp:
1048         (WebCore::rangeClosestToRange):
1049
1050 2014-08-04  Chris Fleizach  <cfleizach@apple.com>
1051
1052         AX: AXSelectTextWithCriteriaParameterizedAttribute incorrectly selects the beginning letters of a word
1053         https://bugs.webkit.org/show_bug.cgi?id=135547
1054
1055         Reviewed by Mario Sanchez Prada.
1056
1057         Allow text search to specify that it wants to match end of words as well as start of words.
1058         This allows select text criteria to match on whole words only.
1059
1060         Test: platform/mac/accessibility/select-text-should-match-whole-words.html
1061
1062         * accessibility/AccessibilityObject.cpp:
1063         (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection):
1064         * editing/FindOptions.h:
1065         * editing/TextIterator.cpp:
1066         (WebCore::SearchBuffer::isWordEndMatch):
1067         (WebCore::SearchBuffer::search):
1068
1069 2014-08-04  Jer Noble  <jer.noble@apple.com>
1070
1071         [MSE] Re-enqueing due to overlapping appended samples can cause stuttering playback
1072         https://bugs.webkit.org/show_bug.cgi?id=135424
1073
1074         Reviewed by Eric Carlson.
1075
1076         If it become necessary to re-enqueue samples (due to appending overlapping samples which cause
1077         existing samples to be removed), the previous behavior was to flush and re-enqueue the new
1078         samples dependencies; i.e., everything up to and including the previous sync sample. This causes
1079         the decoder to visibly stall while it decodes those non-displaying samples, which could be
1080         a second or more worth of encoded video samples, depending on the frequency of sync samples.
1081
1082         Instead, when we are asked to re-enqueue, we will look for the next occurring sync sample.
1083         If found, we can switch over to the replacement samples at that point in the decode queue.
1084         This limits the overhead of a stream switch, and should allow for a visually seamless switch,
1085         at the cost of having to wait for the next sync sample to occur to affect the switch.
1086
1087         * Modules/mediasource/SourceBuffer.cpp:
1088         (WebCore::SourceBuffer::seekToTime): Clear the decode queue when seeking.
1089         (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete): Call reenqueueMediaForCurrentTime.
1090         (WebCore::SourceBuffer::reenqueueMediaForCurrentTime): Switch over to the new stream only
1091             at the next sync sample.
1092
1093 2014-08-04  Chris Fleizach  <cfleizach@apple.com>
1094
1095         AX: The Dictation command "Replace <phrase> with <phrase>" always capitalizes the replacement string
1096         https://bugs.webkit.org/show_bug.cgi?id=135557
1097
1098         Reviewed by Mario Sanchez Prada.
1099
1100         When replacing text, we should match the capitalization of the word being replaced 
1101         (unless the replacement looks like an abbreviation).   
1102  
1103         Test: platform/mac/accessibility/find-and-replace-match-capitalization.html
1104
1105         * accessibility/AccessibilityObject.cpp:
1106         (WebCore::AccessibilityObject::selectText):
1107
1108 2014-08-04  Pratik Solanki  <psolanki@apple.com>
1109
1110         QuickLook resources are cache-replaced with their original binary data causing ASSERT(m_data->size() == newBuffer->size()) in CachedResource.cpp
1111         https://bugs.webkit.org/show_bug.cgi?id=135548
1112         <rdar://problem/17891321>
1113
1114         Reviewed by David Kilzer.
1115
1116         When loading QuickLook resources, the SharedBuffer in the CachedResource is actually a
1117         converted representation of the real QuickLook resource. Replacing this with the actual
1118         network resource (which is what tryReplaceEncodedData() tried to do) is wrong and triggered
1119         asserts in the code.
1120
1121         Fix this by having CachedRawResource::mayTryReplaceEncodedData() return false if we are
1122         loading a QuickLook resource.
1123
1124         No new tests because we don't have a way to test QuickLook documents.
1125
1126         * loader/ResourceLoader.cpp:
1127         (WebCore::ResourceLoader::ResourceLoader):
1128         (WebCore::ResourceLoader::didCreateQuickLookHandle):
1129             Set a flag to indicate that we are loading a QuickLook document.
1130         * loader/ResourceLoader.h:
1131         (WebCore::ResourceLoader::isQuickLookResource):
1132         * loader/cache/CachedRawResource.cpp:
1133         (WebCore::CachedRawResource::CachedRawResource):
1134         (WebCore::CachedRawResource::finishLoading):
1135             Check if we were loading a QuickLook document and if so disable encoded data
1136             replacement.
1137         * loader/cache/CachedRawResource.h:
1138             Add a new bool field returned by mayTryReplaceEncodedData(). Default is true but it is
1139             set to false in finishLoading() if we were loading QuickLook document.
1140
1141 2014-08-04  Jer Noble  <jer.noble@apple.com>
1142
1143         [MSE] Seeking occasionally causes many frames to be displayed in "fast forward" mode
1144         https://bugs.webkit.org/show_bug.cgi?id=135422
1145
1146         Reviewed by Eric Carlson.
1147
1148         When a seek is pending, but samples for the new time is not yet present in the SourceBuffer,
1149         the SourceBufferPrivate may signal that it's ready for new samples through the
1150         sourceBufferPrivateDidBecomeReadyForMoreSamples() method. In this situation, we should not
1151         continue to provideMediaData(), as that will append samples from the prior-to-seeking media
1152         timeline. Since the timeline may have moved forward due to the seek, a decoder may decide to
1153         display those frames as quickly as possible (the "fast forward" behavior) in order to catch
1154         up to the new current time.
1155
1156         If a re-enqueue is pending, don't provide media data in response to being notified that the
1157         SourceBufferPrivate is ready for more samples. Wait until samples for the new current time
1158         are appended.
1159
1160         * Modules/mediasource/SourceBuffer.cpp:
1161         (WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples):
1162         * dom/Document.cpp:
1163         (WebCore::Document::unregisterCollection):
1164
1165 2014-08-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1166
1167         [GTK] Install all unstable webkitdom headers
1168         https://bugs.webkit.org/show_bug.cgi?id=135544
1169
1170         Reviewed by Gustavo Noronha Silva.
1171
1172         We were checking whether generated file existed before they had
1173         been generated.
1174
1175         * PlatformGTK.cmake: Add Unstable.h header for all stable classes
1176         to GObjectDOMBindingsUnstable_INSTALLED_HEADERS and split the
1177         install command for stable and unstable headers making unstable
1178         headers optional.
1179
1180 2014-08-04  peavo@outlook.com  <peavo@outlook.com>
1181
1182         [WinCairo] Compile error in OpenTypeMathData.cpp.
1183         https://bugs.webkit.org/show_bug.cgi?id=135541
1184
1185         Reviewed by Brent Fulgham.
1186
1187         The SharedBuffer class needs to be defined.
1188         Also, the OpenTypeMathData constructor should be implemented when OPENTYPE_MATH is not enabled.
1189
1190         * platform/graphics/opentype/OpenTypeMathData.cpp:
1191
1192 2014-08-03  Dan Bernstein  <mitz@apple.com>
1193
1194         <rdar://problem/17782529> REGRESSION: OS marketing version in iOS Simulator user-agent string is the host OS’s
1195         https://bugs.webkit.org/show_bug.cgi?id=135549
1196
1197         Reviewed by Mark Rowe.
1198
1199         * platform/cocoa/SystemVersion.mm:
1200         (WebCore::createSystemMarketingVersion): On the iOS Simulator, locate the system Library
1201         directory relative to the Simulator root.
1202
1203 2014-08-02  Jeremy Jones  <jeremyj@apple.com>
1204
1205         Support both window and view based video fullscreen.
1206         https://bugs.webkit.org/show_bug.cgi?id=135525
1207
1208         Reviewed by Simon Fraser.
1209
1210         Presenting in a separate window gives greater flexibility for rotation separately from the app.
1211         Presenting in the same window works better if the interface is rehosted in another process.
1212
1213         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1214         (-[WebVideoFullscreenController enterFullscreen:]): Use clientRect instead of screenRect.
1215         * platform/ios/WebVideoFullscreenInterfaceAVKit.h: Add m_window and m_parentView.
1216         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: 
1217         (-[WebAVVideoLayer setBounds:]): Parent view might not be fullscreen; use window instead.
1218         (WebVideoFullscreenInterfaceAVKit::setupFullscreen): Conditionally create UIWindow and UIViewController for fullscreen.
1219         (WebVideoFullscreenInterfaceAVKit::enterFullscreen): Video, not the container should have black background.
1220         (WebVideoFullscreenInterfaceAVKit::exitFullscreen): Conditionally translate finalRect.
1221         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreen): Clean up UIWindow and force status bar to correct orientation.
1222         (WebVideoFullscreenInterfaceAVKit::invalidate): Clean up UIWindow.
1223         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen): Hide window and exit without animation.
1224         * platform/ios/WebVideoFullscreenModelMediaElement.mm:
1225         (WebVideoFullscreenModelMediaElement::setVideoFullscreenLayer): Apply frame, because it may have been set before the layer.
1226
1227 2014-08-02  Benjamin Poulain  <bpoulain@apple.com>
1228
1229         Update the SearchFieldResultsButtonElement shadow Pseudo Id when HTMLInputElement's maxResults change
1230         https://bugs.webkit.org/show_bug.cgi?id=135491
1231
1232         Reviewed by Ryosuke Niwa.
1233
1234         Replace the shadowPseudoId() override + manual style invalidation by the generic pseudo ID update.
1235
1236         * html/HTMLInputElement.cpp:
1237         (WebCore::HTMLInputElement::parseAttribute):
1238         * html/InputType.cpp:
1239         (WebCore::InputType::maxResultsAttributeChanged):
1240         * html/InputType.h:
1241         * html/SearchInputType.cpp:
1242         (WebCore::SearchInputType::SearchInputType):
1243         (WebCore::updateResultButtonPseudoType):
1244         (WebCore::SearchInputType::maxResultsAttributeChanged):
1245         (WebCore::SearchInputType::createShadowSubtree):
1246         (WebCore::SearchInputType::destroyShadowSubtree):
1247         * html/SearchInputType.h:
1248         * html/shadow/TextControlInnerElements.cpp:
1249         (WebCore::SearchFieldResultsButtonElement::shadowPseudoId): Deleted.
1250         * html/shadow/TextControlInnerElements.h:
1251
1252 2014-08-02  Benjamin Poulain  <bpoulain@apple.com>
1253
1254         Add warnings for the buggy implementations of shadowPseudoId()
1255         https://bugs.webkit.org/show_bug.cgi?id=135477
1256
1257         Reviewed by Ryosuke Niwa.
1258
1259         Dean is going to look into fixing media element styling.
1260         In the meantime, add warnings to prevent this from spreading.
1261
1262         * dom/Element.h:
1263         * html/shadow/SliderThumbElement.cpp:
1264         (WebCore::SliderThumbElement::shadowPseudoId):
1265         (WebCore::SliderContainerElement::shadowPseudoId):
1266
1267 2014-08-01  Commit Queue  <commit-queue@webkit.org>
1268
1269         Unreviewed, rolling out r171957.
1270         https://bugs.webkit.org/show_bug.cgi?id=135538
1271
1272         Caused GTK assertions and test failures (Requested by smfr on
1273         #webkit).
1274
1275         Reverted changeset:
1276
1277         "Clean up image subsampling code, make it less iOS-specific"
1278         https://bugs.webkit.org/show_bug.cgi?id=134916
1279         http://trac.webkit.org/changeset/171957
1280
1281 2014-08-01  Myles C. Maxfield  <litherum@gmail.com>
1282
1283         [CMake] Allow CMake to find GLib on FreeBSD
1284         https://bugs.webkit.org/show_bug.cgi?id=132530
1285
1286         Reviewed by Gustavo Noronha Silva.
1287
1288         On FreeBSD, glibconfig.h is at /usr/local/include/glib-2.0/glibconfig.h.
1289
1290         * Source/cmake/FindGLIB.cmake:
1291
1292 2014-08-01  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1293
1294         REGRESSION(r171942): [CMAKE] [GTK] build broken (clean build).
1295         https://bugs.webkit.org/show_bug.cgi?id=135522
1296
1297         Reviewed by Martin Robinson.
1298
1299         No new tests required, no new functionality.
1300
1301         * CMakeLists.txt: Add missing include to the inspector headers
1302         and fix the path to InspectorJSTypeBuilders.h
1303
1304 2014-08-01  Simon Fraser  <simon.fraser@apple.com>
1305
1306         Fix resource leak in FillLayersPropertyWrapper object member
1307         https://bugs.webkit.org/show_bug.cgi?id=135462
1308
1309         Reviewed by Andreas Kling.
1310
1311         Fix leak of m_fillLayerPropertyWrapper by using unique_ptr<>.
1312         Based on patch by Przemyslaw Kuczynski.
1313
1314         * page/animation/CSSPropertyAnimation.cpp:
1315         (WebCore::FillLayersPropertyWrapper::FillLayersPropertyWrapper):
1316
1317 2014-08-01  Simon Fraser  <simon.fraser@apple.com>
1318
1319         Clean up image subsampling code, make it less iOS-specific
1320         https://bugs.webkit.org/show_bug.cgi?id=134916
1321
1322         Reviewed by Dean Jackson.
1323
1324         Compile the image subsampling code on both Mac and iOS, and make it more platform
1325         neutral in general. Add a setting to allow it to be enabled on Mac for testing.
1326         
1327         The most significant changes are in ImageSourceCG and BitmapImageCG. CG's ImageSource
1328         is no longer stateful with respect to subsampling; its functions take a SubsamplingLevel
1329         when appropriate. CG's BitmapImage now determines which level of subsampling to use
1330         for a given frame, storing the subsampling level in the frame data. It can replace
1331         an aggressively subsampled frame with a less subsampled frame if necessary.
1332         
1333         To reduce the chances of subsampling affecting rendering, BitmapImage::size() now
1334         always returns the non-subsampled size; subsampling is strictly internal to BitmapImage.
1335         BitmapImage::draw() takes care of scaling the srcRect for subsampled images.
1336         
1337         iOS had a code path that enabled caching of frame metadata in BitmapImage without
1338         actually decoding the frame; make this cross-platform.
1339
1340         * WebCore.exp.in: Changed signature for GraphicsContext::drawNativeImage().
1341         * WebCore.xcodeproj/project.pbxproj: Added ImageSource.cpp, which is not built
1342         for Cocoa but useful for reference.
1343         * loader/cache/CachedImage.cpp:
1344         (WebCore::CachedImage::imageSizeForRenderer): Remove iOS-specific subsampling code.
1345         (WebCore::CachedImage::createImage): Call setAllowSubsampling() on the image if we
1346         can get to Settings (m_loader is null for image documents).
1347         (WebCore::CachedImage::currentFrameKnownToBeOpaque): This forced decode always
1348         caused creation of the non-subsampled image, so remove it. There's no reason to
1349         eagerly decode the frame here.
1350         * loader/cache/CachedImage.h: Fix comment.
1351         * page/Settings.cpp: Add defaultImageSubsamplingEnabled, true for iOS and false for Mac.
1352         * page/Settings.in: Added imageSubsamplingEnabled.
1353         * platform/graphics/BitmapImage.cpp:
1354         (WebCore::BitmapImage::BitmapImage): Init some more things. Default m_allowSubsampling to
1355         true for iOS to catch images created in code paths where we can't get to Settings.
1356         (WebCore::BitmapImage::haveFrameAtIndex): Handy helper.
1357         (WebCore::BitmapImage::cacheFrame): Now takes the subsampling level and whether to cache
1358         just metadata, or also the frame.
1359         (WebCore::BitmapImage::didDecodeProperties): No need to store originalSize.
1360         (WebCore::BitmapImage::updateSize): When we get the size for the first time, call
1361         determineMinimumSubsamplingLevel() to choose a reasonable subsampling level which takes
1362         platform-specific limits into account.
1363         (WebCore::BitmapImage::dataChanged): Comment.
1364         (WebCore::BitmapImage::ensureFrameIsCached): Take ImageFrameCaching into account.
1365         (WebCore::BitmapImage::frameAtIndex): Choose a subsampling level given the scale,
1366         then determine if we can use the currently cached frame, or whether we should resample.
1367         (WebCore::BitmapImage::frameIsCompleteAtIndex): Caching m_isComplete is now done when caching
1368         frame metadata.
1369         (WebCore::BitmapImage::frameDurationAtIndex):
1370         (WebCore::BitmapImage::frameHasAlphaAtIndex): The 'true' return is the safe return value.
1371         (WebCore::BitmapImage::frameOrientationAtIndex): Caching m_orientation is now done when caching
1372         frame metadata.
1373         (WebCore::BitmapImage::cacheFrameInfo): Deleted.
1374         (WebCore::BitmapImage::originalSize): Deleted.
1375         (WebCore::BitmapImage::originalSizeRespectingOrientation): Deleted.
1376         (WebCore::BitmapImage::currentFrameSize): Deleted.
1377         (WebCore::BitmapImage::ensureFrameInfoIsCached): Deleted.
1378         * platform/graphics/BitmapImage.h:
1379         (WebCore::FrameData::FrameData):
1380         * platform/graphics/GraphicsContext.h: No need to pass a scale param now.
1381         * platform/graphics/ImageSource.cpp: Non-Cocoa changes.
1382         (WebCore::ImageSource::subsamplingLevelForScale):
1383         (WebCore::ImageSource::allowSubsamplingOfFrameAtIndex):
1384         (WebCore::ImageSource::size):
1385         (WebCore::ImageSource::frameSizeAtIndex):
1386         (WebCore::ImageSource::createFrameAtIndex):
1387         (WebCore::ImageSource::frameBytesAtIndex):
1388         * platform/graphics/ImageSource.h: No longer stores subsampling state.
1389         (WebCore::ImageSource::isSubsampled): Deleted.
1390         * platform/graphics/cairo/BitmapImageCairo.cpp:
1391         (WebCore::BitmapImage::determineMinimumSubsamplingLevel):
1392         * platform/graphics/cg/BitmapImageCG.cpp:
1393         (WebCore::FrameData::clear):
1394         (WebCore::BitmapImage::BitmapImage): Init more members.
1395         (WebCore::BitmapImage::determineMinimumSubsamplingLevel): Choose a minimum subsampling
1396         level for the platform (subsample until the image area falls under a threshold).
1397         (WebCore::BitmapImage::checkForSolidColor): Don't bother decoding frames if the image
1398         is not 1x1. Also take care not to decode a non-subsampled image.
1399         (WebCore::BitmapImage::draw): The actual bug fix is here; remove logic that
1400         computed srcRectForCurrentFrame from m_size and m_originalSize; for some callers
1401         srcRect was computed using the pre-subsampled size, and for others it was the subsampled size.
1402         Instead, scale srcRect by mapping between the non-subsampled size, and the size of the CGImageRef
1403         which is affected by subsampling.
1404         (WebCore::BitmapImage::copyUnscaledFrameAtIndex):
1405         * platform/graphics/cg/GraphicsContext3DCG.cpp:
1406         (WebCore::GraphicsContext3D::ImageExtractor::extractImage): Remove #ifdeffed code.
1407         (WebCore::GraphicsContext3D::paintToCanvas):
1408         * platform/graphics/cg/GraphicsContextCG.cpp:
1409         (WebCore::GraphicsContext::drawNativeImage): No more weird scaling!
1410         * platform/graphics/cg/ImageBufferCG.cpp:
1411         (WebCore::ImageBuffer::draw):
1412         * platform/graphics/cg/ImageSourceCG.cpp:
1413         (WebCore::ImageSource::ImageSource):
1414         (WebCore::createImageSourceOptions): Helper that always returns a new CFDictionaryRef.
1415         (WebCore::imageSourceOptions): If not subsampling, return the cached CFDictionaryRef, otherwise
1416         make a new options dict and return it.
1417         (WebCore::ImageSource::subsamplingLevelForScale): Helper that returns a subsampling level
1418         between 0 and 3 given a scale.
1419         (WebCore::ImageSource::isSizeAvailable): SkipMetadata is a default value for the param now.
1420         (WebCore::ImageSource::allowSubsamplingOfFrameAtIndex): We turn off subsampling for progressive
1421         JPEGs because of a bug, so need this to know if a frame should be subsampled.
1422         (WebCore::ImageSource::frameSizeAtIndex): The looping to find a subsampling level is now in BitmapImageCG.
1423         (WebCore::ImageSource::orientationAtIndex):
1424         (WebCore::ImageSource::size): Always use a subsampling level of 0 for size().
1425         (WebCore::ImageSource::getHotSpot):
1426         (WebCore::ImageSource::repetitionCount):
1427         (WebCore::ImageSource::createFrameAtIndex): The caller mapped a scale to a level.
1428         (WebCore::ImageSource::frameDurationAtIndex):
1429         (WebCore::ImageSource::frameBytesAtIndex):
1430         (WebCore::ImageSource::imageSourceOptions): Deleted.
1431         (WebCore::ImageSource::originalSize): Deleted.
1432         * platform/graphics/mac/ImageMac.mm:
1433         (WebCore::BitmapImage::invalidatePlatformData): 0 -> nullptr
1434         * platform/graphics/wince/ImageWinCE.cpp:
1435         (WebCore::BitmapImage::determineMinimumSubsamplingLevel):
1436
1437 2014-08-01  Andreas Kling  <akling@apple.com>
1438
1439         Many DOM objects have InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero for no reason.
1440         <https://webkit.org/b/135519>
1441
1442         Don't set this structure flag unless the object actually has an override
1443         for getOwnPropertySlotByIndex().
1444
1445         Reviewed by Geoffrey Garen.
1446
1447         * bindings/scripts/CodeGeneratorJS.pm:
1448         (GenerateHeader):
1449         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
1450         * bindings/scripts/test/JS/JSTestException.h:
1451         * bindings/scripts/test/JS/JSTestInterface.h:
1452         * bindings/scripts/test/JS/JSTestObj.h:
1453         * bindings/scripts/test/JS/JSTestTypedefs.h:
1454
1455 2014-08-01  Myles C. Maxfield  <mmaxfield@apple.com>
1456
1457         SVG Font kerning can take an early out if the font has no kerning information
1458         https://bugs.webkit.org/show_bug.cgi?id=135524
1459
1460         Reviewed by Dean Jackson.
1461
1462         Rather than calling SVGFontElement::horizontalKerningForPairOfStringsAndGlyphs() again
1463         and again, skip the iteration entirely if every call would return 0.
1464
1465         No new tests because there is no behavior change.
1466
1467         * rendering/svg/SVGTextRunRenderingContext.cpp:
1468         (WebCore::SVGTextRunRenderingContext::applySVGKerning):
1469         * svg/SVGFontElement.h:
1470
1471 2014-08-01  Beth Dakin  <bdakin@apple.com>
1472
1473         Inspector highlights clipped at the bottom on the page in WK1 views with 
1474         contentInsets
1475         https://bugs.webkit.org/show_bug.cgi?id=135480
1476         -and corresponding-
1477         <rdar://problem/17850323>
1478
1479         Forgot to commit this one very critical part with 
1480         http://trac.webkit.org/changeset/171951 
1481
1482         * platform/ScrollView.cpp:
1483         (WebCore::ScrollView::unscaledVisibleContentSizeIncludingObscuredArea):
1484
1485 2014-08-01  Beth Dakin  <bdakin@apple.com>
1486
1487         Inspector highlights clipped at the bottom on the page in WK1 views with 
1488         contentInsets
1489         https://bugs.webkit.org/show_bug.cgi?id=135480
1490         -and corresponding-
1491         <rdar://problem/17850323>
1492
1493         Reviewed by Simon Fraser.
1494
1495         unscaledTotalVisibleContentSize() was the main function on Mac that was expected 
1496         to return the rect representing ALL visible content, including content that might 
1497         be in an inset area and obscured by UI elements. This patch re-names that function 
1498         to unscaledVisibleContentSizeIncludingObscuredArea(), and that patch makes that 
1499         function return the right thing in the platformWidget() case.
1500
1501         Re-name.
1502         * inspector/InspectorOverlay.cpp:
1503         (WebCore::InspectorOverlay::update):
1504
1505         Return platformVisibleContentSizeIncludingObscuredArea() for the platformWidget() 
1506         case and re-name.
1507         * platform/ScrollView.cpp:
1508         (WebCore::ScrollView::unscaledVisibleContentSizeIncludingObscuredArea):
1509
1510         This was just wrong. It was returning the big rectangle instead of the small one 
1511         for platformWidget().
1512         (WebCore::ScrollView::unscaledUnobscuredVisibleContentSize):
1513
1514         New platform functions.
1515         (WebCore::ScrollView::platformVisibleContentRectIncludingObscuredArea):
1516         (WebCore::ScrollView::platformVisibleContentSizeIncludingObscuredArea):
1517         (WebCore::ScrollView::unscaledTotalVisibleContentSize): Deleted.
1518         * platform/ScrollView.h:
1519         * platform/ios/ScrollViewIOS.mm:
1520         (WebCore::ScrollView::platformVisibleContentRectIncludingObscuredArea):
1521         (WebCore::ScrollView::platformVisibleContentSizeIncludingObscuredArea):
1522         * platform/mac/ScrollViewMac.mm:
1523         (WebCore::ScrollView::platformVisibleContentRect):
1524         (WebCore::ScrollView::platformVisibleContentSize):
1525         (WebCore::ScrollView::platformVisibleContentRectIncludingObscuredArea):
1526         (WebCore::ScrollView::platformVisibleContentSizeIncludingObscuredArea):
1527
1528         Re-name.
1529         * rendering/RenderLayerCompositor.cpp:
1530         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
1531         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
1532         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
1533         (WebCore::RenderLayerCompositor::ensureRootLayer):
1534
1535 2014-08-01  Myles C. Maxfield  <mmaxfield@apple.com>
1536
1537         SVGGlyph wastes space due to padding
1538         https://bugs.webkit.org/show_bug.cgi?id=135520
1539
1540         Reviewed by Dean Jackson.
1541
1542         Rearrange members in SVGGlyph so there is no wasted padding space.
1543
1544         No new tests because there is no behavior change.
1545
1546         * platform/graphics/SVGGlyph.h:
1547         (WebCore::SVGGlyph::SVGGlyph):
1548
1549 2014-07-31  Dean Jackson  <dino@apple.com>
1550
1551         [Media iOS] Ensure there is a nice default fallback for missing wireless target names
1552         https://bugs.webkit.org/show_bug.cgi?id=135488
1553         <rdar://problem/17879156>
1554
1555         Reviewed by Eric Carlson.
1556
1557         We occasionally run into cases where this.host.externalDeviceDisplayName
1558         is empty or null, creating a pretty ugly/confusing string in the
1559         wireless playback status screen.
1560
1561         If this happens, we should default to using "Apple TV".
1562
1563         * Modules/mediacontrols/mediaControlsiOS.js:
1564         (ControllerIOS.prototype.updateWirelessPlaybackStatus): Check if the externalDeviceDisplayName
1565         is empty or null, and fall back to "Apple TV" if so.
1566
1567 2014-07-30  Myles C. Maxfield  <mmaxfield@apple.com>
1568
1569         URLs in srcset attributes are not made absolute upon copy and paste
1570         https://bugs.webkit.org/show_bug.cgi?id=135448
1571
1572         Reviewed by Ryosuke Niwa.
1573
1574         When pasting, canonicalize URLs in srcset the same way we do with src.
1575
1576         Test: editing/pasteboard/img-srcset-copy-paste-canonicalization.html
1577
1578         * dom/Element.cpp:
1579         (WebCore::Element::completeURLsInAttributeValue): Initial implemention, moved from markup.cpp.
1580         * dom/Element.h:
1581         (WebCore::Element::attributeContainsURL): New function for completeURLs to call.
1582         (WebCore::Element::completeURLsInAttributeValue): Only called if attributeContainsURL returns
1583         true. Default implementation simply calls isURLAttribute().
1584         * editing/markup.cpp:
1585         (WebCore::completeURLs): Call attributeContainsURL() and completeURLsInAttributeValue() to
1586         complete the URL, so nodes can perform their own behavior.
1587         * html/HTMLImageElement.cpp:
1588         (WebCore::HTMLImageElement::attributeContainsURL): Return true for srcset.
1589         (WebCore::HTMLImageElement::completeUrlAttributeValue): Use our existing srcset parser to
1590         parse the srcset attribute, then use its output to canonicalize URLs, and build it back up
1591         into a string.
1592         * html/HTMLImageElement.h:
1593         (WebCore::HTMLImageElement::attributeContainsURL):
1594         (WebCore::HTMLImageElement::completeUrlAttributeValue):
1595         * html/parser/HTMLSrcsetParser.cpp: Make parseImageCandidatesFromSrcsetAttribute() public
1596         and change its signature to return its result.
1597         (WebCore::parseImageCandidatesFromSrcsetAttribute):
1598         * html/parser/HTMLSrcsetParser.h: Ditto.
1599
1600 2014-07-31  Andreas Kling  <akling@apple.com>
1601
1602         Remove the JSC::OverridesVisitChildren flag.
1603         <https://webkit.org/b/135489>
1604
1605         Tweak the bindings code generator to stop spitting out the flag.
1606
1607         Reviewed by Geoffrey Garen.
1608
1609         * bindings/js/JSDOMBinding.h:
1610         * bindings/js/JSDOMGlobalObject.cpp:
1611         (WebCore::JSDOMGlobalObject::visitChildren):
1612         * bindings/scripts/CodeGeneratorJS.pm:
1613         (GenerateHeader):
1614         (GenerateImplementation):
1615
1616 2014-08-01  Jer Noble  <jer.noble@apple.com>
1617
1618         [MSE][Mac] Volume is not remembered between items in a YouTube playlist
1619         https://bugs.webkit.org/show_bug.cgi?id=135479
1620
1621         Reviewed by Eric Carlson.
1622
1623         When an AVSampleBufferAudioRenderer is added to the player, set its -volume and -muted
1624         properties with the current values from the HTMLMediaElement. 
1625
1626         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1627         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer):
1628
1629 2014-08-01  Tim Horton  <timothy_horton@apple.com>
1630
1631         Fix the iOS build after r171891
1632
1633         * platform/ios/ScrollViewIOS.mm:
1634         (WebCore::ScrollView::platformTopContentInset):
1635         (WebCore::ScrollView::platformSetTopContentInset):
1636
1637 2014-08-01  Pratik Solanki  <psolanki@apple.com>
1638
1639         Remove EventNames.h include from header files
1640         https://bugs.webkit.org/show_bug.cgi?id=135486
1641
1642         Reviewed by Alexey Proskuryakov.
1643
1644         No new tests because no functional changes.
1645
1646         * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h:
1647         * Modules/gamepad/GamepadEvent.h:
1648         * Modules/indexeddb/IDBRequest.h:
1649         * Modules/indexeddb/IDBTransaction.h:
1650         * Modules/mediastream/RTCStatsResponse.h:
1651         * Modules/websockets/WebSocket.h:
1652         * css/FontLoader.h:
1653         * dom/SecurityPolicyViolationEvent.h:
1654         * loader/appcache/DOMApplicationCache.h:
1655         * workers/AbstractWorker.h:
1656         * workers/Worker.h:
1657         * workers/WorkerGlobalScope.h:
1658         * xml/XMLHttpRequest.h:
1659         * xml/XMLHttpRequestProgressEvent.h:
1660
1661 2014-08-01  Simon Fraser  <simon.fraser@apple.com>
1662
1663         nullptr goodness in RenderLayer
1664         https://bugs.webkit.org/show_bug.cgi?id=135512
1665
1666         Reviewed by Brent Fulgham.
1667
1668         Use nullptr in RenderLayer.
1669
1670         * rendering/RenderLayer.cpp:
1671         (WebCore::RenderLayer::RenderLayer):
1672         (WebCore::RenderLayer::updateDescendantDependentFlags):
1673         (WebCore::accumulateOffsetTowardsAncestor):
1674         (WebCore::RenderLayer::scrollRectToVisible):
1675         (WebCore::RenderLayer::destroyScrollbar):
1676         (WebCore::RenderLayer::paintLayerContents):
1677         (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows):
1678         (WebCore::RenderLayer::hitTestLayer):
1679         (WebCore::RenderLayer::hitTestList):
1680         (WebCore::RenderLayer::calculateClipRects):
1681
1682 2014-08-01  Tim Horton  <timothy_horton@apple.com>
1683
1684         Build fix for iOS
1685
1686         * bindings/objc/DOM.mm:
1687         (-[DOMRange renderedImageForcingBlackText:renderedImageForcingBlackText:]):
1688         We use CGImageRef instead of NSImage here on iOS.
1689
1690 2014-08-01  Renato Nagy  <nagy.renato@stud.u-szeged.hu>
1691
1692         ASSERTION FAILED: listNode in WebCore::RenderListItem::updateListMarkerNumbers
1693         https://bugs.webkit.org/show_bug.cgi?id=134970
1694
1695         Reviewed by Zalan Bujtas.
1696
1697         Removed an unnecessary assert, because the null return value of enclosingList() is
1698         handled properly after this assert.
1699
1700         * rendering/RenderListItem.cpp:
1701         (WebCore::RenderListItem::updateListMarkerNumbers):
1702
1703 2014-08-01  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1704
1705         Replace DEPRECATED_DEFINE_STATIC_LOCAL with NeverDestroyed<T> in NavigatorContentUtils
1706         https://bugs.webkit.org/show_bug.cgi?id=135494
1707
1708         Reviewed by Andrei Bucur.
1709
1710         Use static NeverDestroyed<T> variables instead of the DEPRECATED_DEFINE_STATIC_LOCAL macro.
1711
1712         No new tests, no behavior changes.
1713
1714         * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
1715         (WebCore::customHandlersStateString):
1716         (WebCore::NavigatorContentUtils::isProtocolHandlerRegistered):
1717
1718 2014-07-31  Benjamin Poulain  <bpoulain@apple.com>
1719
1720         Remove shadowPseudoId() override from the shadow media controls
1721         https://bugs.webkit.org/show_bug.cgi?id=135474
1722
1723         Reviewed by Eric Carlson.
1724
1725         Small cleanup.
1726
1727         * html/shadow/MediaControlElementTypes.h:
1728         * html/shadow/MediaControlElements.cpp:
1729         (WebCore::MediaControlPanelElement::MediaControlPanelElement):
1730         (WebCore::MediaControlPanelEnclosureElement::MediaControlPanelEnclosureElement):
1731         (WebCore::MediaControlOverlayEnclosureElement::MediaControlOverlayEnclosureElement):
1732         (WebCore::MediaControlTimelineContainerElement::MediaControlTimelineContainerElement):
1733         (WebCore::MediaControlVolumeSliderContainerElement::MediaControlVolumeSliderContainerElement):
1734         (WebCore::MediaControlStatusDisplayElement::MediaControlStatusDisplayElement):
1735         (WebCore::MediaControlPanelMuteButtonElement::MediaControlPanelMuteButtonElement):
1736         (WebCore::MediaControlVolumeSliderMuteButtonElement::MediaControlVolumeSliderMuteButtonElement):
1737         (WebCore::MediaControlPlayButtonElement::MediaControlPlayButtonElement):
1738         (WebCore::MediaControlOverlayPlayButtonElement::MediaControlOverlayPlayButtonElement):
1739         (WebCore::MediaControlSeekForwardButtonElement::MediaControlSeekForwardButtonElement):
1740         (WebCore::MediaControlSeekBackButtonElement::MediaControlSeekBackButtonElement):
1741         (WebCore::MediaControlRewindButtonElement::MediaControlRewindButtonElement):
1742         (WebCore::MediaControlReturnToRealtimeButtonElement::MediaControlReturnToRealtimeButtonElement):
1743         (WebCore::MediaControlToggleClosedCaptionsButtonElement::MediaControlToggleClosedCaptionsButtonElement):
1744         (WebCore::MediaControlClosedCaptionsContainerElement::MediaControlClosedCaptionsContainerElement):
1745         (WebCore::MediaControlClosedCaptionsTrackListElement::MediaControlClosedCaptionsTrackListElement):
1746         (WebCore::MediaControlTimelineElement::MediaControlTimelineElement):
1747         (WebCore::MediaControlPanelVolumeSliderElement::MediaControlPanelVolumeSliderElement):
1748         (WebCore::MediaControlFullscreenVolumeSliderElement::MediaControlFullscreenVolumeSliderElement):
1749         (WebCore::MediaControlFullscreenButtonElement::MediaControlFullscreenButtonElement):
1750         (WebCore::MediaControlFullscreenVolumeMinButtonElement::MediaControlFullscreenVolumeMinButtonElement):
1751         (WebCore::MediaControlFullscreenVolumeMaxButtonElement::MediaControlFullscreenVolumeMaxButtonElement):
1752         (WebCore::MediaControlTimeRemainingDisplayElement::MediaControlTimeRemainingDisplayElement):
1753         (WebCore::MediaControlCurrentTimeDisplayElement::MediaControlCurrentTimeDisplayElement):
1754         (WebCore::MediaControlTextTrackContainerElement::MediaControlTextTrackContainerElement):
1755         (WebCore::MediaControlPanelElement::shadowPseudoId): Deleted.
1756         (WebCore::MediaControlPanelEnclosureElement::shadowPseudoId): Deleted.
1757         (WebCore::MediaControlOverlayEnclosureElement::shadowPseudoId): Deleted.
1758         (WebCore::MediaControlTimelineContainerElement::shadowPseudoId): Deleted.
1759         (WebCore::MediaControlVolumeSliderContainerElement::shadowPseudoId): Deleted.
1760         (WebCore::MediaControlStatusDisplayElement::shadowPseudoId): Deleted.
1761         (WebCore::MediaControlPanelMuteButtonElement::shadowPseudoId): Deleted.
1762         (WebCore::MediaControlVolumeSliderMuteButtonElement::shadowPseudoId): Deleted.
1763         (WebCore::MediaControlPlayButtonElement::shadowPseudoId): Deleted.
1764         (WebCore::MediaControlOverlayPlayButtonElement::shadowPseudoId): Deleted.
1765         (WebCore::MediaControlSeekForwardButtonElement::shadowPseudoId): Deleted.
1766         (WebCore::MediaControlSeekBackButtonElement::shadowPseudoId): Deleted.
1767         (WebCore::MediaControlRewindButtonElement::shadowPseudoId): Deleted.
1768         (WebCore::MediaControlReturnToRealtimeButtonElement::shadowPseudoId): Deleted.
1769         (WebCore::MediaControlToggleClosedCaptionsButtonElement::shadowPseudoId): Deleted.
1770         (WebCore::MediaControlClosedCaptionsContainerElement::shadowPseudoId): Deleted.
1771         (WebCore::MediaControlClosedCaptionsTrackListElement::shadowPseudoId): Deleted.
1772         (WebCore::MediaControlTimelineElement::shadowPseudoId): Deleted.
1773         (WebCore::MediaControlPanelVolumeSliderElement::shadowPseudoId): Deleted.
1774         (WebCore::MediaControlFullscreenVolumeSliderElement::shadowPseudoId): Deleted.
1775         (WebCore::MediaControlFullscreenButtonElement::shadowPseudoId): Deleted.
1776         (WebCore::MediaControlFullscreenVolumeMinButtonElement::shadowPseudoId): Deleted.
1777         (WebCore::MediaControlFullscreenVolumeMaxButtonElement::shadowPseudoId): Deleted.
1778         (WebCore::MediaControlTimeRemainingDisplayElement::shadowPseudoId): Deleted.
1779         (WebCore::MediaControlCurrentTimeDisplayElement::shadowPseudoId): Deleted.
1780         (WebCore::MediaControlTextTrackContainerElement::textTrackContainerElementShadowPseudoId): Deleted.
1781         (WebCore::MediaControlTextTrackContainerElement::shadowPseudoId): Deleted.
1782         * html/shadow/MediaControlElements.h:
1783         * html/shadow/MediaControls.cpp:
1784         (WebCore::MediaControls::MediaControls):
1785         (WebCore::MediaControls::shadowPseudoId): Deleted.
1786         * html/shadow/MediaControls.h:
1787
1788 2014-07-31  Timothy Horton  <timothy_horton@apple.com>
1789
1790         Build fix for platforms where we should have automaticallyAdjustsContentInsets but it isn't public yet
1791
1792         * platform/mac/ScrollViewMac.mm:
1793
1794 2014-07-31  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1795
1796         [EFL] Add support for building with Geoclue2.
1797         https://bugs.webkit.org/show_bug.cgi?id=135455
1798
1799         Reviewed by Gyuyoung Kim.
1800
1801         No new tests required, no new functionality.
1802
1803         * PlatformEfl.cmake: Generate derived sources for Geoclue2Interface
1804         and include gio-unix path.
1805
1806 2014-07-31  Zalan Bujtas  <zalan@apple.com>
1807
1808         Subpixel rendering: Region painting needs to take subpixel accumulation into account.
1809         https://bugs.webkit.org/show_bug.cgi?id=135469
1810
1811         Similar to non-region painting, when the context is translated, we need to propagate
1812         the subpixel difference so that renderers get snapped to the same position as if they
1813         were not part of a region.
1814
1815         Reviewed by Simon Fraser.
1816
1817         Covered by existing tests/not testable (webkit.org/b/135470)
1818
1819         * html/shadow/MediaControlElements.cpp:
1820         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
1821         * page/FrameView.cpp:
1822         (WebCore::FrameView::paintContents):
1823         * rendering/RenderLayer.cpp:
1824         (WebCore::RenderLayer::paint):
1825         (WebCore::RenderLayer::calculateClipRects):
1826         * rendering/RenderLayer.h:
1827
1828 2014-07-31  Jer Noble  <jer.noble@apple.com>
1829
1830         [iOS] Video in an <embed> has a bad aspect ratio when in fullscreen mode.
1831         https://bugs.webkit.org/show_bug.cgi?id=135481
1832
1833         Reviewed by Simon Fraser.
1834
1835         Do not change the gravity of our AVPlayerLayer when in full screen mode; its gravity
1836         is controlled by setVideoFullscreenGravity(), and should not be affected by style changes.
1837
1838         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1839         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoLayerGravity):
1840
1841 2014-07-31  Beth Dakin  <bdakin@apple.com>
1842
1843         Hit-testing broken in WebKit 1 views with AppKit's contentInsets
1844         https://bugs.webkit.org/show_bug.cgi?id=135434
1845         -and corresponding-
1846         <rdar://problem/17850323>
1847
1848         Reviewed by Benjamin Poulain.
1849
1850         AppKit's contentInsets are factored into scroll positions and mouse positions, but
1851         in WebCore, we generally want all of those things to be factored out so that, for
1852         example, the scroll position of a document pinned to the top is the same whether
1853         or not there is a contentInset. So to fix hit-testing in WebKit 1 views with
1854         contentInsets, this patch factors the inset out or into of all coordinate
1855         conversion methods just like we do for the WebKit2 contentInset.
1856         
1857         This patch also adds the ability to test WK1 platformContentInsets with
1858         window.internals, and it re-names convertFromRenderer to 
1859         convertFromRendererToContainingView and also re-names convertToRenderer to
1860         convertFromContainingViewToRenderer.
1861
1862         ScrollView::topContentInset() takes an optional parameter indicating whether the
1863         caller wants the WebCore::Page contentInset or the platform content inset. It’s
1864         necessary to distinguish between these cases because there is a lot of code that
1865         only wants the WebCore::Page contentInset since that feature is actually
1866         implemented in WebCore as opposed to being implemented at the platform level.
1867         * WebCore.exp.in:
1868         * page/FrameView.cpp:
1869         (WebCore::FrameView::topContentInset):
1870
1871         For layout test purposes, set the platforTopContentInset here if there is a 
1872         platformWidget().
1873         (WebCore::FrameView::topContentInsetDidChange):
1874
1875         Re-named functions, also all coordinate conversion functions call 
1876         topContentInset(ManualOrPlatformContentInset)
1877         (WebCore::FrameView::convertFromContainingViewToRenderer):
1878         (WebCore::FrameView::convertToContainingView):
1879         (WebCore::FrameView::convertFromContainingView):
1880         (WebCore::FrameView::convertFromRenderer): Deleted.
1881         (WebCore::FrameView::convertToRenderer): Deleted.
1882         * page/FrameView.h:
1883         * page/Page.cpp:
1884         (WebCore::Page::setTopContentInset):
1885         * platform/ScrollView.cpp:
1886         (WebCore::ScrollView::documentScrollOffsetRelativeToViewOrigin):
1887         (WebCore::ScrollView::documentScrollPositionRelativeToViewOrigin):
1888         (WebCore::ScrollView::contentsToRootView):
1889         (WebCore::ScrollView::rootViewToTotalContents):
1890         (WebCore::ScrollView::contentsToWindow):
1891         (WebCore::ScrollView::platformTopContentInset):
1892         (WebCore::ScrollView::platformSetTopContentInset):
1893         * platform/ScrollView.h:
1894         (WebCore::ScrollView::topContentInset):
1895         * platform/ios/ScrollViewIOS.mm:
1896         (WebCore::ScrollView::platformTopContentInset):
1897         (WebCore::ScrollView::platformSetTopContentInset):
1898
1899         Implement new platform inset-related functions using AppKit's implementation.
1900         * platform/mac/ScrollViewMac.mm:
1901         (WebCore::ScrollView::platformTopContentInset):
1902         (WebCore::ScrollView::platformSetTopContentInset):
1903         
1904         When we set the scroll position for the documentView, we have to factor the inset
1905         back into the WebCore scroll position.
1906         (WebCore::ScrollView::platformSetScrollPosition):
1907         
1908         Re-named functions.
1909         * rendering/RenderLayer.cpp:
1910         (WebCore::RenderLayer::convertFromScrollbarToContainingView):
1911         (WebCore::RenderLayer::convertFromContainingViewToScrollbar):
1912         * rendering/RenderListBox.cpp:
1913         (WebCore::RenderListBox::convertFromScrollbarToContainingView):
1914         (WebCore::RenderListBox::convertFromContainingViewToScrollbar):
1915
1916 2014-07-31  Dean Jackson  <dino@apple.com>
1917
1918         Default buttons do not pulse in OS X 10.10
1919         https://bugs.webkit.org/show_bug.cgi?id=135447
1920         <rdar://problem/17875896>
1921
1922         Reviewed by Dan Bernstein.
1923
1924         OS X Yosemite does not have the animated pulsing default
1925         buttons seen in previous releases. We don't need to have
1926         a timer in RenderButton constantly triggering repaints.
1927
1928         * platform/mac/ThemeMac.mm:
1929         (WebCore::paintButton): No need to advance the animation.
1930         * rendering/RenderButton.cpp:
1931         (WebCore::RenderButton::styleDidChange): Ask the theme if it
1932         should advance the animation.
1933         * rendering/RenderTheme.h:
1934         (WebCore::RenderTheme::defaultButtonHasAnimation): Virtual function
1935         indicating if the button needs to repaint.
1936         * rendering/RenderThemeMac.h:
1937         * rendering/RenderThemeMac.mm:
1938         (WebCore::RenderThemeMac::defaultButtonHasAnimation): Provide platform
1939         specific result on Yosemite and above.
1940
1941 2014-07-31  Tim Horton  <timothy_horton@apple.com>
1942
1943         DOM::renderedImageForcingBlackText returns an image with the wrong logical size on 2x displays
1944         https://bugs.webkit.org/show_bug.cgi?id=135442
1945         <rdar://problem/17614632>
1946
1947         Reviewed by Simon Fraser.
1948
1949         * bindings/objc/DOM.mm:
1950         (-[DOMRange renderedImageForcingBlackText:renderedImageForcingBlackText:]):
1951         Scale the NSImage size by the device scale factor,
1952         similar to what we did for drag images in r167403.
1953         Ideally this scaling would happen in the code that
1954         generates the images, but this is a much larger change
1955         with much more regression potential.
1956
1957 2014-07-31  Bear Travis  <betravis@adobe.com>
1958
1959         [CSS Font Loading] Rename document.fontloader to document.fonts
1960         https://bugs.webkit.org/show_bug.cgi?id=135393
1961
1962         Reviewed by Bem Jones-Bey.
1963
1964         The most recent version of the specification has renamed
1965         document.fontloader to document.fonts. This change updates the
1966         names in WebCore and LayoutTests.
1967
1968         Fixed up existing tests under LayoutTests/fast/css/fontloader-*
1969         and LayoutTests/http/webfont/fontloader-*
1970
1971         * css/CSSFontFace.cpp:
1972         (WebCore::CSSFontFace::notifyFontLoader):
1973         (WebCore::CSSFontFace::notifyLoadingDone):
1974         * dom/Document.cpp:
1975         (WebCore::Document::fonts):
1976         (WebCore::Document::fontloader): Deleted.
1977         * dom/Document.h:
1978         * dom/Document.idl:
1979         * page/FrameView.cpp:
1980         (WebCore::FrameView::performPostLayoutTasks):
1981
1982 2014-07-31  Andrei Bucur  <abucur@adobe.com>
1983
1984         REGRESSION: Search highlight is broken in RTL multicolumn content
1985         https://bugs.webkit.org/show_bug.cgi?id=135452
1986
1987         Reviewed by Simon Fraser.
1988
1989         The offsets for elements inside RTL multi-column elements are incorrectly computed because
1990         the columns don't calculate their left position according to the writing direction.
1991
1992         The patch extracts the column position computation in two helper functions (for top and left)
1993         so they can be used when needed in different parts of the code. In our case, the |columnLogicalLeft|
1994         function should be used inside |columnTranslationForOffset|.
1995
1996         Test: fast/multicol/content-bounding-box-rtl.html
1997
1998         * rendering/RenderMultiColumnSet.cpp:
1999         (WebCore::RenderMultiColumnSet::columnLogicalLeft): Return the logical left of a column relative to the set.
2000         (WebCore::RenderMultiColumnSet::columnLogicalTop): Return the logical top of a column relative to the set.
2001         (WebCore::RenderMultiColumnSet::columnRectAt): Split the code between columnLogicalLeft and columnLogicalTop.
2002         (WebCore::RenderMultiColumnSet::collectLayerFragments): Make code clearer by adding a new line.
2003         (WebCore::RenderMultiColumnSet::columnTranslationForOffset): Use columnLogicalLeft instead of duplicating logic.
2004         * rendering/RenderMultiColumnSet.h:
2005
2006 2014-07-31  Martin Hodovan  <mhodovan.u-szeged@partner.samsung.com>
2007
2008         Eliminate "FractionConversion" from CSSPrimitiveValue::convertToLength
2009         https://bugs.webkit.org/show_bug.cgi?id=135377
2010
2011         Reviewed by Darin Adler.
2012
2013         The FractionConversion argument in CSSPrimitiveValue::convertToLength
2014         doesn't seem to actually have a purpose. It is for converting numbers
2015         into Length(x * 100, Percent), but this case shouldn't be reachable.
2016         The original patch introducing it doesn't shed any light either:
2017         [https://bugs.webkit.org/show_bug.cgi?id=74913
2018
2019         This patch removes the now unused FractionConversion argument. Note
2020         that we can probably also merge the two Fixed conversions, as the
2021         two only differ in clamping large numbers (probably unintended).
2022
2023         Patch by Timothy Loh, backported from Blink: https://codereview.chromium.org/71253002
2024
2025         No new tests.
2026
2027         * css/CSSCalculationValue.cpp:
2028         (WebCore::determineCategory):
2029         * css/CSSParser.cpp:
2030         (WebCore::parseTransformTranslateArguments):
2031         (WebCore::parseTranslateTransformValue):
2032         (WebCore::parseTransformArguments): Deleted.
2033         * css/CSSPrimitiveValueMappings.h:
2034         (WebCore::CSSPrimitiveValue::convertToLength):
2035         * css/DeprecatedStyleBuilder.cpp:
2036         (WebCore::ApplyPropertyClip::convertToLength):
2037         * css/StyleResolver.cpp:
2038         (WebCore::StyleResolver::convertToIntLength):
2039         (WebCore::StyleResolver::convertToFloatLength):
2040         * css/TransformFunctions.cpp:
2041         (WebCore::convertToFloatLength):
2042
2043 2014-07-31  Joseph Pecoraro  <pecoraro@apple.com>
2044
2045         Web Inspector: console.profile missing profile information
2046         https://bugs.webkit.org/show_bug.cgi?id=135432
2047
2048         Reviewed by Timothy Hatcher.
2049
2050         By switching console.profile to start/stop the timeline we would
2051         not have a chance to recompile JS functions with profiling information.
2052         This used to work because whenever the inspector was open we would
2053         have profiling information enabled. Go back to that behavior.
2054
2055         * inspector/InspectorController.cpp:
2056         (WebCore::InspectorController::profilerEnabled):
2057         Instead of checking if the timeline agent has started, check if the
2058         timeline agent has been created. Going back to the normal behavior
2059         of always having profiling information when the inspector is open.
2060
2061         * inspector/InspectorTimelineAgent.h:
2062         * inspector/InspectorTimelineAgent.cpp:
2063         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
2064         Recompile initializing the timeline agent to include profiling information.
2065
2066         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
2067         Recompile destrying the timeline agent, only if needed.
2068
2069         (WebCore::InspectorTimelineAgent::willCallFunction):
2070         (WebCore::InspectorTimelineAgent::didCallFunction):
2071         (WebCore::InspectorTimelineAgent::willEvaluateScript):
2072         (WebCore::InspectorTimelineAgent::didEvaluateScript):
2073         Using a boolean to track nested calls would not give expected
2074         behavior when un-nesting. Switch to a counter to ensure that
2075         as we start profiling in the outermost level we then stop
2076         profiling at that same level and not inside an inner nesting.
2077
2078 2014-07-31  Wenson Hsieh  <wenson_hsieh@apple.com>
2079
2080         Refactor EventHandler to call ScrollAnimator::handleWheelEvent for overflow scrolling
2081         https://bugs.webkit.org/show_bug.cgi?id=135195
2082
2083         Reviewed by Beth Dakin.
2084
2085         ScrollableArea::handleWheelEvent is not currently being used to handle wheel events for overflow scrolling; it instead directly invokes ScrollableArea::scroll.
2086         In order to expose wheel phases on Mac, the PlatformWheelEvent itself should propagate down to ScrollableArea, not just the scroll granularity, direction and
2087         multiplier required by ScrollableArea::scroll. With this patch, PlatformWheelEvent will be "shipped" along with the WheelEvent.
2088
2089         No new tests, since behavior should not have changed.
2090
2091         * page/EventHandler.cpp:
2092         (WebCore::didScrollInScrollableAreaForSingleAxis): Calls ScrollableArea::scroll directly using WheelEvent's data. Used to handle programmatic WheelEvents, e.g. from JavaScript.
2093         (WebCore::handleWheelEventInAppropriateEnclosingBoxForSingleAxis): Finds the correct ScrollableArea and attempts to scroll it using the information contained in the WheelEvent via ScrollableArea::handleWheelEvent
2094         (WebCore::EventHandler::defaultWheelEventHandler): Updated to use handleWheelEventInAppropriateEnclosingBoxForSingleAxis instead of scrollNode.
2095         (WebCore::scrollNode): Deleted.
2096         * rendering/RenderListBox.h: Made RenderListBox::scroll public so it can be invoked from EventHandler::handleWheelEventInAppropriateEnclosingBoxForSingleAxis.
2097         * rendering/RenderNamedFlowThread.cpp: Refactored to let EventHandler update nextScrollBlock in the case of isRenderNamedFlowThread().
2098         (WebCore::RenderNamedFlowThread::fragmentFromRenderBoxAsRenderBlock): 
2099         * rendering/RenderNamedFlowThread.h:
2100
2101 2014-07-31  Dan Bernstein  <mitz@apple.com>
2102
2103         WebCore part of: Server trust authentication challenges aren’t sent to the navigation delegate
2104         https://bugs.webkit.org/show_bug.cgi?id=135327
2105
2106         Reviewed by Alexey Proskuryakov.
2107
2108         * platform/network/cf/ResourceHandleCFNet.cpp:
2109         (WebCore::ResourceHandle::receivedCredential): Don’t try to change the persistence of
2110         credentials used for server trust, because the platform doesn’t support persistence values
2111         other than Session for server trust.
2112         * platform/network/mac/ResourceHandleMac.mm:
2113         (WebCore::ResourceHandle::receivedCredential): Ditto.
2114
2115 2014-07-31  Dan Bernstein  <mitz@apple.com>
2116
2117         Tried to fix building with the OS X 10.9 SDK while targeting OS X 10.8.
2118
2119         * platform/network/cocoa/CredentialCocoa.mm:
2120         (WebCore::toCredentialPersistence):
2121
2122 2014-07-31  Dan Bernstein  <mitz@apple.com>
2123
2124         Reverted r171854, because it broke building with the OS X 10.8 SDK.
2125
2126         * platform/network/cocoa/CredentialCocoa.mm:
2127         (WebCore::toCredentialPersistence):
2128
2129 2014-07-31  Dan Bernstein  <mitz@apple.com>
2130
2131         Tried to fix building with the OS X 10.9 SDK while targeting OS X 10.8.
2132
2133         * platform/network/cocoa/CredentialCocoa.mm:
2134         (WebCore::toCredentialPersistence):
2135
2136 2014-07-31  Jer Noble  <jer.noble@apple.com>
2137
2138         REGRESSION(??): [iOS] Disabling MediaPlaybackRequiresUserGesture does not remove user gesture requirement for entering full screen.
2139         https://bugs.webkit.org/show_bug.cgi?id=135443
2140
2141         Reviewed by Dean Jackson.
2142
2143         Allow full screen mode to be entered without a user gesture if the gesture requirement for media playback
2144         has been unset.
2145
2146         * html/HTMLMediaElement.cpp:
2147         (WebCore::HTMLMediaElement::HTMLMediaElement):
2148
2149 2014-07-31  Andrei Bucur  <abucur@adobe.com>
2150
2151         [CSS Multicolumn] Clear the lines when switching to multi-column layout
2152         https://bugs.webkit.org/show_bug.cgi?id=135127
2153
2154         Reviewed by Alexandru Chiculita.
2155
2156         When switching an element to multi-column layout it becomes a container of block
2157         children. When this happens the existing line boxes must be deleted in addition
2158         to clearing the hasInlineChildren flag.
2159
2160         Tests: fast/multicol/inline-container-to-multicol.html
2161                fast/multicol/inline-container-to-multicol-float.html
2162                fast/multicol/inline-container-to-multicol-positioned.html
2163
2164         * rendering/RenderBlockFlow.cpp:
2165         (WebCore::RenderBlockFlow::createMultiColumnFlowThread):
2166
2167 2014-07-30  Andreas Kling  <akling@apple.com>
2168
2169         PropertyName's internal string is always atomic.
2170         <https://webkit.org/b/135451>
2171
2172         Use PropertyName::publicName() directly instead of taking the slow route
2173         through AtomicString::findStringWithHash().
2174
2175         These strings are always atomic, and findStringWithHash() would trudge
2176         through a full hash lookup just to discover that indeed, they are!
2177
2178         Reviewed by Benjamin Poulain.
2179
2180         * bindings/js/JSDOMBinding.cpp:
2181         (WebCore::findAtomicString): Deleted.
2182         * bindings/js/JSDOMBinding.h:
2183         * bindings/js/JSDOMWindowCustom.cpp:
2184         (WebCore::namedItemGetter):
2185         (WebCore::JSDOMWindow::getOwnPropertySlot):
2186         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
2187         * bindings/js/JSHTMLDocumentCustom.cpp:
2188         (WebCore::JSHTMLDocument::canGetItemsForName):
2189         (WebCore::JSHTMLDocument::nameGetter):
2190
2191 2014-07-30  Benjamin Poulain  <benjamin@webkit.org>
2192
2193         ElementRuleCollector: group the shadow tree code
2194         https://bugs.webkit.org/show_bug.cgi?id=135410
2195
2196         Reviewed by Andreas Kling.
2197
2198         * css/ElementRuleCollector.cpp:
2199         (WebCore::ElementRuleCollector::collectMatchingRules):
2200         Little cleanup: group the shadow tree rule collection in the same block.
2201
2202 2014-07-30  Benjamin Poulain  <benjamin@webkit.org>
2203
2204         Cleanup DetailsMarkerControl
2205         https://bugs.webkit.org/show_bug.cgi?id=135429
2206
2207         Reviewed by Andreas Kling.
2208
2209         Remove the override of shadowPseudoId(). This is a simple type of shadowId,
2210         it should use the generic pseudo() path.
2211
2212         Move DetailsMarkerControl::create() out-of-line. One could justify inlining the constructor,
2213         inlining the ::create() function has little value.
2214
2215         * html/shadow/DetailsMarkerControl.cpp:
2216         (WebCore::DetailsMarkerControl::create):
2217         (WebCore::DetailsMarkerControl::DetailsMarkerControl):
2218         (WebCore::DetailsMarkerControl::rendererIsNeeded):
2219         (WebCore::DetailsMarkerControl::shadowPseudoId): Deleted.
2220         (WebCore::DetailsMarkerControl::summaryElement): Deleted.
2221         * html/shadow/DetailsMarkerControl.h:
2222         (WebCore::DetailsMarkerControl::create): Deleted.
2223
2224 2014-07-30  Benjamin Poulain  <bpoulain@apple.com>
2225
2226         Remove UploadButtonElement::shadowPseudoId()
2227         https://bugs.webkit.org/show_bug.cgi?id=135435
2228
2229         Reviewed by Andreas Kling.
2230
2231         Use the generic pseudo() path instead of a custom shadowPseudoId().
2232
2233         * html/FileInputType.cpp:
2234         (WebCore::UploadButtonElement::create):
2235         (WebCore::UploadButtonElement::createForMultiple):
2236         (WebCore::UploadButtonElement::UploadButtonElement):
2237         Set the type in the common constructor instead of the call sites.
2238         (WebCore::UploadButtonElement::shadowPseudoId): Deleted.
2239         * html/FileInputType.h:
2240
2241 2014-07-30  Benjamin Poulain  <bpoulain@apple.com>
2242
2243         Remove SpinButtonElement::shadowPseudoId
2244         https://bugs.webkit.org/show_bug.cgi?id=135436
2245
2246         Reviewed by Andreas Kling.
2247
2248         Use the generic pseudo.
2249
2250         * html/shadow/SpinButtonElement.cpp:
2251         (WebCore::SpinButtonElement::SpinButtonElement):
2252         (WebCore::SpinButtonElement::shadowPseudoId): Deleted.
2253         * html/shadow/SpinButtonElement.h:
2254
2255 2014-07-30  Benjamin Poulain  <bpoulain@apple.com>
2256
2257         Clean up YouTubeEmbedShadowElement
2258         https://bugs.webkit.org/show_bug.cgi?id=135437
2259
2260         Reviewed by Andreas Kling.
2261
2262         * html/shadow/YouTubeEmbedShadowElement.cpp:
2263         (WebCore::YouTubeEmbedShadowElement::YouTubeEmbedShadowElement):
2264         (WebCore::YouTubeEmbedShadowElement::pluginElement): Deleted.
2265         This is unused in WebCore.
2266
2267         (WebCore::YouTubeEmbedShadowElement::shadowPseudoId): Deleted.
2268         Use the generic pseudo path instead of a custom shadowPseudoId.
2269         * html/shadow/YouTubeEmbedShadowElement.h:
2270
2271 2014-07-30  Benjamin Poulain  <bpoulain@apple.com>
2272
2273         Remove shadowPseudoId() from InputFieldSpeechButtonElement and SearchFieldCancelButtonElement
2274         https://bugs.webkit.org/show_bug.cgi?id=135438
2275
2276         Reviewed by Andreas Kling.
2277
2278         Use the generic path.
2279
2280         * html/shadow/TextControlInnerElements.cpp:
2281         (WebCore::SearchFieldCancelButtonElement::SearchFieldCancelButtonElement):
2282         (WebCore::InputFieldSpeechButtonElement::InputFieldSpeechButtonElement):
2283         (WebCore::SearchFieldCancelButtonElement::shadowPseudoId): Deleted.
2284         (WebCore::InputFieldSpeechButtonElement::shadowPseudoId): Deleted.
2285         * html/shadow/TextControlInnerElements.h:
2286
2287 2014-07-30  Andy Estes  <aestes@apple.com>
2288
2289         USE(CONTENT_FILTERING) should be ENABLE(CONTENT_FILTERING)
2290         https://bugs.webkit.org/show_bug.cgi?id=135439
2291
2292         Reviewed by Tim Horton.
2293
2294         We now support two different platform content filters, and will soon support a mock content filter (as part of
2295         webkit.org/b/128858). This makes content filtering a feature of WebKit, not just an adoption of a third-party
2296         library. ENABLE() is the correct macro to use for such a feature.
2297
2298         * Configurations/FeatureDefines.xcconfig:
2299         * WebCore.exp.in:
2300         * loader/DocumentLoader.cpp:
2301         (WebCore::DocumentLoader::finishedLoading):
2302         (WebCore::DocumentLoader::responseReceived):
2303         (WebCore::DocumentLoader::commitData):
2304         (WebCore::DocumentLoader::dataReceived):
2305         * loader/DocumentLoader.h:
2306         * loader/FrameLoaderClient.h:
2307         * platform/ContentFilter.h:
2308         * platform/ios/ContentFilterIOS.mm:
2309         * platform/mac/ContentFilterMac.mm:
2310
2311 2014-07-30  Andreas Kling  <akling@apple.com>
2312
2313         Static hash tables no longer need to be coupled with a VM.
2314         <https://webkit.org/b/135421>
2315
2316         Update for JSC::ClassInfo changes.
2317         
2318         Remove the JSNoStaticTables mode for IDL code generation, which was used to
2319         ensure that each VM had its own unique copy of certain static tables.
2320         This was used for interfaces that could be used in workers, and now there's
2321         no need to manually annotate these things anymore.
2322
2323         Also remove the DOMObjectHashTableMap class that was only used for this.
2324
2325         Reviewed by Geoffrey Garen.
2326
2327         * Modules/indexeddb/IDBAny.idl:
2328         * Modules/indexeddb/IDBCursor.idl:
2329         * Modules/indexeddb/IDBCursorWithValue.idl:
2330         * Modules/indexeddb/IDBDatabase.idl:
2331         * Modules/indexeddb/IDBFactory.idl:
2332         * Modules/indexeddb/IDBIndex.idl:
2333         * Modules/indexeddb/IDBKeyRange.idl:
2334         * Modules/indexeddb/IDBObjectStore.idl:
2335         * Modules/indexeddb/IDBOpenDBRequest.idl:
2336         * Modules/indexeddb/IDBRequest.idl:
2337         * Modules/indexeddb/IDBTransaction.idl:
2338         * Modules/indexeddb/IDBVersionChangeEvent.idl:
2339         * Modules/webdatabase/Database.idl:
2340         * Modules/webdatabase/DatabaseSync.idl:
2341         * Modules/webdatabase/SQLError.idl:
2342         * Modules/webdatabase/SQLException.idl:
2343         * Modules/webdatabase/SQLResultSet.idl:
2344         * Modules/webdatabase/SQLResultSetRowList.idl:
2345         * Modules/webdatabase/SQLTransaction.idl:
2346         * Modules/webdatabase/SQLTransactionSync.idl:
2347         * Modules/websockets/CloseEvent.idl:
2348         * Modules/websockets/WebSocket.idl:
2349         * WebCore.xcodeproj/project.pbxproj:
2350         * bindings/js/DOMObjectHashTableMap.cpp: Removed.
2351         * bindings/js/DOMObjectHashTableMap.h: Removed.
2352         * bindings/js/JSDOMBinding.cpp:
2353         (WebCore::getHashTableForGlobalData): Deleted.
2354         * bindings/js/JSDOMBinding.h:
2355         (WebCore::getStaticValueSlotEntryWithoutCaching):
2356         * bindings/js/JSDOMGlobalObject.cpp:
2357         * bindings/js/JSDOMWindowBase.cpp:
2358         * bindings/js/JSDOMWindowCustom.cpp:
2359         (WebCore::JSDOMWindow::getOwnPropertySlot):
2360         (WebCore::JSDOMWindow::put):
2361         * bindings/js/JSDOMWindowShell.cpp:
2362         * bindings/js/JSImageConstructor.cpp:
2363         * bindings/js/JSLocationCustom.cpp:
2364         (WebCore::JSLocation::putDelegate):
2365         * bindings/js/JSStorageCustom.cpp:
2366         (WebCore::JSStorage::deleteProperty):
2367         (WebCore::JSStorage::putDelegate):
2368         * bindings/js/JSWorkerGlobalScopeBase.cpp:
2369         * bindings/js/WebCoreJSClientData.h:
2370         * bindings/scripts/CodeGeneratorJS.pm:
2371         (GenerateGetOwnPropertySlotBody):
2372         (GenerateImplementation):
2373         (GenerateConstructorHelperMethods):
2374         (hashTableAccessor): Deleted.
2375         (prototypeHashTableAccessor): Deleted.
2376         (constructorHashTableAccessor): Deleted.
2377         * bindings/scripts/IDLAttributes.txt:
2378         * bridge/c/CRuntimeObject.cpp:
2379         * bridge/c/c_instance.cpp:
2380         * bridge/objc/ObjCRuntimeObject.mm:
2381         * bridge/objc/objc_instance.mm:
2382         * bridge/objc/objc_runtime.mm:
2383         * bridge/runtime_array.cpp:
2384         * bridge/runtime_method.cpp:
2385         * bridge/runtime_object.cpp:
2386         * crypto/CryptoKey.idl:
2387         * css/CSSFontFaceLoadEvent.idl:
2388         * dom/DOMCoreException.idl:
2389         * dom/DOMStringList.idl:
2390         * dom/ErrorEvent.idl:
2391         * dom/Event.idl:
2392         * dom/EventException.idl:
2393         * dom/EventListener.idl:
2394         * dom/MessageChannel.idl:
2395         * dom/MessageEvent.idl:
2396         * dom/MessagePort.idl:
2397         * dom/ProgressEvent.idl:
2398         * fileapi/Blob.idl:
2399         * fileapi/File.idl:
2400         * fileapi/FileError.idl:
2401         * fileapi/FileException.idl:
2402         * fileapi/FileList.idl:
2403         * fileapi/FileReader.idl:
2404         * fileapi/FileReaderSync.idl:
2405         * html/DOMURL.idl:
2406         * page/EventSource.idl:
2407         * page/WorkerNavigator.idl:
2408         * workers/DedicatedWorkerGlobalScope.idl:
2409         * workers/SharedWorkerGlobalScope.idl:
2410         * workers/WorkerGlobalScope.idl:
2411         * workers/WorkerLocation.idl:
2412         * xml/XMLHttpRequest.idl:
2413         * xml/XMLHttpRequestException.idl:
2414         * xml/XMLHttpRequestProgressEvent.idl:
2415         * xml/XMLHttpRequestUpload.idl:
2416
2417 2014-07-30  Dan Bernstein  <mitz@apple.com>
2418
2419         <rdar://problem/17199364> [Mac] Popup button arrows appear on the left, underlapping text, when the UI layout direction is right-to-left
2420         https://bugs.webkit.org/show_bug.cgi?id=135426
2421
2422         Reviewed by Dean Jackson.
2423
2424         No test, because the UI layout direction in the test harness is always left-to-right.
2425
2426         * rendering/RenderThemeMac.mm:
2427         (WebCore::RenderThemeMac::popupButton): Forced the user interface layout direction of the
2428         NSPopUpButtonCell to left-to-right. Added a FIXME about how we could make this vary based on
2429         the direction of the <select>, though that would require additional changes elsewhere.
2430
2431 2014-07-30  Dan Bernstein  <mitz@apple.com>
2432
2433         Made Credential hold onto an NSURLCredential when needed.
2434         Work towards fixing https://bugs.webkit.org/show_bug.cgi?id=135327
2435
2436         Reviewed by Alexey Proskuryakov.
2437
2438         No change in functionality.
2439
2440         * WebCore.exp.in: Updated.
2441
2442         * platform/network/Credential.h: Removed definition of CERTIFICATE_CREDENTIALS_SUPPORTED,
2443         which is not used anymore.
2444
2445         * platform/network/CredentialBase.h:
2446         (WebCore::CredentialBase::encodingRequiresPlatformData): Added a base implementation that
2447         returns false.
2448
2449         * platform/network/cf/AuthenticationCF.cpp:
2450         Changed to use the Credential constructor that takes an CFURLCredential, and the new
2451         cfCredential member function. Made the createCF and core functions Windows-only and
2452         therefore removed the CERTIFICATE_CREDENTIALS_SUPPORTED code from them.
2453         * platform/network/cf/AuthenticationCF.h:
2454
2455         * platform/network/cf/CredentialStorageCFNet.cpp:
2456         (WebCore::CredentialStorage::getFromPersistentStorage): Changed to construct a Credential
2457         from a CFURLCredential.
2458         (WebCore::CredentialStorage::saveToPersistentStorage): Changed to use the new cfCredential
2459         member function.
2460
2461         * platform/network/cf/ResourceHandleCFNet.cpp:
2462         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Ditto to both.
2463         (WebCore::ResourceHandle::receivedCredential): Ditto.
2464
2465         * platform/network/cocoa/CredentialCocoa.h:
2466         Replaced the m_identity, m_certificates and m_type member variables with an m_nsCredential
2467         one holding onto an NSURLCredential. Declared constructors from and getters for
2468         NSURLCredential and CFURLCredentialRef.
2469         (WebCore::Credential::encodingRequiresPlatformData): Override that checks the
2470         NSURLCredential if necessary.
2471
2472         * platform/network/cocoa/CredentialCocoa.mm:
2473         (WebCore::toNSURLCredentialPersistence): New helper function.
2474         (WebCore::toCredentialPersistence): Ditto.
2475         (WebCore::Credential::Credential): Defined constructors to create or take an
2476         NSURLCredential.
2477         (WebCore::Credential::cfCredential): Added.
2478         (WebCore::Credential::nsCredential): Added. Returns nil for the empty credential.
2479         (WebCore::Credential::isEmpty): Changed to check m_nsCredential.
2480         (WebCore::Credential::platformCompare): Changed to compare m_nsCredential if needed.
2481         (WebCore::Credential::encodingRequiresPlatformData): Returns true if the credential is not
2482         a user and a password.
2483
2484         * platform/network/mac/AuthenticationMac.h: Removed mac and core functions for Credential.
2485         * platform/network/mac/AuthenticationMac.mm:
2486         (-[WebCoreAuthenticationClientAsChallengeSender useCredential:forAuthenticationChallenge:]):
2487         Changed to use Credential constructor that takes an NSURLCredential.
2488         (WebCore::AuthenticationChallenge::AuthenticationChallenge): Ditto. Also use the
2489         nsCredential getter.
2490
2491         * platform/network/mac/CredentialStorageMac.mm:
2492         (WebCore::CredentialStorage::getFromPersistentStorage): Use new Credential constructor.
2493
2494         * platform/network/mac/ResourceHandleMac.mm:
2495         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Ditto. Also use the
2496         nsCredential getter.
2497         (WebCore::ResourceHandle::receivedCredential): Ditto.
2498
2499 2014-07-30  Sergio Villar Senin  <svillar@igalia.com>
2500
2501         [GTK] Build depends on OpenGL ES
2502         https://bugs.webkit.org/show_bug.cgi?id=135289
2503
2504         Reviewed by Martin Robinson.
2505
2506         Guard the OpenGL ES code with USE(OPENGL_ES_2).
2507
2508         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
2509         * platform/graphics/opengl/Extensions3DOpenGLES.h:
2510
2511 2014-07-30  Radu Stavila  <stavila@adobe.com>
2512
2513         Member name collision in RenderView and SelectionSubtreeRoot
2514         https://bugs.webkit.org/show_bug.cgi?id=135233
2515
2516         Reviewed by Mihnea Ovidenie.
2517
2518         The selectionStart/End members in RenderView have been renamed to fix confusion caused by the fact that
2519         RenderView inherits SelectionSubtreeRoot, which also has the same selectionStart/End members.
2520
2521         No new tests required, no new functionality.
2522
2523         * rendering/RenderBlock.cpp:
2524         (WebCore::RenderBlock::isSelectionRoot):
2525         * rendering/RenderView.cpp:
2526         (WebCore::RenderView::RenderView):
2527         (WebCore::RenderView::setSelection):
2528         (WebCore::RenderView::getSelection):
2529         * rendering/RenderView.h:
2530
2531 2014-07-30  Zan Dobersek  <zdobersek@igalia.com>
2532
2533         [TexMap] Move TextureMapperLayer::textureMapper() definition into the header
2534         https://bugs.webkit.org/show_bug.cgi?id=135384
2535
2536         Reviewed by Martin Robinson.
2537
2538         Move the definitions of TextureMapperLayer::textureMapper() and TextureMapperLayer::rootLayer()
2539         into the TextureMapperLayer header. This makes both functions inline-able, removing unnecessary
2540         calling overhead in GraphicsLayerTextureMapper::flushCompositingState() and
2541         GraphicsLayerTextureMapper::updateBackingStoreIfNeeded().
2542
2543         TextureMapperLayer::rootLayer() now also returns a reference.
2544
2545         * platform/graphics/texmap/TextureMapperLayer.cpp:
2546         (WebCore::TextureMapperLayer::~TextureMapperLayer):
2547         (WebCore::TextureMapperLayer::rootLayer): Deleted.
2548         (WebCore::TextureMapperLayer::textureMapper): Deleted.
2549         * platform/graphics/texmap/TextureMapperLayer.h:
2550         (WebCore::TextureMapperLayer::textureMapper):
2551         (WebCore::TextureMapperLayer::rootLayer):
2552
2553 2014-07-29  Andreas Kling  <akling@apple.com>
2554
2555         Crash when using 'em' units to specify font-size inside animation keyframe.
2556         <https://webkit.org/b/135395>
2557         <rdar://problem/17851910>
2558
2559         We'd forgotten to initialize the "parent style" when resolving keyframe
2560         styles, and this led to a crash in length conversion where the code
2561         assumes a parent style will be present.
2562
2563         To keep this fix minimal, simply make the "parent style" a clone of the
2564         base element style.
2565
2566         Reviewed by Simon Fraser.
2567
2568         Test: fast/animation/keyframe-with-font-size-in-em-units.html
2569
2570         * css/StyleResolver.cpp:
2571         (WebCore::StyleResolver::styleForKeyframe):
2572
2573 2014-07-29  Pratik Solanki  <psolanki@apple.com>
2574
2575         [iOS] REGRESSION(r171526): PDF documents fail to load in WebKit1 with disk image caching enabled
2576         https://bugs.webkit.org/show_bug.cgi?id=135359
2577         <rdar://problem/17824645>
2578
2579         Reviewed by Darin Adler.
2580
2581         r171526 broke the case where we have a memory mapped file from the DiskImageCache in the
2582         SharedBuffer. In such a case, m_buffer is empty and createCFData() returned an
2583         WebCoreSharedBufferData with an empty buffer.
2584
2585         Fix this by taking the easy route of bringing back the old code for the disk image cache
2586         file backed case. In the long run we probably want to remove the iOS specific disk image
2587         cache anyway.
2588
2589         Review also uncovered another bug in r171526 where we were balancing an Objective-C alloc
2590         with a CFRelease which is incorrect when running under GC. Fix that by using adoptNS along
2591         with adoptCF which is what the code did before.
2592
2593         No new tests because the bug only occurs on device and we can't run tests on device yet.
2594
2595         * platform/mac/SharedBufferMac.mm:
2596         (-[WebCoreSharedBufferData initWithDiskImageSharedBuffer:]):
2597         (-[WebCoreSharedBufferData length]):
2598         (-[WebCoreSharedBufferData bytes]):
2599         (WebCore::SharedBuffer::createCFData):
2600
2601 2014-07-29  Benjamin Poulain  <bpoulain@apple.com>
2602
2603         VisitedLinkState::determineLinkState should take a reference
2604         https://bugs.webkit.org/show_bug.cgi?id=135375
2605
2606         Reviewed by Sam Weinig.
2607
2608         * css/StyleResolver.cpp:
2609         (WebCore::StyleResolver::State::initElement):
2610         * dom/VisitedLinkState.h:
2611         (WebCore::VisitedLinkState::determineLinkState):
2612
2613 2014-07-29  Brady Eidson  <beidson@apple.com>
2614
2615         Make WKOriginDataManager actually operate on IndexedDatabases.
2616         https://bugs.webkit.org/show_bug.cgi?id=135346
2617
2618         Reviewed by Sam Weinig (and David Kilzer and Alex Christensen)
2619
2620         * WebCore.exp.in:
2621
2622 2014-07-29  Dan Bernstein  <mitz@apple.com>
2623
2624         Moved the Cocoa-specific parts of CredentialBase into a Cocoa-specific Credential class.
2625         Work towards fixing https://bugs.webkit.org/show_bug.cgi?id=135327
2626
2627         Reviewed by Alexey Proskuryakov.
2628
2629         No change in functionality.
2630
2631         * WebCore.exp.in: Updated for functions moved in the class hierarchy.
2632
2633         * WebCore.xcodeproj/project.pbxproj: Added CredentialCocoa.{h,mm}.
2634
2635         * platform/network/Credential.h: For Cocoa, include CredentialCocoa.h instead of the generic
2636         class.
2637         (WebCore::Credential::Credential): Removed #if CERTIFICATE_CREDENTIALS_SUPPORTED code.
2638
2639         * platform/network/CredentialBase.cpp:
2640         (WebCore::CredentialBase::CredentialBase): Changed to use emptyString instead of "", removed
2641         #if CERTIFICATE_CREDENTIALS_SUPPORTED code.
2642         (WebCore::CredentialBase::isEmpty): Ditto.
2643         (WebCore::CredentialBase::compare): Renamed operator== to this, removed
2644         #if CERTIFICATE_CREDENTIALS_SUPPORTED code, but changed the end to call platformCompare.
2645         (WebCore::CredentialBase::identity): Deleted.
2646         (WebCore::CredentialBase::certificates): Deleted.
2647         (WebCore::CredentialBase::type): Deleted.
2648         * platform/network/CredentialBase.h: Removed #if CERTIFICATE_CREDENTIALS_SUPPORTED members.
2649         (WebCore::CredentialBase::platformCompare): Added a base implementation that returns true.
2650         (WebCore::operator==): Changed to use CredentialBase::compare.
2651
2652         * platform/network/cocoa/CredentialCocoa.h: Added.
2653         (WebCore::Credential::Credential):
2654         * platform/network/cocoa/CredentialCocoa.mm: Added.
2655         (WebCore::Credential::Credential): Moved the constructor that takes an identity and
2656         certificates here.
2657         (WebCore::Credential::isEmpty): Moved here.
2658         (WebCore::Credential::identity): Ditto.
2659         (WebCore::Credential::certificates): Ditto.
2660         (WebCore::Credential::type): Ditto.
2661         (WebCore::Credential::platformCompare): Moved the code that compares client-certificate
2662         credentials here.
2663
2664         * platform/network/mac/AuthenticationMac.mm:
2665         (WebCore::mac): Removed #if CERTIFICATE_CREDENTIALS_SUPPORTED guards in this Cocoa-only
2666         file.
2667         (WebCore::core): Ditto.
2668
2669 2014-07-29  Daniel Bates  <dabates@apple.com>
2670
2671         Use WTF::move() instead of std::move() to help ensure move semantics
2672         https://bugs.webkit.org/show_bug.cgi?id=135351
2673
2674         Reviewed by Alexey Proskuryakov.
2675
2676         * page/CaptionUserPreferences.cpp:
2677         (WebCore::CaptionUserPreferences::updateCaptionStyleSheetOveride):
2678
2679 2014-07-29  Mihnea Ovidenie  <mihnea@adobe.com>
2680
2681         [CSSRegions] Assertion failure hit testing a region-based multicolumn in a region
2682         https://bugs.webkit.org/show_bug.cgi?id=135385
2683
2684         Reviewed by Andrei Bucur.
2685
2686         When a region-based multicolumn element is displayed and hit tested in a region,
2687         we have to disable the named flow region information not only for painting,
2688         but also for hit-testing. This is a follow-up for https://bugs.webkit.org/show_bug.cgi?id=132121,
2689         which provided the fix for painting.
2690
2691         Test: fast/regions/assert-hit-test-multicol-in-region.html
2692
2693         * rendering/RenderLayer.cpp:
2694         (WebCore::RenderLayer::hitTestLayer):
2695
2696 2014-07-29  Zalan Bujtas  <zalan@apple.com>
2697
2698         Cleanup RenderSelectionInfoBase/RenderSelectionInfo/RenderBlockSelectionInfo.
2699         https://bugs.webkit.org/show_bug.cgi?id=135326
2700
2701         Reviewed by Darin Adler.
2702
2703         1. Move implementation to RenderSelectInfo.cpp
2704         2. RenderSelectionInfoBase/RenderSelectionInfo/RenderBlockSelectionInfo take Render* reference.
2705         3. Remove unused functions.
2706         4. Add RenderSelectionInfoBase::repaintRectangle()
2707
2708         No change in behavior.
2709
2710         * WebCore.xcodeproj/project.pbxproj:
2711         * rendering/RenderSelectionInfo.cpp: Added.
2712         (WebCore::RenderSelectionInfoBase::RenderSelectionInfoBase):
2713         (WebCore::RenderSelectionInfoBase::repaintRectangle):
2714         (WebCore::RenderSelectionInfo::RenderSelectionInfo):
2715         (WebCore::RenderSelectionInfo::repaint):
2716         (WebCore::RenderBlockSelectionInfo::RenderBlockSelectionInfo):
2717         (WebCore::RenderBlockSelectionInfo::repaint):
2718         * rendering/RenderSelectionInfo.h:
2719         (WebCore::RenderSelectionInfo::collectedSelectionRects):
2720         (WebCore::RenderSelectionInfoBase::RenderSelectionInfoBase): Deleted.
2721         (WebCore::RenderSelectionInfoBase::object): Deleted.
2722         (WebCore::RenderSelectionInfo::RenderSelectionInfo): Deleted.
2723         (WebCore::RenderSelectionInfo::repaint): Deleted.
2724         (WebCore::RenderSelectionInfo::rects): Deleted.
2725         (WebCore::RenderBlockSelectionInfo::RenderBlockSelectionInfo): Deleted.
2726         (WebCore::RenderBlockSelectionInfo::repaint): Deleted.
2727         (WebCore::RenderBlockSelectionInfo::block): Deleted.
2728         * rendering/RenderView.cpp:
2729         (WebCore::RenderView::subtreeSelectionBounds):
2730         (WebCore::RenderView::repaintSubtreeSelection):
2731         (WebCore::RenderView::clearSubtreeSelection):
2732         (WebCore::RenderView::applySubtreeSelection):
2733
2734 2014-07-28  Pratik Solanki  <psolanki@apple.com>
2735
2736         Get SharedBuffer.h out of ResourceBuffer.h (and a few other places)
2737         https://bugs.webkit.org/show_bug.cgi?id=131782
2738
2739         Original patch by Tim Horton.
2740         Reviewed by Darin Adler.
2741
2742         No new tests because no functional changes.
2743
2744         * Modules/indexeddb/IDBCallbacks.h:
2745         * Modules/indexeddb/IDBCursorBackend.h:
2746         * loader/ios/DiskImageCacheIOS.h:
2747         Forward declare SharedBuffer in headers.
2748
2749         * Modules/indexeddb/IDBRequest.cpp:
2750         * loader/cache/CachedImage.cpp:
2751         * loader/icon/IconLoader.cpp:
2752         * loader/ios/DiskImageCacheIOS.mm:
2753         * loader/cache/MemoryCache.cpp:
2754         * loader/mac/ResourceBuffer.mm:
2755         Include SharedBuffer.h in implementation files.
2756
2757         * Modules/notifications/Notification.h:
2758         * loader/appcache/ApplicationCacheGroup.h:
2759         Remove unnecessary includes.
2760
2761         * loader/ResourceBuffer.cpp:
2762         (WebCore::ResourceBuffer::adoptSharedBuffer):
2763         * loader/ResourceBuffer.h:
2764         Out-of-line adoptSharedBuffer so that the PassRefPtr doesn't require including SharedBuffer.h.
2765
2766         * platform/graphics/opentype/OpenTypeMathData.cpp:
2767         * platform/graphics/opentype/OpenTypeMathData.h:
2768         Out-of-line destructor to avoid requiring SharedBuffer.h for the RefPtr.
2769         Forward-declare SharedBuffer in the header, include in implementation.
2770
2771 2014-07-29  Zan Dobersek  <zdobersek@igalia.com>
2772
2773         [TexMap] GraphicsLayerTextureMapper::addAnimation() box size parameter should be FloatSize
2774         https://bugs.webkit.org/show_bug.cgi?id=135237
2775
2776         Reviewed by Martin Robinson.
2777
2778         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2779         (WebCore::GraphicsLayerTextureMapper::addAnimation):
2780         * platform/graphics/texmap/GraphicsLayerTextureMapper.h: The boxSize parameter of the
2781         addAnimation() method must be of the same type as the parameter in the base class
2782         declaration -- a const FloatSize reference. Only then is the base virtual method
2783         actually overriden.
2784
2785 2014-07-28  Dan Bernstein  <mitz@apple.com>
2786
2787         iOS build fix.
2788
2789         * WebCore.exp.in:
2790
2791 2014-07-28  Dan Bernstein  <mitz@apple.com>
2792
2793         Introduced CredentialBase and made Credential derive from it
2794         Work towards fixing https://bugs.webkit.org/show_bug.cgi?id=135327
2795
2796         Reviewed by Darin Adler.
2797
2798         No change in functionality.
2799
2800         * CMakeLists.txt: Updated for source file rename.
2801
2802         * WebCore.exp.in: Changed to export CredentialBase symbols.
2803
2804         * WebCore.vcxproj/WebCore.vcxproj: Updated for source file rename and new header.
2805         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
2806
2807         * WebCore.xcodeproj/project.pbxproj: Ditto.
2808
2809         * platform/network/Credential.cpp: Renamed to CredentialBase.cpp.
2810
2811         * platform/network/Credential.h: Defined Credential to derive from CredentialBase.
2812
2813         * platform/network/CredentialBase.cpp: Renamed Credential.cpp to this. Updated for the new
2814         name.
2815
2816         * platform/network/CredentialBase.h: Copied from Credential.h, renamed the class to
2817         CredentialBase, and made the constructors protected.
2818
2819 2014-07-28  Zalan Bujtas  <zalan@apple.com>
2820
2821         REGRESSION(r164133): Selection disappears after scrolling on nytimes.com
2822         https://bugs.webkit.org/show_bug.cgi?id=135361
2823
2824         Reviewed by Ryosuke Niwa.
2825
2826         Ensure that when a RenderElement, part of the current selection is removed,
2827         we recalculate and update the selection soon after layout.
2828
2829         Test: fast/dynamic/selection-gets-cleared-when-part-of-it-gets-removed.html
2830
2831         * editing/FrameSelection.cpp:
2832         (WebCore::FrameSelection::setNeedsSelectionUpdate):
2833         (WebCore::FrameSelection::didLayout): didLayout name reflects its functionality better.
2834         (WebCore::FrameSelection::layoutDidChange): Deleted.
2835         * editing/FrameSelection.h: : move some functions to private.
2836         * page/FrameView.cpp:
2837         (WebCore::FrameView::performPostLayoutTasks):
2838         * rendering/RenderBlockFlow.cpp:
2839         (WebCore::RenderBlockFlow::willBeDestroyed):
2840         * rendering/RenderElement.cpp:
2841         (WebCore::RenderElement::removeChildInternal):
2842         * rendering/RenderInline.cpp:
2843         (WebCore::RenderInline::willBeDestroyed):
2844
2845 2014-07-28  Dean Jackson  <dino@apple.com>
2846
2847         [Media iOS] Touching play button feels unresponsive
2848         https://bugs.webkit.org/show_bug.cgi?id=135370
2849         <rdar://problem/17756281>
2850
2851         Reviewed by Simon Fraser.
2852
2853         Add an :active rule that shows a slightly darker button when touched.
2854
2855         * Modules/mediacontrols/mediaControlsiOS.css:
2856         (audio::-webkit-media-controls-start-playback-button:active):
2857
2858 2014-07-28  Brady Eidson  <beidson@apple.com>
2859
2860         REGRESSION(168376): Standalone images pasted to Outlook 2011 don't display
2861         <rdar://problem/17768371> and https://bugs.webkit.org/show_bug.cgi?id=135363
2862
2863         Reviewed by Tim Horton.
2864
2865         Outlook isn’t prepared to handle the resource load callbacks when sent synchronously.
2866
2867         r168376 was an optimization that we no longer need, so the simplest fix is to roll it out.
2868
2869         * editing/mac/EditorMac.mm:
2870         (WebCore::Editor::WebContentReader::readImage):
2871
2872         * loader/archive/ArchiveResource.cpp:
2873         (WebCore::ArchiveResource::ArchiveResource):
2874         * loader/archive/ArchiveResource.h:
2875         (WebCore::ArchiveResource::setShouldLoadImmediately): Deleted.
2876         (WebCore::ArchiveResource::shouldLoadImmediately): Deleted.
2877
2878         * loader/cache/CachedResourceLoader.cpp:
2879         (WebCore::CachedResourceLoader::requestResource):
2880
2881 2014-07-28  Mark Hahnenberg  <mhahnenberg@apple.com>
2882
2883         ASSERTION FAILED: m_heap->vm()->currentThreadIsHoldingAPILock()
2884         https://bugs.webkit.org/show_bug.cgi?id=135352
2885
2886         Reviewed by Oliver Hunt.
2887
2888         * Modules/plugins/QuickTimePluginReplacement.mm:
2889         (WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected): This should be taking a 
2890         JSLock like its sibling methods do (e.g. installReplacement).
2891
2892 2014-07-28  Antti Koivisto  <antti@apple.com>
2893
2894         <embed> videos flashes constantly while playing inline on iPad, making it unwatchable
2895         https://bugs.webkit.org/show_bug.cgi?id=135356
2896         <rdar://problem/16828238>
2897
2898         Reviewed by Simon Fraser.
2899         
2900         The shadow tree for media controls is scheduling style recalc. The general silliness of
2901         HTMLPlugInImageElement::willRecalcStyle/willDetachRenderers is turning those into render
2902         tree reconstructions causing flicker.
2903
2904         * html/HTMLPlugInImageElement.cpp:
2905         (WebCore::HTMLPlugInImageElement::willRecalcStyle):
2906         
2907             Don't do the forced renderer reconstruction if there is no style change for the element
2908             or its ancestors. This way recalcs scheduled by the shadow tree don't trigger the widget
2909             update code path.
2910
2911 2014-07-27  Brent Fulgham  <bfulgham@apple.com>
2912
2913         [Mac, iOS] Paint-on closed captions get out-of-order in Safari
2914         https://bugs.webkit.org/show_bug.cgi?id=135332
2915         <rdar://problem/15317278>
2916
2917         Reviewed by Jer Noble.
2918
2919         * html/shadow/MediaControlElements.cpp:
2920         (WebCore::MediaControlTextTrackContainerElement::updateDisplay): If the
2921         number of active cues is greater than the current set of CSS boxes representing
2922         the cues, throw away the CSS boxes and re-layout all the cues.
2923         * html/track/InbandGenericTextTrack.cpp:
2924         (WebCore::InbandGenericTextTrack::addGenericCue): Add some logging.
2925         (WebCore::InbandGenericTextTrack::removeGenericCue): Ditto.
2926         * html/track/TextTrackCueGeneric.cpp:
2927         (WebCore::TextTrackCueGeneric::isOrderedBefore): Revise ordering rules so that we put
2928         newer cues earlier in the layout order so they are drawn towards the bottom
2929         of the screen. Only do this for Generic captions.
2930         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
2931         (WebCore::InbandTextTrackPrivateAVF::processAttributedStrings): Adjust logging
2932         messages.
2933         (WebCore::InbandTextTrackPrivateAVF::removeCompletedCues): Add logging.
2934
2935 2014-07-28  Andreas Kling  <akling@apple.com>
2936
2937         REGRESSION (r160806): CSS zoom property doesn't work on anything inside anchors.
2938         <https://webkit.org/b/135344>
2939         <rdar://problem/17759577>
2940
2941         When DeprecatedStyleBuilder applies the CSS zoom property (ApplyPropertyZoom)
2942         it first resets the "effective zoom" by calling RenderStyle::setEffectiveZoom().
2943
2944         This mechanism was not resistent to being called multiple times, due to the
2945         optimization in RenderStyle::setZoom() to avoid copy-on-writing the shared data
2946         when setting some property to the already-set value.
2947
2948         The bug would happen in this sequence:
2949
2950         ApplyPropertyZoom:
2951             - setEffectiveZoom(1);
2952             - setZoom(2); // this updates the effective zoom
2953         ApplyPropertyZoom:
2954             - setEffectiveZoom(1);
2955             - setZoom(2); // this doesn't update the effective zoom
2956
2957         When we run the second setZoom(2); call, the RenderStyle's zoom value is 2
2958         already and we'll early return without updating the effective zoom.
2959
2960         This change moves the updating of the effective zoom in setZoom() to take place
2961         before the early return due to overwriting with the same value.
2962
2963         Note: the fact that we're apply the zoom property twice is an inefficiency that
2964         we should figure out a way to avoid in the future.
2965
2966         Reviewed by Simon Fraser.
2967
2968         Test: fast/css/zoom-inside-link.html
2969
2970         * rendering/style/RenderStyle.h:
2971         (WebCore::RenderStyle::setZoom):
2972
2973 2014-07-28  Bear Travis  <betravis@adobe.com>
2974
2975         [CSS Font Loading] Update Font Loading Code
2976         https://bugs.webkit.org/show_bug.cgi?id=135340
2977
2978         Reviewed by Antti Koivisto.
2979
2980         Update the Font Loading code to build again, as trunk has evolved
2981         since the feature was originally written. Mostly, this requires
2982         updating the code to work with the new Font representation.
2983
2984         The original tests were enabled only for the Chromium port.
2985         They will need to be updated when the feature is enabled by default.
2986
2987         * WebCore.xcodeproj/project.pbxproj: Add missing files.
2988         * css/FontLoader.cpp: Update to new Font representation.
2989         (WebCore::LoadFontCallback::createFromParams):
2990         (WebCore::LoadFontCallback::~LoadFontCallback):
2991         (WebCore::FontLoader::loadFont):
2992         (WebCore::FontLoader::checkFont):
2993         (WebCore::applyPropertyToCurrentStyle):
2994         (WebCore::FontLoader::resolveFontStyle):
2995
2996 2014-07-28  Wenson Hsieh  <wenson_hsieh@apple.com>
2997
2998         Let WheelEvent wrap a PlatformWheelEvent
2999         https://bugs.webkit.org/show_bug.cgi?id=135244
3000
3001         WheelEvent now wraps a PlatformWheelEvent. m_directionInvertedFromDevice, as well as m_phase and m_momentumPhase
3002         have been removed, since the information is redundant in PlatformWheelEvent. Note that deltaX and deltaY have
3003         NOT been replaced, since we need double precision instead of float precision.
3004
3005         Reviewed by Beth Dakin.
3006
3007         No new tests, since behavior should not have changed.
3008
3009         * dom/WheelEvent.cpp:
3010         (WebCore::WheelEvent::WheelEvent):
3011         (WebCore::WheelEvent::initWheelEvent):
3012         * dom/WheelEvent.h:
3013         (WebCore::WheelEvent::wheelEvent): Returns a non-null pointer to the PlatformWheelEvent iff WheelEvent was initialized by PlatformWheelEvent.
3014         (WebCore::WheelEvent::webkitDirectionInvertedFromDevice): Updated to use PlatformWheelEvent.
3015         (WebCore::WheelEvent::phase): Updated to use PlatformWheelEvent.
3016         (WebCore::WheelEvent::momentumPhase): Updated to use PlatformWheelEvent.
3017
3018 2014-07-28  Brent Fulgham  <bfulgham@apple.com>
3019
3020         Unreviewed 'merge' fix.
3021
3022         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
3023         Correct line endings to allow EWS merges again.
3024
3025 2014-07-28  Zoltan Horvath  <zoltan@webkit.org>
3026
3027         [CSS3-Text] Adjust text-justify implementation to the latest spec
3028         https://bugs.webkit.org/show_bug.cgi?id=135317
3029
3030         Reviewed by Darin Adler.
3031
3032         Text-justify no longer accepts the following values: Inter-ideograph, inter-
3033         cluster, and kashida. This patch removes them and updates the tests as well.
3034
3035         [1] http://dev.w3.org/csswg/css-text-3/#propdef-text-justify
3036
3037         Updated existing tests.
3038
3039         * css/CSSParser.cpp:
3040         (WebCore::isValidKeywordPropertyAndValue):
3041         * css/CSSPrimitiveValueMappings.h:
3042         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3043         (WebCore::CSSPrimitiveValue::operator TextJustify):
3044         * css/CSSValueKeywords.in:
3045         * rendering/style/RenderStyle.cpp:
3046         (WebCore::RenderStyle::changeRequiresLayout):
3047         * rendering/style/RenderStyleConstants.h:
3048         * rendering/style/StyleRareInheritedData.h:
3049
3050 2014-07-28  Radu Stavila  <stavila@adobe.com>
3051
3052         REGRESSION (r169105): Crash in selection
3053         https://bugs.webkit.org/show_bug.cgi?id=134303
3054
3055         Reviewed by Mihnea Ovidenie.
3056
3057         When splitting the selection between different subtrees, all subtrees must have their selection cleared before
3058         starting to apply the new selection. Otherwise, when selecting objects in a named flow thread and going up
3059         its containing block chain, we can end up in the view's selection root, which has not yet been updated and so
3060         we get inconsistent data.
3061
3062         To achieve this goal, the selection update was split into a "clear" and an "apply" method. The updateSelectionForSubtrees
3063         method first iterates through all subtrees and performs the "clear" method and then starts all over again
3064         and performs the "apply" method.
3065
3066         Test: fast/regions/selection/crash-deselect.html
3067
3068         * WebCore.xcodeproj/project.pbxproj:
3069         * rendering/RenderSelectionInfo.h:
3070         * rendering/RenderView.cpp:
3071         (WebCore::RenderView::setSelection):
3072         (WebCore::RenderView::splitSelectionBetweenSubtrees):
3073         (WebCore::RenderView::updateSelectionForSubtrees): Added, clears and re-applies selection for all selection subtrees.
3074         (WebCore::RenderView::clearSubtreeSelection): Added, clears selection and returns previously selected information.
3075         (WebCore::RenderView::applySubtreeSelection): Added, updates the selection status of all objects inside the selection tree, compares old and new data and repaints accordingly.
3076         (WebCore::RenderView::setSubtreeSelection): Deleted.
3077         * rendering/RenderView.h:
3078         * rendering/SelectionSubtreeRoot.cpp:
3079         (WebCore::SelectionSubtreeRoot::SelectionSubtreeRoot):
3080         * rendering/SelectionSubtreeRoot.h:
3081         (WebCore::SelectionSubtreeRoot::OldSelectionData::OldSelectionData):
3082
3083 2014-07-28  Yusuke Suzuki  <utatane.tea@gmail.com>
3084
3085         CSS: Fix :visited behavior for SubSelectors
3086         https://bugs.webkit.org/show_bug.cgi?id=135324
3087
3088         Reviewed by Benjamin Poulain.
3089
3090         Disable :visited match for the selectors that has SubSelectors.
3091
3092         Tests: fast/history/nested-visited-test-complex.html
3093                fast/history/sibling-visited-test-complex.html
3094
3095         * css/SelectorChecker.cpp:
3096         (WebCore::SelectorChecker::matchRecursively):
3097
3098 2014-07-27  Ryuan Choi  <ryuan.choi@samsung.com>
3099
3100         Remove GraphicsSurfaceGLX.cpp
3101         https://bugs.webkit.org/show_bug.cgi?id=135279
3102
3103         Reviewed by Darin Adler.
3104
3105         GraphicsSurfaceGLX.cpp is not used since Qt dropped and Efl port changed at r146458
3106
3107         * platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp: Removed.
3108
3109 2014-07-27  Bruno de Oliveira Abinader  <bruno.d@partner.samsung.com>
3110
3111         Support for :enabled selector on Anchor & Area elements
3112         https://bugs.webkit.org/show_bug.cgi?id=134826
3113
3114         Reviewed by Darin Adler.
3115
3116         Updates the PseudoClassEnabled selector checker to check for Anchor & Area
3117         elements with a 'href' attribute.
3118
3119         Spec: http://html.spec.whatwg.org/#selector-enabled
3120
3121         Test: fast/css/css-selector-enabled-links.html
3122
3123         * css/SelectorCheckerTestFunctions.h:
3124         (WebCore::isEnabled): Added check for anchor & area elements.
3125
3126 2014-07-27  Daniel Bates  <dabates@apple.com>
3127
3128         [WK2] Crash when accessing window.localStorage after calling window.close()
3129         https://bugs.webkit.org/show_bug.cgi?id=135328
3130         <rdar://problem/17315237>
3131
3132         Reviewed by Sam Weinig.
3133
3134         Fixes an issue where accessing local storage for the first time after calling window.close()
3135         causes a crash.
3136
3137         For now, we should disallow accessing local storage after calling window.close() regardless of
3138         whether it's the first access to local storage as this seems like a bad idiom to support. Note,
3139         this represents a change in behavior from WebKit1. If such usage of window.localStorage turns
3140         out to be reasonable then we can visit this decision again in <https://bugs.webkit.org/show_bug.cgi?id=135330>.
3141
3142         Tests: storage/domstorage/localstorage/access-storage-after-window-close.html
3143                storage/domstorage/localstorage/access-storage-then-set-value-in-storage-after-window-close.html
3144                storage/domstorage/localstorage/set-value-in-storage-after-window-close.html
3145
3146         * page/DOMWindow.cpp:
3147         (WebCore::DOMWindow::localStorage): Modified to only return the cached local storage or
3148         create a new local storage so long as the page isn't being closed. Also, substitute nullptr
3149         for 0.
3150         (WebCore::DOMWindow::close): Call Page::setIsClosing() to mark that the page is closing.
3151         * page/Page.cpp:
3152         (WebCore::Page::Page): Initialize m_isClosing to false.
3153         * page/Page.h:
3154         (WebCore::Page::setIsClosing): Added.
3155         (WebCore::Page::isClosing): Added.
3156
3157 2014-07-27  Filip Pizlo  <fpizlo@apple.com>
3158
3159         Merge r170090, r170092, r170129, r170141, r170161, r170215, r170275, r170375, r170376, r170382, r170383, r170399, r170436, r170489, r170490, r170556 from ftlopt.
3160         
3161         This fixes the previous mismerge and adds test coverage for the thing that went wrong.
3162         Also, this adds some helpers for making it easier to inspect JavaScript values.
3163
3164         * testing/Internals.cpp:
3165         (WebCore::Internals::description):
3166         * testing/Internals.h:
3167         * testing/Internals.idl:
3168
3169     2014-07-25  Mark Lam  <mark.lam@apple.com>
3170     
3171             [ftlopt] Renamed DebuggerActivation to DebuggerScope.
3172             <https://webkit.org/b/134273>
3173     
3174             Reviewed by Michael Saboff.
3175     
3176             No new tests.
3177     
3178             * ForwardingHeaders/debugger/DebuggerActivation.h: Removed.
3179             - Removed because this is not used.
3180     
3181 2014-07-26  Brian J. Burg  <burg@cs.washington.edu>
3182
3183         Web Replay: log and enforce session/segment state machine transitions
3184         https://bugs.webkit.org/show_bug.cgi?id=135224
3185
3186         Reviewed by Timothy Hatcher.
3187
3188         For debugging purposes, log session and segment state transitions.
3189         Assert that segment state transitions are valid.
3190
3191         No new tests. No behavior was changed.
3192
3193         * replay/ReplayController.cpp:
3194         (WebCore::logDispatchedDOMEvent):
3195         (WebCore::sessionStateToString):
3196         (WebCore::segmentStateToString):
3197         (WebCore::ReplayController::setSessionState):
3198         (WebCore::ReplayController::setSegmentState):
3199         (WebCore::ReplayController::createSegment):
3200         (WebCore::ReplayController::completeSegment): Remove a wrong state transition.
3201         (WebCore::ReplayController::loadSegmentAtIndex):
3202         (WebCore::ReplayController::unloadSegment): Fix a now-erroneous assertion.
3203         (WebCore::ReplayController::startPlayback):
3204         (WebCore::ReplayController::pausePlayback):
3205         (WebCore::ReplayController::willDispatchEvent):
3206         (WebCore::ReplayController::cancelPlayback):
3207         * replay/ReplayController.h:
3208
3209 2014-07-26  Filip Pizlo  <fpizlo@apple.com>
3210
3211         Unreviewed, roll out r171641-r171644. It broke some tests; will investigate and
3212         reland later.
3213
3214         * ForwardingHeaders/debugger/DebuggerActivation.h: Added.
3215
3216 2014-07-26  Timothy Horton  <timothy_horton@apple.com>
3217
3218         Crash in Web Content Process under ~PDFDocument under clearTouchEventListeners at topDocument()
3219         https://bugs.webkit.org/show_bug.cgi?id=135319
3220         <rdar://problem/17315168>
3221
3222         Reviewed by Darin Adler and Antti Koivisto.
3223
3224         * dom/Document.h:
3225         * dom/Document.cpp:
3226         (WebCore::Document::Document):
3227         (WebCore::Document::prepareForDestruction):
3228         Add a flag on Document, m_hasPreparedForDestruction, which ensures
3229         that each Document only goes through prepareForDestruction() once.
3230         prepareForDestruction() can be called a number of times during teardown,
3231         but it's only necessary to actually execute it once.
3232         
3233         This was previously achieved by virtue of all callers of prepareForDestruction()
3234         first checking hasLivingRenderTree, and prepareForDestruction() tearing down
3235         the render tree, but that meant that prepareForDestruction() was not called
3236         for Documents who never had a render tree in the first place.
3237
3238         The only part of prepareForDestruction() that is now predicated on hasLivingRenderTree()
3239         is the call to destroyRenderTree(); the rest of the function has the potential to be relevant
3240         for non-rendered placeholder documents and can safely deal with them in other ways.
3241
3242         It is important to call prepareForDestruction() on non-rendered placeholder documents
3243         because some of the cleanup (like disconnectFromFrame()) is critical to safe destruction.
3244
3245         * loader/FrameLoader.cpp:
3246         (WebCore::FrameLoader::clear):
3247         Call prepareForDestruction() even if we don't have a living render tree.
3248         For the sake of minimizing change, removeFocusedNodeOfSubtree still
3249         depends on having a living render tree before calling prepareForDestruction().
3250
3251         * page/Frame.cpp:
3252         (WebCore::Frame::setView):
3253         (WebCore::Frame::setDocument):
3254         Call prepareForDestruction() even if we don't have a living render tree.
3255
3256 2014-07-25  Filip Pizlo  <fpizlo@apple.com>
3257
3258         Merge r170090, r170092, r170129, r170141, r170161, r170215, r170275, r170375, r170376, r170382, r170383, r170399, r170436, r170489, r170490, r170556 from ftlopt.
3259
3260     2014-07-25  Mark Lam  <mark.lam@apple.com>
3261     
3262             [ftlopt] Renamed DebuggerActivation to DebuggerScope.
3263             <https://webkit.org/b/134273>
3264     
3265             Reviewed by Michael Saboff.
3266     
3267             No new tests.
3268     
3269             * ForwardingHeaders/debugger/DebuggerActivation.h: Removed.
3270             - Removed because this is not used.
3271     
3272 2014-07-25  Zalan Bujtas  <zalan@apple.com>
3273
3274         Subpixel rendering: Rounded rect gets non-renderable at certain subpixel size.
3275         https://bugs.webkit.org/show_bug.cgi?id=135314
3276         <rdar://problem/17812921>
3277
3278         Reviewed by Tim Horton.
3279
3280         While calculating the rounded rect for painting, the radius is adjusted to compensate
3281         for the pixel snapped size. However while scaling the radius, certain values overflow
3282         (float) mantissa and it produces a non-renderable rounded rect where the radius becomes bigger
3283         than the rectangle dimensions. In such cases, we need to shrink the radius to make it
3284         renderable again.
3285
3286         Test: transitions/rounded-rect-becomes-non-renderable-while-transitioning.html
3287
3288         * platform/graphics/RoundedRect.cpp:
3289         (WebCore::RoundedRect::pixelSnappedRoundedRectForPainting): shrink the radius by
3290         one device pixel. It is as good as any other small value.
3291
3292 2014-07-25  Jer Noble  <jer.noble@apple.com>
3293
3294         [EME][Mac] CDM error messages not piped through to MediaKeySession correctly; clients don't receive error events
3295         https://bugs.webkit.org/show_bug.cgi?id=135312
3296         <rdar://problem/17817223>
3297
3298         Reviewed by Brent Fulgham.
3299
3300         Set (and clear) the client interface so that errors can be piped from the CDMSession up to the MediaKeySession.
3301
3302         * Modules/encryptedmedia/MediaKeySession.cpp:
3303         (WebCore::MediaKeySession::MediaKeySession):
3304         (WebCore::MediaKeySession::close):
3305
3306 2014-07-25  Jer Noble  <jer.noble@apple.com>
3307
3308         [MSE] Playback stalls & readyState drops to HAVE_CURRENT_DATA at end of stream with unbalanced buffered SourceBuffers
3309         https://bugs.webkit.org/show_bug.cgi?id=135291
3310         <rdar://problem/17715503>
3311
3312         Reviewed by Sam Weinig.
3313
3314         Test: media/media-source/media-source-end-of-stream-buffered.html
3315
3316         When determining the correct ReadyState for the MediaSource in monitorSourceBuffers(), use the same
3317         definition of "buffered" as is used in the calculation of HTMLMediaElement.buffered and in the
3318         Stream Ended algorithm. Namely, when the stream has ended, treat each SourceBuffer as if its last
3319         buffered range extends to the duration of the stream. This allows playback to continue through to
3320         the duration without stalling due to monitorSourceBuffers().
3321
3322         * Modules/mediasource/SourceBuffer.cpp:
3323         (WebCore::SourceBuffer::bufferedAccountingForEndOfStream): Added; extends the last range in buffered
3324             to MediaSource::duration() if the MediaSource is ended.
3325         (WebCore::SourceBuffer::hasCurrentTime): Uses bufferedAccountingForEndOfStream().
3326         (WebCore::SourceBuffer::hasFutureTime): Ditto.
3327         (WebCore::SourceBuffer::canPlayThrough): Ditto.
3328         * Modules/mediasource/SourceBuffer.h:
3329
3330         Add a convenience method for determining whether the MediaSource has ended:
3331         * Modules/mediasource/MediaSource.cpp:
3332         (WebCore::MediaSource::isEnded):
3333         * Modules/mediasource/MediaSource.h:
3334
3335         Add start() and end() methods that don't take a (usually ignored) isValid inout parameter. Add duration()
3336         and maximumBufferedTime() convenience methods:
3337         * platform/graphics/PlatformTimeRanges.cpp:
3338         (WebCore::PlatformTimeRanges::start):
3339         (WebCore::PlatformTimeRanges::end):
3340         (WebCore::PlatformTimeRanges::duration):
3341         (WebCore::PlatformTimeRanges::maximumBufferedTime):
3342         * platform/graphics/PlatformTimeRanges.h:
3343
3344 2014-07-25  Pratik Solanki  <psolanki@apple.com>
3345
3346         [iOS] REGRESSION(r171526): Images fail to load sometimes
3347         https://bugs.webkit.org/show_bug.cgi?id=135304
3348         <rdar://problem/17811922>
3349
3350         Reviewed by Alexey Proskuryakov.
3351
3352         SharedBuffer::createCFData() calls data() as a way to coalesce the data array elements and
3353         segments into m_buffer. However, data() has an optimization where if we had a single element
3354         in the data array, it would just return that and not do coalescing. So when we passed
3355         m_buffer to WebCoreSharedData, we passed a buffer with no data in it.
3356
3357         Fix this by bringing the optimization to createCFData() and return the CFDataRef from the
3358         data array if we just have a single element.
3359
3360         No new tests. Should be covered by existing tests.
3361
3362         * platform/mac/SharedBufferMac.mm:
3363         (WebCore::SharedBuffer::createCFData):
3364
3365 2014-07-25  Jer Noble  <jer.noble@apple.com>
3366
3367         [MSE] High CPU usage in SampleMap::findSamplesWithinPresentationRange() with a large number of buffered samples.
3368         https://bugs.webkit.org/show_bug.cgi?id=135247
3369
3370         Reviewed by Geoffrey Garen.
3371
3372         Anchor our search for overlapping frames to the end of the search range when the overlap range is sufficiently
3373         close to the end of the search range. The common case for this search is when a sample is about to be appended
3374         to the end of the sample queue, so this should turn most searches into no-ops.
3375
3376         * Modules/mediasource/SampleMap.cpp:
3377         (WebCore::PresentationOrderSampleMap::findSamplesWithinPresentationRangeFromEnd):
3378         * Modules/mediasource/SampleMap.h:
3379         * Modules/mediasource/SourceBuffer.cpp:
3380         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
3381
3382 2014-07-25  Gavin Barraclough  <baraclough@apple.com>
3383
3384         Yosemite version number is 101000
3385         https://bugs.webkit.org/show_bug.cgi?id=135301
3386
3387         Reviewed by Sam Weinig.
3388
3389         * WebCore.exp.in:
3390         * platform/ContentFilter.h:
3391         * platform/mac/ScrollViewMac.mm:
3392         (WebCore::ScrollView::platformVisibleContentRect):
3393         * platform/mac/ThemeMac.mm:
3394         (WebCore::updateStates):
3395         (WebCore::paintToggleButton):
3396         * platform/network/cf/CookieJarCFNet.cpp:
3397         (WebCore::copyCookiesForURLWithFirstPartyURL):
3398         * platform/network/cf/ResourceRequest.h:
3399         (WebCore::ResourceRequest::resourcePrioritiesEnabled):
3400         * rendering/RenderThemeMac.mm:
3401         (WebCore::RenderThemeMac::search):
3402
3403 2014-07-25  David Hyatt  <hyatt@apple.com>
3404
3405         [New Multicolumn] RenderViews paginated as RL or LR don't handle percentage widths correctly.
3406         REGRESSION: Images don’t scale to fit in page in vertical text books
3407
3408         https://bugs.webkit.org/show_bug.cgi?id=135204
3409         <rdar://problem/17043792>
3410         
3411         Reviewed by Simon Fraser.
3412
3413         Added fast/multicol/pagination/RightToLeft-max-width.html
3414
3415         * rendering/RenderView.cpp:
3416         (WebCore::RenderView::availableLogicalHeight):
3417         Put back in the same code that used to exist for the old columns (but ported to the new
3418         columns).
3419     
3420 2014-07-25  Dan Bernstein  <mitz@apple.com>
3421
3422         [Mac] Unneeded MobileMe workaround in ResourceHandle::receivedCredential
3423         https://bugs.webkit.org/show_bug.cgi?id=135297
3424
3425         Reviewed by Alexey Proskuryakov.
3426
3427         * platform/network/mac/ResourceHandleMac.mm:
3428         (WebCore::ResourceHandle::receivedCredential): Removed the site-specific behavior for
3429         gallery.me.com.
3430
3431 2014-07-25  Commit Queue  <commit-queue@webkit.org>
3432
3433         Unreviewed, rolling out r171480.
3434         https://bugs.webkit.org/show_bug.cgi?id=135300
3435
3436         it broke replace