3b3f4a9147163a3fbe724d8cd71f132972cad369
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2014-07-24  Daniel Bates  <dabates@apple.com>
2             And Alexey Proskuryakov  <ap@apple.com>
3
4         [iOS] REGRESSION (WebKit2): Can't login to Wordpress.com, facebook.com when always allowing cookies
5         https://bugs.webkit.org/show_bug.cgi?id=135273
6         <rdar://problem/17598815>
7
8         Reviewed by Alexey Proskuryakov.
9
10         Fixes an issue where cookies may be created in the wrong cookie store.
11
12         Currently, when we update the CFURLRequest object associated with a ResourceRequest object
13         we explicitly set a cookie storage, cookie accept policy, and SSL properties based on the
14         corresponding values in the old CFURLRequest object (if we have one). This ultimately leads
15         to CFNetwork associating the cookies for the request with a different cookie store when we
16         handle the request in the NetworkProcess. Instead, we shouldn't set these properties
17         explicitly as we already copy them implicitly earlier (via CFURLRequestCreateMutableCopy()).
18
19         * platform/network/cf/ResourceRequestCFNet.cpp:
20         (WebCore::ResourceRequest::doUpdatePlatformRequest):
21
22 2014-07-24  Peyton Randolph  <prandolph@apple.com>
23
24         Rename feature flag for long-press gesture on Mac.                                                                   
25         https://bugs.webkit.org/show_bug.cgi?id=135259                                                                  
26
27         Reviewed by Beth Dakin.
28
29         * Configurations/FeatureDefines.xcconfig:
30         Rename LINK_LONG_PRESS to MAC_LONG_PRESS.
31
32 2014-07-24  Dan Bernstein  <mitz@apple.com>
33
34         Fixed Windows build fix.
35
36         * platform/network/cf/AuthenticationCF.cpp:
37
38 2014-07-24  Dan Bernstein  <mitz@apple.com>
39
40         Attempted Windows build fix.
41
42         * platform/network/cf/AuthenticationCF.cpp:
43         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
44         * platform/network/cf/CredentialStorageCFNet.cpp:
45         (WebCore::CredentialStorage::getFromPersistentStorage):
46         * platform/network/cf/ProtectionSpaceCFNet.cpp:
47         (WebCore::ProtectionSpace::receivesCredentialSecurely):
48         (WebCore::ProtectionSpaceBase::receivesCredentialSecurely): Deleted.
49
50 2014-07-24  Dan Bernstein  <mitz@apple.com>
51
52         <rdar://problem/17766348> [Cocoa] WebCore::ProtectionSpace doesn’t preserve all NSURLProtectionSpace properties, such as the distinguishedNames array
53         https://bugs.webkit.org/show_bug.cgi?id=135229
54
55         Reviewed by Alexey Proskuryakov.
56
57         * CMakeLists.txt: Updated for rename of a source file.
58
59         * WebCore.exp.in: Updated.
60
61         * WebCore.vcxproj/WebCore.vcxproj: Updated for rename of source files, added
62         ProtectionSpaceCFNet.{cpp,h}.
63         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
64
65         * WebCore.xcodeproj/project.pbxproj: Updated for rename of source files, added
66         ProtectionSpaceCococa.{h.mm}.
67
68         * platform/network/ProtectionSpace.cpp: Renamed to ProtectionSpaceBase.cpp.
69         * platform/network/ProtectionSpace.h: This file was renamed to ProtectionSpaceBase.h, and
70         in its place added a generic ProtectionSpace class that just derives from
71         ProtectionSpaceBase. For Cocoa and CFNetwork, ProtectionSpace{Cocoa,CFNet}.h is included
72         instead of the generic class.
73
74         * platform/network/ProtectionSpaceBase.cpp: Renamed ProtectionSpace.cpp to this.
75         (WebCore::ProtectionSpaceBase::ProtectionSpaceBase): Updated for rename.
76         (WebCore::ProtectionSpaceBase::host): Ditto.
77         (WebCore::ProtectionSpaceBase::port): Ditto.
78         (WebCore::ProtectionSpaceBase::serverType): Ditto.
79         (WebCore::ProtectionSpaceBase::isProxy): Ditto.
80         (WebCore::ProtectionSpaceBase::realm): Ditto.
81         (WebCore::ProtectionSpaceBase::authenticationScheme): Ditto.
82         (WebCore::ProtectionSpaceBase::receivesCredentialSecurely): Removed CFNetwork-specific part,
83         which is now implemented in ProtectionSpaceCFNet.cpp.
84         (WebCore::ProtectionSpaceBase::compare): Replaced operator== with this, and made it call
85         ProtectionSpace::platformCompare at the end if needed.
86
87         * platform/network/ProtectionSpaceBase.h: Renamed ProtectionSpace.h to this.
88         (WebCore::ProtectionSpaceBase::encodingRequiresPlatformData): Added with a default
89         implementation that returns false, for ProtectionSpace implementations to override.
90         (WebCore::ProtectionSpaceBase::platformCompare): Added with a default implementation that
91         returns true, for ProtectionSpace implementations to override.
92         (WebCore::operator==): Changed to call compare.
93
94         * platform/network/cf/AuthenticationCF.cpp:
95         (WebCore::AuthenticationChallenge::AuthenticationChallenge): Changed to use the
96         ProtectionSpace constructor that takes a CFURLProtectionSpaceRef.
97         (WebCore::createCF): Changed to use ProtectionSpace::cfSpace.
98
99         * platform/network/cf/AuthenticationCF.h: Guarded a couple of functiosn that aren’t used in
100         Cocoa with #if PLATFORM(WIN).
101
102         * platform/network/cf/CredentialStorageCFNet.cpp:
103         (WebCore::CredentialStorage::getFromPersistentStorage): Changed to use
104         ProtectionSpace::cfSpace.
105         (WebCore::CredentialStorage::saveToPersistentStorage): Ditto.
106
107         * platform/network/cf/ProtectionSpaceCFNet.cpp: Added.
108         (WebCore::ProtectionSpaceBase::receivesCredentialSecurely): Override with the
109         CFNetwork-specific test that was previously in ProtectionSpace.cpp.
110
111         * platform/network/cf/ProtectionSpaceCFNet.h: Copied from Source/WebCore/platform/network/ProtectionSpace.h.
112         Declare ProtectionSpace and override receivesCredentialSecurely.
113
114         * platform/network/mac/AuthenticationMac.h: Deleted the ProtectionSpace core() and mac().
115         * platform/network/mac/AuthenticationMac.mm:
116         (WebCore::AuthenticationChallenge::AuthenticationChallenge): Changed to use the
117         ProtectionSpace constructor that takes an NSURLProtectionSpace.
118         (WebCore::mac): Changed to use ProtectionSpace::nsSpace.
119
120         * platform/network/mac/CredentialStorageMac.mm:
121         (WebCore::CredentialStorage::getFromPersistentStorage): Ditto.
122
123         * platform/network/mac/ResourceHandleMac.mm:
124         (WebCore::ResourceHandle::receivedCredential): Changed to use the ProtectionSpace
125         constructor that takes an NSURLProtectionSpace.
126
127         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
128         (-[WebCoreResourceHandleAsDelegate connection:canAuthenticateAgainstProtectionSpace:]):
129         Ditto.
130
131         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
132         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
133         Ditto.
134
135 2014-07-24  Benjamin Poulain  <benjamin@webkit.org>
136
137         [WK2] Fixed/Sticky layers can get mispositioned when the layer tree commit change their position or size
138         https://bugs.webkit.org/show_bug.cgi?id=135227
139         <rdar://problem/17279500>
140
141         Reviewed by Simon Fraser.
142
143         Keep track of the creation/destruction of Fixed and Sticky nodes in the ScrollingTree.
144
145         * page/scrolling/ScrollingTree.cpp:
146         (WebCore::ScrollingTree::ScrollingTree):
147         * page/scrolling/ScrollingTree.h:
148         (WebCore::ScrollingTree::hasFixedOrSticky):
149         (WebCore::ScrollingTree::fixedOrStickyNodeAdded):
150         (WebCore::ScrollingTree::fixedOrStickyNodeRemoved):
151         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
152         (WebCore::ScrollingTreeFixedNode::ScrollingTreeFixedNode):
153         (WebCore::ScrollingTreeFixedNode::~ScrollingTreeFixedNode):
154         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
155         (WebCore::ScrollingTreeStickyNode::ScrollingTreeStickyNode):
156         (WebCore::ScrollingTreeStickyNode::~ScrollingTreeStickyNode):
157
158 2014-07-24  Wenson Hsieh  <wenson_hsieh@apple.com>
159
160         Let WheelEvent wrap a PlatformWheelEvent
161         https://bugs.webkit.org/show_bug.cgi?id=135244
162
163         When WheelEvent is initialized with a PlatformWheelEvent, store that PlatformWheelEvent for future use.
164
165         Reviewed by Beth Dakin.
166
167         No new tests because behavior should not have changed.
168
169         * dom/WheelEvent.cpp: Added method to access the PlatformWheelEvent.
170         (WebCore::WheelEvent::WheelEvent):
171         * dom/WheelEvent.h: Added field to store PlatformWheelEvent, if initialized via PlatformWheelEvent.
172         (WebCore::WheelEvent::wheelEvent):
173
174 2014-07-24  Brian J. Burg  <burg@cs.washington.edu>
175
176         Web Replay: don't encode/decode primitive types that lack explicit sizes
177         https://bugs.webkit.org/show_bug.cgi?id=133430
178
179         Reviewed by Anders Carlsson.
180
181         Remove uses of unsigned long in encode/decode methods because the type lacks an
182         explicit size. Move frame index serialization away from using unsigned long.
183
184         * replay/ReplayController.cpp:
185         (WebCore::logDispatchedDOMEvent): Fix the format string.
186         * replay/SerializationMethods.cpp:
187         (WebCore::frameIndexFromDocument):
188         (WebCore::frameIndexFromFrame):
189         (WebCore::documentFromFrameIndex):
190         (WebCore::frameFromFrameIndex):
191         (JSC::EncodingTraits<PluginData>::encodeValue):
192         (JSC::EncodingTraits<PluginData>::decodeValue):
193         * replay/SerializationMethods.h:
194         * replay/WebInputs.json: Remove primitive types without explicit sizes.
195
196 2014-07-24  Pratik Solanki  <psolanki@apple.com>
197
198         Sharing SharedBuffer between WebCore and ImageIO is racy and crash prone
199         https://bugs.webkit.org/show_bug.cgi?id=135069
200         <rdar://problem/17470655>
201
202         Reviewed by Simon Fraser.
203
204         When passing image data to ImageIO for decoding, we pass an NSData subclass that is a wraper
205         around SharedBuffer. This can be a problem when ImageIO tries to access the data on the CA
206         thread. End result is data corruption on large image loads and potential crashes. The fix is
207         to have SharedBuffer create a copy of its data if the data has been passed to ImageIO and
208         might be accessed concurrently.
209
210         Since Vector is not refcounted, we do this by having a new refcounted object in SharedBuffer
211         that contains the buffer and we pass that in our NSData subclass WebCoreSharedBufferData.
212         Code that would result in the Vector memory moving e.g. append(), resize(), now checks to
213         see if the buffer was shared and if so, will create a new copy of the vector. This ensures
214         that the main thread does not end up invalidating the vector memory that we have passed it
215         to ImageIO.
216
217         No new tests because no functional changes.
218
219         * loader/cache/CachedResource.cpp:
220         (WebCore::CachedResource::makePurgeable):
221             Remove early return - createPurgeableMemory() has the correct check now.
222         * platform/SharedBuffer.cpp:
223         (WebCore::SharedBuffer::SharedBuffer):
224         (WebCore::SharedBuffer::adoptVector):
225         (WebCore::SharedBuffer::createPurgeableBuffer):
226             Don't create purgeable buffer if we are sharing the buffer.
227         (WebCore::SharedBuffer::append):
228         (WebCore::SharedBuffer::clear):
229         (WebCore::SharedBuffer::copy):
230         (WebCore::SharedBuffer::duplicateDataBufferIfNecessary): Added.
231             Create a new copy of the data if we have shared the buffer and if appending to it would
232             exceed the capacity of the vector resulting in memmove.
233         (WebCore::SharedBuffer::appendToInternalBuffer): Added.
234         (WebCore::SharedBuffer::clearInternalBuffer): Added.
235         (WebCore::SharedBuffer::buffer):
236             Create a new copy of the buffer if we have shared it.
237         (WebCore::SharedBuffer::getSomeData):
238         * platform/SharedBuffer.h:
239         * platform/cf/SharedBufferCF.cpp:
240         (WebCore::SharedBuffer::SharedBuffer):
241         (WebCore::SharedBuffer::singleDataArrayBuffer):
242         (WebCore::SharedBuffer::maybeAppendDataArray):
243         * platform/mac/SharedBufferMac.mm:
244             Pass the InternalBuffer object to WebCoreSharedBufferData
245         (-[WebCoreSharedBufferData dealloc]):
246         (-[WebCoreSharedBufferData initWithSharedBufferInternalBuffer:]):
247         (-[WebCoreSharedBufferData length]):
248         (-[WebCoreSharedBufferData bytes]):
249         (WebCore::SharedBuffer::createNSData):
250             Call createCFData() instead of duplicating code.
251         (WebCore::SharedBuffer::createCFData):
252             If the data is in purgeable memory, make a copy of it since m_buffer was cleared when
253             creating the purgeable buffer.
254         (-[WebCoreSharedBufferData initWithSharedBuffer:]): Deleted.
255
256 2014-07-24  peavo@outlook.com  <peavo@outlook.com>
257
258         [Curl] Enable file logging.
259         https://bugs.webkit.org/show_bug.cgi?id=135202
260
261         Reviewed by Alex Christensen.
262
263         The Curl api offers the possibility to write log messages to file. Enable this for debugging purposes.
264
265         * platform/network/curl/ResourceHandleManager.cpp:
266         (WebCore::ResourceHandleManager::ResourceHandleManager):
267         (WebCore::ResourceHandleManager::~ResourceHandleManager):
268         (WebCore::ResourceHandleManager::initializeHandle):
269         * platform/network/curl/ResourceHandleManager.h:
270
271 2014-07-24  Tibor Meszaros  <tmeszaros.u-szeged@partner.samsung.com>
272
273         Sort WebCore.exp.in after r171252
274         https://bugs.webkit.org/show_bug.cgi?id=135239
275
276         Reviewed by Csaba Osztrogonác.
277
278         * WebCore.exp.in:
279
280 2014-07-24  Mihnea Ovidenie  <mihnea@adobe.com>
281
282         [New Multicolumn] Assertion failure when an input element has multicolumn style
283         https://bugs.webkit.org/show_bug.cgi?id=135234
284
285         Reviewed by Andrei Bucur.
286
287         Restrict the assertion in RenderBlock::canComputeRegionRangeForBox
288         only to RenderNamedFlowThread objects since for RenderMultiColumnFlowThread
289         objects we can compute a range of regions during their parent block layout.   
290
291         Test: fast/multicol/newmulticol/input-as-multicol.html
292
293         * rendering/RenderBlock.cpp:
294         (WebCore::canComputeRegionRangeForBox):
295
296 2014-07-23  Jeremy Jones  <jeremyj@apple.com>
297
298         Transparent fullscreen background when video is not present.
299         https://bugs.webkit.org/show_bug.cgi?id=135226
300
301         Reviewed by Simon Fraser.
302
303         Set background to black just before beginning the animation to fullscreen.
304
305         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
306         (WebVideoFullscreenInterfaceAVKit::enterFullscreen): set background color black.
307
308 2014-07-23  Joseph Pecoraro  <pecoraro@apple.com>
309
310         ScriptController::updateDocument ASSERT mutating map while iterating map
311         https://bugs.webkit.org/show_bug.cgi?id=135211
312
313         Reviewed by Oliver Hunt.
314
315         Avoid iterating over m_windowShells in more places. This prevents
316         the possibility of a collection during JSC allocation which might
317         cause a mutation to m_windowShells (HTMLMediaElement destruction).
318
319         Have ScriptController defriend ScriptCachedFrameData by providing
320         a getter for the list of window shells.
321
322         * bindings/js/ScriptCachedFrameData.cpp:
323         (WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
324         (WebCore::ScriptCachedFrameData::restore):
325         * bindings/js/ScriptController.cpp:
326         (WebCore::ScriptController::windowShells):
327         (WebCore::ScriptController::clearWindowShell):
328         (WebCore::ScriptController::attachDebugger):
329         (WebCore::ScriptController::updateDocument):
330         * bindings/js/ScriptController.h:
331
332 2014-07-23  Commit Queue  <commit-queue@webkit.org>
333
334         Unreviewed, rolling out r171498.
335         https://bugs.webkit.org/show_bug.cgi?id=135223
336
337         It will regress some scroll position restoration on navigation
338         (r167916). (Requested by smfr on #webkit).
339
340         Reverted changeset:
341
342         "[iOS WK2] Header bar on nytimes articles lands in the wrong
343         place after rubberbanding"
344         https://bugs.webkit.org/show_bug.cgi?id=135221
345         http://trac.webkit.org/changeset/171498
346
347 2014-07-23  Tim Horton  <timothy_horton@apple.com>
348
349         REGRESSION (r171376): Sometimes we detect less than the whole phone number
350         https://bugs.webkit.org/show_bug.cgi?id=135220
351         <rdar://problem/17783423>
352
353         Reviewed by Brady Eidson.
354
355         * editing/Editor.cpp:
356         (WebCore::Editor::scanSelectionForTelephoneNumbers):
357         Use the visible selection's start and end instead of base and extent, because they'll
358         always be in the right order in the case of a directional selection (base can be *after* extent
359         if you select from right to left). This fixes the code that expands the selection.
360
361         Pass the *entire* expanded selection to DataDetectors, instead of using TextIterator.
362         This way, we will find each number only once, and will never get part of a phone number once
363         and then the whole phone number later.
364
365 2014-07-23  Simon Fraser  <simon.fraser@apple.com>
366
367         [iOS WK2] Header bar on nytimes articles lands in the wrong place after rubberbanding
368         https://bugs.webkit.org/show_bug.cgi?id=135221
369
370         Reviewed by Tim Horton.
371
372         Add a function on GraphicsLayer to force a flush of the layer position
373         to the underlying graphics system, so that when layers cease being
374         scroll-coordinated, we can ensure that their layers are repositioned
375         in the correct location.
376
377         * WebCore.exp.in:
378         * platform/graphics/GraphicsLayer.h:
379         (WebCore::GraphicsLayer::forcePositionUpdate):
380         * platform/graphics/ca/GraphicsLayerCA.cpp:
381         (WebCore::GraphicsLayerCA::forcePositionUpdate):
382         * platform/graphics/ca/GraphicsLayerCA.h:
383         * rendering/RenderLayerCompositor.cpp:
384         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
385
386 2014-07-23  Pratik Solanki  <psolanki@apple.com>
387
388         Get rid of SharedBuffer::NSDataRetainPtrWithoutImplicitConversionOperator
389         https://bugs.webkit.org/show_bug.cgi?id=135219
390
391         Reviewed by Anders Carlsson.
392
393         No new tests because no functional changes.
394
395         * loader/ResourceBuffer.h:
396         * loader/mac/ResourceBuffer.mm:
397         (WebCore::ResourceBuffer::createNSData):
398         * platform/SharedBuffer.h:
399         (WebCore::SharedBuffer::NSDataRetainPtrWithoutImplicitConversionOperator::NSDataRetainPtrWithoutImplicitConversionOperator): Deleted.
400         * platform/mac/SharedBufferMac.mm:
401         (WebCore::SharedBuffer::createNSData):
402
403 2014-07-23  Zalan Bujtas  <zalan@apple.com>
404
405         Subpixel rendering: Cleanup RenderLayerCompositor::deviceScaleFactor()
406         https://bugs.webkit.org/show_bug.cgi?id=135208
407
408         Reviewed by Simon Fraser.
409
410         Use m_renderView.document() to retrieve device scale factor value. m_renderView.document()
411         is always available while this->page() is not.
412
413         No change in behavior.
414
415         * rendering/RenderLayerBacking.cpp:
416         (WebCore::RenderLayerBacking::updateTransform):
417         (WebCore::RenderLayerBacking::computeTransformOriginForPainting):
418         * rendering/RenderLayerCompositor.cpp:
419         (WebCore::RenderLayerCompositor::deviceScaleFactor):
420
421 2014-07-23  peavo@outlook.com  <peavo@outlook.com>
422
423         [WinCairo] Gstreamer rendering is not working.
424         https://bugs.webkit.org/show_bug.cgi?id=135201
425
426         Reviewed by Alex Christensen.
427
428         WinCairo does not support accelerated rendering yet.
429
430         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
431         (WebCore::MediaPlayerPrivateGStreamerBase::supportsAcceleratedRendering):
432
433 2014-07-23  Commit Queue  <commit-queue@webkit.org>
434
435         Unreviewed, rolling out r171455.
436         https://bugs.webkit.org/show_bug.cgi?id=135209
437
438         completely broke selection highlight invalidation (Requested
439         by thorton on #webkit).
440
441         Reverted changeset:
442
443         "REGRESSION (r169105): Crash in selection"
444         https://bugs.webkit.org/show_bug.cgi?id=134303
445         http://trac.webkit.org/changeset/171455
446
447 2014-07-23  Alex Christensen  <achristensen@webkit.org>
448
449         Compile window-inactive and fullscreen pseudoclasses in css selectors.
450         https://bugs.webkit.org/show_bug.cgi?id=135200
451
452         Reviewed by Benjamin Poulain.
453
454         * css/SelectorChecker.cpp:
455         (WebCore::SelectorChecker::checkOne):
456         Removed the check of context.hasSelectionPseudo for a window-inactive pseudoclass.
457         Moved logic to SelectorCheckerTestFunctions.h to share with the selector compiler.
458         * css/SelectorCheckerTestFunctions.h:
459         (WebCore::isWindowInactive):
460         (WebCore::matchesFullScreenAnimatingFullScreenTransitionPseudoClass):
461         (WebCore::matchesFullScreenAncestorPseudoClass):
462         (WebCore::matchesFullScreenDocumentPseudoClass):
463         Added from SelectorChecker.cpp.
464         * cssjit/SelectorCompiler.cpp:
465         (WebCore::SelectorCompiler::addPseudoClassType):
466         Added unoptimized pseudoclass cases for window-inactive and fullscreen pseudoclasses.
467         Explicitly listed uncompiled pseudoclasses for future work instead of using a default.
468
469 2014-07-23  Brent Fulgham  <bfulgham@apple.com>
470
471         [Win] Use NO_RETURN_DUE_TO_CRASH on Windows.
472         https://bugs.webkit.org/show_bug.cgi?id=13519
473
474         Reviewed by Mark Lam.
475
476         * svg/SVGZoomAndPan.h: Add NO_RETURN_DUE_TO_CRASH to
477         header so function declarations match implementation.
478
479 2014-07-23  Joseph Pecoraro  <pecoraro@apple.com>
480
481         JSDOMWindowShell leaks on pages with media elements
482         https://bugs.webkit.org/show_bug.cgi?id=135178
483
484         Reviewed by Oliver Hunt.
485
486         The DOMWindowWorld for HTMLMediaElements with MEDIA_CONTROLS_SCRIPT
487         was not getting cleared and removed.
488
489         * bindings/js/ScriptController.cpp:
490         (WebCore::ScriptController::clearWindowShell):
491         Iterate over a copy of the values. A sweep / garbage collection caused by
492         any JSC allocation during iteration could trigger a mutation of the m_windowShells
493         table that was being iterating. So instead iterate a list that won't mutate.
494
495         * html/HTMLMediaElement.cpp:
496         (WebCore::HTMLMediaElement::~HTMLMediaElement):
497         If we had an isolated world, release as much memory as possible.
498
499 2014-07-23  Bem Jones-Bey  <bjonesbe@adobe.com>
500
501         Ensure we compute the min and max height of replaced elements to 'none' or 0 when appropriate.
502         https://bugs.webkit.org/show_bug.cgi?id=135181
503
504         Reviewed by David Hyatt.
505
506         If a replaced element has a percentage min or max height specified then that height value should
507         compute to 'none' for max-height and 0 for min-height when its containing block
508         does not have a height 'specified explicitly'.
509
510         This is based on a Blink patch by Robert Hogan.
511
512         Tests: css2.1/20110323/max-height-percentage-003.html
513                fast/replaced/max-height-percentage-quirks.html
514                fast/replaced/min-height-percentage-quirks.html
515                fast/replaced/min-height-percentage.html
516
517         * rendering/RenderBox.cpp:
518         (WebCore::RenderBox::logicalHeightComputesAsNone):
519         (WebCore::RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight):
520         * rendering/RenderBox.h:
521
522 2014-07-23  Bem Jones-Bey  <bjonesbe@adobe.com>
523
524         Remove CSS_EXCLUSIONS compile flag and leftover code
525         https://bugs.webkit.org/show_bug.cgi?id=135175
526
527         Reviewed by Zoltan Horvath.
528
529         At this point, the CSS_EXCLUSIONS flag guards nothing but some useless
530         stubs. This removes the flag and the useless code.
531
532         No new tests, just removing code.
533
534         * Configurations/FeatureDefines.xcconfig:
535         * bindings/generic/RuntimeEnabledFeatures.cpp:
536         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
537         * bindings/generic/RuntimeEnabledFeatures.h:
538         (WebCore::RuntimeEnabledFeatures::setCSSExclusionsEnabled): Deleted.
539         (WebCore::RuntimeEnabledFeatures::cssExclusionsEnabled): Deleted.
540         * testing/InternalSettings.cpp:
541         (WebCore::InternalSettings::Backup::Backup):
542         (WebCore::InternalSettings::Backup::restoreTo):
543         (WebCore::InternalSettings::setCSSExclusionsEnabled): Deleted.
544         * testing/InternalSettings.h:
545         * testing/InternalSettings.idl:
546
547 2014-07-23  Jer Noble  <jer.noble@apple.com>
548
549         [MSE][Mac] Support abort() in SourceBufferPrivateAVFObjC.
550         https://bugs.webkit.org/show_bug.cgi?id=135163
551
552         Reviewed by Brent Fulgham.
553
554         Recreate the parser when asked to abort().
555
556         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
557         (WebCore::SourceBufferPrivateAVFObjC::abort):
558
559 2014-07-23  Myles C. Maxfield  <mmaxfield@apple.com>
560
561         Migrate accessibility/ to using nullptr instead of 0
562         https://bugs.webkit.org/show_bug.cgi?id=135185
563
564         Reviewed by Simon Fraser.
565
566         No new tests because there is no behavior change.
567
568         * accessibility/AXObjectCache.cpp:
569         (WebCore::AXObjectCache::focusedImageMapUIElement):
570         (WebCore::AXObjectCache::focusedUIElementForPage):
571         (WebCore::AXObjectCache::get):
572         (WebCore::AXObjectCache::getOrCreate):
573         (WebCore::AXObjectCache::rootObject):
574         (WebCore::AXObjectCache::rootObjectForFrame):
575         * accessibility/AXObjectCache.h:
576         (WebCore::AXObjectCache::focusedUIElementForPage):
577         (WebCore::AXObjectCache::get):
578         (WebCore::AXObjectCache::getOrCreate):
579         (WebCore::AXObjectCache::rootObject):
580         (WebCore::AXObjectCache::rootObjectForFrame):
581         (WebCore::AXObjectCache::rootAXEditableElement):
582         * accessibility/AccessibilityARIAGridRow.cpp:
583         (WebCore::AccessibilityARIAGridRow::disclosedByRow):
584         * accessibility/AccessibilityImageMapLink.cpp:
585         (WebCore::AccessibilityImageMapLink::AccessibilityImageMapLink):
586         (WebCore::AccessibilityImageMapLink::parentObject):
587         * accessibility/AccessibilityListBox.cpp:
588         (WebCore::AccessibilityListBox::listBoxOptionAccessibilityObject):
589         (WebCore::AccessibilityListBox::elementAccessibilityHitTest):
590         * accessibility/AccessibilityListBoxOption.cpp:
591         (WebCore::AccessibilityListBoxOption::AccessibilityListBoxOption):
592         (WebCore::AccessibilityListBoxOption::parentObject):
593         (WebCore::AccessibilityListBoxOption::listBoxOptionParentNode):
594         * accessibility/AccessibilityMenuListPopup.cpp:
595         (WebCore::AccessibilityMenuListPopup::menuListOptionAccessibilityObject):
596         * accessibility/AccessibilityMockObject.cpp:
597         (WebCore::AccessibilityMockObject::AccessibilityMockObject):
598         * accessibility/AccessibilityMockObject.h:
599         * accessibility/AccessibilityNodeObject.cpp:
600         (WebCore::AccessibilityNodeObject::detach):
601         (WebCore::AccessibilityNodeObject::firstChild):
602         (WebCore::AccessibilityNodeObject::lastChild):
603         (WebCore::AccessibilityNodeObject::previousSibling):
604         (WebCore::AccessibilityNodeObject::nextSibling):
605         (WebCore::AccessibilityNodeObject::parentObject):
606         (WebCore::AccessibilityNodeObject::document):
607         (WebCore::AccessibilityNodeObject::anchorElement):
608         (WebCore::nativeActionElement):
609         (WebCore::AccessibilityNodeObject::actionElement):
610         (WebCore::AccessibilityNodeObject::mouseButtonListener):
611         (WebCore::AccessibilityNodeObject::labelForElement):
612         (WebCore::AccessibilityNodeObject::menuItemElementForMenu):
613         (WebCore::AccessibilityNodeObject::menuButtonForMenu):
614         * accessibility/AccessibilityObject.cpp:
615         (WebCore::AccessibilityObject::AccessibilityObject):
616         (WebCore::AccessibilityObject::detach):
617         (WebCore::AccessibilityObject::firstAccessibleObjectFromNode):
618         (WebCore::AccessibilityObject::findMatchingObjects):
619         (WebCore::renderListItemContainerForNode):
620         (WebCore::AccessibilityObject::accessibilityObjectForPosition):
621         (WebCore::AccessibilityObject::document):
622         (WebCore::AccessibilityObject::page):
623         (WebCore::AccessibilityObject::documentFrameView):
624         (WebCore::AccessibilityObject::anchorElementForNode):
625         (WebCore::AccessibilityObject::headingElementForNode):
626         (WebCore::AccessibilityObject::firstAnonymousBlockChild):
627         (WebCore::AccessibilityObject::element):
628         (WebCore::AccessibilityObject::focusedUIElement):
629         (WebCore::AccessibilityObject::scrollToMakeVisibleWithSubFocus):
630         * accessibility/AccessibilityObject.h:
631         (WebCore::AccessibilityObject::node):
632         (WebCore::AccessibilityObject::renderer):
633         (WebCore::AccessibilityObject::selectedRadioButton):
634         (WebCore::AccessibilityObject::selectedTabItem):
635         (WebCore::AccessibilityObject::accessibilityHitTest):
636         (WebCore::AccessibilityObject::firstChild):
637         (WebCore::AccessibilityObject::lastChild):
638         (WebCore::AccessibilityObject::previousSibling):
639         (WebCore::AccessibilityObject::nextSibling):
640         (WebCore::AccessibilityObject::parentObjectIfExists):
641         (WebCore::AccessibilityObject::observableObject):
642         (WebCore::AccessibilityObject::titleUIElement):
643         (WebCore::AccessibilityObject::correspondingLabelForControlElement):
644         (WebCore::AccessibilityObject::correspondingControlForLabelElement):
645         (WebCore::AccessibilityObject::scrollBar):
646         (WebCore::AccessibilityObject::anchorElement):
647         (WebCore::AccessibilityObject::actionElement):
648         (WebCore::AccessibilityObject::widget):
649         (WebCore::AccessibilityObject::widgetForAttachmentView):
650         (WebCore::AccessibilityObject::activeDescendant):
651         (WebCore::AccessibilityObject::mathRadicandObject):
652         (WebCore::AccessibilityObject::mathRootIndexObject):
653         (WebCore::AccessibilityObject::mathUnderObject):
654         (WebCore::AccessibilityObject::mathOverObject):
655         (WebCore::AccessibilityObject::mathNumeratorObject):
656         (WebCore::AccessibilityObject::mathDenominatorObject):
657         (WebCore::AccessibilityObject::mathBaseObject):
658         (WebCore::AccessibilityObject::mathSubscriptObject):
659         (WebCore::AccessibilityObject::mathSuperscriptObject):
660         (WebCore::AccessibilityObject::getScrollableAreaIfScrollable):
661         * accessibility/AccessibilityProgressIndicator.cpp:
662         (WebCore::AccessibilityProgressIndicator::progressElement):
663         (WebCore::AccessibilityProgressIndicator::meterElement):
664         * accessibility/AccessibilityRenderObject.cpp:
665         (WebCore::AccessibilityRenderObject::detach):
666         (WebCore::AccessibilityRenderObject::renderBoxModelObject):
667         (WebCore::AccessibilityRenderObject::firstChild):
668         (WebCore::AccessibilityRenderObject::lastChild):
669         (WebCore::startOfContinuations):
670         (WebCore::childBeforeConsideringContinuations):
671         (WebCore::AccessibilityRenderObject::previousSibling):
672         (WebCore::AccessibilityRenderObject::nextSibling):
673         (WebCore::nextContinuation):
674         (WebCore::AccessibilityRenderObject::renderParentObject):
675         (WebCore::AccessibilityRenderObject::parentObject):
676         (WebCore::AccessibilityRenderObject::anchorElement):
677         (WebCore::AccessibilityRenderObject::textUnderElement):
678         (WebCore::AccessibilityRenderObject::node):
679         (WebCore::AccessibilityRenderObject::labelElementContainer):
680         (WebCore::AccessibilityRenderObject::internalLinkElement):
681         (WebCore::AccessibilityRenderObject::titleUIElement):
682         (WebCore::AccessibilityRenderObject::setFocused):
683         (WebCore::AccessibilityRenderObject::topRenderer):
684         (WebCore::AccessibilityRenderObject::document):
685         (WebCore::AccessibilityRenderObject::widget):
686         (WebCore::AccessibilityRenderObject::accessibilityParentForImageMap):
687         (WebCore::AccessibilityRenderObject::documentFrameView):
688         (WebCore::AccessibilityRenderObject::widgetForAttachmentView):
689         (WebCore::AccessibilityRenderObject::rootEditableElementForPosition):
690         (WebCore::AccessibilityRenderObject::visiblePositionForPoint):
691         (WebCore::AccessibilityRenderObject::accessibilityImageMapHitTest):
692         (WebCore::AccessibilityRenderObject::remoteSVGElementHitTest):
693         (WebCore::AccessibilityRenderObject::accessibilityHitTest):
694         (WebCore::AccessibilityRenderObject::correspondingControlForLabelElement):
695         (WebCore::AccessibilityRenderObject::correspondingLabelForControlElement):
696         (WebCore::AccessibilityRenderObject::observableObject):
697         (WebCore::AccessibilityRenderObject::inheritsPresentationalRole):
698         (WebCore::AccessibilityRenderObject::detachRemoteSVGRoot):
699         (WebCore::AccessibilityRenderObject::addHiddenChildren):
700         (WebCore::AccessibilityRenderObject::setAccessibleName):
701         (WebCore::AccessibilityRenderObject::getScrollableAreaIfScrollable):
702         (WebCore::AccessibilityRenderObject::mathRadicandObject):
703         (WebCore::AccessibilityRenderObject::mathRootIndexObject):
704         (WebCore::AccessibilityRenderObject::mathNumeratorObject):
705         (WebCore::AccessibilityRenderObject::mathDenominatorObject):
706         (WebCore::AccessibilityRenderObject::mathUnderObject):
707         (WebCore::AccessibilityRenderObject::mathOverObject):
708         (WebCore::AccessibilityRenderObject::mathBaseObject):
709         (WebCore::AccessibilityRenderObject::mathSubscriptObject):
710         (WebCore::AccessibilityRenderObject::mathSuperscriptObject):
711         * accessibility/AccessibilitySVGRoot.cpp:
712         (WebCore::AccessibilitySVGRoot::AccessibilitySVGRoot):
713         * accessibility/AccessibilityScrollView.cpp:
714         (WebCore::AccessibilityScrollView::detach):
715         (WebCore::AccessibilityScrollView::scrollBar):
716         (WebCore::AccessibilityScrollView::updateScrollbars):
717         (WebCore::AccessibilityScrollView::addChildScrollbar):
718         (WebCore::AccessibilityScrollView::clearChildren):
719         (WebCore::AccessibilityScrollView::webAreaObject):
720         (WebCore::AccessibilityScrollView::accessibilityHitTest):
721         (WebCore::AccessibilityScrollView::documentFrameView):
722         (WebCore::AccessibilityScrollView::parentObject):
723         (WebCore::AccessibilityScrollView::parentObjectIfExists):
724         * accessibility/AccessibilityScrollbar.cpp:
725         (WebCore::AccessibilityScrollbar::document):
726         * accessibility/AccessibilitySpinButton.cpp:
727         (WebCore::AccessibilitySpinButton::AccessibilitySpinButton):
728         * accessibility/AccessibilityTable.cpp:
729         (WebCore::AccessibilityTable::AccessibilityTable):
730         (WebCore::AccessibilityTable::clearChildren):
731         (WebCore::AccessibilityTable::cellForColumnAndRow):
732         * accessibility/AccessibilityTableCell.cpp:
733         (WebCore::AccessibilityTableCell::parentTable):
734         (WebCore::AccessibilityTableCell::titleUIElement):
735         * accessibility/AccessibilityTableColumn.cpp:
736         (WebCore::AccessibilityTableColumn::headerObject):
737         (WebCore::AccessibilityTableColumn::headerObjectForSection):
738         * accessibility/AccessibilityTableRow.cpp:
739         (WebCore::AccessibilityTableRow::parentTable):
740         (WebCore::AccessibilityTableRow::headerObject):
741         * accessibility/ios/AXObjectCacheIOS.mm:
742         (WebCore::AXObjectCache::detachWrapper):
743         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
744         (-[WebAccessibilityObjectWrapper detach]):
745         (-[WebAccessibilityObjectWrapper tableCellParent]):
746         (-[WebAccessibilityObjectWrapper tableParent]):
747         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
748         (-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]):
749         (rendererForView):
750         (-[WebAccessibilityObjectWrapper _convertToDOMRange:]):
751         * accessibility/mac/AXObjectCacheMac.mm:
752         (WebCore::AXObjectCache::detachWrapper):
753         * accessibility/mac/AccessibilityObjectMac.mm:
754         (WebCore::AccessibilityObject::detachFromParent):
755         (WebCore::AccessibilityObject::accessibilityIgnoreAttachment):
756         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
757         (-[WebAccessibilityObjectWrapperBase detach]):
758         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
759         (CreateCGColorIfDifferent):
760         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
761         (rendererForView):
762         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
763         * accessibility/win/AccessibilityObjectWrapperWin.h:
764         (WebCore::AccessibilityObjectWrapper::AccessibilityObjectWrapper):
765
766 2014-07-23  Mihnea Ovidenie  <mihnea@adobe.com>
767
768         ASSERTION FAILED: generatingElement() in WebCore::RenderNamedFlowFragment::regionOversetState
769         https://bugs.webkit.org/show_bug.cgi?id=135153
770
771         Reviewed by David Hyatt.
772
773         Even though the CSSRegions spec defines the behaviour of a multicolumn region,
774         we currently do not support this functionality. This patch ensures that a multicolumn
775         element does not become a region. In the future, when we will implement the multicolumn
776         as region functionality, http://dev.w3.org/csswg/css-regions/#multi-column-regions, we
777         will remove this restriction.
778
779         Test: fast/regions/multicol-as-region-prevented.html
780
781         * rendering/RenderBlockFlow.cpp:
782         (WebCore::RenderBlockFlow::createRenderNamedFlowFragmentIfNeeded):
783
784 2014-07-23  Zan Dobersek  <zdobersek@igalia.com>
785
786         [CMake] Avoid building WebCore with ANGLE's OpenGL/EGL headers
787         https://bugs.webkit.org/show_bug.cgi?id=135167
788
789         Reviewed by Martin Robinson.
790
791         * CMakeLists.txt: Don't add ANGLE/include to the WebCore_INCLUDE_DIRECTORIES list
792         as this results in ANGLE's OpenGL and EGL headers being included, instead of the
793         headers that are provided by the system. Only the ANGLESupport library should be built
794         with that specific header inclusion path.
795
796 2014-07-10  Radu Stavila  <stavila@adobe.com>
797
798         REGRESSION (r169105): Crash in selection
799         https://bugs.webkit.org/show_bug.cgi?id=134303
800
801         Reviewed by David Hyatt.
802
803         When splitting the selection between different subtrees, all subtrees must have their selection cleared before
804         starting to apply the new selection. Otherwise, when selecting objects in a named flow thread and going up
805         its containing block chain, we can end up in the view's selection root, which has not yet been updated and so
806         we get inconsistent data.
807
808         To achieve this goal, the selection update was split into a "clear" and an "apply" method. The updateSelectionForSubtrees
809         method first iterates through all subtrees and performs the "clear" method and then starts all over again
810         and performs the "apply" method.
811
812         Also, the selectionStart/End members in RenderView have been renamed to fix problems caused by the fact that
813         RenderView inherits SelectionSubtreeRoot, which also has the same selectionStart/End members.
814
815         Test: fast/regions/selection/crash-deselect.html
816
817         * WebCore.xcodeproj/project.pbxproj:
818         * rendering/RenderBlock.cpp:
819         (WebCore::RenderBlock::isSelectionRoot):
820         * rendering/RenderSelectionInfo.h:
821         * rendering/RenderView.cpp:
822         (WebCore::RenderView::RenderView):
823         (WebCore::RenderView::setSelection): Renamed m_selectionStart/End to m_unsplitSelectionStart/End
824         (WebCore::RenderView::splitSelectionBetweenSubtrees):
825         (WebCore::RenderView::updateSelectionForSubtrees): Added, clears and re-applies selection for all selection subtrees.
826         (WebCore::RenderView::clearSubtreeSelection): Added, clears selection and returns previously selected information.
827         (WebCore::RenderView::applySubtreeSelection): Added, updates the selection status of all objects inside the selection tree, compares old and new data and repaints accordingly.
828         (WebCore::RenderView::getSelection): Renamed m_selectionStart/End to m_unsplitSelectionStart/End
829         (WebCore::RenderView::setSubtreeSelection): Deleted.
830         * rendering/RenderView.h:
831         * rendering/SelectionSubtreeRoot.cpp:
832         (WebCore::SelectionSubtreeRoot::SelectionSubtreeRoot):
833         * rendering/SelectionSubtreeRoot.h:
834         (WebCore::SelectionSubtreeRoot::OldSelectionData::OldSelectionData):
835
836 2014-07-22  Brent Fulgham  <bfulgham@apple.com>
837
838         [Win] Build fix for bot.
839
840         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
841         (WebCore::createLegibleOutputSubtypes): Declare 'wvtt' locally, rather
842         than relying on potentially unavailable declaration.
843
844 2014-07-22  Brent Fulgham  <bfulgham@apple.com>
845
846         [Win] Build fix for Windows bots
847
848         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: Provide missing
849         structure definition when needed by bot.
850
851 2014-07-22  Brent Fulgham  <bfulgham@apple.com>
852
853         [Win] Build fix for EWS bots.
854
855         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: Forward declare
856         structure definition.
857
858 2014-07-22  Brent Fulgham  <bfulgham@apple.com>
859
860         [Win] Fix Crash when handling Legible Output callbacks
861         https://bugs.webkit.org/show_bug.cgi?id=134946
862
863         Reviewed by Dean Jackson.
864
865         Relanding after adding fixes to support build bots.
866
867         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
868         (WebCore::InbandTextTrackPrivateAVF::processNativeSamples): Remove
869         Windows-specific 'ASSERT_NOT_REACHED' code path.
870         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
871         (WebCore::createLegibleOutputSubtypes): Added.
872         (WebCore::AVFWrapper::createPlayerItem): Updated to request native
873         samples from AVFoundationCF.
874
875 2014-07-16  Myles C. Maxfield  <mmaxfield@apple.com>
876
877         Copying and pasting trivial H2 content causes a crash in firstPositionInNode
878         https://bugs.webkit.org/show_bug.cgi?id=134897
879
880         Reviewed by Ryosuke Niwa.
881
882         ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuilder() attempts
883         to move pasted headings out of existed headings, with out regard to if the existing
884         heading is the contenteditable root.
885
886         Test: editing/pasteboard/heading-crash.html
887
888         * editing/ReplaceSelectionCommand.cpp:
889         (WebCore::ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuilder):
890
891 2014-07-22  Ryuan Choi  <ryuan.choi@samsung.com>
892
893         Remove dead APIs from TiledBackingStore
894         https://bugs.webkit.org/show_bug.cgi?id=135158
895
896         Reviewed by Gyuyoung Kim.
897
898         setContentsFrozen and related code of TiledBackingStore are not used since Qt port is removed.
899
900         * platform/graphics/TiledBackingStore.cpp:
901         (WebCore::TiledBackingStore::TiledBackingStore):
902         (WebCore::TiledBackingStore::updateTileBuffers):
903         (WebCore::TiledBackingStore::setContentsScale):
904         (WebCore::TiledBackingStore::createTiles):
905         (WebCore::TiledBackingStore::startTileBufferUpdateTimer):
906         (WebCore::TiledBackingStore::startBackingStoreUpdateTimer):
907         (WebCore::TiledBackingStore::commitScaleChange): Deleted.
908         (WebCore::TiledBackingStore::isBackingStoreUpdatesSuspended): Deleted.
909         (WebCore::TiledBackingStore::isTileBufferUpdatesSuspended): Deleted.
910         (WebCore::TiledBackingStore::setContentsFrozen): Deleted.
911         * platform/graphics/TiledBackingStore.h:
912         (WebCore::TiledBackingStore::contentsFrozen): Deleted.
913
914 2014-07-22  Alex Christensen  <achristensen@webkit.org>
915
916         Fix window-inactive css selectors when using querySelector.
917         https://bugs.webkit.org/show_bug.cgi?id=135149
918
919         Reviewed by Tim Horton.
920
921         Test: fast/selectors/querySelector-window-inactive.html
922
923         * css/SelectorChecker.cpp:
924         (WebCore::SelectorChecker::checkOne):
925         Removed default and implemented case PseudoClassWindowInactive.
926
927 2014-07-22  Tim Horton  <timothy_horton@apple.com>
928
929         REGRESSION (r171016): Reproducible infinite spin selecting phone number
930         https://bugs.webkit.org/show_bug.cgi?id=135183
931         <rdar://problem/17727342>
932
933         Reviewed by Ryosuke Niwa.
934
935         * editing/Editor.cpp:
936         (WebCore::Editor::scanRangeForTelephoneNumbers):
937         Make use of TextIterator::subrange, which knows how to make a subrange from character positions,
938         instead of assuming that our character positions translate directly to positions in the incoming range.
939         Make use of DocumentMarkerController::addMarker, which takes a range and applies the marker to
940         all text nodes inside the range as appropriate.
941         Fix naming of the shadowed 'length' local.
942         Fix a typo in the comment.
943
944 2014-07-22  Myles C. Maxfield  <mmaxfield@apple.com>
945
946         [iOS] [OSX] Don't transcode WOFF on platforms that support it natively
947         https://bugs.webkit.org/show_bug.cgi?id=134904
948
949         Reviewed by Andreas Kling.
950
951         No new tests because there is no behavior change.
952
953         * loader/cache/CachedFont.cpp:
954         (WebCore::CachedFont::ensureCustomFontData):
955
956 2014-07-22  peavo@outlook.com  <peavo@outlook.com>
957
958         [Win] Crash after plugin is unloaded.
959         https://bugs.webkit.org/show_bug.cgi?id=119044
960
961         Reviewed by Darin Adler.
962
963         We need to invalidate all runtime objects when a plugin view is destroyed, in case the plugin is unloaded,
964         and one of these runtime objects accesses the plugin function table upon destruction afterwards, which will cause a crash.
965         If we use the weak pointer to the runtime object when invalidating, it will be null if it's in the WeakImpl::Dead state.
966         This means the runtime object will not be invalidated, possibly causing a crash if the plugin is unloaded.
967         It should be safe to use the raw pointer to the runtime object when invalidating, since finalized runtime objects
968         will be removed from the set of runtime objects in the method RootObject::finalize().
969
970         * bridge/runtime_root.cpp:
971         (JSC::Bindings::RootObject::invalidate): Make sure all runtime objects are invalidated by getting the raw runtime object pointer from the hash key.
972
973 2014-07-22  Enrica Casucci  <enrica@apple.com>
974
975         REGRESSION (WebKit2): Selection inside accelerated overflow:scroll doesn't track scrolling.
976         https://bugs.webkit.org/show_bug.cgi?id=135180
977         <rdar://problem/16721055>
978
979         Reviewed by Simon Fraser.
980
981         AsyncScrollingCoordinator will force a selection update on iOS
982         when scrolling terminates in an overflow scroll.
983
984         * loader/EmptyClients.h:
985         * page/EditorClient.h:
986         * page/scrolling/AsyncScrollingCoordinator.cpp:
987         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
988         * page/scrolling/ScrollingTree.h:
989         (WebCore::ScrollingTree::scrollingTreeNodeWillStartScroll):
990         (WebCore::ScrollingTree::scrollingTreeNodeDidEndScroll):
991
992 2014-07-22  Myles C. Maxfield  <mmaxfield@apple.com>
993
994         [Mac] Cocoa throws exception when the return type of NSAccessibilityLinkedUIElementsAttribute is not an array
995         https://bugs.webkit.org/show_bug.cgi?id=135165
996
997         Reviewed by Simon Fraser.
998
999         Return an empty array instead of nil.
1000
1001         Updated tests.
1002
1003         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1004         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1005
1006 2014-07-22  Commit Queue  <commit-queue@webkit.org>
1007
1008         Unreviewed, rolling out r171357.
1009         https://bugs.webkit.org/show_bug.cgi?id=135173
1010
1011         broke Windows build. (Requested by bfulgham on #webkit).
1012
1013         Reverted changeset:
1014
1015         "[Win] Fix Crash when handling Legible Output callbacks"
1016         https://bugs.webkit.org/show_bug.cgi?id=134946
1017         http://trac.webkit.org/changeset/171357
1018
1019 2014-07-22  Brent Fulgham  <bfulgham@apple.com>
1020
1021         [Win] Fix Crash when handling Legible Output callbacks
1022         https://bugs.webkit.org/show_bug.cgi?id=134946
1023
1024         Reviewed by Dean Jackson.
1025
1026         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
1027         (WebCore::InbandTextTrackPrivateAVF::processNativeSamples): Remove
1028         Windows-specific 'ASSERT_NOT_REACHED' code path.
1029         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1030         (WebCore::createLegibleOutputSubtypes): Added.
1031         (WebCore::AVFWrapper::createPlayerItem): Updated to request native
1032         samples from AVFoundationCF.
1033
1034 2014-07-21  Sam Weinig  <sam@webkit.org>
1035
1036         [Cocoa] WKScriptMessageHandlers don't seem to function properly after navigating
1037         https://bugs.webkit.org/show_bug.cgi?id=135148
1038
1039         Reviewed by Geoffrey Garen.
1040
1041         The "webkit" property on the window was not getting installed for subsequent
1042         loads due to intricate dance playing setting the JSDOMWindow where the DOMWindow
1043         object is not yet in a Frame when the JSDOMWindow is created. Since we were
1044         adding the "webkit" property on construction, the property was returning null
1045         thinking it had no Frame and was in a bad state. We can fix this by making the
1046         "webkit" property behave like all the other window properties moving its getting
1047         to JSDOMWindow::getOwnPropertySlot.
1048
1049         Added API test (WebKit2Cocoa/UserContentController).
1050
1051         * bindings/js/JSDOMWindowBase.cpp:
1052         (WebCore::JSDOMWindowBase::finishCreation):
1053         * bindings/js/JSDOMWindowCustom.cpp:
1054         (WebCore::jsDOMWindowWebKit):
1055         (WebCore::JSDOMWindow::getOwnPropertySlot):
1056
1057 2014-07-22  Brent Fulgham  <bfulgham@apple.com>
1058
1059         [Win] Fix Leak in WebCore::createGlobalImageFileDescriptor 
1060         https://bugs.webkit.org/show_bug.cgi?id=134423
1061         <rdar://problem/17492758>
1062
1063         Reviewed by Geoffrey Garen.
1064
1065         * platform/win/PasteboardWin.cpp:
1066         (WebCore::createGlobalImageFileDescriptor): Unlock and release the
1067         HGLOBAL when exiting early.
1068
1069 2014-07-21  Myles C. Maxfield  <mmaxfield@apple.com>
1070
1071         Clicking on links while accessibility is enabled sometimes crashes
1072         https://bugs.webkit.org/show_bug.cgi?id=135074
1073
1074         Reviewed by Chris Fleizach.
1075
1076         When an accessibility request comes in from the system, we call updateBackingStore() on the
1077         relevant AccessibilityObject, which triggers a relayout of the entire document. This relayout
1078         might delete that accessibility node and its parent, which would cause the node to be deleted.
1079         After the stack unwinds, we then call a member function on the node without checking for this
1080         condition.
1081
1082         Test: accessibility/parent-delete.html
1083
1084         * accessibility/AccessibilityObject.cpp:
1085         (WebCore::AccessibilityObject::updateBackingStore): Retain the node for the duration of the
1086         function.
1087
1088 2014-07-22  Jeremy Jones  <jeremyj@apple.com>
1089
1090         Don't create new UIWindow for video fullscreen.
1091         https://bugs.webkit.org/show_bug.cgi?id=135038
1092
1093         Reviewed by Darin Adler.
1094
1095         * WebCore.exp.in:
1096         * platform/ios/WebVideoFullscreenControllerAVKit.h: use UIView instead of UIScreen.
1097         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1098         (-[WebVideoFullscreenController enterFullscreen:]): provide parent UIView.
1099         * platform/ios/WebVideoFullscreenInterfaceAVKit.h: remove UIWindow.
1100         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: 
1101         (WebVideoFullscreenInterfaceAVKit::setupFullscreen): ditto 
1102         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreen): ditto
1103         (WebVideoFullscreenInterfaceAVKit::invalidate): ditto
1104         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen): ditto
1105
1106 2014-07-22  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1107
1108         [GTK] Rollout r170529 due to ~10% performance regression on the
1109         perf test Animation/balls.
1110         https://bugs.webkit.org/show_bug.cgi?id=134972
1111
1112         Reviewed by Martin Robinson.
1113
1114         Reverted changeset:
1115         "Increase priority on SharedTimer source."
1116         https://trac.webkit.org/r170529
1117
1118 2014-07-18  Dirk Schulze  <krit@webkit.org>
1119
1120         Turn width/height to presentation attributes
1121         https://bugs.webkit.org/show_bug.cgi?id=135046
1122
1123         Reviewed by Dean Jackson.
1124
1125         The elements <svg>, <image>, <pattern>, <mask> and <foreignObject> have the
1126         'width' and 'height' attributes. So far they can just be set by SVG DOM or
1127         setAttribute. Furthermore, animations just work with SVG Animation - No support
1128         for CSS Animations and CSS Transitions. We started to turn the width and height
1129         attributes on SVG roots to presentation attributes already. A presentation
1130         attribute is a CSS property that can also be set by DOM (or now by SVG DOM).
1131
1132         This patch turns all width and height attributes to presentation attributes. It
1133         basically allows authors to style width and height with CSS as well. Width and
1134         height can now be set with CSS style sheets and can be animated with CSS.
1135
1136         To some degree it made it possible to remove code duplication. However, since
1137         SVG DOM requires us to use SVGLength types and since we did not turn all
1138         SVG attributes to the CSS length values (and our internal Length struct) yet,
1139         we still need a hybrid - a bridge between SVGLength (for SVG DOM) and Length (for
1140         RenderStyle). Once we move all attributes to use the Length struct, we can make SVGLength
1141         a wrapper for Length and can move more code to the render tree.
1142
1143         The current challenge is to synchronize SVG DOM, normal DOM and RenderStyle.
1144         With this patch we handle most part in RenderStyle. SVG DOM changes are
1145         synchronized to DOM and RenderStyle will call needsStyleRecalc. Furthermore,
1146         SVG Animations will continue to animate the SVG DOM (and synchronize the changes
1147         back to RenderStyle) if the element has a JS property for the currently animated
1148         attribute.
1149
1150         Short example:
1151
1152             <rect>
1153                 <animate attributeName="width">
1154             </rect>
1155
1156         The <rect> element has the SVG DOM property 'width'. Therefore, we animate the SVG DOM
1157         property and synchronize RenderStyle.
1158
1159             <ellipse>
1160                 <animate attributeName="width">
1161             </ellipse>
1162
1163         The <ellipse> element does NOT have the SVG DOM property 'width'. Therefore, we
1164         animate the CSS property directly. With synchronizing RenderStyle in all cases, we
1165         make sure that the CSS cascade works even on animating on multiple SVG hierarchy
1166         levels (animation of 'width' on <g> and inheriting the property value on a child
1167         <rect>).
1168
1169         With using presentation attributes, we also inherit the CSS property parsing for
1170         SVG attributes. <rect width="  100px  "> is possible now. (Note the trailing whitespaces.)
1171         This follows a recent resolution of the SVG WG.
1172
1173         Since we turned width and height to presentation attributes, the layout optimization
1174         selfHasRelativeLengths() in the DOM can't be used anymore. selfHasRelativeLengths() was
1175         intended to solve a problem where we did not layout relatively position/sized elements
1176         when the parent changes its size. However, as a side effect it did not call layout
1177         for absolutely positioned/sized elements since the layout does not change. I run
1178         all performance tests that we have and even wrote a test with hundreds of elements
1179         that would be affected by this optimization. The differences were inside the sigma
1180         of a normal test run. (Means I couldn't measure a performance difference.)
1181         Therefore, it is not worth it to keep the "optimization" around and I will probably
1182         remove it entirely for all basic shapes but <path> and <polygon> in future patches.
1183
1184         Tests: svg/css/parse-height.html
1185                svg/css/parse-width.html
1186                svg/css/width-height-presentation-attribute-expected.svg
1187                svg/css/width-height-presentation-attribute.svg
1188
1189         * css/CSSComputedStyleDeclaration.cpp:
1190         (WebCore::ComputedStyleExtractor::propertyValue): We never calculated the computed
1191             value of width/height for SVG elements and returned auto instead. This is based
1192             on a rule of CSS 2 and needs to be fixed in CSS3.
1193         * css/DeprecatedStyleBuilder.cpp:
1194         (WebCore::ApplyPropertyLength::applyValue): Length always incorporates the zoom level.
1195             In SVG we still apply the zoom after all operations by scaling the context. We need
1196             to take this in account for Length and don't apply zoom on SVG inline elements.
1197         * css/StyleResolver.cpp:
1198         (WebCore::StyleResolver::useSVGZoomRulesForLength):
1199             See above.
1200         * css/StyleResolver.h:
1201         * rendering/svg/RenderSVGRect.cpp:
1202         (WebCore::RenderSVGRect::updateShapeFromElement): Do not call width() and height() on
1203             SVG DOM but use the values of RenderStyle instead.
1204         * rendering/svg/SVGPathData.cpp:
1205         (WebCore::updatePathFromRectElement): Ditto.
1206         * svg/SVGAnimateElement.cpp:
1207         (WebCore::SVGAnimateElement::resetAnimatedType): We need to differ between CSS properties
1208             with and without SVG DOM on the current element. In the later case we animate the 
1209             SVG DOM and need to synch RenderStyle.
1210         (WebCore::SVGAnimateElement::clearAnimatedType): Ditto.
1211         (WebCore::SVGAnimateElement::applyResultsToTarget): Ditto.
1212         * svg/SVGAnimationElement.cpp:
1213         (WebCore::SVGAnimationElement::isTargetAttributeCSSProperty): This checks if the CSS property
1214             has to be synched with SVG DOM.
1215         (WebCore::SVGAnimationElement::shouldApplyAnimation): Ditto.
1216         * svg/SVGAnimationElement.h:
1217         * svg/SVGElement.cpp:
1218         (WebCore::populateAttributeNameToCSSPropertyIDMap): Add width and heigth to the CSS property
1219             list for presentation attributes.
1220         (WebCore::populateCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): CSS properties with
1221             SVG DOM synchronization need to be treated differently. Collect them in a separate map.
1222         (WebCore::cssPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): Caller for the map.
1223         (WebCore::SVGElement::animatedPropertyTypeForAttribute): We need to check both maps here:
1224             CSS properties and CSS properties with SVG DOM synch.
1225         (WebCore::SVGElement::isAnimatableCSSProperty): Ditto.
1226         (WebCore::SVGElement::isPresentationAttributeWithSVGDOM): Just return true if the property name
1227             is in the map of properties with SVG DOM for the current element.
1228         * svg/SVGElement.h:
1229         (WebCore::SVGElement::invalidateSVGPresentationAttributeStyle): Call needsStyleRecalc.
1230         * svg/SVGFilterElement.cpp: Make width/height presentation attribute.
1231         (WebCore::SVGFilterElement::svgAttributeChanged):
1232         (WebCore::SVGFilterElement::selfHasRelativeLengths): Deleted.
1233         * svg/SVGFilterElement.h: Ditto.
1234         * svg/SVGForeignObjectElement.cpp:
1235         (WebCore::SVGForeignObjectElement::svgAttributeChanged):
1236         (WebCore::SVGForeignObjectElement::selfHasRelativeLengths): Deleted.
1237         * svg/SVGForeignObjectElement.h:
1238         * svg/SVGImageElement.cpp: Ditto.
1239         (WebCore::SVGImageElement::svgAttributeChanged):
1240         (WebCore::SVGImageElement::isPresentationAttribute): Deleted.
1241         (WebCore::SVGImageElement::collectStyleForPresentationAttribute): Deleted.
1242         (WebCore::SVGImageElement::selfHasRelativeLengths): Deleted.
1243         * svg/SVGImageElement.h:
1244         * svg/SVGLength.h: Transform an Length value to an absolute value by taking the SVG viewport
1245             into account. (An SVG viewport is not the same as the CSS viewport.)
1246         * svg/SVGLengthContext.cpp: Ditto.
1247         (WebCore::SVGLengthContext::valueForLength):
1248         * svg/SVGLengthContext.h:
1249         * svg/SVGMaskElement.cpp: Make width/height presentation attribute.
1250         (WebCore::SVGMaskElement::svgAttributeChanged):
1251         (WebCore::SVGMaskElement::selfHasRelativeLengths): Deleted.
1252         * svg/SVGMaskElement.h:
1253         * svg/SVGPatternElement.cpp: Ditto.
1254         (WebCore::SVGPatternElement::svgAttributeChanged):
1255         (WebCore::SVGPatternElement::selfHasRelativeLengths): Deleted.
1256         * svg/SVGPatternElement.h:
1257         * svg/SVGRectElement.cpp: Ditto.
1258         (WebCore::SVGRectElement::svgAttributeChanged):
1259         (WebCore::SVGRectElement::selfHasRelativeLengths): Deleted.
1260         * svg/SVGRectElement.h:
1261         * svg/SVGSVGElement.cpp: Ditto.
1262         (WebCore::SVGSVGElement::svgAttributeChanged): Clean up redundant layout calls.
1263         (WebCore::SVGSVGElement::isPresentationAttribute): Deleted.
1264         (WebCore::SVGSVGElement::collectStyleForPresentationAttribute): Deleted.
1265         * svg/SVGSVGElement.h:
1266         * svg/properties/SVGAnimatedProperty.cpp: Synchronize SVG DOM with DOM.
1267         (WebCore::SVGAnimatedProperty::commitChange):
1268
1269 2014-07-22  Adrian Perez de Castro  <aperez@igalia.com>
1270
1271         [GStreamer] [GTK] WebKit does not build with GStreamer 1.4
1272         https://bugs.webkit.org/show_bug.cgi?id=135114
1273
1274         Reviewed by Philippe Normand.
1275
1276         Fix build with GStreamer 1.4
1277
1278         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1279         Change GstMpegTs-prefixed types to use the GstMpegts prefix.
1280         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
1281         (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection):
1282         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1283         Ditto.
1284
1285 2014-07-21  Benjamin Poulain  <bpoulain@apple.com>
1286
1287         [iOS][WK2] Improve event throttling for Scroll Events
1288         https://bugs.webkit.org/show_bug.cgi?id=135082
1289         <rdar://problem/17445266>
1290
1291         Reviewed by Simon Fraser.
1292
1293         This patch is composed of two parts. The first part in the WebKit layer
1294         track an approximate measurement of the main thread responsiveness.
1295         The second part in WebCore use that information to avoid sending events
1296         if a page is unresponsive.
1297
1298         In WebCore, this patch only consider scroll events so far. Hopefully the concept
1299         should be easy to generalize.
1300
1301         * loader/EmptyClients.h:
1302         * page/ChromeClient.h:
1303         Chrome client provides us with one information: how long an incoming event should be delayed.
1304         Every port is free to implement whatever logic is suitable for them.
1305
1306         * page/FrameView.cpp:
1307         (WebCore::FrameView::FrameView):
1308         (WebCore::FrameView::reset):
1309         (WebCore::FrameView::delayedScrollEventTimerFired):
1310         (WebCore::FrameView::scrollPositionChanged):
1311         (WebCore::FrameView::sendScrollEvent):
1312         * page/FrameView.h:
1313         Scroll events do not have any associated information so they can be coalesced by just skipping
1314         all input hapenning during the throttling delay.
1315
1316         The implementation is done by using a timer to delay the events.
1317
1318 2014-07-21  Tim Horton  <timothy_horton@apple.com>
1319
1320         Avoid putting empty-sized surfaces into IOSurfacePool
1321         https://bugs.webkit.org/show_bug.cgi?id=135136
1322
1323         Reviewed by Simon Fraser.
1324
1325         * platform/graphics/cg/IOSurfacePool.cpp:
1326         (WebCore::IOSurfacePool::addSurface):
1327         Avoid adding 0x0 surfaces to the pool, because they will wreak havoc
1328         when their size is used as the key in the CachedSurfaceMap.
1329         Additionally, avoid any empty sizes, because they're just pointless.
1330
1331 2014-07-21  Beth Dakin  <bdakin@apple.com>
1332
1333         WK1 should always setAcceleratedCompositingForFixedPositionEnabled(true) on 
1334         Yosemite
1335         https://bugs.webkit.org/show_bug.cgi?id=135135
1336
1337         Reviewed by Darin Adler.
1338
1339         This patch gets rid of the ChromeClient function that was introduced with 
1340         http://trac.webkit.org/changeset/171308 We’ll just enable the Setting instead.
1341         * css/StyleResolver.cpp:
1342         (WebCore::StyleResolver::adjustRenderStyle):
1343         (WebCore::fixedPositionCreatesStackingContext): Deleted.
1344         * page/ChromeClient.h:
1345         (WebCore::ChromeClient::requiresAcceleratedCompositingForViewportConstrainedPosition): Deleted.
1346         * rendering/RenderLayerCompositor.cpp:
1347         (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
1348
1349 2014-07-21  Simon Fraser  <simon.fraser@apple.com>
1350
1351         [iOS WK2] Turn off position:fixed behavior when the keyboard is up
1352         https://bugs.webkit.org/show_bug.cgi?id=132537
1353
1354         Reviewed by Benjamin Poulain.
1355
1356         Export RenderObject::localToContainerPoint().
1357
1358         * WebCore.exp.in:
1359
1360 2014-07-21  Jer Noble  <jer.noble@apple.com>
1361
1362         [MSE] YouTube video decode error when variant-switching
1363         https://bugs.webkit.org/show_bug.cgi?id=135128
1364
1365         Reviewed by Brent Fulgham.
1366
1367         Test: media/media-source/media-source-overlapping-decodetime.html
1368
1369         When variant-switching, the situation can arise where an existing sample with a presentation
1370         timestamp of N and a decode timestamp of M, and a new sample with a presentation timestamp > N
1371         and the same decode timestamp of M, will keep the new sample from being added to the SampleMap.
1372         This can result in a decode error when samples depending on that new, missing sample are enqueued.
1373
1374         The MSE spec is silent on the issue of overlapping decode timestamps. However, it guarantees that
1375         presentation timestamps are non-overlapping. So instead of using just the decode timestamp as a key
1376         for storing the samples in decode order, use both the decode timestamp and the presentation timestamp.
1377         That ensures that samples with different presentation times but equal decode times are both inserted
1378         into the decode queue, and in the correct order.
1379
1380         * Modules/mediasource/SampleMap.cpp:
1381         (WebCore::SampleIsRandomAccess::operator()): Update the parameter type to match the new KeyType.
1382         (WebCore::SampleMap::addSample): Pass both decodeTime and presentationTime as the key to decodeOrder.
1383         (WebCore::SampleMap::removeSample): Ditto.
1384         (WebCore::DecodeOrderSampleMap::findSampleWithDecodeKey): Renamed from findSampleWithDecodeTime.
1385         (WebCore::DecodeOrderSampleMap::reverseFindSampleWithDecodeKey): renamed from reverseFindSampleWithDecodeTime.
1386         (WebCore::DecodeOrderSampleMap::findSyncSamplePriorToPresentationTime): Use renamed version of above.
1387         (WebCore::DecodeOrderSampleMap::findSyncSampleAfterPresentationTime): Ditto.
1388         (WebCore::DecodeOrderSampleMap::findDependentSamples): Ditto.
1389         (WebCore::DecodeOrderSampleMap::findSampleWithDecodeTime): Deleted.
1390         (WebCore::DecodeOrderSampleMap::reverseFindSampleWithDecodeTime): Deleted.
1391         * Modules/mediasource/SampleMap.h:
1392         * Modules/mediasource/SourceBuffer.cpp:
1393         (WebCore::SourceBuffer::removeCodedFrames): Ditto.
1394         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Ditto.
1395         (WebCore::SourceBuffer::reenqueueMediaForTime): Ditto.
1396
1397 2014-07-21  Andy Estes  <aestes@apple.com>
1398
1399         [iOS] Handle QuickLook ResourceLoaders in the web process
1400         https://bugs.webkit.org/show_bug.cgi?id=135113
1401
1402         Reviewed by David Kilzer.
1403
1404         No new tests. QuickLook is not testable from WebKit.
1405
1406         * WebCore.exp.in:
1407         * loader/ResourceLoadScheduler.cpp:
1408         (WebCore::ResourceLoadScheduler::maybeLoadQuickLookResource): Start loading the ResourceLoader if it is for a QuickLook resource.
1409         * loader/ResourceLoadScheduler.h:
1410
1411 2014-07-21  Alexey Proskuryakov  <ap@apple.com>
1412
1413         Case sensitive file system build fix.
1414
1415         * page/scrolling/ScrollingStateTree.cpp:
1416
1417 2014-07-21  Beth Dakin  <bdakin@apple.com>
1418
1419         Put position:fixed elements into layers when a WK1 view is layer-backed
1420         https://bugs.webkit.org/show_bug.cgi?id=135075
1421
1422         Reviewed by Darin Adler.
1423
1424         This patch adds a new ChromeClient function called 
1425         requiresAcceleratedCompositingForViewportConstrainedPosition(). Since a view can 
1426         go in and out of layer backing, we need a ChromeClient method that can be 
1427         dynamically re-evaluated rather than using the existing settings for enabling 
1428         accelerated fixed and fixed that creates a stacking context.
1429
1430         Ensure that fixed elements create a stacking context when 
1431         requiresAcceleratedCompositingForViewportConstrainedPosition is true.
1432         * css/StyleResolver.cpp:
1433         (WebCore::StyleResolver::adjustRenderStyle):
1434
1435         New ChromeClient function.
1436         * page/ChromeClient.h:
1437
1438 2014-07-21  Simon Fraser  <simon.fraser@apple.com>
1439
1440         Add helper functions to dump the scrolling state tree from the debugger
1441         https://bugs.webkit.org/show_bug.cgi?id=135101
1442
1443         Reviewed by Darin Adler.
1444
1445         Add debug-only showScrollingStateTree() functions that take a ScrollingStateTree* and ScrollingStateNode*
1446         for use while debugging.
1447
1448         * page/scrolling/ScrollingStateTree.cpp:
1449         (showScrollingStateTree):
1450         * page/scrolling/ScrollingStateTree.h:
1451
1452 2014-07-20  Simon Fraser  <simon.fraser@apple.com>
1453
1454         [iOS WK1] Single touch div scrolling doesn't work in framesets (breaks Word previews)
1455         https://bugs.webkit.org/show_bug.cgi?id=135103
1456         <rdar://problem/11830219>
1457
1458         Reviewed by Darin Adler.
1459
1460         After r166117 all layer flushing starts on the root frame; we no longer flush layers
1461         for each frame during painting. However, flushing GraphicsLayers can set some state
1462         on a subframe RenderLayerCompositor that is now never processed, which breaks scroll
1463         layer registration.
1464         
1465         Fix by doing a walk of the Frame tree, and calling didFlushLayers() on subframe RenderLayerCompositors
1466         before calling didFlushLayers() on self.
1467
1468         * rendering/RenderLayerCompositor.cpp:
1469         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
1470         (WebCore::RenderLayerCompositor::didFlushLayers):
1471         (WebCore::RenderLayerCompositor::notifySubframesAfterLayerFlush):
1472         (WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers): Drive-by nullptr.
1473         * rendering/RenderLayerCompositor.h:
1474
1475 2014-07-21  Eric Carlson  <eric.carlson@apple.com>
1476
1477         [iOS] a Paused media session is not active
1478         https://bugs.webkit.org/show_bug.cgi?id=135108
1479
1480         Reviewed by Darin Adler.
1481
1482         Activating the shared AudioSession will pause audio playing in another application,
1483         so only report a Playing media sessions as active.
1484
1485         * platform/audio/MediaSessionManager.cpp:
1486         * platform/audio/MediaSessionManager.h:
1487         (WebCore::MediaSessionManager::activeAudioSessionRequired): Renamed from hasActive to make
1488         clear what it does. Only return true for a session that is Playing.
1489
1490         * platform/audio/mac/MediaSessionManagerMac.cpp:
1491         (MediaSessionManager::updateSessionState): hasActive renamed to activeAudioSessionRequired.
1492
1493 2014-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1494
1495         Unreviewed. Update GObject DOM bindings test results after r171285.
1496
1497         * bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObject.cpp:
1498         * bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp:
1499         * bindings/scripts/test/GObject/WebKitDOMTestCustomNamedGetter.cpp:
1500         * bindings/scripts/test/GObject/WebKitDOMTestEventConstructor.cpp:
1501         * bindings/scripts/test/GObject/WebKitDOMTestEventTarget.cpp:
1502         * bindings/scripts/test/GObject/WebKitDOMTestException.cpp:
1503         * bindings/scripts/test/GObject/WebKitDOMTestGenerateIsReachable.cpp:
1504         * bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp:
1505         * bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp:
1506         * bindings/scripts/test/GObject/WebKitDOMTestNamedConstructor.cpp:
1507         * bindings/scripts/test/GObject/WebKitDOMTestNode.cpp:
1508         * bindings/scripts/test/GObject/WebKitDOMTestNondeterministic.cpp:
1509         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1510         * bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructors.cpp:
1511         * bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp:
1512         * bindings/scripts/test/GObject/WebKitDOMTestTypedefs.cpp:
1513         * bindings/scripts/test/GObject/WebKitDOMattribute.cpp:
1514         * bindings/scripts/test/GObject/WebKitDOMreadonly.cpp:
1515
1516 2014-07-20  Pratik Solanki  <psolanki@apple.com>
1517
1518         Reduce the chances of a race condition when sharing SharedBuffer
1519         https://bugs.webkit.org/show_bug.cgi?id=135060
1520         <rdar://problem/17729444>
1521
1522         Reviewed by Darin Adler.
1523
1524         We currently pass a SharedBuffer wrapped in WebCoreSharedBufferData to ImageIO for image
1525         decoding. This is not thread safe since ImageIO will access this buffer on a separate
1526         thread. We access SharedBuffer::buffer() on the other thread which resizes the Vector
1527         m_buffer if m_size is greater than the vector size. Since the code in SharedBuffer::append()
1528         sets m_size before appending the data to the buffer, m_size is out of sync with the m_buffer
1529         size for the entire duration of the Vector append which could be doing a lot of copying if
1530         the resource is large. While this change does not fix the race condition, we can at least
1531         reduce the chances of SharedBuffer::buffer() calling resize() by setting m_size after the
1532         cector has finished appending.
1533
1534         No new tests because no functional changes.
1535
1536         * platform/SharedBuffer.cpp:
1537         (WebCore::SharedBuffer::append):
1538
1539 2014-07-20  Jeremy Jones  <jeremyj@apple.com>
1540
1541         Fix test crashes when cloning video layer since r171286
1542         https://bugs.webkit.org/show_bug.cgi?id=135112
1543
1544         Unreviewed. Fix crashing tests by conditionalizing inline video layer change.
1545         compositing/video/video-reflection.html [ Crash ]
1546         media/video-layer-crash.html [ Crash ]
1547
1548         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: add conditional
1549         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: ditto
1550         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): ditto
1551         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer): ditto
1552         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformLayer): ditto
1553
1554 2014-07-20  Jeremy Jones  <jeremyj@apple.com>
1555
1556         Disable ff/rw based on canPlayFastForward and canPlayFastRewind.
1557         https://bugs.webkit.org/show_bug.cgi?id=134894
1558
1559         Reviewed by Darin Adler.
1560
1561         * WebCore.exp.in: add symbol for canPlayFastReverse
1562         * html/HTMLMediaElement.cpp: Add two new accessors
1563         (WebCore::HTMLMediaElement::nextScanRate): possibly limit scanRate
1564         (WebCore::HTMLMediaElement::canPlayFastForward): added
1565         (WebCore::HTMLMediaElement::canPlayFastReverse): added
1566         * html/HTMLMediaElement.h: declare two new methods
1567         * platform/graphics/MediaPlayer.cpp: Plumb through two new accessors
1568         (WebCore::MediaPlayer::maxFastForwardRate): added
1569         (WebCore::MediaPlayer::minFastReverseRate): added
1570         * platform/graphics/MediaPlayer.h: Declare new methods
1571         * platform/graphics/MediaPlayerPrivate.h: Added two new methods.
1572         (WebCore::MediaPlayerPrivateInterface::maxFastForwardRate): added
1573         (WebCore::MediaPlayerPrivateInterface::minFastReverseRate): added
1574         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: member to cache ff/rw enabled state
1575         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1576         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): observe on item canPlayFastForward canPlayFastReverse
1577         (WebCore::MediaPlayerPrivateAVFoundationObjC::canPlayFastForwardDidChange): added
1578         (WebCore::MediaPlayerPrivateAVFoundationObjC::canPlayFastReverseDidChange): added
1579         (WebCore::itemKVOProperties): observe canPlayFastForward canPlayFastRewind
1580         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): ditto
1581         * platform/ios/WebVideoFullscreenInterface.h: add new method
1582         * platform/ios/WebVideoFullscreenInterfaceAVKit.h: ditto
1583         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: ditto
1584         (WebVideoFullscreenInterfaceAVKit::setCanPlayFastReverse): Set value on WebAVPlayerController.
1585         (-[WebAVPlayerController canScanBackward]): Deleted.
1586         (+[WebAVPlayerController keyPathsForValuesAffectingCanScanBackward]): Deleted.
1587         * platform/ios/WebVideoFullscreenModelMediaElement.mm:
1588         (WebVideoFullscreenModelMediaElement::updateForEventName): update canPlayFastReverse.
1589
1590 2014-07-18  Gavin Barraclough  <baraclough@apple.com>
1591
1592         HTMLMediaElement should registerWithDocument on iOS
1593         https://bugs.webkit.org/show_bug.cgi?id=135084
1594         <rdar://problem/17702531>
1595
1596         Reviewed by Andreas Kling.
1597
1598         Otherwise it won't know when the visibility changes!
1599
1600         * html/HTMLMediaElement.cpp:
1601         (WebCore::HTMLMediaElement::registerWithDocument):
1602         (WebCore::HTMLMediaElement::unregisterWithDocument):
1603
1604 2014-07-20  Jeremy Jones  <jeremyj@apple.com>
1605
1606         Decrease flicker when enter and exit fullscreen.
1607         https://bugs.webkit.org/show_bug.cgi?id=134919
1608
1609         Reviewed by Simon Fraser.
1610
1611         Put AVPlayerLayer in a container layer so moving it between inline and fullscreen
1612         is as easy as adding and removing it from a containter layer; no need to do a layout.
1613
1614         Make sure fullscreen layers are transparent before moving moving the AVPlayerLayer
1615         between inline and fullscreen so you don't briefly see the empty fullscreen layers.
1616
1617         * html/HTMLMediaElement.cpp:
1618         (WebCore::HTMLMediaElement::platformLayer): remove fullscreen special case.
1619         (WebCore::HTMLMediaElement::setVideoFullscreenLayer): no need to recalc style
1620         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: add inline container layer
1621         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: 
1622         add WebVideoContainerLayer to contain AVPlayerLayer and keep layout correct.
1623         (-[WebVideoContainerLayer setBounds:]): forward setbounds to set child frame.
1624         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): create the video container layer
1625         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer): destroy the video container layer
1626         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformLayer): use container layer instead of video layer
1627         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer): use transactions to prevent unwanted animation.
1628         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenFrame): ditto
1629         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
1630         (PlatformCALayerMac::layerTypeForPlatformLayer): WebVideoContainerLayer is a kind of AVPlayerLayer
1631         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1632         (-[WebVideoFullscreenController didCleanupFullscreen]): remove video fullscreen layer first
1633         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1634         (WebVideoFullscreenInterfaceAVKit::setupFullscreen): make background transparent during transition.
1635            dispatch_async to allow CATransaction to complete before calling didSetupFullscreen()
1636
1637 2014-07-20  Ryuan Choi  <ryuan.choi@samsung.com>
1638
1639         Move ExceptionCodeDescription.h into the files that actually need it
1640         https://bugs.webkit.org/show_bug.cgi?id=134968
1641
1642         Reviewed by Darin Adler.
1643
1644         No new tests because no functional changes.
1645
1646         * Modules/indexeddb/IDBDatabaseException.cpp:
1647         * Modules/webdatabase/SQLException.cpp:
1648         * bindings/js/JSDOMBinding.cpp:
1649         * bindings/objc/ExceptionHandlers.mm:
1650         * bindings/scripts/CodeGeneratorGObject.pm:
1651         (Generate):
1652         * dom/DOMCoreException.cpp:
1653         * dom/EventException.cpp:
1654         * dom/ExceptionBase.cpp:
1655         * dom/ExceptionCode.h:
1656         * dom/RangeException.cpp:
1657         * fileapi/FileException.cpp:
1658         * inspector/DOMEditor.cpp:
1659         * inspector/InspectorDOMAgent.cpp:
1660         * svg/SVGException.cpp:
1661         * xml/XMLHttpRequestException.cpp:
1662         * xml/XPathException.cpp:
1663
1664 2014-07-20  Dan Bernstein  <mitz@apple.com>
1665
1666         <rdar://problems/17742611> -[_WKActivatedElementInfo image] is often empty
1667         https://bugs.webkit.org/show_bug.cgi?id=135107
1668
1669         Reviewed by Sam Weinig.
1670
1671         Test: TestWebKitAPI/Tests/mac/RenderedImageFromDOMNode.mm
1672
1673         * page/FrameView.cpp:
1674         (WebCore::FrameView::paintContents): To work around http://webkit.org/b/135106, replace the
1675         paint root with its nearest ancestor that isn’t an inline with culled line boxes, if needed.
1676
1677 2014-07-20  Darin Adler  <darin@apple.com>
1678
1679         Crashes seen in wheel event handling
1680         https://bugs.webkit.org/show_bug.cgi?id=135102
1681
1682         Reviewed by Beth Dakin.
1683
1684         Speculative fix based on guesses about what could be crashing.
1685         The crash seems to be calling ref on an event target, and my guess is that this
1686         has something to do with latching.
1687
1688         * page/EventHandler.cpp:
1689         (WebCore::EventHandler::platformPrepareForWheelEvents): Updated argument types.
1690         (WebCore::EventHandler::handleWheelEvent): Refactored a little and made some local
1691         variables use RefPtr instead of raw pointers. Also added some comments.
1692
1693         * page/EventHandler.h: Changed argument types to RefPtr.
1694
1695         * page/mac/EventHandlerMac.mm:
1696         (WebCore::EventHandler::platformPrepareForWheelEvents): Updated argument types.
1697         Also added a FIXME.
1698
1699 2014-07-20  Simon Fraser  <simon.fraser@apple.com>
1700
1701         Print layerIDs in GraphicsLayer dumps
1702         https://bugs.webkit.org/show_bug.cgi?id=135100
1703
1704         Reviewed by Darin Adler.
1705
1706         When calling showGraphicsLayerTree() from the debugger, it's useful to show
1707         layerIDs so they can be correlated with remote layer tree transactions. So
1708         when dumping with debug info, dump the primary layer ID.
1709
1710         * platform/graphics/GraphicsLayer.cpp:
1711         (WebCore::GraphicsLayer::dumpProperties):
1712
1713 2014-07-20  Eric Carlson  <eric.carlson@apple.com>
1714
1715         [iOS] ignore requests to set volume
1716         https://bugs.webkit.org/show_bug.cgi?id=135081
1717
1718         Applied post-review comments from Darin Adler.
1719
1720         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1721         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume): Don't include unreachable
1722             code on iOS.
1723
1724 2014-07-19  Mark Rowe  <mrowe@apple.com>
1725
1726         <https://webkit.org/b/135085> Ensure that make_names.pl generates the same result when run multiple times.
1727
1728         Perl 5.18 introduced hash randomization. This results in the iteration order of hashes being different
1729         from one run to the next. To ensure identical output we can iterate over the hash keys in sorted order.
1730
1731         Reviewed by Alexey Proskuryakov.
1732
1733         * bindings/scripts/StaticString.pm:
1734         (GenerateStrings):
1735         (GenerateStringAsserts):
1736         * dom/make_names.pl:
1737
1738 2014-07-19  Zan Dobersek  <zdobersek@igalia.com>
1739
1740         Document::unregisterNodeListforInvalidation() and Document::unregisterCollection() have incorrect assertions
1741         https://bugs.webkit.org/show_bug.cgi?id=134869
1742
1743         Reviewed by Darin Adler.
1744
1745         Both methods should assert that the relevant HashMap is either empty if invalidation originates
1746         from Document::invalidateNodeListAndCollectionCaches() or acutally contains the element that is
1747         being invalidated. In the first case the HashMap is empty because its entries were moved out in
1748         the Document::invalidateNodeListAndCollectionCaches().
1749
1750         This was exposed by r170995 (later rolled out in r170999) which introduced move constructor and
1751         move assignment operators for HashTable. The assertions in the titular methods won't be passing
1752         until r170995 relands.
1753
1754         * dom/Document.cpp:
1755         (WebCore::Document::unregisterNodeListForInvalidation):
1756
1757 2014-07-18  Eric Carlson  <eric.carlson@apple.com>
1758
1759         [iOS] ignore requests to set volume
1760         https://bugs.webkit.org/show_bug.cgi?id=135081
1761
1762         Reviewed by Jer Noble.
1763
1764         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1765         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume): Do nothing on iOS.
1766
1767 2014-07-18  Andy Estes  <aestes@apple.com>
1768
1769         [iOS] Tapping "Allow Website" on a restricted page does not bring up the keypad
1770         https://bugs.webkit.org/show_bug.cgi?id=135072
1771         <rdar://problem/17528188>
1772
1773         Reviewed by David Kilzer.
1774
1775         No new tests. Content filtering is not testable from WebKit.
1776
1777         * WebCore.exp.in: Exported necessary ContentFilter symbols.
1778         * loader/DocumentLoader.cpp:
1779         (WebCore::DocumentLoader::finishedLoading): Called FrameLoaderClient::contentFilterDidBlockLoad().
1780         (WebCore::DocumentLoader::responseReceived): Created a new ContentFilter.
1781         (WebCore::DocumentLoader::dataReceived): Called FrameLoaderClient::contentFilterDidBlockLoad().
1782         (WebCore::DocumentLoader::setContentFilterForBlockedLoad): Deleted.
1783         (WebCore::DocumentLoader::handleContentFilterRequest): Deleted.
1784         * loader/DocumentLoader.h:
1785         * loader/FrameLoaderClient.h:
1786         (WebCore::FrameLoaderClient::contentFilterDidBlockLoad):
1787         * loader/PolicyChecker.cpp:
1788         (WebCore::PolicyChecker::checkNavigationPolicy): Removed the check for unblock navigations, as this is now
1789         handled at the WebKit layer.
1790         * platform/ContentFilter.h: ContentFilter no longer needs to be RefCounted, so made various changes in order to
1791         make it compatible with unique_ptr.
1792         * platform/ios/ContentFilterIOS.mm:
1793         (WebCore::scheme): Changed from a public member function to a static inline free function.
1794         (WebCore::ContentFilter::handleUnblockRequestAndDispatchIfSuccessful): Renamed from requestUnblockAndDispatchIfSuccessful.
1795         * platform/mac/ContentFilterMac.mm:
1796         (WebCore::ContentFilter::ContentFilter): Added a default constructor for use during message decoding.
1797         (WebCore::ContentFilter::addData): Removed calls to ref() and deref(). These were never actually needed since
1798         we were dispatching the block synchronously.
1799         (WebCore::ContentFilter::finishedAddingData): Ditto.
1800         (WebCore::ContentFilter::encode): Encoded m_platformContentFilter to the NSKeyedArchiver if it conforms to NSSecureCoding.
1801         (WebCore::ContentFilter::decode): Decoded m_platformContentFilter from the NSKeyedUnarchiver if it conforms to NSSecureCoding.
1802         (WebCore::ContentFilter::create): Deleted.
1803
1804 2014-07-18  Simon Fraser  <simon.fraser@apple.com>
1805
1806         [iOS WK2] position:fixed in iframes with programmatic scroll could end up in the wrong place
1807         https://bugs.webkit.org/show_bug.cgi?id=135078
1808         <rdar://problem/17401823>
1809
1810         Reviewed by Tim Horton.
1811         
1812         When the UI-side scrolling tree receives a requested scroll position update, it scrolls
1813         the node (e.g. a frame) then traverses child nodes to update them, e.g. for fixed position.
1814         However, we would always use a viewport rect for the main document (from the scrolling tree),
1815         which is not appropriate for subframes. Subframes should just use their own visible
1816         rect to position fixed children.
1817
1818         Test: platform/mac-wk2/tiled-drawing/scrolling/frames/fixed-inside-frame.html
1819
1820         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
1821         (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateChildNodesAfterScroll):
1822
1823 2014-07-18  Beth Dakin  <bdakin@apple.com>
1824
1825         Fixed position elements are misplaced when a WK1 view has contentInsets set
1826         https://bugs.webkit.org/show_bug.cgi?id=135031
1827         -and corresponding-
1828         <rdar://problem/17682335>
1829
1830         Reviewed by Tim Horton.
1831
1832         [NSScrollView documentVisibleRect] includes content that is within the inset-area 
1833         of a view, but WebCore is interested in the content that is fully visible, so we 
1834         need to factor the inset sizes out of this rect.
1835
1836         Implement contract() to avoid the awkwardness of calling expand() with negative 
1837         values.
1838         * platform/graphics/IntSize.h:
1839         (WebCore::IntSize::contract):
1840
1841         Factor out insets
1842         * platform/mac/ScrollViewMac.mm:
1843         (WebCore::ScrollView::platformVisibleContentRect):
1844         (WebCore::ScrollView::platformVisibleContentSize):
1845
1846 2014-07-18  Tim Horton  <timothy_horton@apple.com>
1847
1848         Take navigation snapshots whenever the current back-forward item is going to change
1849         https://bugs.webkit.org/show_bug.cgi?id=135058
1850         <rdar://problem/17464515>
1851
1852         Reviewed by Dan Bernstein.
1853
1854         * loader/HistoryController.cpp:
1855         (WebCore::HistoryController::updateForCommit):
1856         (WebCore::HistoryController::recursiveUpdateForCommit):
1857         (WebCore::HistoryController::recursiveUpdateForSameDocumentNavigation):
1858         (WebCore::HistoryController::createItem):
1859         Use setCurrentItem instead of duplicating the contents of it inside each of these functions.
1860
1861         (WebCore::HistoryController::setCurrentItem):
1862         (WebCore::HistoryController::replaceCurrentItem):
1863         When setting or replacing the current item, let the FrameLoaderClient know that we're going
1864         to change which history item is "current".
1865
1866         * loader/FrameLoaderClient.h:
1867         (WebCore::FrameLoaderClient::willChangeCurrentHistoryItem): Added.
1868
1869 2014-07-18  Commit Queue  <commit-queue@webkit.org>
1870
1871         Unreviewed, rolling out r171207.
1872         https://bugs.webkit.org/show_bug.cgi?id=135056
1873
1874         Broke multiple tests on Yosemite (Requested by ap on #webkit).
1875
1876         Reverted changeset:
1877
1878         "Fixed position elements are misplaced when a WK1 view has
1879         contentInsets set"
1880         https://bugs.webkit.org/show_bug.cgi?id=135031
1881         http://trac.webkit.org/changeset/171207
1882
1883 2014-07-18  Commit Queue  <commit-queue@webkit.org>
1884
1885         Unreviewed, rolling out r171218.
1886         https://bugs.webkit.org/show_bug.cgi?id=135055
1887
1888         Made fast/dom/HTMLObjectElement/beforeload-set-text-
1889         crash.xhtml crash (Requested by ap on #webkit).
1890
1891         Reverted changeset:
1892
1893         "REGRESSION (r169105): Crash in selection"
1894         https://bugs.webkit.org/show_bug.cgi?id=134303
1895         http://trac.webkit.org/changeset/171218
1896
1897 2014-07-18  Radu Stavila  <stavila@adobe.com>
1898
1899         REGRESSION (r169105): Crash in selection
1900         https://bugs.webkit.org/show_bug.cgi?id=134303
1901
1902         Reviewed by Ryosuke Niwa.
1903
1904         When splitting the selection between different subtrees, all subtrees must have their selection cleared before
1905         starting to apply the new selection. Otherwise, when selecting objects in a named flow thread and going up
1906         its containing block chain, we can end up in the view's selection root, which has not yet been updated and so
1907         we get inconsistent data.
1908
1909         To achieve this goal, the selection update was split into a "clear" and an "apply" method. The updateSelectionForSubtrees
1910         method first iterates through all subtrees and performs the "clear" method and then starts all over again
1911         and performs the "apply" method.
1912
1913         Also, the selectionStart/End members in RenderView have been renamed to fix problems caused by the fact that
1914         RenderView inherits SelectionSubtreeRoot, which also has the same selectionStart/End members.
1915
1916         Test: fast/regions/selection/crash-deselect.html
1917
1918         * WebCore.xcodeproj/project.pbxproj:
1919         * rendering/RenderBlock.cpp:
1920         (WebCore::RenderBlock::isSelectionRoot):
1921         * rendering/RenderSelectionInfo.h:
1922         * rendering/RenderView.cpp:
1923         (WebCore::RenderView::RenderView):
1924         (WebCore::RenderView::setSelection): Renamed m_selectionStart/End to m_unsplitSelectionStart/End
1925         (WebCore::RenderView::splitSelectionBetweenSubtrees):
1926         (WebCore::RenderView::updateSelectionForSubtrees): Added, clears and re-applies selection for all selection subtrees.
1927         (WebCore::RenderView::clearSubtreeSelection): Added, clears selection and returns previously selected information.
1928         (WebCore::RenderView::applySubtreeSelection): Added, updates the selection status of all objects inside the selection tree, compares old and new data and repaints accordingly.
1929         (WebCore::RenderView::getSelection): Renamed m_selectionStart/End to m_unsplitSelectionStart/End
1930         (WebCore::RenderView::setSubtreeSelection): Deleted.
1931         * rendering/RenderView.h:
1932         * rendering/SelectionSubtreeRoot.cpp:
1933         (WebCore::SelectionSubtreeRoot::SelectionSubtreeRoot):
1934         * rendering/SelectionSubtreeRoot.h:
1935         (WebCore::SelectionSubtreeRoot::OldSelectionData::OldSelectionData):
1936
1937 2014-07-17  Jer Noble  <jer.noble@apple.com>
1938
1939         [MSE] Re-enqueue after a removeCodedFrames() only if the removed frames overlap what may have possibly been enqueued but undisplayed.
1940         https://bugs.webkit.org/show_bug.cgi?id=135039
1941
1942         Reviewed by Eric Carlson.
1943
1944         When a client calls removeCodedFrames(), we must re-enqueue those ranges if the removed samples overlap with
1945         enqueued but possibly un-displayed samples. Otherwise, replacement samples may lead to decode errors as those
1946         new samples dependencies are not met. But if we re-enqueue too frequently, this may cause subtle but noticible
1947         display timing glitches, so only re-enqueue when removeCodedFrames have a possiblity of removing enqueued, but
1948         not yet displayed samples.
1949
1950         * Modules/mediasource/SourceBuffer.cpp:
1951         (WebCore::SourceBuffer::removeCodedFrames):
1952
1953 2014-07-17  David Kilzer  <ddkilzer@apple.com>
1954
1955         SECTORDER_FLAGS should be defined in target's xcconfig file, not Base.xcconfig
1956         <http://webkit.org/b/135006>
1957
1958         Reviewed by Darin Adler.
1959
1960         * Configurations/Base.xcconfig: Move SECTORDER_FLAGS to
1961         WebCore.xcconfig.
1962         * Configurations/DebugRelease.xcconfig: Remove empty
1963         SECTORDER_FLAGS definition.
1964         * Configurations/WebCoreTestShim.xcconfig: Ditto.
1965         * Configurations/WebCoreTestSupport.xcconfig: Ditto.
1966         * Configurations/WebCore.xcconfig: Use $(CONFIGURATION) so
1967         SECTORDER_FLAGS is only set on Production builds.
1968
1969 2014-07-17  Zalan Bujtas  <zalan@apple.com>
1970
1971         Subpixel rendering: Embedded non-compositing rotate transform paints to wrong position.
1972         https://bugs.webkit.org/show_bug.cgi?id=135028
1973
1974         Reviewed by Simon Fraser.
1975
1976         CTM always translates to where the layer's renderer() is going to paint.
1977         It ensures that the pixel snapped renderer() always end up painting to (0, 0) which is
1978         required to be able to position properly on transformed context.
1979
1980         Test: fast/layers/hidpi-transform-on-child-content-is-mispositioned.html
1981
1982         * rendering/RenderLayer.cpp:
1983         (WebCore::RenderLayer::beginTransparencyLayers):
1984         (WebCore::RenderLayer::clipToRect):
1985         (WebCore::RenderLayer::paintLayerByApplyingTransform):
1986         (WebCore::RenderLayer::paintBackgroundForFragments):
1987         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
1988         (WebCore::RenderLayer::paintOutlineForFragments):
1989         (WebCore::RenderLayer::paintMaskForFragments):
1990         (WebCore::RenderLayer::paintOverflowControlsForFragments):
1991         (WebCore::RenderLayer::calculateClipRects):
1992         * rendering/RenderLayer.h:
1993
1994 2014-07-17  Beth Dakin  <bdakin@apple.com>
1995
1996         Fixed position elements are misplaced when a WK1 view has contentInsets set
1997         https://bugs.webkit.org/show_bug.cgi?id=135031
1998         -and corresponding-
1999         <rdar://problem/17682335>
2000
2001         Reviewed by Tim Horton.
2002
2003         [NSScrollView documentVisibleRect] is not the rect that we are looking for when 
2004         this function is called. WebCore is interested in the rect that does not include 
2005         content that is within the inset region.
2006
2007         Implement contract() to avoid the awkwardness of calling expand() with negative 
2008         values.
2009         * platform/graphics/IntSize.h:
2010         (WebCore::IntSize::contract):
2011
2012         Use _insetBounds instead of documentVisibleRect, and when it’s necessary to use 
2013         the frame’s dimensions, extract the inset from that size.
2014         * platform/mac/ScrollViewMac.mm:
2015         (WebCore::ScrollView::platformVisibleContentRect):
2016         (WebCore::ScrollView::platformVisibleContentSize):
2017
2018 2014-07-17  Enrica Casucci  <enrica@apple.com>
2019
2020         [REGRESSION WK2]The menu bar does not show up when tapping on the caret.
2021         https://bugs.webkit.org/show_bug.cgi?id=135023
2022         <rdar://problem/17617282>
2023
2024         Reviewed by Benjamin Poulain.
2025
2026         Adding some exports.
2027         
2028         * WebCore.exp.in:
2029
2030 2014-07-17  Timothy Hatcher  <timothy@apple.com>
2031
2032         Make console.profile record to the Timeline.
2033
2034         https://bugs.webkit.org/show_bug.cgi?id=134643
2035
2036         Reviewed by Joseph Pecoraro.
2037
2038         Passes existing profiler tests in fast/profiler.
2039
2040         * bindings/js/ScriptState.cpp:
2041         (WebCore::domWindowFromExecState):
2042         (WebCore::frameFromExecState):
2043         (WebCore::scriptExecutionContextFromExecState):
2044         (WebCore::mainWorldExecState):
2045         (WebCore::execStateFromNode):
2046         * bindings/js/ScriptState.h:
2047         * inspector/InspectorController.cpp:
2048         (WebCore::InspectorController::InspectorController):
2049         (WebCore::InspectorController::profilerEnabled):
2050         (WebCore::InspectorController::setProfilerEnabled):
2051         * inspector/InspectorController.h:
2052         * inspector/InspectorInstrumentation.cpp:
2053         (WebCore::InspectorInstrumentation::startProfilingImpl):
2054         (WebCore::InspectorInstrumentation::stopProfilingImpl):
2055         * inspector/InspectorTimelineAgent.cpp:
2056         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
2057         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
2058         (WebCore::InspectorTimelineAgent::start):
2059         (WebCore::InspectorTimelineAgent::stop):
2060         (WebCore::startProfiling):
2061         (WebCore::stopProfiling):
2062         (WebCore::InspectorTimelineAgent::startFromConsole):
2063         (WebCore::InspectorTimelineAgent::stopFromConsole):
2064         (WebCore::InspectorTimelineAgent::didWriteHTML):
2065         (WebCore::InspectorTimelineAgent::breakpointActionProbe):
2066         (WebCore::toProtocol):
2067         (WebCore::InspectorTimelineAgent::addRecordToTimeline):
2068         (WebCore::InspectorTimelineAgent::didCompleteRecordEntry):
2069         (WebCore::InspectorTimelineAgent::didCompleteCurrentRecord):
2070         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
2071         (WebCore::InspectorTimelineAgent::sendEvent):
2072         (WebCore::InspectorTimelineAgent::createRecordEntry):
2073         (WebCore::InspectorTimelineAgent::pushCurrentRecord):
2074         * inspector/InspectorTimelineAgent.h:
2075         (WebCore::InspectorTimelineAgent::TimelineRecordEntry::TimelineRecordEntry):
2076         (WebCore::InspectorTimelineAgent::pushCurrentRecord):
2077         * inspector/InstrumentingAgents.cpp:
2078         (WebCore::InstrumentingAgents::InstrumentingAgents):
2079         (WebCore::InstrumentingAgents::reset):
2080         * inspector/InstrumentingAgents.h:
2081         (WebCore::InstrumentingAgents::persistentInspectorTimelineAgent):
2082         (WebCore::InstrumentingAgents::setPersistentInspectorTimelineAgent):
2083         * inspector/TimelineRecordFactory.cpp:
2084         (WebCore::TimelineRecordFactory::createConsoleProfileData):
2085         * inspector/TimelineRecordFactory.h:
2086         * inspector/protocol/Timeline.json:
2087         * page/PageConsole.cpp:
2088         (WebCore::PageConsole::profileEnd):
2089
2090 2014-07-16  Sam Weinig  <sam@webkit.org>
2091
2092         Don't send geolocation permission requests when the page is not visible
2093         <rdar://problem/17208715>
2094         https://bugs.webkit.org/show_bug.cgi?id=134989
2095
2096         Reviewed by Darin Adler.
2097
2098         Instead of eagerly requesting geolocation permission for pages that aren't visible,
2099         store a set of pending requests, and send them only once the page has become visible.
2100
2101         * Modules/geolocation/GeolocationController.cpp:
2102         (WebCore::GeolocationController::GeolocationController):
2103         (WebCore::GeolocationController::~GeolocationController):
2104         (WebCore::GeolocationController::requestPermission):
2105         (WebCore::GeolocationController::cancelPermissionRequest):
2106         (WebCore::GeolocationController::viewStateDidChange):
2107         (WebCore::provideGeolocationTo):
2108         * Modules/geolocation/GeolocationController.h:
2109         Store pending requests to be fired once the page is visible.
2110
2111         * WebCore.xcodeproj/project.pbxproj:
2112         Add ViewStateChangeObserver.h
2113
2114         * page/Page.cpp:
2115         (WebCore::Page::addViewStateChangeObserver):
2116         (WebCore::Page::removeViewStateChangeObserver):
2117         (WebCore::Page::setViewState):
2118         * page/Page.h:
2119         Add a set of registered view state observers, and notify them when the
2120         view state changes.
2121
2122         * page/ViewStateChangeObserver.h: Added.
2123         (WebCore::ViewStateChangeObserver::~ViewStateChangeObserver):
2124         Add an observer that can register with the page for view state changes.
2125
2126 2014-07-17  Jer Noble  <jer.noble@apple.com>
2127
2128         Enable legacy fullscreen API in media controls
2129         https://bugs.webkit.org/show_bug.cgi?id=134985
2130
2131         Reviewed by Eric Carlson.
2132
2133         Allow clients who have not enabled HTML5 Fullscreen APIs to still use fullscreen mode
2134         with <video> elements by using the legacy, video-element-specific fullscreen APIs in
2135         the <video> media controls.
2136
2137         * Modules/mediacontrols/mediaControlsApple.js:
2138         (Controller):
2139         (Controller.prototype.handleReadyStateChange):
2140         (Controller.prototype.isFullScreen):
2141         (Controller.prototype.handlePlayButtonClicked):
2142         (Controller.prototype.updateFullscreenButton):
2143         (Controller.prototype.handleFullscreenButtonClicked):
2144
2145 2014-07-17  Vineet Chaudhary  <code.vineet@gmail.com>
2146
2147         [GObject] StrictTypeChecking extended attribute fails for methods with sequence<T>.
2148         https://bugs.webkit.org/show_bug.cgi?id=121698
2149
2150         Reviewed by Antonio Gomes.
2151
2152         GodeGenerator was including wrong heeaders as WebKitDOMlong[] for methods with
2153         array parameters and StrictTypeChecking extended attribute.
2154         No new tests. TestObj.idl covers the tests.
2155
2156         * bindings/scripts/CodeGenerator.pm:
2157         (GetArrayOrSequenceType):
2158         * bindings/scripts/CodeGeneratorGObject.pm:
2159         (GenerateFunction):
2160         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2161         (webkit_dom_test_obj_strict_function_with_array):
2162         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
2163         * bindings/scripts/test/GObject/WebKitDOMTestTypedefs.cpp:
2164         (webkit_dom_test_typedefs_func):
2165         (webkit_dom_test_typedefs_nullable_array_arg):
2166         * bindings/scripts/test/GObject/WebKitDOMTestTypedefs.h:
2167         * bindings/scripts/test/TestObj.idl:
2168
2169 2014-07-17  Yusuke Suzuki  <utatane.tea@gmail.com>
2170
2171         CSS JIT: Clean up return path
2172         https://bugs.webkit.org/show_bug.cgi?id=135011
2173
2174         Reviewed by Benjamin Poulain.
2175
2176         Clean up the existing CSS JIT return path before adding new early return path
2177         for pseudo elements.
2178
2179         * cssjit/SelectorCompiler.cpp:
2180         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
2181         * cssjit/StackAllocator.h:
2182         (WebCore::StackAllocator::StackReference::StackReference):
2183         (WebCore::StackAllocator::StackReference::isValid):
2184         (WebCore::StackAllocator::popAndDiscard): Deleted.
2185
2186 2014-07-16  Zalan Bujtas  <zalan@apple.com>
2187
2188         Subpixel rendering: Adjust cliprect with devicePixelFractionFromRenderer() before painting.
2189         https://bugs.webkit.org/show_bug.cgi?id=134950
2190         <rdar://problem/17617994>
2191
2192         Reviewed by Simon Fraser.
2193
2194         The cliprect coming from the graphics layer needs to be adjusted with the subpixel gap
2195         from renderer. This is symmetric with the offsetting we do, when the dirty rect is sent off to the GraphicsLayer.
2196         It puts us back to the correct coordinating system for intersecting with renderers.
2197
2198         Test: compositing/hidpi-compositing-layer-with-tile-layers-on-subpixel-position.html
2199
2200         * rendering/RenderLayer.cpp:
2201         (WebCore::RenderLayer::beginTransparencyLayers):
2202         (WebCore::RenderLayer::clipToRect):
2203
2204 2014-07-16  Simon Fraser  <simon.fraser@apple.com>
2205
2206         Fix a typo noticed by Darin.
2207         
2208         * rendering/RenderBox.cpp:
2209         (WebCore::shouldApplyContainersClipAndOffset):
2210         (WebCore::RenderBox::computeRectForRepaint):
2211         (WebCore::shouldAppyContainersClipAndOffset): Deleted.
2212
2213 2014-07-16  Simon Fraser  <simon.fraser@apple.com>
2214
2215         Improve showTree() logging
2216         https://bugs.webkit.org/show_bug.cgi?id=134997
2217
2218         Reviewed by Tim Horton.
2219
2220         Have the debug showTree(), which dumps the Node/Element tree, show which nodes need
2221         style recalc, and print element renderers.
2222
2223         * dom/Node.cpp:
2224         (WebCore::Node::showNode):
2225
2226 2014-07-16  Simon Fraser  <simon.fraser@apple.com>
2227
2228         [iOS] Expose the points on WebEventRegion
2229         https://bugs.webkit.org/show_bug.cgi?id=134978
2230
2231         Reviewed by Tim Horton.
2232
2233         Expose WebEventRegion's points so that UIKit can get at them.
2234
2235         * page/ios/WebEventRegion.h:
2236         * page/ios/WebEventRegion.mm:
2237         (-[WebEventRegion p1]):
2238         (-[WebEventRegion p2]):
2239         (-[WebEventRegion p3]):
2240         (-[WebEventRegion p4]):
2241
2242 2014-07-16  Brady Eidson  <beidson@apple.com>
2243
2244         Add WebSecurityOrigin "webSecurityOriginFromDatabaseIdentifier" SPI and change _websiteDataURLForContainerWithURL: SPI
2245         <rdar://problem/17454712> and https://bugs.webkit.org/show_bug.cgi?id=134984
2246
2247         Reviewed by Dan Bernstein.
2248
2249         Change _websiteDataURLForContainerWithURL: SPI to include an optional bundle identifier argument:
2250         * UIProcess/API/Cocoa/WKProcessPool.mm:
2251         (+[WKProcessPool _websiteDataURLForContainerWithURL:bundleIdentifierIfNotInContainer:]):
2252         (+[WKProcessPool _websiteDataURLForContainerWithURL:]): Deleted.
2253         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2254
2255         Add a big shiny comment in a few key places:
2256         * DatabaseProcess/DatabaseProcess.cpp:
2257         (WebKit::DatabaseProcess::initializeDatabaseProcess):
2258         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
2259         (WebKit::UniqueIDBDatabase::UniqueIDBDatabase):
2260         * UIProcess/WebContext.cpp:
2261         (WebKit::WebContext::applyPlatformSpecificConfigurationDefaults):
2262         (WebKit::WebContext::ensureDatabaseProcess):
2263
2264 2014-07-16  Roger Fong  <roger_fong@apple.com>
2265
2266         Captions container should not clip content.
2267         https://bugs.webkit.org/show_bug.cgi?id=134840.
2268         <rdar://problem/14553608>.
2269
2270         Reviewed by Simon Fraser.
2271
2272         Tests: media/track/track-in-band-subtitles-too-large.html
2273                media/track/track-long-word-container-sizing.html
2274
2275         * Modules/mediacontrols/mediaControlsApple.css:
2276         (video::-webkit-media-text-track-container):
2277         Set word break property of WebCTT cues to normal to make it consistent with in-band cues.
2278         * html/track/TextTrackCueGeneric.cpp:
2279         (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
2280         Set -webkit-min-content on min-width/min-height property of the text track display.
2281         * html/track/VTTCue.cpp:
2282         (WebCore::VTTCueBox::applyCSSProperties):
2283         Do the same for WebVTT cues.
2284
2285 2014-07-16  Eric Carlson  <eric.carlson@apple.com>
2286
2287         [Mac] replace AVPlayerItem on the main thread
2288         https://bugs.webkit.org/show_bug.cgi?id=134983
2289
2290         Reviewed by Jer Noble.
2291
2292         No new tests, this fixes a problem with a thread configuration not present in the
2293         test environment.
2294
2295         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2296         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2297         (WebCore::MediaPlayerPrivateAVFoundationObjC::setAVPlayerItem): New, when called off of 
2298             the main thread, dispatch to the main thread before setting AVPlayerItem.
2299         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): Call setAVPlayerItem.
2300         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Ditto.
2301         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData): Ditto.
2302
2303 2014-07-16  Jer Noble  <jer.noble@apple.com>
2304
2305         [MSE] http/tests/media/media-source/mediasource-buffered.html is flakey
2306         https://bugs.webkit.org/show_bug.cgi?id=134949
2307
2308         Reviewed by Eric Carlson.
2309
2310         Depending on which SourceBuffer is successfully parsed first, the order of activeSourceBuffers
2311         may change from run to run, breaking the http/tests/media/media-source/mediasource-buffered.html
2312         test. Make the order of activeSourceBuffers the same as (a subset of) sourceBuffers, by replacing
2313         calls to activeSourceBuffers->add() and with a new call to regenerateActiveSourceBuffers(), which
2314         swaps the contents of the SourceBufferList with a new, ordered Vector.
2315
2316         * Modules/mediasource/MediaSource.cpp:
2317         (WebCore::MediaSource::addSourceBuffer):
2318         (WebCore::MediaSource::sourceBufferDidChangeAcitveState):
2319         (WebCore::MediaSource::regenerateActiveSourceBuffers):
2320         * Modules/mediasource/MediaSource.h:
2321         * Modules/mediasource/SourceBufferList.cpp:
2322         (WebCore::SourceBufferList::swap):
2323         * Modules/mediasource/SourceBufferList.h:
2324
2325 2014-07-16  Mike West  <mkwst@chromium.org>
2326
2327         CSP: Drop 'script-nonce' directive.
2328         https://bugs.webkit.org/show_bug.cgi?id=134926
2329
2330         Reviewed by Darin Adler.
2331
2332         This patch drops the outdated 'script-nonce' Content Security
2333         Policy directive. It was removed from the spec, and replaced in
2334         CSP2 with a new 'script-src' syntax. We should implement that
2335         instead.
2336
2337         Until then, removing the outdated syntax will ensure that no one
2338         ends up relying on it in WebKit's implementation.
2339
2340         This should have limited web-visible impact, as the feature is
2341         behind the CSP_NEXT flag, which is not enabled by default.
2342
2343         * dom/ScriptElement.cpp:
2344         (WebCore::ScriptElement::requestScript):
2345         (WebCore::ScriptElement::executeScript):
2346         * page/ContentSecurityPolicy.cpp:
2347         (WebCore::CSPDirectiveList::allowJavaScriptURLs):
2348         (WebCore::CSPDirectiveList::allowInlineEventHandlers):
2349         (WebCore::CSPDirectiveList::addDirective):
2350         (WebCore::NonceDirective::NonceDirective): Deleted.
2351         (WebCore::NonceDirective::allows): Deleted.
2352         (WebCore::NonceDirective::parse): Deleted.
2353         (WebCore::CSPDirectiveList::checkNonce): Deleted.
2354         (WebCore::CSPDirectiveList::checkNonceAndReportViolation): Deleted.
2355         (WebCore::CSPDirectiveList::allowScriptNonce): Deleted.
2356         (WebCore::isAllowedByAllWithNonce): Deleted.
2357         (WebCore::ContentSecurityPolicy::allowScriptNonce): Deleted.
2358         (WebCore::ContentSecurityPolicy::reportInvalidNonce): Deleted.
2359         * page/ContentSecurityPolicy.h:
2360
2361 2014-07-16  Jer Noble  <jer.noble@apple.com>
2362
2363         REGRESSION(r171069) 75% repro crash in WebCore::AudioHardwareListenerMac::processIsRunningChanged()
2364         https://bugs.webkit.org/show_bug.cgi?id=134986
2365
2366         Reviewed by Eric Carlson.
2367
2368         Add a WeakPtrFactory to AudioHardwareListenerMac, so that if CoreAudio calls our block after
2369         being unregistered, we can bail early instead of calling into a deleted object.
2370
2371         * platform/audio/mac/AudioHardwareListenerMac.cpp:
2372         (WebCore::AudioHardwareListenerMac::AudioHardwareListenerMac):
2373         * platform/audio/mac/AudioHardwareListenerMac.h:
2374
2375 2014-07-16  Jer Noble  <jer.noble@apple.com>
2376
2377         [MSE] REGRESSION(r171033): ASSERT in WebCore::MediaSource::onReadyStateChange()
2378         https://bugs.webkit.org/show_bug.cgi?id=134941
2379
2380         Reviewed by Eric Carlson.
2381
2382         Only do our modified-order change of the readyState if the error parameter is empty,
2383         as that's the only case where a duration change will cause an inadvertant readyState
2384         change.
2385
2386         * Modules/mediasource/MediaSource.cpp:
2387         (WebCore::MediaSource::streamEndedWithError):
2388
2389 2014-07-16  Alexey Proskuryakov  <ap@apple.com>
2390
2391         Remove svn:executable property erroneously added in <http://trac.webkit.org/changeset/171144> somehow.
2392
2393         * ChangeLog: Removed property svn:executable.
2394         * svg/SVGSVGElement.h: Removed property svn:executable.
2395         * svg/animation/SVGSMILElement.h: Removed property svn:executable.
2396
2397 2014-07-16  Daniel Bates  <dabates@apple.com>
2398
2399         Substitute CGRectZero for NSZeroRect in -[DOMNode hrefFrame].
2400
2401         Rubber-stamped by Zalan Bujtas.
2402
2403         The method -[DOMNode hrefFrame] returns a CGRect. So, when we don't have a renderer
2404         we should return CGRectZero instead of a NSZeroRect.
2405
2406         * bindings/objc/DOM.mm:
2407         (-[DOMNode hrefFrame]): Also, fix up some code style issues.
2408
2409 2014-07-16  Jeongeun Kim  <je_julie.kim@samsung.com>
2410
2411         mutable pointers from const methods, timeContainer().
2412         https://bugs.webkit.org/show_bug.cgi?id=134757
2413
2414         Reviewed by Alexey Proskuryakov.
2415
2416         Avoid return mutable pointers from const methods.
2417         No new tests, no behavior change.
2418
2419         * svg/SVGSVGElement.h:
2420         * svg/animation/SVGSMILElement.h:
2421         (WebCore::SVGSMILElement::timeContainer):
2422
2423 2014-07-15  Yusuke Suzuki  <utatane.tea@gmail.com>
2424
2425         CSS: Generalize CSS First Letter treatment
2426         https://bugs.webkit.org/show_bug.cgi?id=134936
2427
2428         Reviewed by Benjamin Poulain.
2429
2430         first-letter pseudo element rule is handled differently from the other rules
2431         such as first-line. This patch removes this special handling in SelectorChecker
2432         and handles it in RulesFeatureSet.
2433
2434         * css/RuleFeature.cpp:
2435         (WebCore::RuleFeatureSet::collectFeaturesFromSelector):
2436         (WebCore::RuleFeatureSet::add):
2437         (WebCore::RuleFeatureSet::clear):
2438         * css/RuleFeature.h:
2439         (WebCore::RuleFeatureSet::RuleFeatureSet):
2440         * css/SelectorChecker.cpp:
2441         (WebCore::SelectorChecker::matchRecursively):
2442         * css/StyleResolver.h:
2443         (WebCore::StyleResolver::usesFirstLetterRules):
2444         * dom/DocumentStyleSheetCollection.cpp:
2445         (WebCore::DocumentStyleSheetCollection::combineCSSFeatureFlags):
2446         (WebCore::DocumentStyleSheetCollection::resetCSSFeatureFlags):
2447         * dom/DocumentStyleSheetCollection.h:
2448         (WebCore::DocumentStyleSheetCollection::setUsesFirstLetterRules): Deleted.
2449
2450 2014-07-15  Simon Fraser  <simon.fraser@apple.com>
2451
2452         Fix non-iOS builds.
2453
2454         * rendering/RenderBox.cpp:
2455         (WebCore::shouldAppyContainersClipAndOffset):
2456
2457 2014-07-15  Simon Fraser  <simon.fraser@apple.com>
2458
2459         [iOS] Fix touches inside accelerated overflow:scroll
2460         https://bugs.webkit.org/show_bug.cgi?id=134961
2461         <rdar://problem/16088789>
2462
2463         Reviewed by Benjamin Poulain.
2464
2465         When individual elements inside an overflow:scroll with -webkit-overflow-scrolling: touch
2466         had touch event listeners, we would fail to take the scroll offset into account when
2467         building the touch event region, causing touches on those elements to fail after scrolling.
2468         
2469         Touch event region building uses RenderObject::absoluteClippedOverflowRect(), and that
2470         code path tries to fix up repaint rects to work correctly in composited overflow:scroll.
2471         However, that broke the touch region computation.
2472         
2473         Fix by only ignoring the scroll offset for calls to computeRectForRepaint() which
2474         have a non-null repaintContainer (which indicates that we're doing a repaint in the
2475         compositing layer), and for which the repaintContainer is the containing block
2476         which is using composited scrolling. This restores correct behavior to the event region
2477         code which always calls this with a null repaintContainer.
2478
2479         * rendering/RenderBox.cpp:
2480         (WebCore::shouldAppyContainersClipAndOffset):
2481         (WebCore::RenderBox::computeRectForRepaint):
2482
2483 2014-07-15  Simon Fraser  <simon.fraser@apple.com>
2484
2485         [iOS] Fix issues drawing subsampled image elements and CSS images
2486         https://bugs.webkit.org/show_bug.cgi?id=134944
2487         <rdar://problem/17634095>
2488
2489         Reviewed by Dean Jackson.
2490
2491         After r170675 it is important for BitmapImage::draw() to be given a srcRect computed
2492         using the original size of the image, not the subsampled size.
2493         
2494         So fix various code paths that end up in image drawing to use the originalSize(),
2495         which requires giving Image a virtual function that just returns size(), and hence has
2496         a FloatSize return value.
2497         
2498         Tested by setting a very low subsampling threshold and browsing various sites.
2499         
2500         A better longterm fix will happen via bug 134916.
2501
2502         * platform/graphics/BitmapImage.cpp:
2503         (WebCore::BitmapImage::originalSize):
2504         * platform/graphics/BitmapImage.h:
2505         * platform/graphics/GraphicsContext.cpp:
2506         (WebCore::GraphicsContext::drawImage):
2507         * platform/graphics/Image.cpp:
2508         (WebCore::Image::drawTiled):
2509         (WebCore::Image::computeIntrinsicDimensions):
2510         * platform/graphics/Image.h:
2511         (WebCore::Image::originalSize):
2512         * platform/graphics/cg/BitmapImageCG.cpp:
2513         (WebCore::BitmapImage::BitmapImage): Just use m_size for initializing the other members.
2514         (WebCore::BitmapImage::draw):
2515         * platform/graphics/cg/GraphicsContext3DCG.cpp:
2516         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
2517         * platform/graphics/cg/ImageCG.cpp:
2518         (WebCore::Image::drawPattern):
2519
2520 2014-07-15  Brent Fulgham  <bfulgham@apple.com>
2521
2522         [Win] Unreviewed build fix after r171069.
2523
2524         Add missing AudioHardwareListener implementation on Windows.
2525
2526         * WebCore.vcxproj/WebCore.vcxproj:
2527         * WebCore.vcxproj/WebCore.vcxproj.filters:
2528
2529 2014-07-15  Antti Koivisto  <antti@apple.com>
2530
2531         REGRESSION (r155957): Invalid cast in WebCore::RenderNamedFlowThread::getRanges
2532         https://bugs.webkit.org/show_bug.cgi?id=134888
2533
2534         Reviewed by Mihnea Ovidenie.
2535
2536         Test: fast/regions/flowthread-getranges-box-cast.html
2537
2538         * rendering/RenderNamedFlowThread.cpp:
2539         (WebCore::RenderNamedFlowThread::getRanges): Test the type before casting.
2540
2541 2014-07-15  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2542
2543         [GTK] Update GObject DOM bindings symbols file after r171014.
2544         https://bugs.webkit.org/show_bug.cgi?id=134907
2545
2546         Reviewed by Philippe Normand.
2547
2548         * bindings/gobject/webkitdom.symbols: Update to the current API.
2549
2550 2014-07-15  Manuel Rego Casasnovas  <rego@igalia.com>
2551
2552         Unreviwed fix wrong indentation from r171082.
2553
2554         * rendering/RenderGrid.cpp:
2555         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
2556
2557 2014-07-14  Zalan Bujtas  <zalan@apple.com>
2558
2559         Subpixel rendering: Zero sized compositing container's content positioned off by one device pixel.
2560         https://bugs.webkit.org/show_bug.cgi?id=134903
2561
2562         Reviewed by Simon Fraser.
2563
2564         The compositing layer boundaries are calculated using its renderer()'s and the renderer()'s
2565         descendants' bounds. However when the renderer() is zero sized, its bounds are omitted.
2566         In such cases, when the child content has offset from the renderer(), the subpixel adjustment
2567         of the compositing layer becomes negative (-meaning that the compositing layer is to the right/bottom
2568         direction from its renderer()). Remove fabs() to be able to express such direction.
2569
2570         Test: compositing/hidpi-compositing-layer-with-zero-sized-container.html
2571
2572         * rendering/RenderLayerBacking.cpp:
2573         (WebCore::RenderLayerBacking::updateGeometry):
2574
2575 2014-07-14  Jeremy Jones  <jeremyj@apple.com>
2576
2577         Fix crash on WebVideoFullscreenManagerProxy construction.
2578         https://bugs.webkit.org/show_bug.cgi?id=134909
2579
2580         Unreviewed fix crash from r171089
2581
2582         Remove unnecessary dispatch to main queue since it can happen during construction.
2583
2584         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2585         (WebVideoFullscreenInterfaceAVKit::setWebVideoFullscreenModel): remove dispatch_async
2586
2587 2014-07-14  Jeremy Jones  <jeremyj@apple.com>
2588
2589         WebVideoFullscreenInterfaceAVKit should only call the UI from main thread.
2590         https://bugs.webkit.org/show_bug.cgi?id=134890
2591
2592         Reviewed by Eric Carlson.
2593
2594         dispatch_async to the main thread before setting properties that would affect the UI.
2595
2596         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2597         (WebVideoFullscreenInterfaceAVKit::setWebVideoFullscreenModel): wrap in call to dispatch_async
2598         (WebVideoFullscreenInterfaceAVKit::setDuration): ditto
2599         (WebVideoFullscreenInterfaceAVKit::setCurrentTime): ditto
2600         (WebVideoFullscreenInterfaceAVKit::setRate): ditto
2601         (WebVideoFullscreenInterfaceAVKit::setVideoDimensions): ditto
2602         (WebVideoFullscreenInterfaceAVKit::setSeekableRanges): ditto
2603         (WebVideoFullscreenInterfaceAVKit::setAudioMediaSelectionOptions): ditto
2604         (WebVideoFullscreenInterfaceAVKit::setLegibleMediaSelectionOptions): ditto
2605         (WebVideoFullscreenInterfaceAVKit::setExternalPlayback): ditto
2606
2607 2014-07-14  Tibor Meszaros  <tmeszaros.u-szeged@partner.samsung.com>
2608
2609         Fix the !ENABLE(FILTERS) && !ENABLE(CSS_FILTERS) build after r167497
2610         https://bugs.webkit.org/show_bug.cgi?id=134679
2611
2612         Reviewed by Darin Adler.
2613
2614         * html/ImageData.cpp:
2615         * platform/graphics/cairo/ImageBufferCairo.cpp:
2616
2617 2014-07-14  Manuel Rego Casasnovas  <rego@igalia.com>
2618
2619         [CSS Grid Layout] Support sparse in auto-placement algorithm
2620         https://bugs.webkit.org/show_bug.cgi?id=134544
2621
2622         Reviewed by Sergio Villar Senin.
2623
2624         This patch implements sparse mode for auto-placement algorithm, which is
2625         the default mode in the new grid-auto-flow syntax. It keeps track of the
2626         auto-placement cursor in
2627         RenderGrid::placeAutoMajorAxisItemsOnGrid() and updates it accordingly
2628         when auto-positioned items are placed.
2629         If we're in dense mode it resets the cursor after each item (which keeps
2630         the old behavior that was using dense mode by default).
2631
2632         GridIterator has been adapted to look for empty areas from a given
2633         position in both directions.
2634
2635         Test: fast/css-grid-layout/grid-auto-flow-sparse.html
2636
2637         * rendering/RenderGrid.cpp:
2638         (WebCore::RenderGrid::GridIterator::GridIterator): Modify constructor to
2639         add an optional argument for the varying index. This allows to look for
2640         empty areas in both axis.
2641         (WebCore::RenderGrid::placeAutoMajorAxisItemsOnGrid): Defined the
2642         auto-placement cursor and rested after each item if we're in dense mode.
2643         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid): Use auto-placement
2644         cursor to look for empty areas from the last auto-positioned item
2645         placed.
2646         * rendering/RenderGrid.h: Modify placeAutoMajorAxisItemOnGrid() header
2647         to receive the auto-placement cursor.
2648
2649 2014-07-14  Brent Fulgham  <bfulgham@apple.com>
2650
2651         [iOS] Some videos play as inline audio-only content
2652         https://bugs.webkit.org/show_bug.cgi?id=134898.
2653         <rdar://problem/17629379>
2654
2655         Reviewed by Eric Carlson.
2656
2657         Add a new 'presentationType' accessor that indicates if the media
2658         element is playing in 'audio' mode. This can happen if a video
2659         element plays an HLS stream that starts off in audio-only mode.
2660
2661         * html/HTMLMediaElement.cpp:
2662         (WebCore::HTMLMediaElement::presentationType): Added.
2663         * html/HTMLMediaElement.h:
2664         * platform/audio/MediaSession.cpp:
2665         (WebCore::MediaSession::presentationType): Added.
2666         * platform/audio/MediaSession.h:
2667         * platform/audio/MediaSessionManager.cpp: 
2668         (WebCore::MediaSessionManager::sessionRestrictsInlineVideoPlayback):
2669         Use the presentationType, rather than the mediaType to control
2670         inline playback behavior.
2671         * platform/audio/ios/AudioDestinationIOS.h:
2672         (WebCore::AudioDestinationMac::presentationType): Add presentationType.
2673         * platform/audio/mac/AudioDestinationMac.h:
2674         (WebCore::AudioDestinationMac::presentationType): Ditto.
2675
2676 2014-07-14  Bear Travis  <betravis@adobe.com>
2677
2678         [Feature Queries] Enable Feature Queries on Mac
2679         https://bugs.webkit.org/show_bug.cgi?id=134404
2680
2681         Reviewed by Antti Koivisto.
2682
2683         Enable Feature Queries on Mac and resume running the
2684         feature tests.
2685
2686         * Configurations/FeatureDefines.xcconfig: Turn on
2687         ENABLE_CSS3_CONDITIONAL_RULES.
2688
2689 2014-07-11  David Hyatt  <hyatt@apple.com>
2690
2691         <rdar://problem/17305458> Cannot interact with video controls in ePubs
2692         Bug 134836 - [New Multicolumn] Crawl to check for compositing between us and the enclosingPaginationLayer
2693         https://bugs.webkit.org/show_bug.cgi?id=134836
2694
2695         Reviewed by Dean Jackson.
2696
2697         The paginatedAndComposited bit being set in updateLayerPositions just didn't work, since compositing states
2698         can change without triggering that function. This patch just gets rid of the bit and does a crawl every time
2699         to check. This ensures that changes in compositing states don't necessitate any changes in pagination,
2700         since the lookup will always check the current compositing state.
2701         
2702         The new function that does this check is hasCompositedLayerInEnclosingPaginationChain.
2703         
2704         I have been unable to reproduce this issue, and this is therefore a purely speculative fix. I have no test
2705         case to provide because of this.
2706
2707         * rendering/RenderLayer.cpp:
2708         (WebCore::RenderLayer::RenderLayer):
2709         (WebCore::RenderLayer::updateLayerPositions):
2710         (WebCore::RenderLayer::hasCompositedLayerInEnclosingPaginationChain):
2711         (WebCore::RenderLayer::updatePagination):
2712         * rendering/RenderLayer.h:
2713
2714 2014-07-14  Zalan Bujtas  <zalan@apple.com>
2715
2716         Move composite bounds calculation to RenderLayerBacking.
2717         https://bugs.webkit.org/show_bug.cgi?id=134864
2718
2719         Reviewed by Darin Adler.
2720
2721         No change in functionality.
2722
2723         * rendering/RenderLayerBacking.cpp:
2724         (WebCore::RenderLayerBacking::updateCompositedBounds):
2725         * rendering/RenderLayerCompositor.cpp: it was just proxying the calculateLayerBounds()
2726         to the RenderLayer.
2727         (WebCore::RenderLayerCompositor::calculateCompositedBounds): Deleted.
2728         * rendering/RenderLayerCompositor.h:
2729
2730 2014-07-14  Tim Horton  <timothy_horton@apple.com>
2731
2732         Fix the build.
2733
2734         * platform/audio/MediaSessionManager.h:
2735
2736 2014-07-14  Eric Carlson  <eric.carlson@apple.com>
2737
2738         [Mac] don't enable low power audio mode on external output devices
2739         https://bugs.webkit.org/show_bug.cgi?id=134877
2740
2741         Reviewed by Sam Weinig.
2742
2743         No new tests, this deals with changes to the audio hardware at runtime.
2744
2745         * WebCore.xcodeproj/project.pbxproj: Remove AudioSessionListener.h.
2746         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
2747
2748         * platform/audio/AudioHardwareListener.cpp:
2749         (WebCore::AudioHardwareListener::AudioHardwareListener): Initialize m_outputDeviceSupportsLowPowerMode
2750             to true on iOS.
2751         * platform/audio/AudioHardwareListener.h:
2752         (WebCore::AudioHardwareListener::outputDeviceSupportsLowPowerMode): New accessor.
2753         (WebCore::AudioHardwareListener::setHardwareActivity): New setter for derived classes.
2754         (WebCore::AudioHardwareListener::setOutputDeviceSupportsLowPowerMode): Ditto.
2755
2756         Remove AudioSessionListener interface, it wasn't being used.
2757         * platform/audio/AudioSession.cpp:
2758         (WebCore::AudioSession::addListener): Deleted.
2759         (WebCore::AudioSession::removeListener): Deleted.
2760         (WebCore::AudioSession::beganAudioInterruption): Deleted.
2761         (WebCore::AudioSession::endedAudioInterruption): Deleted.
2762         * platform/audio/AudioSession.h:
2763         * platform/audio/AudioSessionListener.h: Removed.
2764
2765         * platform/audio/MediaSessionManager.cpp:
2766         (WebCore::MediaSessionManager::addSession): Allocate the AudioHardwareListener if necessary.
2767         (WebCore::MediaSessionManager::removeSession): Free the AudioHardwareListener if necessary.
2768         (WebCore::MediaSessionManager::audioOutputDeviceChanged): AudioHardwareListener client interface
2769             called when the output device changes, call updateSessionState to make sure we are using
2770             the correct buffer size.
2771         * platform/audio/MediaSessionManager.h:
2772
2773         * platform/audio/ios/AudioDestinationIOS.h:
2774         * platform/audio/ios/AudioSessionIOS.mm:
2775         (WebCore::AudioSessionPrivate::AudioSessionPrivate): Drive-by cleanup, remove ObjC helper object
2776             that was used to listen for OS notifications, it is no longer used.
2777         (SOFT_LINK_POINTER): Deleted.
2778         (-[WebAudioSessionHelper initWithCallback:]): Deleted.
2779         (-[WebAudioSessionHelper dealloc]): Deleted.
2780         (-[WebAudioSessionHelper interruption:]): Deleted.
2781
2782         * platform/audio/mac/AudioHardwareListenerMac.cpp:
2783         (WebCore::currentDeviceSupportsLowPowerBufferSize): New, return true only if using build-in 
2784             transport device.
2785         (WebCore::processIsRunningPropertyDescriptor): Return reference to static AudioObjectPropertyAddress
2786             for kAudioHardwarePropertyProcessIsRunning instead of declaring one in every method
2787             that needs one.
2788         (WebCore::outputDevicePropertyDescriptor): Return reference to static AudioObjectPropertyAddress
2789             for kAudioHardwarePropertyDefaultOutputDevice.
2790         (WebCore::AudioHardwareListenerMac::AudioHardwareListenerMac): Restructure and add audio object
2791             listener for default output device.
2792         (WebCore::AudioHardwareListenerMac::~AudioHardwareListenerMac): *Remove* listener audio object
2793             property listener instead of *Adding* a new one. Remove new listener.
2794         (WebCore::AudioHardwareListenerMac::propertyChanged): Enumerate the properties that changed,
2795             call appropriate method.
2796         (WebCore::AudioHardwareListenerMac::processIsRunningChanged): Renamed from setHardwareActive, 
2797             cleanup.
2798         (WebCore::AudioHardwareListenerMac::outputDeviceChanged): New, call client.audioHardwareOutputDeviceChanged.
2799         (WebCore::AudioHardwareListenerMac::setHardwareActive): Deleted, renamed processIsRunningChanged.
2800         * platform/audio/mac/AudioHardwareListenerMac.h:
2801
2802         * platform/audio/mac/MediaSessionManagerMac.cpp:
2803         (MediaSessionManager::updateSessionState): Only set the output buffer size to 4K when hardware
2804             supports it.
2805
2806 2014-07-13  Benjamin Poulain  <benjamin@webkit.org>
2807
2808         Remove SelectorCheckerFastPath from the style resolution algorithm
2809         https://bugs.webkit.org/show_bug.cgi?id=134866
2810
2811         Reviewed by Antti Koivisto.
2812
2813         SelectorCheckerFastPath is now pure overhead because it can almost never match
2814         if the CSS JIT was unable to compile.
2815
2816         * css/ElementRuleCollector.cpp:
2817         (WebCore::ElementRuleCollector::ruleMatches):
2818         The "pre-filter" behind fastCheckableSelector had two parts:
2819         1) Filtering the pseudoID.
2820         2) Filtering on the rule hash.
2821
2822         The first part has been generalized (RuleDatacanMatchPseudoElement())
2823         and moved to collectMatchingRulesForList(). 
2824
2825         (WebCore::ElementRuleCollector::collectMatchingRulesForList):
2826         * css/RuleSet.cpp:
2827         (WebCore::selectorCanMatchPseudoElement):
2828         (WebCore::RuleData::RuleData):
2829         (WebCore::RuleSet::addRegionRule):
2830         (WebCore::RuleSet::addRulesFromSheet):
2831         * css/RuleSet.h:
2832         (WebCore::RuleData::canMatchPseudoElement):
2833         (WebCore::RuleData::hasFastCheckableSelector): Deleted.
2834         * css/StyleResolver.cpp:
2835
2836 2014-07-13  Benjamin Poulain  <benjamin@webkit.org>
2837
2838         Remove an useless check from SelectorChecker
2839         https://bugs.webkit.org/show_bug.cgi?id=134868
2840
2841         Reviewed by Darin Adler.
2842
2843         * css/SelectorChecker.cpp:
2844         (WebCore::SelectorChecker::matchRecursively):
2845         The condition of this if() branch can never be met for the mode "QueryingRules".
2846
2847         The next condition in that if() is "dynamicPseudo != NOPSEUDO", which implies
2848         a pseudo element was matched prior to the current context/simple selector.
2849         This cannot happen with QueryingRules, since we never match pseudo elements for
2850         SelectorQuery.
2851
2852 2014-07-12  Nikos Andronikos  <nikos.andronikos-webkit@cisra.canon.com.au>
2853
2854         Elements with rendering disabled due to dimensions should not contribute to parent bounding box
2855         https://bugs.webkit.org/show_bug.cgi?id=134184
2856
2857         Reviewed by Dirk Schulze.
2858
2859         SVG elements that have rendering disabled should not contribute to any ancestor elements bounding box.
2860         Examples of elements with rendering disabled:
2861         - basic shape with width <= 0 or height <= 0
2862         - path with no path data (d attribute missing or empty)
2863         - polyline or polygon element with no point data (points attribute missing or empty)
2864
2865         To achieve this a method (isRenderingDisabled) was added to RenderSVGShape and it's derived classes.
2866         This is used to determine if an element is included when creating the union of child bounding boxes
2867         in a container element.
2868
2869         Tests: svg/custom/GetBBox-path-nodata.html
2870                svg/custom/GetBBox-polygon-nodata.html
2871                svg/custom/GetBBox-polyline-nodata.html
2872                svg/custom/getBBox-container-hiddenchild.html
2873
2874         * rendering/svg/RenderSVGEllipse.cpp:
2875         (WebCore::RenderSVGEllipse::isRenderingDisabled):
2876         New method added. Checks bounding box to determine if rendering is disabled.
2877         * rendering/svg/RenderSVGEllipse.h:
2878         * rendering/svg/RenderSVGPath.cpp:
2879         (WebCore::RenderSVGPath::isRenderingDisabled):
2880         New method added. Checks bounding box to determine if rendering is disabled.
2881         * rendering/svg/RenderSVGPath.h:
2882         * rendering/svg/RenderSVGRect.cpp:
2883         (WebCore::RenderSVGRect::isRenderingDisabled):
2884         New method added. Checks bounding box to determine if rendering is disabled.
2885         * rendering/svg/RenderSVGRect.h:
2886         * rendering/svg/RenderSVGShape.h:
2887         (WebCore::RenderSVGShape::isRenderingDisabled):
2888         New method added. Always returns false so that derived classes that do not
2889         implement this method retain the existing behaviour.
2890         * rendering/svg/SVGRenderSupport.cpp:
2891         (WebCore::SVGRenderSupport::computeContainerBoundingBoxes):
2892         For each element potentially being included in the unioned bounding box of
2893         a container, check isRenderingDisabled and skip that element if true.
2894
2895         * rendering/svg/RenderSVGEllipse.cpp:
2896         (WebCore::RenderSVGEllipse::isRenderingDisabled):
2897         * rendering/svg/RenderSVGEllipse.h:
2898         * rendering/svg/RenderSVGPath.cpp:
2899         (WebCore::RenderSVGPath::isRenderingDisabled):
2900         * rendering/svg/RenderSVGPath.h:
2901         * rendering/svg/RenderSVGRect.cpp:
2902         (WebCore::RenderSVGRect::isRenderingDisabled):
2903         * rendering/svg/RenderSVGRect.h:
2904         * rendering/svg/RenderSVGShape.h:
2905         * rendering/svg/SVGRenderSupport.cpp:
2906         (WebCore::SVGRenderSupport::computeContainerBoundingBoxes):
2907
2908 2014-07-12  Benjamin Poulain  <benjamin@webkit.org>
2909
2910         Rename selectorListContainsUncommonAttributeSelector() to selectorListContainsAttributeSelector()
2911         https://bugs.webkit.org/show_bug.cgi?id=134862
2912
2913         Reviewed by Sam Weinig.
2914
2915         Unlike containsUncommonAttributeSelector(), selectorListContainsUncommonAttributeSelector() does not
2916         evaluate the attribute for "uncommon" types.
2917
2918         It would be possible to change the function instead to evaluate common attributes based
2919         on the match type and the pseudo class type. Such change would be more risky
2920         and we would get very little benefit from it, I leave that for later if that ever becomes useful.
2921
2922         * css/RuleSet.cpp:
2923         (WebCore::selectorListContainsAttributeSelector):
2924         (WebCore::containsUncommonAttributeSelector):
2925         (WebCore::selectorListContainsUncommonAttributeSelector): Deleted.
2926
2927 2014-07-12  Zan Dobersek  <zdobersek@igalia.com>
2928
2929         Use braced-init-list to create one-item Vector object in insertPerformanceEntry
2930         https://bugs.webkit.org/show_bug.cgi?id=133675
2931
2932         Reviewed by Darin Adler.
2933
2934         * page/PerformanceUserTiming.cpp:
2935         (WebCore::insertPerformanceEntry): Avoid wasting three lines for creating a
2936         Vector object with just one item that in the end gets copied. Use the
2937         braced-init-list syntax instead, leveraging Vector's std::initializer_list
2938         constructor.
2939
2940 2014-07-12  Allan Sandfeld Jensen  <allan.jensen@digia.com>
2941
2942         Memory leaks with autoLoadImages off
2943         https://bugs.webkit.org/show_bug.cgi?id=124411
2944
2945         Reviewed by Darin Adler.
2946
2947         Do not emit notifyFinished for images with deferred load,
2948         and allow deferred loads to be cancelled.
2949
2950         * loader/cache/CachedResource.cpp:
2951         (WebCore::CachedResource::checkNotify):
2952         (WebCore::CachedResource::cancelLoad):
2953
2954 2014-07-11  Jer Noble  <jer.noble@apple.com>
2955
2956         [MSE] http/tests/media/media-source/mediasource-duration.html is failing.
2957         https://bugs.webkit.org/show_bug.cgi?id=134852
2958
2959         Reviewed by Eric Carlson.
2960
2961         Fixes the following tests:
2962         http/tests/media/media-source/mediasource-config-change-mp4-a-bitrate.html
2963         http/tests/media/media-source/mediasource-config-change-mp4-av-audio-bitrate.html
2964         http/tests/media/media-source/mediasource-config-change-mp4-av-video-bitrate.html
2965         http/tests/media/media-source/mediasource-config-change-mp4-v-bitrate.html
2966         http/tests/media/media-source/mediasource-config-change-mp4-v-framerate.html
2967         http/tests/media/media-source/mediasource-duration.html
2968         http/tests/media/media-source/mediasource-play.html
2969
2970         The primary change necessary to fix the mediasource-duration.html test was to add support
2971         for delaying the completion of a seek operation until the HTMLMediaElement's readyState
2972         rises to > HAVE_CURRENT_DATA. This is accomplished by modifying MediaSourcePrivate to have
2973         waitForSeekCompleted() and seekCompleted() virtual methods. These are called by MediaSource
2974         when a seek operation results in the current time moving outside the currently buffered time
2975         ranges, and when an append operation results in the readyState changing, respectively.
2976
2977         A number of other drive-by fixes were necessary to get this test fully passing, as noted
2978         below.
2979
2980         Make the MediaSource the primary owner of the media's duration, rather than the MediaSourcePrivate.
2981         Move the MediaSourcePrivateClient pointer to the MediaSourcePrivate from the MediaPlayerPrivate, so
2982         the MediaSource's duration can be retrieved.  While we're at it, do the same thing for buffered.
2983
2984         * Modules/mediasource/MediaSource.cpp:
2985         (WebCore::MediaSource::MediaSource): Initialize m_duration.
2986         (WebCore::MediaSource::duration): Simple accessor.
2987         (WebCore::MediaSource::setDurationInternal): Bring 'duration change algorithm' up to spec.
2988         (WebCore::MediaSource::setReadyState): Reset m_duration on close.
2989         * Modules/mediasource/MediaSource.h:
2990         * platform/graphics/MediaSourcePrivate.h:
2991         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2992         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load): Do not call setPrivateAndOpen().
2993         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationDouble): Pass through to MediaSourcePrivateAVFObjC.
2994         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::buffered): Ditto.
2995         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
2996         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
2997         (WebCore::MediaSourcePrivateAVFObjC::create): Call setPrivateAndOpen().
2998         (WebCore::MediaSourcePrivateAVFObjC::MediaSourcePrivateAVFObjC): Set m_client.
2999         (WebCore::MediaSourcePrivateAVFObjC::duration): Pass through to MediaSourcePrivateClient.
3000         (WebCore::MediaSourcePrivateAVFObjC::buffered): Ditto.
3001         (WebCore::MediaSourcePrivateAVFObjC::durationChanged): Pass through to MediaPlayerPrivateMediaSourceAVFObjC.
3002         (WebCore::MediaSourcePrivateAVFObjC::setDuration): Deleted.
3003         * platform/graphics/gstreamer/MediaSourceGStreamer.cpp:
3004         (WebCore::MediaSourceGStreamer::open): Pass in MediaSourcePrivateClient.
3005         (WebCore::MediaSourceGStreamer::MediaSourceGStreamer): Initialize m_mediaSource.
3006         (WebCore::MediaSourceGStreamer::durationChanged): Retrieve the duration from MediaSourcePrivateClient.
3007         (WebCore::MediaSourceGStreamer::markEndOfStream): Remove unnecssary ASSERT.
3008         (WebCore::MediaSourceGStreamer::unmarkEndOfStream): Ditto.
3009         (WebCore::MediaSourceGStreamer::setDuration): Deleted.
3010         * platform/graphics/gstreamer/MediaSourceGStreamer.h:
3011         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
3012         (WebCore::MockMediaPlayerMediaSource::load): Do not call setPrivateAndOpen().
3013         (WebCore::MockMediaPlayerMediaSource::buffered): Pass through to MockMediaSourcePrivate.
3014         (WebCore::MockMediaPlayerMediaSource::durationDouble): Ditto.
3015         (WebCore::MockMediaPlayerMediaSource::advanceCurrentTime): Ditto.
3016         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
3017         (WebCore::MockMediaSourcePrivate::create): Call setPrivateAndOpen().
3018         (WebCore::MockMediaSourcePrivate::MockMediaSourcePrivate): Set m_client.
3019         (WebCore::MockMediaSourcePrivate::duration): Pass through to MediaSourcePrivateClient.
3020         (WebCore::MockMediaSourcePrivate::buffered): Ditto.
3021         (WebCore::MockMediaSourcePrivate::durationChanged): Pass thorugh to MockMediaPlayerMediaSource.
3022         (WebCore::MockMediaSourcePrivate::setDuration): Deleted.
3023
3024         Route seekToTime through MediaSource, rather than through MediaSourcePrivate, so that
3025         the time can be compared against the buffered ranges, and trigger the delay of the seek
3026         operation if necessary. Add a seekTimer to MediaPlayerPrivateMediaSourceAVFObjC, as this
3027         guarantees the order of asynchronous operations, rather than callOnMainThread, which can
3028         cause async operations to occur out of order.
3029
3030         * Modules/mediasource/MediaSource.cpp:
3031         (WebCore::MediaSource::seekToTime): Bring up to spec.
3032         (WebCore::MediaSource::completeSeek): Ditto.
3033         (WebCore::MediaSource::monitorSourceBuffers): Call completeSeek() when appropriate.
3034         * Modules/mediasource/SourceBuffer.cpp:
3035         (WebCore::SourceBuffer::sourceBufferPrivateSeekToTime): Deleted.
3036         (WebCore::SourceBuffer::seekToTime): Renamed from sourceBufferPrivateSeekToTime().
3037         * platform/graphics/MediaSourcePrivate.h:
3038         * platform/graphics/MediaSourcePrivateClient.h:
3039         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3040         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3041         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC): Add seekTimer. Only
3042             call timeChanged() if no longer seeking, thereby triggering a 'seeked' event.
3043         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC): Clear m_seekTimer.
3044         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance): Use m_seekTimer.
3045         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekTimerFired): Call seekInternal.
3046         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal): Add logging.
3047         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitForSeekCompleted): Added.
3048         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekCompleted): Added; trigger 'seeked'.
3049         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setReadyState): No longer attempt to finish seek when
3050             readyState changes here; this has been moved up to MediaSource.cpp.
3051         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
3052         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
3053         (WebCore::MediaSourcePrivateAVFObjC::waitForSeekCompleted): Pass through to MediaPlayerPrivateMediaSourceAVFObjC.
3054         (WebCore::MediaSourcePrivateAVFObjC::seekCompleted): Ditto.
3055         (WebCore::MediaSourcePrivateAVFObjC::seekToTime): Pass through to MediaSourcePrivateClient.
3056         (WebCore::MediaSourcePrivateAVFObjC::fastSeekTimeForMediaTime): Ditto.
3057         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
3058         (WebCore::MockMediaPlayerMediaSource::MockMediaPlayerMediaSource): Initialize m_seekCompleted.
3059         (WebCore::MockMediaPlayerMediaSource::seeking): Check for an uncompleted seek operation. 
3060         (WebCore::MockMediaPlayerMediaSource::seekWithTolerance): Ditto.
3061         (WebCore::MockMediaPlayerMediaSource::waitForSeekCompleted): Added.
3062         (WebCore::MockMediaPlayerMediaSource::seekCompleted): Added; trigger 'seeked'.
3063         * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
3064         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
3065         (WebCore::MockMediaSourcePrivate::waitForSeekCompleted): Pass through to MockMediaPlayerMediaSource.
3066         (WebCore::MockMediaSourcePrivate::seekCompleted): Ditto.
3067         * platform/mock/mediasource/MockMediaSourcePrivate.h:
3068
3069         Drive-by fixes.
3070
3071         * Modules/mediasource/MediaSource.cpp:
3072         (WebCore::MediaSource::streamEndedWithError): Re-order the steps in streamEndedWithError()
3073             to avoid the MediaSource being closed and re-opened by the resulting duration change
3074             operation.
3075         * Modules/mediasource/MediaSource.h:
3076         * Modules/mediasource/SourceBuffer.cpp:
3077         (WebCore::SourceBuffer::remove): Added logging.
3078         (WebCore::SourceBuffer::removeCodedFrames): Ditto.
3079         (WebCore::SourceBuffer::hasFutureTime): Swap an ASSERT for an early-return; it's possible
3080             for currentTime() to be outside of a buffered area.
3081         * Modules/mediasource/SourceBuffer.h:
3082         * html/HTMLMediaElement.cpp:
3083         (WebCore::HTMLMediaElement::parseAttribute): Do not issue an additional 'timeupdate' event
3084             after finishSeek() issues one of its own.
3085         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3086         (WebCore::globalDataParserQueue): Allow parsing operations to happen concurrently on
3087             background queues.
3088
3089 2014-07-12  Eric Carlson  <eric.carlson@apple.com>
3090
3091         [iOS] update control type when playback state changes
3092         https://bugs.webkit.org/show_bug.cgi?id=134856
3093
3094         Reviewed by Dean Jackson.
3095
3096         Check to make sure the correct type of media controls are showing when playback state
3097         changes so we don't end up with the wrong type of controls during playback.
3098
3099         * Modules/mediacontrols/mediaControlsApple.js: 
3100         (Controller.prototype.HandledVideoEvents): Drive-by fix, call handlePlay on 'playing' instead
3101             of 'play' so controls don't hide too early.
3102         * Modules/mediacontrols/mediaControlsiOS.js:
3103         (ControllerIOS.prototype.setPlaying): New, call updateControls to make sure inline
3104             controls are shown when appropriate.
3105
3106 2014-07-12  Dean Jackson  <dino@apple.com>
3107
3108         [iOS Media] Start playback button should indicate when it can't play
3109         https://bugs.webkit.org/show_bug.cgi?id=134851
3110
3111         Post-commit review with Eric Carlson on IRC.
3112
3113         * Modules/mediacontrols/mediaControlsiOS.js:
3114         (ControllerIOS.prototype.updateStatusDisplay): Remove the line that sets the
3115         class on the inline play button.
3116
3117 2014-07-11  Dean Jackson  <dino@apple.com>
3118
3119         [iOS Media] Start playback button should indicate when it can't play
3120         https://bugs.webkit.org/show_bug.cgi?id=134851
3121
3122         Reviewed by Sam Weinig.
3123
3124         If a video element has errors and cannot play, then the start
3125         playback button should use the "broken" icon.
3126
3127         * Modules/mediacontrols/mediaControlsApple.js: Add a new "failed" class.
3128         * Modules/mediacontrols/mediaControlsiOS.js:
3129         (ControllerIOS.prototype.shouldHaveStartPlaybackButton): We need a playback button
3130         even when there is an error.
3131         (ControllerIOS.prototype.handleWirelessPickerButtonTouchStart): Don't offer Airplay
3132         if we're in an error state.
3133         (ControllerIOS.prototype.updateStatusDisplay): Set the "failed" class on
3134         the playback buttons if we are in an error state.
3135
3136 2014-07-11  Benjamin Poulain  <benjamin@webkit.org>
3137
3138         Partition the CSS rules based on the most specific filter of the rightmost fragment
3139         https://bugs.webkit.org/show_bug.cgi?id=134828
3140
3141         Reviewed by Andreas Kling.
3142
3143         Previously, RuleSet was partitioning each rule based on the rightmost filter.
3144         While fast, this had the side effect of putting many selectors with ID match in the class
3145         bucket (because the selectors are generally written starting with the ID).
3146
3147         This patch replace the code of findBestRuleSetAndAdd() by a simple loop going over all
3148         the simple selectors in the rightmost fragment to find the best bucket.
3149
3150         * css/ElementRuleCollector.cpp:
3151         (WebCore::ElementRuleCollector::ruleMatches):
3152         * css/RuleSet.cpp:
3153         (WebCore::isSelectorMatchingHTMLBasedOnRuleHash):
3154         I unified ruleData.hasRightmostSelectorMatchingHTMLBasedOnRuleHash() and hasMultipartSelector().
3155
3156         (WebCore::RuleData::RuleData):
3157         (WebCore::rulesCountForName):
3158         (WebCore::RuleSet::addRule):
3159         I removed the recursive part of findBestRuleSetAndAdd() (which was wrong anyway). The function
3160         was useless so I just moved the algorithm to addRule() directly.
3161
3162         We first loop over all the CSSSelectors related by SubSelector, this correspond to the rightmost fragment.
3163         If a filter with high specificity is found, we add the rule immediately and end there.
3164         If a filter that is not very specific is found, we keep a pointer to the selector to use it later.
3165
3166         (WebCore::RuleSet::findBestRuleSetAndAdd): Deleted.
3167         * css/RuleSet.h:
3168         (WebCore::RuleData::hasMultipartSelector): Deleted.
3169
3170 2014-07-11  Alex Christensen  <achristensen@webkit.org>
3171
3172         [WinCairo] Unreviewed build fix after r170937.
3173
3174         * WebCore.vcxproj/WebCoreGeneratedWinCairo.make:
3175         Update and apply changes applied to WebCoreGenerated.make in r170937.
3176
3177 2014-07-11  Joseph Pecoraro  <pecoraro@apple.com>
3178
3179         Web Inspector: Crash when using a stale InspectableNode Node
3180         https://bugs.webkit.org/show_bug.cgi?id=134849
3181
3182         Reviewed by Timothy Hatcher.
3183
3184         * inspector/PageConsoleAgent.cpp:
3185
3186 2014-07-11  Jer Noble  <jer.noble@apple.com>
3187
3188         [MSE] Separate MediaSource logging into its own log channel
3189         https://bugs.webkit.org/show_bug.cgi?id=134809
3190
3191         Reviewed by Eric Carlson.
3192
3193         Separate out MediaSource logging (which can be quite verbose) into its own log channel,
3194         distinct from the Media log channel. Add some per-sample logging and further sequester that
3195         logging into its own MediaSourceSamples log channel.
3196
3197         Add the MediaSource and MediaSourceSamples channels:
3198         * platform/Logging.h:
3199
3200         Move LOG(Media) -> LOG(MediaSource):
3201         * Modules/mediasource/MediaSource.cpp:
3202         (WebCore::MediaSource::MediaSource):
3203         (WebCore::MediaSource::~MediaSource):
3204         (WebCore::MediaSource::setReadyState):
3205         (WebCore::MediaSource::addSourceBuffer):
3206         (WebCore::MediaSource::removeSourceBuffer):
3207         (WebCore::MediaSource::isTypeSupported):
3208         * Modules/mediasource/SourceBuffer.cpp:
3209         (WebCore::SourceBuffer::sourceBufferPrivateSeekToTime):
3210         (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
3211         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
3212         (WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples):
3213         (WebCore::SourceBuffer::provideMediaData):
3214         (WebCore::SourceBuffer::monitorBufferingRate):
3215         (WebCore::SourceBuffer::textTrackAddCues):
3216         (WebCore::SourceBuffer::hasFutureTime):
3217         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3218         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
3219         (WebCore::SourceBufferPrivateAVFObjC::didFailToParseStreamDataWithError):
3220         (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
3221         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
3222         (WebCore::SourceBufferPrivateAVFObjC::append):
3223         (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError):
3224         (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError):
3225         (WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples):
3226         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
3227
3228 2014-07-11  Brady Eidson  <beidson@apple.com>
3229
3230         Phone numbers that span two lines are not detected.
3231         <rdar://problem/17601146> and https://bugs.webkit.org/show_bug.cgi?id=134808
3232
3233         Reviewed by Tim Horton.
3234
3235         * editing/Editor.cpp:
3236         (WebCore::Editor::scanSelectionForTelephoneNumbers): After scanning a range from the TextIterator,
3237             create an "edge range" window around the end of the TextIterator range, and scan it.
3238             Also make sure to not accumulate duplicate ranges that might have showed up in both the
3239             TextIterator range and the edge window range.
3240
3241 2014-07-11  Enrica Casucci  <enrica@apple.com>
3242
3243         Implement textStylingAtPosition in WK2.
3244         https://bugs.webkit.org/show_bug.cgi?id=134843
3245         <rdar://problem/17614981>
3246         
3247         Reviewed by Benjamin Poulain.
3248
3249         Adding some exports and making styleForSelectionStart public.
3250
3251         * WebCore.exp.in:
3252         * editing/Editor.h:
3253
3254 2014-07-11  Zalan Bujtas  <zalan@apple.com>
3255
3256         REGRESSION (r168868): eBay 'see all' links fail due to different JS bindings conversion behavior.
3257         https://bugs.webkit.org/show_bug.cgi?id=134841
3258         <rdar://problem/17577563>
3259
3260         Reviewed by Simon Fraser.
3261
3262         Revert back to type int for Element.scroll* APIs in order to preserve exception handling
3263         behavior.
3264
3265         Test: cssom/non-subpixel-scroll-top-left-values.html
3266
3267         * dom/Element.cpp:
3268         (WebCore::Element::scrollLeft):
3269         (WebCore::Element::scrollTop):
3270         (WebCore::Element::setScrollLeft):
3271         (WebCore::Element::setScrollTop):
3272         (WebCore::Element::scrollWidth):
3273         (WebCore::Element::scrollHeight):
3274         * dom/Element.h:
3275         * dom/Element.idl:
3276         * html/HTMLBodyElement.cpp:
3277         (WebCore::adjustForZoom):
3278         (WebCore::HTMLBodyElement::scrollLeft):
3279         (WebCore::HTMLBodyElement::setScrollLeft):
3280         (WebCore::HTMLBodyElement::scrollTop):
3281         (WebCore::HTMLBodyElement::setScrollTop):
3282         (WebCore::HTMLBodyElement::scrollHeight):
3283         (WebCore::HTMLBodyElement::scrollWidth):
3284         * html/HTMLBodyElement.h:
3285
3286 2014-07-11  Joseph Pecoraro  <pecoraro@apple.com>
3287
3288         Web Inspector: Debugger Pause button does not work
3289         https://bugs.webkit.org/show_bug.cgi?id=134785
3290
3291         Reviewed by Timothy Hatcher.
3292
3293         * CMakeLists.txt:
3294         * DerivedSources.make:
3295         * inspector/CommandLineAPIModuleSource.js:
3296         Minification strips the sourceURL command. Add it back with minification.
3297
3298 2014-07-11  Andreas Kling  <akling@apple.com>
3299
3300         Use the bare minimum tile coverage rect when under memory pressure.
3301         <https://webkit.org/b/134837>
3302
3303         When the browser is under critical memory pressure, don't generate any
3304         more tiles than are needed to cover the exposed viewport rect.
3305
3306         Reviewed by Pratik Solanki.
3307
3308         * page/FrameView.cpp:
3309         (WebCore::FrameView::computeCoverageRect):
3310
3311 2014-07-11  Javier Fernandez  <jfernandez@igalia.com>
3312
3313         [CSS Grid Layout] Implement justify-self css property
3314         https://bugs.webkit.org/show_bug.cgi?id=134419
3315
3316         Reviewed by Dean Jackson.
3317
3318         This change adds the justify-self property from CSS 3 Box Alignment
3319         and implements the parsing.
3320
3321         From Blink r164685 by <jchaffraix@chromium.org>
3322
3323         Test: fast/css/parse-justify-self.html
3324
3325         * css/CSSComputedStyleDeclaration.cpp:
3326         (WebCore::ComputedStyleExtractor::propertyValue):
3327         * css/CSSParser.cpp:
3328         (WebCore::isValidKeywordPropertyAndValue):
3329         (WebCore::CSSParser::parseValue):
3330         (WebCore::isItemPositionKeyword):
3331         (WebCore::CSSParser::parseJustifySelf):
3332         * css/CSSParser.h:
3333         * css/CSSPrimitiveValueMappings.h:
3334         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3335         (WebCore::CSSPrimitiveValue::operator EJustifySelf):
3336         (WebCore::CSSPrimitiveValue::operator EJustifySelfOverflowAlignment):
3337         * css/CSSPropertyNames.in:
3338         * css/CSSValueKeywords.in:
3339         * css/DeprecatedStyleBuilder.cpp:
3340         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
3341         * css/StyleResolver.cpp:
3342         (WebCore::StyleResolver::applyProperty):
3343         * rendering/style/RenderStyle.h:
3344         * rendering/style/RenderStyleConstants.h:
3345         * rendering/style/StyleRareNonInheritedData.cpp:
3346         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
3347         (WebCore::StyleRareNonInheritedData::operator==):
3348         * rendering/style/StyleRareNonInheritedData.h:
3349
3350 2014-07-11  Bear Travis  <betravis@adobe.com>
3351
3352         [Feature Queries] Feature Query CSS Grammar Productions Should Return a Value
3353         https://bugs.webkit.org/show_bug.cgi?id=134810
3354
3355         Reviewed by Antti Koivisto.
3356
3357         The parsing return values are used to determine if a feature query is valid. Two
3358         grammar productions have been updated to correctly return a value.
3359
3360         Tests exist for this feature but will not be run until the feature is turned on.
3361         See https://bugs.webkit.org/show_bug.cgi?id=134404.
3362
3363         * css/CSSGrammar.y.in: Adding return values for two valid feature query productions.
3364
3365 2014-07-10  Brent Fulgham  <bfulgham@apple.com>
3366
3367         Use a separate backdrop element to allow cues to have highlight and background color
3368         https://bugs.webkit.org/show_bug.cgi?id=134821
3369         <rdar://problem/15999721>
3370
3371         Reviewed by Eric Carlson.
3372
3373         Add a new <div> element wrapping the existing cue <span>. This allows
3374         us to have a highlight on the cue (in the <span> background), as well
3375         as an overall background color.
3376
3377         * Modules/mediacontrols/mediaControlsApple.css:
3378         (video::-webkit-media-text-track-display-backdrop): New markup for
3379         the backdrop element of the caption.
3380         * html/track/VTTCue.cpp:
3381         (WebCore::VTTCue::cueBackdropShadowPseudoId): Added to
3382         allow user customization of the cue backdrop.
3383         (WebCore::VTTCue::initialize): Rename the old "m_cueBackgroundBox" to
3384         "m_cueHighlightBox" and add a new "m_cueBackdropBox" member.
3385         (WebCore::VTTCue::updateDisplayTree): Update for m_cueHighlightBox.
3386         (WebCore::VTTCue::getDisplayTree): Make m_cueHighlightBox a child
3387         of the new m_cueBackdropBox element, and add m_cueBackdropBox to
3388         the display tree.
3389         * html/track/VTTCue.h:
3390         (WebCore::VTTCue::element):
3391         * page/CaptionUserPreferencesMediaAF.cpp:
3392         (WebCore::CaptionUserPreferencesMediaAF::setInterestedInCaptionPreferenceChanges):
3393         Fix for missing caption style updates. Even if we are already
3394         listening for caption changes, we still want to update the new
3395         instance's style sheet to match.
3396         (WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride):
3397         * rendering/RenderVTTCue.cpp:
3398         (WebCore::RenderVTTCue::initializeLayoutParameters): Take the new
3399         <div> into consideration when looking for the Cue text element.
3400
3401 2014-07-11  Zalan Bujtas  <zalan@apple.com>
3402
3403         Subpixel layout: return integral results for offset*, client*, scroll* by default.
3404         https://bugs.webkit.org/show_bug.cgi?id=134651
3405
3406         Reviewed by Simon Fraser.
3407
3408         Revert to returning integral values for Element.offset* client* scroll* by default.
3409         Fractional values break number of sites(tight design) and JS frameworks(fail to handle fractional values).
3410
3411         Since snapped dimension depends on both the original point and the width/height of the box,
3412         we need to call RenderBoxModelObject::pixelSnapped*() helpers, instead of round().
3413
3414         Covered by existing tests
3415  
3416         * dom/Element.cpp:
3417         (WebCore::subpixelMetricsEnabled):
3418         (WebCore::convertToNonSubpixelValueIfNeeded):
3419         (WebCore::Element::offsetLeft):
3420         (WebCore::Element::offsetTop):
3421         (WebCore::Element::offsetWidth):
3422         (WebCore::Element::offsetHeight):
3423         (WebCore::Element::clientLeft):
3424         (WebCore::Element::clientTop):
3425         (WebCore::Element::clientWidth):
3426         (WebCore::Element::clientHeight):
3427         * page/Settings.in:
3428
3429 2014-07-11  Zalan Bujtas  <zalan@apple.com>
3430
3431         Subpixel rendering: icloud.com password arrow has clipped circle at some window sizes.
3432         https://bugs.webkit.org/show_bug.cgi?id=134824
3433         <rdar://problem/17612729>
3434
3435         Reviewed by Simon Fraser.
3436
3437         Transparent layer clipping needs device pixel offset adjusting.
3438
3439         Test: fast/layers/wrong-clipping-semi-transparent-compositing-layer-on-subpixel-position.html
3440
3441         * rendering/RenderLayer.cpp:
3442         (WebCore::RenderLayer::beginTransparencyLayers):
3443         (WebCore::RenderLayer::paintLayer):
3444         (WebCore::RenderLayer::paintLayerContents):
3445         (WebCore::RenderLayer::paintBackgroundForFragments):
3446         (WebCore::RenderLayer::paintForegroundForFragments):
3447         * rendering/RenderLayer.h:
3448
3449 2014-07-11  Carlos Garcia Campos  <cgarcia@igalia.com>
3450
3451         Unreviewed. Remove unused file.
3452
3453         * html/shadow/MediaControlsGtk.h: Removed.
3454
3455 2014-07-11  Manuel Rego Casasnovas  <rego@igalia.com>
3456
3457         [CSS Grid Layout] Update grid-auto-flow to the new syntax
3458         https://bugs.webkit.org/show_bug.cgi?id=134057
3459
3460         Reviewed by Sergio Villar Senin.
3461
3462         In last versions of the spec grid-auto-flow syntax has changed. New
3463         syntax is:
3464         [ row | column ] && dense? | stack && [ row | column ]?
3465
3466         Implemented parsing for new syntax and added/modified test cases in
3467         current layout tests.
3468
3469         For the moment, the implementation keeps working in the same way, but
3470         using "stack" value for grid-auto-flow property instead of "none". This
3471         should be fixed in a follow-up patch once "stack" is properly
3472         implemented.
3473
3474         Also "dense" needs to be reviewed. Right now auto-placement algorithm is
3475         always "dense" and never "sparse".
3476
3477         No new tests, update current tests to add new cases.
3478
3479         * css/CSSComputedStyleDeclaration.cpp:
3480         (WebCore::ComputedStyleExtractor::propertyValue): Adapt to new syntax.
3481         * css/CSSParser.cpp:
3482         (WebCore::isValidKeywordPropertyAndValue): Removed grid-auto-flow as it
3483         is not a keyword anymore.
3484         (WebCore::isKeywordPropertyID): Ditto.
3485         (WebCore::CSSParser::parseValue): Add specific method for parsing
3486         grid-auto-flow.
3487         (WebCore::CSSParser::parseGridShorthand): Adapt parsing for
3488         grid-auto-flow property inside the shorthand.
3489         (WebCore::isValidGridAutoFlowId): Helper method to check if the CSSValue
3490         id is a valid keyword for grid-auto-flow property.
3491         (WebCore::CSSParser::parseGridAutoFlow): Implement new parsing for
3492         grid-auto-flow.
3493         * css/CSSParser.h: Method header for grid-auto-flow parsing.
3494         * css/CSSPrimitiveValueMappings.h:
3495         (WebCore::CSSPrimitiveValue::operator GridAutoFlow): Deleted.
3496         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Deleted.
3497         * css/CSSValueKeywords.in: Add new keywords required by grid-auto-flow:
3498         "dense" and "stack".
3499         * css/DeprecatedStyleBuilder.cpp:
3500         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder): Remove
3501         default handler as grid-auto-flow is not a keyword now.
3502         * css/StyleResolver.cpp:
3503         (WebCore::StyleResolver::applyProperty): Implement particular handler
3504         for new grid-auto-flow syntax.
3505         * rendering/RenderGrid.cpp:
3506         (WebCore::RenderGrid::placeItemsOnGrid): Keep old "none" behavior as
3507         "stack" behavior for the moment.
3508         (WebCore::RenderGrid::autoPlacementMajorAxisDirection): Use the new
3509         helper methods in RenderStyle.
3510         (WebCore::RenderGrid::autoPlacementMinorAxisDirection): Ditto.
3511         * rendering/style/GridResolvedPosition.cpp:
3512         (WebCore::GridResolvedPosition::resolveGridPositionsFromStyle): Again
3513         keep old "none" behavior for "stack".
3514         * rendering/style/RenderStyle.h: Add new helper methods to know the
3515         direction and algorithm of grid-auto-flow property.
3516         * rendering/style/RenderStyleConstants.h: Redefine GridAutoFlow enum
3517         using flags for algorithm and direction.
3518         * rendering/style/StyleGridData.h: Change m_gridAutoFlow type to
3519         unsigned.
3520
3521 2014-07-10  Myles C. Maxfield  <mmaxfield@apple.com>
3522
3523         [iOS] Pasting rich content does not perform a two-step paste
3524         https://bugs.webkit.org/show_bug.cgi?id=134795
3525
3526         Reviewed by Benjamin Poulain.
3527
3528         UIKit requires writing something (anything!) to a particular pasteboard
3529         during copy in order to flag the content as rich. When a paste occurs,
3530         UIKit will read this flag and perform a two-step paste.
3531
3532         Test: platform/ios-sim/editing/pasteboard/two-step-paste.html
3533
3534         * platform/ios/PlatformPasteboardIOS.mm:
3535         (WebCore::PlatformPasteboard::write):
3536
3537 2014-07-09  Andy Estes  <aestes@apple.com>
3538
3539         [iOS] Some QuickLook documents are not displayed as previews
3540         https://bugs.webkit.org/show_bug.cgi?id=134788
3541         <rdar://problem/17278194>
3542
3543         Reviewed by Pratik Solanki.
3544
3545         ResourceRequest::isMainResourceRequest() is not reliable (e.g. ResourceRequests reconstituted from an
3546         NSURLRequest have no way to set this bit properly) and should probably be removed. Instead of using
3547         isMainResourceRequest() to check if a QuickLookHandle should be created when the Network Process is in use,
3548         just check if the current ResourceLoader is the same as the DocumentLoader's ResourceLoader.
3549
3550         No new tests. QuickLook is not testable from WebKit.
3551
3552         * platform/network/ios/QuickLook.mm:
3553         (WebCore::QuickLookHandle::create):
3554
3555 2014-07-10  Andreas Kling  <akling@apple.com>
3556
3557         [iOS WebKit2] Don't uninstall the memory pressure listener after first signal.
3558         <https://webkit.org/b/134814>
3559
3560         The call to uninstall() should not be made on iOS since iOS doesn't use the
3561         hold-off mechanism in MemoryPressureHandler.
3562
3563         Reviewed by Benjamin Poulain.
3564
3565         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
3566         (WebCore::MemoryPressureHandler::respondToMemoryPressure):
3567
3568 2014-07-10  Jer Noble  <jer.noble@apple.com>
3569
3570         [MSE] Overlapping appended ranges must cause the decoder to flush and re-enqueue.
3571         https://bugs.webkit.org/show_bug.cgi?id=134805
3572
3573         Reviewed by Eric Carlson.
3574
3575         When appending a range of media data which overlaps with an existing range, SourceBuffer
3576         must cause the decoder to flush and re-enqueue samples. Those samples removed by appending
3577         the overlapping range may have already been enqueued for display, and unless the decode
3578         queue is flushed, corruption or decode errors may occur as the new samples are enqueued for
3579         display.
3580
3581         Add a boolean flag onto TrackBuffer to indicate whether the decoder needs to be flushed and
3582         re-enqueued the next time an append operation completes. Set this flag whenever samples are
3583         removed due to overlapping or an explicit call to removeCodedFrames(). Move the contents of
3584         sourceBufferPrivateSeekToTime() (which previously did flushing and re-enqueueing) into a new
3585         function, reenqueueMediaForTime(), which can be called from sourceBufferPrivateAppendComplete().
3586
3587         Drive-by fix: findSyncSampleAfterDecodeIterator() would return the passed in iterator if that
3588         sample is a sync-sample. Fix this to correctly return the next sync sample.
3589
3590         Drive-by fix: Use a SampleMap, rather than a DecodeOrderSampleMap, to track erased samples
3591         so that the erasedSamples are correctly accounted for in both presentation and decode orders.
3592
3593         * Modules/mediasource/SampleMap.cpp:
3594         (WebCore::SampleMap::empty): Add convenience method.
3595         (WebCore::DecodeOrderSampleMap::findSyncSampleAfterDecodeIterator): Drive-by fix.
3596         * Modules/mediasource/SampleMap.h:
3597         (WebCore::SampleMap::decodeOrder): Added const accessor.
3598         (WebCore::SampleMap::presentationOrder): Ditto.
3599         (WebCore::SampleMap::addRange): Added.
3600         * Modules/mediasource/SourceBuffer.cpp:
3601         (WebCore::SourceBuffer::TrackBuffer::TrackBuffer): Add needsReenqueeing flag.
3602         (WebCore::SourceBuffer::sourceBufferPrivateSeekToTime): Move contents into reenqueueMediaForTime().
3603         (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete): Call reenqueMediaForTime() if necessary.
3604         (WebCore::SourceBuffer::removeCodedFrames): Set needsReenqueing.
3605         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Ditto.
3606         (WebCore::SourceBuffer::provideMediaData): Drive-by fix.
3607         (WebCore::SourceBuffer::reenqueueMediaForTime): Moved from sourceBufferPrivateSeekToTime().
3608         * Modules/mediasource/SourceBuffer.h:
3609
3610 2014-07-10  Pratik Solanki  <psolanki@apple.com>
3611
3612         ASSERT in SharedBuffer::maybeAppendDataArray() on MobileSafari launch
3613         https://bugs.webkit.org/show_bug.cgi?id=134812
3614         <rdar://problem/17628434>
3615
3616         Reviewed by Joseph Pecoraro.
3617
3618         Fix bug in my fix in r170930. Initialize the badly named m_shouldUsePurgeableMemory field to
3619         false. This field indicates when it is okay to use purgeable memory and is set to true once
3620         the resource is finished loading. By setting it to true in the constructor we were creating
3621         purgeable memory while the resource was still being loaded and this triggered the assert.
3622
3623         No new tests. Should be covered by existing tests.
3624
3625         * platform/cf/SharedBufferCF.cpp:
3626         (WebCore::SharedBuffer::SharedBuffer):
3627
3628 2014-07-10  Andreas Kling  <akling@apple.com>
3629
3630         [iOS WebKit2] Some memory pressure relief tweaks.
3631         <https://webkit.org/b/134811>
3632
3633         Split memory pressure relief into critical and non-critical sections.
3634         Non-critical relief is for clearing out things that are really not
3635         essential, e.g unused font data, text measurement caches, etc.
3636
3637         On iOS, only flip the "WebKit is under memory pressure" flag when we
3638         are under *critical* memroy pressure, rather than doing it early on
3639         and gimping ourselves because other processes are too big.
3640
3641         Also added logging for when we transition in/out of system pressure.
3642
3643         Reviewed by Geoffrey Garen.
3644
3645         * platform/MemoryPressureHandler.cpp:
3646         (WebCore::MemoryPressureHandler::releaseNoncriticalMemory):
3647         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
3648         (WebCore::MemoryPressureHandler::releaseMemory):
3649         * platform/MemoryPressureHandler.h:
3650         (WebCore::MemoryPressureHandler::ReliefLogger::loggingEnabled):
3651         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
3652         (WebCore::MemoryPressureHandler::install):
3653
3654 2014-07-10  Beth Dakin  <bdakin@apple.com>
3655
3656         Need Setting/WKPreference that allows clients to prevent scrollbars from drawing 
3657         on a secondary thread
3658         https://bugs.webkit.org/show_bug.cgi?id=134778
3659         -and corresponding-
3660         <rdar://problem/17595333>
3661
3662         Reviewed by Tim Horton.
3663
3664         This is a requirement for some types of performance tests. The patch adds a new 
3665         virtual function to ScrollableArea that forces subclasses to indicate the value of 
3666         the Setting. This is required because Scrollbar and ScrollableArea can’t get to 
3667         Settings on their own.
3668
3669         * page/FrameView.cpp:
3670         (WebCore::FrameView::forceUpdateScrollbarsOnMainThreadForPerformanceTesting):
3671         * page/FrameView.h:
3672         * page/Settings.in:
3673         * platform/ScrollableArea.h:
3674         * platform/Scrollbar.cpp:
3675         (WebCore::Scrollbar::supportsUpdateOnSecondaryThread):
3676         * platform/win/PopupMenuWin.h:
3677         * rendering/RenderLayer.cpp:
3678         (WebCore::RenderLayer::forceUpdateScrollbarsOnMainThreadForPerformanceTesting):
3679         * rendering/RenderLayer.h:
3680         * rendering/RenderListBox.cpp:
3681         (WebCore::RenderListBox::forceUpdateScrollbarsOnMainThreadForPerformanceTesting):
3682         * rendering/RenderListBox.h:
3683
3684 2014-07-10  Brady Eidson  <beidson@apple.com>
3685
3686         Phone number highlights should always be visible if the mouse hovers over.
3687         <rdar://problem/17527476> and https://bugs.webkit.org/show_bug.cgi?id=134784
3688
3689         Reviewed by Tim Horton.
3690
3691         * WebCore.exp.in:
3692
3693 2014-07-10  Timothy Horton  <timothy_horton@apple.com>
3694
3695         Assertions or crashes under _takeViewSnapshot when restoring windows
3696         https://bugs.webkit.org/show_bug.cgi?id=134792
3697
3698         Reviewed by Simon Fraser.
3699
3700         * platform/graphics/cocoa/IOSurface.mm:
3701         (IOSurface::createFromImage):
3702
3703 2014-07-10  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3704
3705         [XHR] overrideMimeType() should be able to change encoding in HEADERS RECEIVED state
3706         https://bugs.webkit.org/show_bug.cgi?id=128968
3707
3708         Reviewed by Alexey Proskuryakov.
3709
3710         Moved response encoding computation from didReceiveResponse to didReceiveData, just before the decoder is instantiated.
3711         This allows overrideMimeType to be changed within readystatechange event callback and have an impact on selected encoding.
3712
3713         Test: http/tests/xmlhttprequest/overridemimetype-headers-received-state-force-shiftjis.html
3714
3715         * xml/XMLHttpRequest.cpp:
3716         (WebCore::XMLHttpRequest::didReceiveResponse): Removed m_responseEncoding computation from response and mimeTypeOverride.
3717         (WebCore::XMLHttpRequest::didReceiveData): Added m_responseEncoding computation from response and mimeTypeOverride.
3718
3719 2014-07-09  Brady Eidson  <beidson@apple.com>
3720
3721         Fire connected/disconnected events for Gamepads.
3722         https://bugs.webkit.org/show_bug.cgi?id=134386
3723
3724         Reviewed by Dean Jackson.
3725
3726         No new tests (No effect in a currently tested config)
3727
3728         * Modules/gamepad/GamepadManager.cpp:
3729         (WebCore::navigatorGamepadFromDOMWindow): Handling converting a possibly-null Navigator into
3730             a possibly null NavigatorGamepad.
3731         (WebCore::GamepadManager::platformGamepadConnected): Notify blind Navigator/DOMWindows of all
3732             previously attached Gamepads, then notify everybody of this new gamepad.
3733         (WebCore::GamepadManager::platformGamepadDisconnected): Handle dispatching the disconnected
3734             event to all registered DOMWindows.
3735         (WebCore::GamepadManager::platformGamepadInputActivity): Notify blind Navigator/DOMWindows of all
3736             attached Gamepads.
3737         (WebCore::GamepadManager::makeGamepadVisible): Handles notifying setting up a new gamepads
3738             with all NavigatorGamepads as well as dispatching the connected even to DOMWindows.
3739         (WebCore::GamepadManager::registerDOMWindow):
3740         (WebCore::GamepadManager::unregisterDOMWindow):
3741         (WebCore::GamepadManager::makeGamepadsVisibileToBlindNavigators): Deleted.
3742         * Modules/gamepad/GamepadManager.h:
3743
3744         * Modules/gamepad/NavigatorGamepad.cpp:
3745         (WebCore::NavigatorGamepad::gamepadAtIndex):
3746         * Modules/gamepad/NavigatorGamepad.h:
3747
3748 2014-07-09  Benjamin Poulain  <bpoulain@apple.com>
3749
3750         [iOS][WK2] Disable text quantization while actively changing the page's scale factor
3751         https://bugs.webkit.org/show_bug.cgi?id=134781
3752
3753         Reviewed by Tim Horton and Myles C. Maxfield.
3754
3755         Query the chrome client to setup quantization on each layers.
3756
3757         * page/ChromeClient.h:
3758         (WebCore::ChromeClient::hasStablePageScaleFactor):
3759         * platform/graphics/mac/FontMac.mm:
3760         (WebCore::Font::drawGlyphs):
3761         * rendering/RenderLayer.cpp:
3762         (WebCore::RenderLayer::setupFontSubpixelQuantization):
3763
3764 2014-07-09  peavo@outlook.com  <peavo@outlook.com>
3765
3766         [Curl] Cache entry invalidated too early.
3767         https://bugs.webkit.org/show_bug.cgi?id=134681
3768
3769         Reviewed by Alex Christensen.
3770
3771         When a cache entry has expired, it is invalidated when a request for the corresponding url is started.
3772         This is too early, since the resource is possibly not modified (even though it has expired),
3773         and the server might respond with a 304 (not modified) response.
3774         When we then receive a 304 response, the cache entry is deleted, and we have no cached response/data to provide.
3775         This can be solved by not invalidating the entry when a request for that url is started,
3776         but instead invalidate when a 200 OK response is received (which means the resource has been modified).
3777
3778         * platform/network/curl/CurlCacheManager.cpp:
3779         (WebCore::CurlCacheManager::isCached): Avoid invalidating cache entry when it has expired, wait until we know the server response.
3780         * platform/network/curl/CurlCacheManager.h: Added const modifier.
3781
3782 2014-07-09  Myles C. Maxfield  <mmaxfield@apple.com>
3783
3784         Revert r170413 and r170390
3785         https://bugs.webkit.org/show_bug.cgi?id=134741
3786
3787         Reviewed by Benjamin Poulain.
3788
3789         These patches caused a variety of failures. I'm going to break them up into
3790         smaller chunks and commit them separately at some point in the future.
3791
3792         Requesting a review from Ben Poulain because there were some conflicts with
3793         r170561 in InlineTextBox.cpp and InlineTextBox.h.
3794
3795         * WebCore.exp.in:
3796         * platform/graphics/Font.cpp:
3797         (WebCore::Font::drawText):
3798         (WebCore::Font::drawEmphasisMarks):
3799         (WebCore::Font::adjustSelectionRectForText):
3800         (WebCore::computeUnderlineType):
3801         * platform/graphics/Font.h:
3802         * platform/graphics/FontFastPath.cpp:
3803         (WebCore::Font::getGlyphsAndAdvancesForSimpleText):
3804         (WebCore::Font::drawSimpleText):
3805         (WebCore::Font::drawEmphasisMarksForSimpleText):
3806         (WebCore::Font::drawGlyphBuffer):
3807         (WebCore::Font::drawEmphasisMarks):
3808         (WebCore::Font::adjustSelectionRectForSimpleText):
3809         * platform/graphics/GlyphBuffer.h:
3810         (WebCore::GlyphBuffer::size):
3811         (WebCore::GlyphBuffer::glyphs):
3812         (WebCore::GlyphBuffer::advances):
3813         (WebCore::GlyphBuffer::fontDataAt):
3814         (WebCore::GlyphBuffer::advanceAt):
3815         (WebCore::GlyphBuffer::offsetAt):
3816         (WebCore::GlyphBuffer::reverse):
3817         (WebCore::GlyphBuffer::offsetInString):
3818         (WebCore::GlyphBuffer::swap):
3819         * platform/graphics/GraphicsContext.cpp:
3820         * platform/graphics/Latin1TextIterator.h:
3821         (WebCore::Latin1TextIterator::Latin1TextIterator):
3822         (WebCore::Latin1TextIterator::currentCharacter):
3823         * platform/graphics/SimpleFontData.h:
3824         * platform/graphics/SurrogatePairAwareTextIterator.cpp:
3825         (WebCore::SurrogatePairAwareTextIterator::SurrogatePairAwareTextIterator):
3826         * platform/graphics/SurrogatePairAwareTextIterator.h:
3827         (WebCore::SurrogatePairAwareTextIterator::currentCharacter):
3828         * platform/graphics/TextRun.h:
3829         (WebCore::TextRun::length):
3830         (WebCore::TextRun::charactersLength):
3831         * platform/graphics/WidthIterator.cpp:
3832         (WebCore::WidthIterator::glyphDataForCharacter):
3833         (WebCore::applyFontTransforms):
3834         (WebCore::WidthIterator::advanceInternal):
3835         (WebCore::WidthIterator::advance):
3836         (WebCore::WidthIterator::advanceOneCharacter):
3837         * platform/graphics/WidthIterator.h:
3838         * platform/graphics/cairo/FontCairo.cpp:
3839         (WebCore::Font::drawGlyphs):
3840         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
3841         (WebCore::Font::drawComplexText):
3842         (WebCore::Font::drawEmphasisMarksForComplexText):
3843         (WebCore::Font::adjustSelectionRectForComplexText):
3844         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
3845         (WebCore::HarfBuzzShaper::setNormalizedBuffer):
3846         * platform/graphics/mac/FontComplexTextMac.cpp:
3847         (WebCore::Font::adjustSelectionRectForComplexText):
3848         (WebCore::Font::getGlyphsAndAdvancesForComplexText):
3849         (WebCore::Font::drawComplexText):
3850         (WebCore::Font::drawEmphasisMarksForComplexText):
3851         * platform/graphics/mac/FontMac.mm:
3852         (WebCore::Font::drawGlyphs):
3853         * platform/graphics/win/FontCGWin.cpp:
3854         (WebCore::Font::drawGlyphs):
3855         * platform/graphics/win/FontWin.cpp:
3856         (WebCore::Font::adjustSelectionRectForComplexText):
3857         (WebCore::Font::getGlyphsAndAdvancesForComplexText):
3858         (WebCore::Font::drawComplexText):
3859         (WebCore::Font::drawEmphasisMarksForComplexText):
3860         * platform/graphics/wince/FontWinCE.cpp:
3861         (WebCore::Font::drawGlyphs):
3862         (WebCore::Font::drawComplexText):
3863         (WebCore::Font::drawEmphasisMarksForComplexText):
3864         (WebCore::Font::selectionRectForComplexText):
3865         * rendering/InlineTextBox.cpp:
3866         (WebCore::InlineTextBox::isSelected):
3867         (WebCore::InlineTextBox::selectionState):
3868         (WebCore::InlineTextBox::localSelectionRect):
3869         (WebCore::InlineTextBox::paint):
3870         (WebCore::InlineTextBox::selectionStartEnd):
3871         (WebCore::InlineTextBox::paintSelection):
3872         (WebCore::InlineTextBox::paintCompositionBackground):
3873         (WebCore::InlineTextBox::paintDocumentMarker):
3874         (WebCore::InlineTextBox::paintTextMatchMarker):
3875         (WebCore::InlineTextBox::computeRectForReplacementMarker):
3876         (WebCore::InlineTextBox::paintCompositionUnderline):
3877         (WebCore::InlineTextBox::positionForOffset):
3878         (WebCore::InlineTextBox::constructTextRun):
3879         * rendering/InlineTextBox.h:
3880         (WebCore::InlineTextBox::truncation):
3881         * rendering/RenderCombineText.cpp:
3882         (WebCore::RenderCombineText::getStringToRender):
3883         * rendering/RenderCombineText.h:
3884         * rendering/RenderTextLineBoxes.cpp:
3885         (WebCore::ellipsisRectForBox):
3886         * rendering/svg/SVGInlineFlowBox.cpp:
3887         (WebCore::SVGInlineFlowBox::computeTextMatchMarkerRectForRenderer):
3888         * rendering/svg/SVGInlineTextBox.cpp:
3889         (WebCore::SVGInlineTextBox::positionForOffset):
3890         (WebCore::SVGInlineTextBox::localSelectionRect):
3891         (WebCore::SVGInlineTextBox::paintSelectionBackground):
3892         (WebCore::SVGInlineTextBox::mapStartEndPositionsIntoFragmentCoordinates):
3893         (WebCore::SVGInlineTextBox::paintText):
3894         * rendering/svg/SVGInlineTextBox.h:
3895         * rendering/svg/SVGTextMetricsBuilder.cpp:
3896         (WebCore::SVGTextMetricsBuilder::currentCharacterStartsSurrogatePair):
3897         (WebCore::SVGTextMetricsBuilder::advance):
3898         * rendering/svg/SVGTextQuery.cpp:
3899         (WebCore::SVGTextQuery::mapStartEndPositionsIntoFragmentCoordinates):
3900         (WebCore::SVGTextQuery::modifyStartEndPositionsRespectingLigatures):
3901         (WebCore::SVGTextQuery::subStringLengthCallback):
3902         (WebCore::SVGTextQuery::startPositionOfCharacterCallback):
3903         (WebCore::SVGTextQuery::endPositionOfCharacterCallback):
3904         (WebCore::SVGTextQuery::rotationOfCharacterCallback):
3905         (WebCore::SVGTextQuery::extentOfCharacterCallback):
3906         (WebCore::SVGTextQuery::characterNumberAtPositionCallback):
3907         * rendering/svg/SVGTextQuery.h:
3908         * rendering/svg/SVGTextRunRenderingContext.cpp:
3909         (WebCore::SVGGlyphToPathTranslator::SVGGlyphToPathTranslator):
3910         (WebCore::SVGTextRunRenderingContext::glyphDataForCharacter):
3911         * rendering/svg/SVGTextRunRenderingContext.h:
3912         * svg/SVGFontData.cpp:
3913         (WebCore::SVGFontData::applySVGGlyphSelection):
3914         * svg/SVGFontData.h:
3915
3916 2014-07-08  Jeffrey Pfau  <jpfau@apple.com>
3917
3918         Fix flaky loading tests
3919         https://bugs.webkit.org/show_bug.cgi?id=133696
3920
3921         Reviewed by Ryosuke Niwa.
3922
3923         In some cases, the Frame may be destroyed while the loader is
3924         initializing. Make sure we don't delete it too early.
3925
3926         * loader/FrameLoader.cpp:
3927         (WebCore::FrameLoader::init):
3928
3929 2014-07-09  Simon Fraser  <simon.fraser@apple.com>
3930
3931         Make IndirectCompositingReason an enum class
3932         https://bugs.webkit.org/show_bug.cgi?id=134789
3933
3934         Reviewed by Tim Horton.
3935
3936         Make RenderLayer::IndirectCompositingReason an enum class, and change some code
3937         in RenderLayerCompositor::reasonsForCompositing() to use a switch.
3938
3939         * rendering/RenderLayer.cpp:
3940         (WebCore::RenderLayer::RenderLayer):
3941         * rendering/RenderLayer.h:
3942         * rendering/RenderLayerCompositor.cpp:
3943         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
3944         (WebCore::RenderLayerCompositor::requiresOwnBackingStore):
3945         (WebCore::RenderLayerCompositor::reasonsForCompositing):
3946         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason):
3947
3948 2014-07-09  Pratik Solanki  <psolanki@apple.com>
3949
3950         Make SharedBuffer::append(SharedBuffer*) be smarter about CFData and data arrays
3951         https://bugs.webkit.org/show_bug.cgi?id=134731
3952
3953         Reviewed by Antti Koivisto.
3954
3955         If the target SharedBuffer has a CFDataRef or a data array then we can simply retain that
3956         CFDataRef or data array elements in the SharedBuffer being appended to. This avoids
3957         unnecessary copying.
3958
3959         No new tests because no functional changes.
3960
3961         * platform/SharedBuffer.cpp:
3962         (WebCore::SharedBuffer::append):
3963         (WebCore::SharedBuffer::maybeAppendPlatformData):
3964         * platform/SharedBuffer.h:
3965         * platform/cf/SharedBufferCF.cpp:
3966         (WebCore::SharedBuffer::maybeAppendPlatformData):
3967         (WebCore::SharedBuffer::maybeAppendDataArray):
3968         * platform/soup/SharedBufferSoup.cpp:
3969         (WebCore::SharedBuffer::maybeAppendPlatformData):
3970
3971 2014-07-09  Brent Fulgham  <bfulgham@apple.com>
3972
3973         [Win] Remove uses of 'bash' in build system
3974         https://bugs.webkit.org/show_bug.cgi?