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