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