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