329ec51909138bc5f77de1ce6c27fce370e63994
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2014-10-20  Michael Saboff  <msaboff@apple.com>
2
3         Make post checkin suggested changes to r174847
4         https://bugs.webkit.org/show_bug.cgi?id=137885
5
6         Reviewed by Mark Lam.
7
8         Eliminated the creation of a temporary Identifier when comparing propertyName to "open".
9         Made the suggested post checkin change to put the declaration of "entry" into the if.
10
11         * bindings/js/JSHTMLDocumentCustom.cpp:
12         (WebCore::JSHTMLDocument::getOwnPropertySlot):
13
14 2014-10-20  Chris Dumez  <cdumez@apple.com>
15
16         Use is<>() / downcast<>() for SpinButtonElement
17         https://bugs.webkit.org/show_bug.cgi?id=137896
18
19         Reviewed by Gyuyoung Kim.
20
21         Use is<>() / downcast<>() for SpinButtonElement instead of
22         isSpinButtonElement() / static_cast for consistency with the rest of
23         the code and for safety.
24
25         No new tests, no behavior change.
26
27         * accessibility/AccessibilityRenderObject.cpp:
28         (WebCore::AccessibilityRenderObject::addTextFieldChildren):
29         * html/shadow/SpinButtonElement.h:
30         (isType):
31         * rendering/RenderTheme.cpp:
32         (WebCore::RenderTheme::isSpinUpButtonPartPressed):
33         (WebCore::RenderTheme::isHovered):
34         (WebCore::RenderTheme::isSpinUpButtonPartHovered):
35
36 2014-10-20  Roger Fong  <roger_fong@apple.com>
37
38         Use glFlush instead of glFinish when drawing WebGL output to screen.
39         https://bugs.webkit.org/show_bug.cgi?id=137897.
40         <rdar://problem/15846550>
41
42         Reviewed by Brent Fulgham.
43
44         Passes all conformance tests.
45         Performance tested by http://threejs.org/examples/#webgl_performance and Unity WebGL performance tests.
46
47         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
48         (WebCore::GraphicsContext3D::prepareTexture):
49         Use glFlush instead of glFinish. glFinish is a blocking operation pushed out queued up WebGL operations and then waits until 
50         every operation has completed before returning and every pixel has been updated. This causes severe performance problems,
51         about a 10 fps difference on http://threejs.org/examples/#webgl_performance. glFlush, like glFinish,
52         forces all queued WebGL operations to take place, but returns immediately. Switching to glFlush does not seem
53         make our rendering quality any worse for the handful of sites I've tested and makes our performance on WebGL much better.
54         However, we should continue to be on the watch for any potential rendering issues after this lands.
55
56 2014-10-20  Benjamin Poulain  <bpoulain@apple.com>
57
58         Generalize the compilation of :not() to support arbitrary selector lists
59         https://bugs.webkit.org/show_bug.cgi?id=137843
60
61         Reviewed by Andreas Kling.
62
63         This builds :not() on top of the code created for :nth-child(An+B of selectorList)
64         to support any selector list.
65
66         The tests for the JIT were added previously:
67         -not-boundaries.html
68         -not-backtracking.html
69
70         * cssjit/SelectorCompiler.cpp:
71         (WebCore::SelectorCompiler::addPseudoClassType):
72         Any :not() of a selector is handled through a simple selector list. Cases like
73         :not(foo, bar) simply generate not([fragmentFoo, bragmentBar]).
74
75         Old cases like :not(foo):not(bar) simply add those cases to the selector list,
76         generating not([fragmentFoo, bragmentBar]).
77
78         (WebCore::SelectorCompiler::minimumRegisterRequirements):
79         Register pressure is now tracked through computeBacktrackingMemoryRequirements.
80
81         (WebCore::SelectorCompiler::hasAnyCombinators):
82         (WebCore::SelectorCompiler::computeBacktrackingMemoryRequirements):
83         (WebCore::SelectorCompiler::computeBacktrackingInformation):
84         Abstract the code creating Selector Lists from :nth-child(of). Use that for :not()
85         and  :nth-child(of).
86
87         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatchesNotPseudoClass):
88
89 2014-10-20  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
90
91         Use std::unique_ptr<>|make_unique<> in PluginView::scheduleRequest()
92         https://bugs.webkit.org/show_bug.cgi?id=137874
93
94         Reviewed by Andreas Kling.
95
96         No new tests, no behavior change.
97
98         * plugins/PluginView.cpp:
99         (WebCore::PluginView::requestTimerFired):
100         (WebCore::PluginView::scheduleRequest): Replace PassOwnPtr with std::unique_ptr.
101         (WebCore::PluginView::load): Create PluginRequest using std::make_unique.
102         * plugins/PluginView.h:
103
104 2014-10-20  Beth Dakin  <bdakin@apple.com>
105
106         Speculative build fix.
107
108         * platform/spi/mac/NSViewSPI.h:
109
110 2014-10-20  Beth Dakin  <bdakin@apple.com>
111
112         Add support for action menus
113         https://bugs.webkit.org/show_bug.cgi?id=137891
114         rdar://problem/18451638
115         rdar://problem/18694470
116
117         Reviewed by Anders Carlsson.
118
119         New SPI that is needed for this.
120         * WebCore.exp.in:
121         * WebCore.xcodeproj/project.pbxproj:
122         * platform/spi/mac: Added.
123         * platform/spi/mac/NSViewSPI.h: Added.
124
125 2014-10-20  Dean Jackson  <dino@apple.com>
126
127         [Mac] Support "inverted-colors" and "monochrome" media feature.
128         https://bugs.webkit.org/show_bug.cgi?id=137535
129         <rdar://problem/18586398>
130
131         Rolling out the Windows part of this to fix the build.
132
133         * platform/win/PlatformScreenWin.cpp:
134         (WebCore::screenHasInvertedColors): Revert to a stub function.
135
136 2014-10-20  Chris Dumez  <cdumez@apple.com>
137
138         Unreviewed EFL / GTK build fix after r174898.
139
140         Add missing header include.
141
142         * accessibility/AccessibilityARIAGrid.cpp:
143
144 2014-10-20  Dean Jackson  <dino@apple.com>
145
146         [Mac] Support "inverted-colors" and "monochrome" media feature.
147         https://bugs.webkit.org/show_bug.cgi?id=137535
148         <rdar://problem/18586398>
149
150         Reviewed by Brent Fulgham.
151
152         Add a new media query from CSS Level 4, "inverted-colors", and
153         implement the Apple backends for the "monochrome" media query.
154
155         The platform code went into PlatformScreenMac, which already
156         had a screenIsMonochrome method. This now calls into Core
157         Graphics via SPI. I added a screenHasInvertedColors
158         method which tests for inversion. On iOS, there is public API
159         for both queries. On Windows, we try to use CoreGraphics.
160
161         At the moment neither of these media queries re-evaluate
162         automatically if the user changes their mode. The page will
163         need to be reloaded. It is possible to detect a change on iOS,
164         but not OS X.
165         https://bugs.webkit.org/show_bug.cgi?id=137868
166
167         I decided to not add an ENABLE flag for this, mostly because it
168         is such an isolated feature and seems very unlikely to be
169         controversial. I don't expect the syntax to change. (I'm sure
170         this comment will come back to haunt me.)
171
172         Testing this automatically is slightly tricky. We'd need
173         to expose SPI to invert the user's screen, but then we get
174         inverted images from our testing which could interfere with concurrent
175         operations. Instead I've included some tests that exercise
176         the "false" parts of the media query, with explanations as
177         to why they would fail if the display is inverted.
178
179         Tests: fast/media/mq-inverted-colors.html
180                fast/media/mq-monochrome.html
181
182         * css/CSSValueKeywords.in: Add the "inverted" keyword for "inverted-colors".
183         * css/MediaFeatureNames.h: Add the "inverted-colors" feature name.
184         * css/MediaQueryEvaluator.cpp:
185         (WebCore::inverted_colorsMediaFeatureEval): Implementation of the new media query.
186         * css/MediaQueryExp.cpp:
187         (WebCore::featureWithCSSValueID): The new query takes an id...
188         (WebCore::featureWithoutValue): ... or no value.
189         * platform/PlatformScreen.h: Add "screenHasInvertedColors".
190         * platform/efl/PlatformScreenEfl.cpp:
191         (WebCore::screenHasInvertedColors): Stub implementation.
192         * platform/gtk/PlatformScreenGtk.cpp:
193         (WebCore::screenHasInvertedColors): Ditto.
194         * platform/ios/PlatformScreenIOS.mm:
195         (WebCore::screenHasInvertedColors): Call into the platform accessibility API.
196         (WebCore::screenIsMonochrome): Ditto.
197         * platform/mac/PlatformScreenMac.mm:
198         (WebCore::screenIsMonochrome): Call into the CoreGraphics SPI.
199         (WebCore::screenHasInvertedColors): Call into the CoreGraphics SPI.
200         * platform/win/PlatformScreenWin.cpp:
201         (WebCore::screenHasInvertedColors): Call into CoreGraphics if we're using it.
202
203 2014-10-20  Chris Dumez  <cdumez@apple.com>
204
205         Use is<>() / downcast<>() for Accessibility objects
206         https://bugs.webkit.org/show_bug.cgi?id=137286
207
208         Reviewed by Darin Adler.
209
210         Use is<>() / downcast<>() for Accessibility objects and clean up the
211         surrounding code.
212
213         No new tests, no behavior change.
214
215         * accessibility/AXObjectCache.cpp:
216         (WebCore::AXObjectCache::focusedImageMapUIElement):
217         (WebCore::AXObjectCache::notificationPostTimerFired):
218         * accessibility/AccessibilityARIAGrid.cpp:
219         (WebCore::AccessibilityARIAGrid::addTableCellChild):
220         (WebCore::AccessibilityARIAGrid::addChildren):
221         * accessibility/AccessibilityARIAGridCell.cpp:
222         (WebCore::AccessibilityARIAGridCell::parentTable):
223         (WebCore::AccessibilityARIAGridCell::rowIndexRange):
224         * accessibility/AccessibilityARIAGridRow.cpp:
225         (WebCore::AccessibilityARIAGridRow::disclosedRows):
226         (WebCore::AccessibilityARIAGridRow::disclosedByRow):
227         (WebCore::AccessibilityARIAGridRow::parentTable):
228         * accessibility/AccessibilityARIAGridRow.h:
229         * accessibility/AccessibilityImageMapLink.cpp:
230         (WebCore::AccessibilityImageMapLink::imageMapLinkRenderer):
231         * accessibility/AccessibilityImageMapLink.h:
232         * accessibility/AccessibilityList.h:
233         * accessibility/AccessibilityListBox.cpp:
234         (WebCore::AccessibilityListBox::setSelectedChildren):
235         (WebCore::AccessibilityListBox::selectedChildren):
236         (WebCore::AccessibilityListBox::listBoxOptionAccessibilityObject):
237         * accessibility/AccessibilityListBox.h:
238         * accessibility/AccessibilityListBoxOption.h:
239         * accessibility/AccessibilityMenuList.cpp:
240         (WebCore::AccessibilityMenuList::addChildren):
241         (WebCore::AccessibilityMenuList::didUpdateActiveOption):
242         * accessibility/AccessibilityMenuList.h:
243         * accessibility/AccessibilityMenuListOption.h:
244         * accessibility/AccessibilityMenuListPopup.cpp:
245         (WebCore::AccessibilityMenuListPopup::menuListOptionAccessibilityObject):
246         * accessibility/AccessibilityMenuListPopup.h:
247         * accessibility/AccessibilityMockObject.h:
248         * accessibility/AccessibilityNodeObject.cpp:
249         (WebCore::AccessibilityNodeObject::textUnderElement):
250         * accessibility/AccessibilityNodeObject.h:
251         * accessibility/AccessibilityObject.cpp:
252         (WebCore::appendChildrenToArray):
253         (WebCore::AccessibilityObject::scrollViewAncestor):
254         * accessibility/AccessibilityObject.h:
255         * accessibility/AccessibilityRenderObject.cpp:
256         (WebCore::AccessibilityRenderObject::getDocumentLinks):
257         (WebCore::AccessibilityRenderObject::handleActiveDescendantChanged):
258         (WebCore::AccessibilityRenderObject::inheritsPresentationalRole):
259         (WebCore::AccessibilityRenderObject::addImageMapChildren):
260         (WebCore::AccessibilityRenderObject::addTextFieldChildren):
261         (WebCore::AccessibilityRenderObject::remoteSVGRootElement):
262         (WebCore::AccessibilityRenderObject::ariaSelectedRows):
263         * accessibility/AccessibilityRenderObject.h:
264         * accessibility/AccessibilitySVGRoot.h:
265         * accessibility/AccessibilityScrollView.cpp:
266         (WebCore::AccessibilityScrollView::addChildScrollbar):
267         * accessibility/AccessibilityScrollView.h:
268         * accessibility/AccessibilityScrollbar.h:
269         * accessibility/AccessibilitySlider.cpp:
270         (WebCore::AccessibilitySlider::addChildren):
271         * accessibility/AccessibilitySlider.h:
272         * accessibility/AccessibilitySpinButton.cpp:
273         (WebCore::AccessibilitySpinButton::addChildren):
274         (WebCore::AccessibilitySpinButtonPart::press):
275         * accessibility/AccessibilitySpinButton.h:
276         * accessibility/AccessibilityTable.cpp:
277         (WebCore::AccessibilityTable::addChildren):
278         (WebCore::AccessibilityTable::addChildrenFromSection):
279         (WebCore::AccessibilityTable::headerContainer):
280         (WebCore::AccessibilityTable::columnHeaders):
281         (WebCore::AccessibilityTable::rowHeaders):
282         (WebCore::AccessibilityTable::cellForColumnAndRow):
283         * accessibility/AccessibilityTable.h:
284         Make isAccessibilityTable() public and mark as final so that callers
285         can benefit from tighter typing, as isAccessibilityTable() is
286         stricter than isTable(). isTable() indicates that the object is an
287         AccessibilityTable and is equivalent to is<AccessibilityTable>(object).
288         isAccessibilityTable() is equivalent to "isTable() && renderer()".
289
290         * accessibility/AccessibilityTableCell.cpp:
291         (WebCore::AccessibilityTableCell::parentTable):
292         * accessibility/AccessibilityTableCell.h:
293         * accessibility/AccessibilityTableColumn.cpp:
294         (WebCore::AccessibilityTableColumn::headerObject):
295         (WebCore::AccessibilityTableColumn::addChildren):
296         * accessibility/AccessibilityTableColumn.h:
297         * accessibility/AccessibilityTableHeaderContainer.cpp:
298         (WebCore::AccessibilityTableHeaderContainer::addChildren):
299         * accessibility/AccessibilityTableRow.cpp:
300         (WebCore::AccessibilityTableRow::parentTable):
301         (WebCore::AccessibilityTableRow::headerObject):
302         * accessibility/AccessibilityTableRow.h:
303         * accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
304         (webkitAccessibleSelectionClearSelection):
305         (webkitAccessibleSelectionSelectAllSelection):
306         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
307         (core):
308         (cell):
309         (cellAtIndex):
310         (webkitAccessibleTableGetIndexAt):
311         (webkitAccessibleTableGetNColumns):
312         (webkitAccessibleTableGetNRows):
313         (webkitAccessibleTableGetColumnHeader):
314         (webkitAccessibleTableGetRowHeader):
315         * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
316         (webkitAccessibleTableCellGetColumnHeaderCells):
317         (webkitAccessibleTableCellGetRowHeaderCells):
318         (webkitAccessibleTableCellGetColumnSpan):
319         (webkitAccessibleTableCellGetRowSpan):
320         (webkitAccessibleTableCellGetPosition):
321         * accessibility/ios/AccessibilityObjectIOS.mm:
322         (WebCore::AccessibilityObject::accessibilityPasswordFieldLength):
323         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
324         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
325         (-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]):
326         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
327         (AXAttributeStringSetElement):
328         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
329         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
330         (-[WebAccessibilityObjectWrapper subrole]):
331         (-[WebAccessibilityObjectWrapper roleDescription]):
332         (-[WebAccessibilityObjectWrapper scrollViewParent]):
333         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
334         (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
335         (-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
336         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
337         * inspector/InspectorDOMAgent.cpp:
338         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
339         * rendering/RenderMenuList.cpp:
340         (RenderMenuList::didUpdateActiveOption):
341
342 2014-10-20  Joseph Pecoraro  <pecoraro@apple.com>
343
344         Web Inspector: Generate all Inspector domains together in JavaScriptCore
345         https://bugs.webkit.org/show_bug.cgi?id=137748
346
347         Reviewed by Brian Burg.
348
349         After moving the json files into JavaScriptCore update the includes,
350         and names of functions that were previously prefixed.
351
352         * CMakeLists.txt:
353         * DerivedSources.make:
354         * ForwardingHeaders/inspector/InspectorBackendDispatchers.h: Added.
355         * ForwardingHeaders/inspector/InspectorFrontendDispatchers.h: Added.
356         * ForwardingHeaders/inspector/InspectorJSBackendDispatchers.h: Removed.
357         * ForwardingHeaders/inspector/InspectorJSFrontendDispatchers.h: Removed.
358         * ForwardingHeaders/inspector/InspectorJSProtocolTypes.h: Removed.
359         * ForwardingHeaders/inspector/InspectorProtocolTypesBase.h: Added.
360         * WebCore.vcxproj/WebCore.vcxproj:
361         * WebCore.vcxproj/WebCore.vcxproj.filters:
362         * WebCore.vcxproj/copyForwardingHeaders.cmd:
363         * WebCore.xcodeproj/project.pbxproj:
364         * inspector/CommandLineAPIHost.cpp:
365         * inspector/InspectorApplicationCacheAgent.cpp:
366         * inspector/InspectorApplicationCacheAgent.h:
367         * inspector/InspectorCSSAgent.cpp:
368         * inspector/InspectorCSSAgent.h:
369         * inspector/InspectorController.cpp:
370         * inspector/InspectorDOMAgent.cpp:
371         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
372         * inspector/InspectorDOMAgent.h:
373         * inspector/InspectorDOMDebuggerAgent.cpp:
374         * inspector/InspectorDOMDebuggerAgent.h:
375         * inspector/InspectorDOMStorageAgent.cpp:
376         * inspector/InspectorDOMStorageAgent.h:
377         * inspector/InspectorDatabaseAgent.cpp:
378         * inspector/InspectorDatabaseAgent.h:
379         * inspector/InspectorDatabaseResource.cpp:
380         * inspector/InspectorDatabaseResource.h:
381         * inspector/InspectorFrontendClientLocal.cpp:
382         * inspector/InspectorIndexedDBAgent.cpp:
383         * inspector/InspectorIndexedDBAgent.h:
384         * inspector/InspectorLayerTreeAgent.cpp:
385         * inspector/InspectorLayerTreeAgent.h:
386         * inspector/InspectorPageAgent.cpp:
387         * inspector/InspectorPageAgent.h:
388         * inspector/InspectorReplayAgent.cpp:
389         * inspector/InspectorReplayAgent.h:
390         * inspector/InspectorResourceAgent.cpp:
391         * inspector/InspectorResourceAgent.h:
392         * inspector/InspectorStyleSheet.cpp:
393         * inspector/InspectorStyleSheet.h:
394         * inspector/InspectorTimelineAgent.cpp:
395         (WebCore::InspectorTimelineAgent::addRecordToTimeline):
396         * inspector/InspectorTimelineAgent.h:
397         * inspector/InspectorWorkerAgent.cpp:
398         * inspector/InspectorWorkerAgent.h:
399         * inspector/PageRuntimeAgent.h:
400         * inspector/TimelineRecordFactory.cpp:
401         * inspector/WorkerInspectorController.cpp:
402
403 2014-10-20  Andy Estes  <aestes@apple.com>
404
405         Fix the GTK build.
406
407         * dom/RenderedDocumentMarker.h:
408
409 2014-10-19  Antti Koivisto  <antti@apple.com>
410
411         Avoid unnecessary NSURLResponse construction for QuickLook on iOS
412         https://bugs.webkit.org/show_bug.cgi?id=137876
413
414         Reviewed by Andy Estes.
415
416         QuickLook specific code path creates NSURLResponse in the web process for every response.
417         It is rarely needed so this is unnecessary work.
418
419         * WebCore.exp.in:
420         * platform/network/ios/QuickLook.h:
421         * platform/network/ios/QuickLook.mm:
422         (WebCore::isMainResourceLoader):
423         (WebCore::QuickLookHandle::shouldCreateForMIMEType):
424
425             Separate function for testing if QuickLookHandle is needed.
426
427         (WebCore::QuickLookHandle::create):
428
429             Switch the interface to take ResourceResponse.
430
431 2014-10-20  Andy Estes  <aestes@apple.com>
432
433         Fix the iOS build.
434
435         * WebCore.xcodeproj/project.pbxproj:
436         * dom/RenderedDocumentMarker.h:
437         * page/ios/FrameIOS.mm:
438         (WebCore::Frame::interpretationsForCurrentRoot):
439
440 2014-10-20  Benjamin Poulain  <benjamin@webkit.org>
441
442         Update the <link>'s link status
443         https://bugs.webkit.org/show_bug.cgi?id=137861
444
445         Reviewed by Chris Dumez.
446
447         In the latest HTML spec, <link> has the link status
448         if it has a 'href' attribute, exactly like <a> and <area>:
449             https://html.spec.whatwg.org/multipage/scripting.html#selector-link
450
451         This patch updates WebKit accordingly.
452
453         Tests: fast/css/link-basics.html
454                fast/selectors/link-basics-xhtml.xhtml
455                fast/selectors/link-basics.html
456                fast/selectors/webkit-any-link-basics.html
457
458         * html/HTMLLinkElement.cpp:
459         (WebCore::HTMLLinkElement::parseAttribute):
460
461 2014-10-20  Chris Dumez  <cdumez@apple.com>
462
463         [Mac] Optimize cookiesForDOM() by filtering and serializing cookies in a single pass
464         https://bugs.webkit.org/show_bug.cgi?id=137869
465
466         Reviewed by Darin Adler.
467
468         Optimize cookiesForDOM() by filtering and serializing in 1 pass instead of 2.
469
470         Previously, when accessing document.cookie, we ended up doing the following:
471         1. Call wkHTTPCookiesForURL() to get an NSArray of NSHTTPCookies.
472         2. Call filterCookies() to filter out cookies that are httpOnly or with an
473            empty name, thus allocating a new NSMutableArray.
474         3. Call NSHTTPCookie's requestHeaderFieldsWithCookies() to serialize the
475            cookies
476         4. Construct a WTF::String from the NSString*
477
478         There were several inefficiencies here:
479         1. We needed to pre-filter the cookies and allocate a new NSMutableArray
480            before calling requestHeaderFieldsWithCookies()
481         2. requestHeaderFieldsWithCookies() does more things that we actually need.
482            It constructs a Dictionary of header fields, of which we query the
483            "Cookie" field, even though we merely want a ';'-separated string
484            representation of the cookies in "key=value" form.
485
486         With this patch, we now take care of the string serialization ourselves,
487         using a StringBuilder as it is trivial to do. This also allows us to filter
488         out the httpOnly/invalid cookies as we do the serialization instead of
489         having a first pass to do so.
490
491         When scrolling the http://www.apple.com/iphone/ entire page down, then up,
492         se were spending ~13.1% of the NetworkProcess time in cookiesForDOM()
493         (~96ms) on my machine. With the patch, we spend ~23% less time in
494         cookiesForDOM() (~74ms).
495
496         No new tests, no behavior change.
497
498         * platform/network/mac/CookieJarMac.mm:
499         (WebCore::cookiesForSession):
500         (WebCore::cookiesForDOM):
501         (WebCore::cookieRequestHeaderFieldValue):
502
503 2014-10-19  Chris Dumez  <cdumez@apple.com>
504
505         Kill toRenderedDocumentMarker() by using tighter typing
506         https://bugs.webkit.org/show_bug.cgi?id=137858
507
508         Reviewed by Darin Adler.
509
510         Kill toRenderedDocumentMarker() by using tighter typing. This method
511         was doing no type validation, just a static_cast<>().
512
513         No new tests, no behavior change.
514
515         * dom/DocumentMarkerController.cpp:
516         (WebCore::DocumentMarkerController::addTextMatchMarker):
517         (WebCore::DocumentMarkerController::markersFor):
518         (WebCore::DocumentMarkerController::markersInRange):
519         (DocumentMarkerController::hasMarkers):
520         * dom/DocumentMarkerController.h:
521         * dom/RenderedDocumentMarker.h:
522         (WebCore::toRenderedDocumentMarker): Deleted.
523         * editing/AlternativeTextController.cpp:
524         (WebCore::markersHaveIdenticalDescription):
525         (WebCore::AlternativeTextController::respondToChangedSelection):
526         (WebCore::AlternativeTextController::recordSpellcheckerResponseForModifiedCorrection):
527         (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult):
528         (WebCore::AlternativeTextController::applyDictationAlternative):
529         * editing/CompositeEditCommand.cpp:
530         (WebCore::copyMarkers):
531         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
532         * editing/DeleteSelectionCommand.cpp:
533         (WebCore::DeleteSelectionCommand::originalStringForAutocorrectionAtBeginningOfSelection):
534         * editing/Editor.cpp:
535         (WebCore::Editor::updateMarkersForWordsAffectedByEditing):
536         (WebCore::Editor::selectionStartHasMarkerFor):
537         * rendering/InlineTextBox.cpp:
538         (WebCore::InlineTextBox::paintDocumentMarker):
539         (WebCore::InlineTextBox::paintTextMatchMarker):
540         (WebCore::InlineTextBox::computeRectForReplacementMarker):
541         (WebCore::InlineTextBox::paintDocumentMarkers):
542         * rendering/InlineTextBox.h:
543         * rendering/svg/SVGInlineFlowBox.cpp:
544         (WebCore::SVGInlineFlowBox::computeTextMatchMarkerRectForRenderer):
545         * testing/Internals.cpp:
546         (WebCore::Internals::markerAt):
547         (WebCore::Internals::markerRangeForNode):
548         (WebCore::Internals::markerDescriptionForNode):
549         * testing/Internals.h:
550
551 2014-10-19  Chris Dumez  <cdumez@apple.com>
552
553         Use is<>() / downcast<>() for all remaining RenderObject subclasses
554         https://bugs.webkit.org/show_bug.cgi?id=137845
555
556         Reviewed by Darin Adler.
557
558         Use is<>() / downcast<>() for all remaining RenderObject subclasses and
559         clean up the surrounding code.
560
561         No new tests, no behavior change.
562
563         * accessibility/AccessibilityProgressIndicator.cpp:
564         (WebCore::AccessibilityProgressIndicator::progressElement):
565         (WebCore::AccessibilityProgressIndicator::meterElement):
566         * accessibility/AccessibilityRenderObject.cpp:
567         (WebCore::AccessibilityRenderObject::layoutCount):
568         (WebCore::AccessibilityRenderObject::widgetForAttachmentView):
569         (WebCore::AccessibilityRenderObject::visiblePositionForPoint):
570         * dom/Document.cpp:
571         (WebCore::widgetForElement):
572         * dom/Position.cpp:
573         (WebCore::Position::getInlineBoxAndOffset):
574         * dom/WebKitNamedFlow.cpp:
575         (WebCore::WebKitNamedFlow::overset):
576         (WebCore::WebKitNamedFlow::firstEmptyRegionIndex):
577         (WebCore::WebKitNamedFlow::getRegionsByContent):
578         (WebCore::WebKitNamedFlow::getRegions):
579         * editing/FrameSelection.cpp:
580         (WebCore::isFrameElement):
581         * html/HTMLEmbedElement.cpp:
582         (WebCore::findWidgetRenderer):
583         * html/HTMLFrameOwnerElement.cpp:
584         (WebCore::HTMLFrameOwnerElement::HTMLFrameOwnerElement):
585         (WebCore::HTMLFrameOwnerElement::renderWidget):
586         * html/HTMLMediaElement.cpp:
587         (WebCore::HTMLMediaElement::parseAttribute):
588         * html/HTMLMeterElement.cpp:
589         (WebCore::HTMLMeterElement::renderMeter):
590         * html/HTMLPlugInElement.cpp:
591         (WebCore::HTMLPlugInElement::supportsFocus):
592         * html/HTMLPlugInImageElement.cpp:
593         (WebCore::HTMLPlugInImageElement::renderEmbeddedObject):
594         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
595         * html/HTMLProgressElement.cpp:
596         (WebCore::HTMLProgressElement::renderProgress):
597         * html/PluginDocument.cpp:
598         (WebCore::PluginDocument::pluginWidget):
599         * html/shadow/MediaControlElements.cpp:
600         (WebCore::MediaControlTimelineElement::defaultEventHandler):
601         (WebCore::MediaControlTextTrackContainerElement::updateSizes):
602         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
603         * inspector/InspectorLayerTreeAgent.cpp:
604         (WebCore::InspectorLayerTreeAgent::gatherLayersUsingRenderObjectHierarchy):
605         * inspector/InspectorOverlay.cpp:
606         (WebCore::buildObjectForElementInfo):
607         * loader/SubframeLoader.cpp:
608         (WebCore::SubframeLoader::loadSubframe):
609         * page/Frame.cpp:
610         (WebCore::Frame::ownerRenderer):
611         * page/FrameView.cpp:
612         (WebCore::FrameView::layout):
613         * page/gtk/EventHandlerGtk.cpp:
614         (WebCore::EventHandler::passWidgetMouseDownEventToWidget):
615         * page/ios/EventHandlerIOS.mm:
616         (WebCore::EventHandler::passWidgetMouseDownEventToWidget):
617         (WebCore::EventHandler::passSubframeEventToSubframe):
618         * page/mac/EventHandlerMac.mm:
619         (WebCore::EventHandler::passWidgetMouseDownEventToWidget):
620         (WebCore::EventHandler::passSubframeEventToSubframe):
621         (WebCore::widgetForEventTarget):
622         * platform/efl/RenderThemeEfl.cpp:
623         (WebCore::RenderThemeEfl::applyEdjeRTLState):
624         * rendering/InlineTextBox.cpp:
625         (WebCore::fontToUse):
626         (WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove):
627         (WebCore::InlineTextBox::paint):
628         * rendering/LayoutState.cpp:
629         (WebCore::LayoutState::LayoutState):
630         * rendering/RenderBlock.cpp:
631         (WebCore::RenderBlock::collapseAnonymousBoxChild):
632         (WebCore::RenderBlock::simplifiedLayout):
633         (WebCore::RenderBlock::paintObject):
634         (WebCore::RenderBlock::selectionGaps):
635         (WebCore::RenderBlock::nodeAtPoint):
636         * rendering/RenderBlockFlow.cpp:
637         (WebCore::RenderBlockFlow::layoutBlock):
638         (WebCore::RenderBlockFlow::hitTestFloats):
639         (WebCore::RenderBlockFlow::checkForPaginationLogicalHeightChange):
640         * rendering/RenderBlockLineLayout.cpp:
641         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
642         * rendering/RenderBox.cpp:
643         (WebCore::RenderBox::scroll):
644         (WebCore::RenderBox::nodeAtPoint):
645         (WebCore::RenderBox::repaintLayerRectsForImage):
646         (WebCore::RenderBox::mapLocalToContainer):
647         (WebCore::RenderBox::containingBlockLogicalWidthForPositioned):
648         * rendering/RenderCombineText.h:
649         * rendering/RenderElement.cpp:
650         (WebCore::RenderElement::adjustStyleDifference):
651         (WebCore::addLayers):
652         (WebCore::RenderElement::removeLayers):
653         (WebCore::RenderElement::moveLayers):
654         (WebCore::RenderElement::setNeedsPositionedMovementLayout):
655         (WebCore::RenderElement::renderNamedFlowThreadWrapper):
656         * rendering/RenderEmbeddedObject.h:
657         * rendering/RenderFlowThread.cpp:
658         (WebCore::RenderFlowThread::validateRegions):
659         (WebCore::RenderFlowThread::hasCompositingRegionDescendant):
660         (WebCore::RenderFlowThread::regionForCompositedLayer):
661         (WebCore::RenderFlowThread::clearRenderBoxRegionInfoAndCustomStyle):
662         (WebCore::RenderFlowThread::initializeRegionsComputedAutoHeight):
663         (WebCore::RenderFlowThread::updateRegionsFlowThreadPortionRect):
664         (WebCore::RenderFlowThread::addForcedRegionBreak):
665         (WebCore::RenderFlowThread::addRegionsOverflowFromChild):
666         * rendering/RenderFlowThread.h:
667         * rendering/RenderLayer.cpp:
668         (WebCore::RenderLayer::setFilterBackendNeedsRepaintingInRect):
669         (WebCore::transparencyClipBox):
670         (WebCore::accumulateOffsetTowardsAncestor):
671         (WebCore::RenderLayer::collectFragments):
672         (WebCore::RenderLayer::hitTest):
673         (WebCore::RenderLayer::isFlowThreadCollectingGraphicsLayersUnderRegions):
674         (WebCore::RenderLayer::calculateClipRects):
675         * rendering/RenderLayerBacking.cpp:
676         (WebCore::RenderLayerBacking::updateAfterWidgetResize):
677         (WebCore::RenderLayerBacking::updateConfiguration):
678         (WebCore::isRestartedPlugin):
679         (WebCore::isCompositedPlugin):
680         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
681         (WebCore::RenderLayerBacking::containsPaintedContent):
682         * rendering/RenderLayerCompositor.cpp:
683         (WebCore::RenderLayerCompositor::updateBacking):
684         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
685         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
686         (WebCore::RenderLayerCompositor::requiresCompositingLayer):
687         (WebCore::RenderLayerCompositor::reasonsForCompositing):
688         (WebCore::RenderLayerCompositor::requiresCompositingForVideo):
689         (WebCore::RenderLayerCompositor::requiresCompositingForPlugin):
690         (WebCore::RenderLayerCompositor::requiresCompositingForFrame):
691         * rendering/RenderLayerModelObject.h:
692         * rendering/RenderLineBreak.h:
693         * rendering/RenderMeter.h:
694         * rendering/RenderMultiColumnFlowThread.cpp:
695         (WebCore::RenderMultiColumnFlowThread::firstMultiColumnSet):
696         (WebCore::RenderMultiColumnFlowThread::lastMultiColumnSet):
697         (WebCore::RenderMultiColumnFlowThread::layout):
698         (WebCore::RenderMultiColumnFlowThread::addRegionToThread):
699         (WebCore::RenderMultiColumnFlowThread::flowThreadDescendantInserted):
700         (WebCore::RenderMultiColumnFlowThread::flowThreadRelativeWillBeRemoved):
701         (WebCore::RenderMultiColumnFlowThread::flowThreadDescendantBoxLaidOut):
702         (WebCore::RenderMultiColumnFlowThread::setPageBreak):
703         (WebCore::RenderMultiColumnFlowThread::updateMinimumPageHeight):
704         (WebCore::RenderMultiColumnFlowThread::setRegionRangeForBox):
705         (WebCore::RenderMultiColumnFlowThread::addForcedRegionBreak):
706         (WebCore::RenderMultiColumnFlowThread::physicalTranslationOffsetFromFlowToRegion):
707         * rendering/RenderMultiColumnFlowThread.h:
708         * rendering/RenderMultiColumnSet.cpp:
709         (WebCore::RenderMultiColumnSet::nextSiblingMultiColumnSet):
710         (WebCore::RenderMultiColumnSet::previousSiblingMultiColumnSet):
711         * rendering/RenderMultiColumnSet.h:
712         * rendering/RenderMultiColumnSpannerPlaceholder.h:
713         * rendering/RenderNamedFlowFragment.cpp:
714         (WebCore::RenderNamedFlowFragment::checkRegionStyle):
715         (WebCore::RenderNamedFlowFragment::namedFlowThread):
716         * rendering/RenderNamedFlowFragment.h:
717         * rendering/RenderNamedFlowThread.cpp:
718         (WebCore::RenderNamedFlowThread::updateWritingMode):
719         (WebCore::addFragmentToList):
720         (WebCore::RenderNamedFlowThread::addRegionToThread):
721         (WebCore::RenderNamedFlowThread::removeRegionFromThread):
722         (WebCore::RenderNamedFlowThread::fragmentFromRenderBoxAsRenderBlock):
723         (WebCore::RenderNamedFlowThread::fragmentFromAbsolutePointAndBox):
724         (WebCore::RenderNamedFlowThread::checkInvalidRegions):
725         (WebCore::RenderNamedFlowThread::checkRegionsWithStyling):
726         (WebCore::RenderNamedFlowThread::clearRenderObjectCustomStyle):
727         * rendering/RenderNamedFlowThread.h:
728         * rendering/RenderObject.cpp:
729         (WebCore::scheduleRelayoutForSubtree):
730         (WebCore::RenderObject::setLayerNeedsFullRepaint):
731         (WebCore::RenderObject::setLayerNeedsFullRepaintForPositionedMovementLayout):
732         (WebCore::RenderObject::repaintUsingContainer):
733         (WebCore::RenderObject::selectionRoot):
734         (WebCore::RenderObject::shouldUseTransformFromContainer):
735         (WebCore::RenderObject::getTransformFromContainer):
736         (WebCore::RenderObject::isRooted):
737         (WebCore::RenderObject::willBeDestroyed):
738         (WebCore::RenderObject::isComposited):
739         (WebCore::RenderObject::currentRenderNamedFlowFragment):
740         * rendering/RenderObject.h:
741         * rendering/RenderProgress.h:
742         * rendering/RenderRuby.cpp:
743         (WebCore::lastRubyRun):
744         * rendering/RenderRubyBase.cpp:
745         (WebCore::RenderRubyBase::rubyRun):
746         * rendering/RenderRubyRun.cpp:
747         (WebCore::RenderRubyRun::removeChild):
748         * rendering/RenderRubyRun.h:
749         * rendering/RenderSlider.h:
750         * rendering/RenderText.cpp:
751         (WebCore::RenderText::widthFromCache):
752         * rendering/RenderThemeGtk.cpp:
753         (WebCore::RenderThemeGtk::calculateProgressRect):
754         * rendering/RenderThemeIOS.mm:
755         (WebCore::RenderThemeIOS::paintProgressBar):
756         * rendering/RenderThemeMac.mm:
757         (WebCore::RenderThemeMac::paintMeter):
758         (WebCore::RenderThemeMac::paintProgressBar):
759         * rendering/RenderThemeSafari.cpp:
760         (WebCore::RenderThemeSafari::paintMeter):
761         * rendering/RenderThemeWin.cpp:
762         (WebCore::RenderThemeWin::paintMeter):
763         * rendering/RenderTreeAsText.cpp:
764         (WebCore::writeRenderRegionList):
765         (WebCore::writeLayers):
766         * rendering/RenderVideo.h:
767         * rendering/RenderView.cpp:
768         (WebCore::SelectionIterator::checkForSpanner):
769         (WebCore::isComposited):
770         * rendering/RenderView.h:
771         * rendering/RenderWidget.h:
772         * rendering/line/BreakingContextInlineHeaders.h:
773         (WebCore::BreakingContext::handleText):
774         * rendering/line/LineBreaker.cpp:
775         (WebCore::LineBreaker::skipLeadingWhitespace):
776         * testing/Internals.cpp:
777         (WebCore::Internals::isPluginUnavailabilityIndicatorObscured):
778
779 2014-10-19  Chris Dumez  <cdumez@apple.com>
780
781         Use SPECIALIZE_TYPE_TRAITS_*() macro for RenderScrollbar
782         https://bugs.webkit.org/show_bug.cgi?id=137854
783
784         Reviewed by Darin Adler.
785
786         Use SPECIALIZE_TYPE_TRAITS_*() macro for RenderScrollbar instead of a
787         custom toRenderScrollbar() function, for consistency.
788
789         No new tests, no behavior change.
790
791         * rendering/RenderScrollbar.h:
792         (isType):
793         (WebCore::toRenderScrollbar): Deleted.
794         * rendering/RenderScrollbarTheme.cpp:
795         (WebCore::RenderScrollbarTheme::minimumThumbLength):
796         (WebCore::RenderScrollbarTheme::backButtonRect):
797         (WebCore::RenderScrollbarTheme::forwardButtonRect):
798         (WebCore::RenderScrollbarTheme::trackRect):
799         (WebCore::RenderScrollbarTheme::constrainTrackRectToTrackPieces):
800         (WebCore::RenderScrollbarTheme::willPaintScrollbar):
801         (WebCore::RenderScrollbarTheme::didPaintScrollbar):
802         (WebCore::RenderScrollbarTheme::paintScrollbarBackground):
803         (WebCore::RenderScrollbarTheme::paintTrackBackground):
804         (WebCore::RenderScrollbarTheme::paintTrackPiece):
805         (WebCore::RenderScrollbarTheme::paintButton):
806         (WebCore::RenderScrollbarTheme::paintThumb):
807
808 2014-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
809
810         [GTK] Move GtkDragAndDropHelper from Platform to WebKit2
811         https://bugs.webkit.org/show_bug.cgi?id=137422
812
813         Reviewed by Martin Robinson.
814
815         Remove ClipboardUtilitiesGtk and GtkDragAndDropHelper.
816
817         * PlatformGTK.cmake:
818         * platform/gtk/ClipboardUtilitiesGtk.cpp: Removed.
819         * platform/gtk/ClipboardUtilitiesGtk.h: Removed.
820         * platform/gtk/GtkDragAndDropHelper.cpp: Removed.
821         * platform/gtk/GtkDragAndDropHelper.h: Removed.
822
823 2014-10-19  Roger Fong  <roger_fong@apple.com>
824
825         Unreviewed. Style fix following r174855.
826
827         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
828         (WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary):
829
830 2014-10-18  Antti Koivisto  <antti@apple.com>
831
832         REGRESSION (r173356): Safari can't install a profile, gets 'Download Failed error
833         https://bugs.webkit.org/show_bug.cgi?id=137855
834
835         Reviewed by Dan Bernstein.
836
837         We lose the sniffed MIME type for the response when synthesizing an NSURLResponse. Sniffing requires
838         backchannel data that the synthesized response doesn't have.
839
840         Test: http/tests/mime/mime-type-sniff.html
841
842         * platform/network/mac/ResourceResponseMac.mm:
843         (WebCore::ResourceResponse::initNSURLResponse):
844
845             When synthesizing NSURLResponse explicitly set the Content-type header to the sniffed type.
846
847 2014-10-18  Chris Dumez  <cdumez@apple.com>
848
849         [Mac] Use Fast enumeration consistently in WebFontCache.mm
850         https://bugs.webkit.org/show_bug.cgi?id=137791
851
852         Reviewed by Darin Adler.
853
854         Use fast enumeration consistently in WebFontCache.mm as this results in
855         more efficient, concise and safer code.
856
857         No new tests, no behavior change.
858
859         * platform/mac/WebFontCache.mm:
860         (+[WebFontCache getTraits:inFamily:]):
861         Reserve Vector capacity before the loop as we know how many traits we
862         are going to append. Also use uncheckedAppend() for performance.
863
864         (+[WebFontCache internalFontWithFamily:traits:weight:size:]):
865
866 2014-10-18  Chris Fleizach  <cfleizach@apple.com>
867
868         AX: Tables with <colgroups> are not reporting table column headers
869         https://bugs.webkit.org/show_bug.cgi?id=137846
870
871         Reviewed by Mario Sanchez Prada.
872
873         The code to search for header objects was getting stuck on anonymous RenderTableSections.
874         We also need to check more rows for headers, in case the first row or more is not visible or is empty.
875
876         Test: accessibility/table-column-headers-with-captions.html
877
878         * accessibility/AccessibilityTableColumn.cpp:
879         (WebCore::AccessibilityTableColumn::headerObject):
880         (WebCore::AccessibilityTableColumn::headerObjectForSection):
881
882 2014-10-18  KwangHyuk Kim  <hyuki.kim@samsung.com>
883
884         [EFL] build break occurs on webkit efl build.
885         https://bugs.webkit.org/show_bug.cgi?id=137844
886
887         Reviewed by Gyuyoung Kim.
888
889         As local variable elementAddressRegisterIndex is assigned but not used, there is build break for the webkit efl.
890
891         No new tests because it's just to fix build break.
892
893         * cssjit/SelectorCompiler.cpp:
894         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatchesSelectorList):
895
896 2014-10-17  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
897
898         Apply std::unique_ptr to FooFont classes
899         https://bugs.webkit.org/show_bug.cgi?id=137769
900
901         Reviewed by Andreas Kling.
902
903         As a step to use std::unique_ptr, this patch applies std::unique_ptr to Font classes.
904
905         No new tests, no behavior changes.
906
907         * platform/graphics/Font.cpp:
908         (WebCore::retrieveOrAddCachedFontGlyphs):
909         (WebCore::Font::createLayout):
910         * platform/graphics/SimpleFontData.cpp:
911         (WebCore::SimpleFontData::DerivedFontData::create):
912         * platform/graphics/SimpleFontData.h:
913         Remove create() factory function because public ctor and std::make_unique<> can replace it.
914         * platform/graphics/mac/ComplexTextController.cpp:
915         (WebCore::Font::createLayout):
916
917 2014-10-17  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
918
919         Use std::unique_ptr in WebCore/bindings
920         https://bugs.webkit.org/show_bug.cgi?id=137808
921
922         Reviewed by Andreas Kling.
923
924         Clean up PassOwnPtr|OwnPtr in WebCore/bindings by using std::unique_ptr, std::make_unique
925         and WTF::move.
926
927         No new tests, no behavior changes.
928
929         * bindings/generic/ActiveDOMCallback.h:
930         * bindings/js/JSMessageEventCustom.cpp:
931         (WebCore::handleInitMessageEvent):
932         * bindings/js/SerializedScriptValue.cpp:
933         (WebCore::SerializedScriptValue::SerializedScriptValue):
934         (WebCore::SerializedScriptValue::transferArrayBuffers):
935         (WebCore::SerializedScriptValue::create):
936         * bindings/js/SerializedScriptValue.h:
937         * bindings/js/WorkerScriptDebugServer.cpp:
938         (WebCore::WorkerScriptDebugServer::interruptAndRunTask):
939         * bindings/js/WorkerScriptDebugServer.h:
940         * inspector/WorkerDebuggerAgent.cpp:
941         (WebCore::WorkerDebuggerAgent::interruptAndDispatchInspectorCommands):
942
943 2014-10-16  Roger Fong  <roger_fong@apple.com>
944
945         Calling glReadPixels with BGRA format on an NVIDIA machine with an opaque context returns the wrong alpha values.
946         https://bugs.webkit.org/show_bug.cgi?id=137793.
947         <rdar://problem/15408133>
948
949         Reviewed by Dean Jackson.
950
951         This fixes conformance test context/context-attribute-preserve-drawing-buffer.html.
952
953         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
954         (WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary):
955         On an NVIDIA machine, when the context has alpha turned off, call glReadPixels with RGBA format and then convert to RGBA.
956
957 2014-10-17  Chris Dumez  <cdumez@apple.com>
958
959         Use is<>() / downcast<>() for all SVG RenderObjects
960         https://bugs.webkit.org/show_bug.cgi?id=137840
961
962         Reviewed by Benjamin Poulain.
963
964         Use is<>() / downcast<>() for all SVG RenderObjects and clean up the
965         surrounding code.
966
967         No new tests, no behaviro change.
968
969         * accessibility/AccessibilityRenderObject.cpp:
970         (WebCore::AccessibilityRenderObject::supportsPath):
971         (WebCore::AccessibilityRenderObject::elementPath):
972         * page/FrameView.cpp:
973         (WebCore::FrameView::applyOverflowToViewport):
974         (WebCore::FrameView::forceLayoutParentViewIfNeeded):
975         * rendering/RenderLayerFilterInfo.cpp:
976         (WebCore::RenderLayer::FilterInfo::removeReferenceFilterClients):
977         * rendering/svg/RenderSVGGradientStop.cpp:
978         (WebCore::RenderSVGGradientStop::styleDidChange):
979         * rendering/svg/RenderSVGImage.h:
980         * rendering/svg/RenderSVGInlineText.h:
981         * rendering/svg/RenderSVGResourceContainer.cpp:
982         (WebCore::RenderSVGResourceContainer::markAllClientsForInvalidation):
983         * rendering/svg/RenderSVGResourceContainer.h:
984         * rendering/svg/RenderSVGRoot.cpp:
985         (WebCore::RenderSVGRoot::addResourceForClientInvalidation):
986         * rendering/svg/RenderSVGRoot.h:
987         * rendering/svg/RenderSVGShape.h:
988         * rendering/svg/RenderSVGText.cpp:
989         (WebCore::collectLayoutAttributes):
990         (WebCore::RenderSVGText::subtreeChildWillBeRemoved):
991         (WebCore::RenderSVGText::subtreeTextDidChange):
992         (WebCore::updateFontInAllDescendants):
993         * rendering/svg/RenderSVGText.h:
994         * rendering/svg/SVGInlineTextBox.h:
995         * rendering/svg/SVGRenderSupport.cpp:
996         (WebCore::SVGRenderSupport::mapLocalToContainer):
997         (WebCore::SVGRenderSupport::pushMappingToContainer):
998         (WebCore::SVGRenderSupport::computeContainerBoundingBoxes):
999         * rendering/svg/SVGRenderTreeAsText.cpp:
1000         (WebCore::writeStyle):
1001         * rendering/svg/SVGRenderingContext.cpp:
1002         (WebCore::SVGRenderingContext::bufferForeground):
1003         * rendering/svg/SVGResourcesCycleSolver.cpp:
1004         (WebCore::SVGResourcesCycleSolver::resolveCycles):
1005         * rendering/svg/SVGRootInlineBox.cpp:
1006         (WebCore::SVGRootInlineBox::renderSVGText):
1007         (WebCore::SVGRootInlineBox::computePerCharacterLayoutInformation):
1008         * svg/SVGCircleElement.cpp:
1009         (WebCore::SVGCircleElement::svgAttributeChanged):
1010         * svg/SVGElement.cpp:
1011         (WebCore::SVGElement::svgAttributeChanged):
1012         * svg/SVGEllipseElement.cpp:
1013         (WebCore::SVGEllipseElement::svgAttributeChanged):
1014         * svg/SVGImageElement.cpp:
1015         (WebCore::SVGImageElement::svgAttributeChanged):
1016         (WebCore::SVGImageElement::didAttachRenderers):
1017         * svg/SVGLineElement.cpp:
1018         (WebCore::SVGLineElement::svgAttributeChanged):
1019         * svg/SVGPolyElement.cpp:
1020         (WebCore::SVGPolyElement::svgAttributeChanged):
1021         * svg/SVGRectElement.cpp:
1022         (WebCore::SVGRectElement::svgAttributeChanged):
1023         * svg/SVGSVGElement.cpp:
1024         (WebCore::SVGSVGElement::localCoordinateSpaceTransform):
1025         (WebCore::SVGSVGElement::currentViewBoxRect):
1026         * svg/graphics/SVGImage.cpp:
1027         (WebCore::SVGImage::setContainerSize):
1028         (WebCore::SVGImage::containerSize):
1029
1030 2014-10-17  Chris Dumez  <cdumez@apple.com>
1031
1032         Avoid unnecessary isSVGFont() check in SimpleFontData::applyTransforms()
1033         https://bugs.webkit.org/show_bug.cgi?id=137836
1034
1035         Reviewed by Andreas Kling.
1036
1037         Avoid unnecessary isSVGFont() check in SimpleFontData::applyTransforms().
1038         This function is only called from WidthIterator::applyFontTransforms(),
1039         which already makes sure to call applyTransforms() if isSVGFont()
1040         returns false. This patch replaces the check with a simple assertion.
1041
1042         No new tests, no behavior change.
1043
1044         * platform/graphics/SimpleFontData.h:
1045         * svg/SVGFontData.h:
1046
1047 2014-10-17  Michael Saboff  <msaboff@apple.com>
1048
1049         Don't create cached functions that access lexicalGlobalObject()
1050         https://bugs.webkit.org/show_bug.cgi?id=137839
1051
1052         Reviewed by Geoffrey Garen.
1053
1054         Made it so that all the JSDOMWindow special functions blur(), close(), focus() and postMessage()
1055         are always created as needed for every prototype.  Made it so that JSHTMLDocument does
1056         the same for open().  Updated test to account for these methods not being cached
1057
1058         Updated tests accordingly.
1059
1060         * bindings/js/JSDOMWindowCustom.cpp: 
1061         (WebCore::JSDOMWindow::getOwnPropertySlot): Updated to always create cached versions of the
1062         special functions.
1063         * bindings/js/JSHTMLDocumentCustom.cpp:
1064         (WebCore::JSHTMLDocument::getOwnPropertySlot): Added to create an uncached open() method when
1065         it is first accessed.
1066         * html/HTMLDocument.idl: Added CustomGetOwnPropertySlot and implemented it in JSHTMLDocumentCustom.cpp.
1067
1068 2014-10-17  Simon Fraser  <simon.fraser@apple.com>
1069
1070         [iOS] Speculative fix for a crash under RenderLayerCompositor::updateScrollCoordinatedLayer()
1071         https://bugs.webkit.org/show_bug.cgi?id=137837
1072         rdar://problem/18545452
1073
1074         Reviewed by Tim Horton.
1075
1076         Crash logs suggest that an iframe's RenderView's RenderLayer's backing can be null
1077         in a call to updateScrollCoordinatedLayer(), so add an assertion (to help find a reproducible case)
1078         and a null check.
1079
1080         * rendering/RenderLayerCompositor.cpp:
1081         (WebCore::RenderLayerCompositor::attachScrollingNode):
1082
1083 2014-10-17  Andreas Kling  <akling@apple.com>
1084
1085         Re-arrange parentheses for compilation purposes.
1086
1087         * cssjit/SelectorCompiler.cpp:
1088         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatchesSelectorList):
1089
1090 2014-10-17  Andreas Kling  <akling@apple.com>
1091
1092         Unreviewed build fix after r174838.
1093
1094         Use StackAllocator::addressOf() instead of the old way of grabbing at a stack reference.
1095
1096         * cssjit/SelectorCompiler.cpp:
1097         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatchesSelectorList):
1098
1099 2014-10-17  Chris Dumez  <cdumez@apple.com>
1100
1101         Use is<>() / downcast<>() for RenderBox
1102         https://bugs.webkit.org/show_bug.cgi?id=137804
1103
1104         Reviewed by Andreas Kling.
1105
1106         Use is<>() / downcast<>() for RenderBox and clean up the surrounding
1107         code.
1108
1109         No new tests, no behavior change.
1110
1111         * accessibility/AccessibilityRenderObject.cpp:
1112         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
1113         (WebCore::AccessibilityRenderObject::accessibilityHitTest):
1114         (WebCore::AccessibilityRenderObject::getScrollableAreaIfScrollable):
1115         (WebCore::AccessibilityRenderObject::scrollTo):
1116         * bindings/objc/DOMHTML.mm:
1117         (-[DOMHTMLElement scrollYOffset]):
1118         (-[DOMHTMLElement setScrollXOffset:scrollYOffset:adjustForIOSCaret:]):
1119         * bindings/objc/DOMUIKitExtensions.mm:
1120         (-[DOMNode borderRadii]):
1121         * css/CSSComputedStyleDeclaration.cpp:
1122         (WebCore::sizingBox):
1123         (WebCore::computedTransform):
1124         (WebCore::zoomAdjustedPaddingOrMarginPixelValue):
1125         (WebCore::ComputedStyleExtractor::propertyValue):
1126         * dom/ContainerNode.cpp:
1127         (WebCore::ContainerNode::getLowerRightCorner):
1128         * dom/Document.cpp:
1129         (WebCore::Document::webkitWillEnterFullScreenForElement):
1130         * dom/Element.cpp:
1131         (WebCore::Element::scrollByUnits):
1132         * dom/Node.cpp:
1133         (WebCore::Node::defaultEventHandler):
1134         * dom/Position.cpp:
1135         (WebCore::endsOfNodeAreVisuallyDistinctPositions):
1136         * editing/DeleteButtonController.cpp:
1137         (WebCore::isDeletableElement):
1138         * editing/EditorCommand.cpp:
1139         (WebCore::verticalScrollDistance):
1140         * editing/FrameSelection.cpp:
1141         (WebCore::CaretBase::paintCaret):
1142         * editing/TextIterator.cpp:
1143         (WebCore::fullyClipsContents):
1144         (WebCore::shouldEmitExtraNewlineForNode):
1145         * editing/htmlediting.cpp:
1146         (WebCore::absoluteBoundsForLocalCaretRect):
1147         * html/HTMLFormControlElement.cpp:
1148         (WebCore::HTMLFormControlElement::isFocusable):
1149         * html/HTMLPlugInImageElement.cpp:
1150         (WebCore::HTMLPlugInImageElement::checkSizeChangeForSnapshotting):
1151         * html/HTMLSelectElement.cpp:
1152         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
1153         * html/shadow/SliderThumbElement.cpp:
1154         (WebCore::SliderThumbElement::setPositionFromPoint):
1155         * inspector/InspectorOverlay.cpp:
1156         (WebCore::buildObjectForElementInfo):
1157         * page/AutoscrollController.cpp:
1158         (WebCore::AutoscrollController::updateAutoscrollRenderer):
1159         * page/EventHandler.cpp:
1160         (WebCore::EventHandler::startPanScrolling):
1161         * page/FrameView.cpp:
1162         (WebCore::FrameView::embeddedContentBox):
1163         * page/GestureTapHighlighter.cpp:
1164         * page/SpatialNavigation.cpp:
1165         (WebCore::isScrollableNode):
1166         * page/animation/CSSPropertyAnimation.cpp:
1167         (WebCore::blendFunc):
1168         * platform/efl/RenderThemeEfl.cpp:
1169         (WebCore::RenderThemeEfl::baselinePosition):
1170         * plugins/PluginView.cpp:
1171         (WebCore::PluginView::invalidateWindowlessPluginRect):
1172         * rendering/InlineBox.cpp:
1173         (WebCore::InlineBox::logicalHeight):
1174         (WebCore::InlineBox::adjustPosition):
1175         * rendering/InlineElementBox.cpp:
1176         (WebCore::InlineElementBox::deleteLine):
1177         (WebCore::InlineElementBox::extractLine):
1178         (WebCore::InlineElementBox::attachLine):
1179         (WebCore::InlineElementBox::paint):
1180         (WebCore::InlineElementBox::nodeAtPoint):
1181         * rendering/InlineFlowBox.cpp:
1182         (WebCore::InlineFlowBox::addToLine):
1183         (WebCore::InlineFlowBox::addReplacedChildOverflow):
1184         * rendering/LayoutState.cpp:
1185         (WebCore::LayoutState::LayoutState):
1186         * rendering/RenderBlock.cpp:
1187         (WebCore::RenderBlock::simplifiedNormalFlowLayout):
1188         (WebCore::RenderBlock::markFixedPositionObjectForLayoutIfNeeded):
1189         (WebCore::RenderBlock::clearPercentHeightDescendantsFrom):
1190         (WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
1191         (WebCore::RenderBlock::addFocusRingRects):
1192         * rendering/RenderBlockFlow.cpp:
1193         (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
1194         (WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
1195         * rendering/RenderBlockLineLayout.cpp:
1196         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForLine):
1197         (WebCore::RenderBlockFlow::layoutLineBoxes):
1198         * rendering/RenderBox.cpp:
1199         (WebCore::RenderBox::findAutoscrollable):
1200         (WebCore::computeBlockStaticDistance):
1201         (WebCore::RenderBox::positionForPoint):
1202         (WebCore::RenderBox::layoutOverflowRectForPropagation):
1203         * rendering/RenderBox.h:
1204         (WebCore::RenderBox::previousSiblingBox):
1205         (WebCore::RenderBox::nextSiblingBox):
1206         (WebCore::RenderBox::parentBox):
1207         (WebCore::RenderBox::firstChildBox):
1208         (WebCore::RenderBox::lastChildBox):
1209         * rendering/RenderBoxModelObject.cpp:
1210         (WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent):
1211         (WebCore::RenderBoxModelObject::computeStickyPositionConstraints):
1212         (WebCore::RenderBoxModelObject::constrainingRectForStickyPosition):
1213         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
1214         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
1215         * rendering/RenderElement.cpp:
1216         (WebCore::RenderElement::removeChildInternal):
1217         (WebCore::RenderElement::styleWillChange):
1218         (WebCore::RenderElement::repaintAfterLayoutIfNeeded):
1219         * rendering/RenderEmbeddedObject.cpp:
1220         (WebCore::RenderEmbeddedObject::layout):
1221         * rendering/RenderFieldset.cpp:
1222         (WebCore::RenderFieldset::findLegend):
1223         * rendering/RenderFlowThread.cpp:
1224         (WebCore::RenderFlowThread::adjustedPositionRelativeToOffsetParent):
1225         (WebCore::RenderFlowThread::currentActiveRenderBox):
1226         * rendering/RenderFlowThread.h:
1227         * rendering/RenderFullScreen.cpp:
1228         (WebCore::RenderFullScreen::unwrapRenderer):
1229         * rendering/RenderImage.cpp:
1230         (WebCore::RenderImage::layoutShadowControls):
1231         (WebCore::RenderImage::computeIntrinsicRatioInformation):
1232         * rendering/RenderInline.cpp:
1233         (WebCore::RenderInline::absoluteRects):
1234         (WebCore::RenderInline::addFocusRingRects):
1235         * rendering/RenderLayer.cpp:
1236         (WebCore::RenderLayer::updateLayerPosition):
1237         (WebCore::RenderLayer::perspectiveTransform):
1238         (WebCore::RenderLayer::perspectiveOrigin):
1239         (WebCore::parentLayerCrossFrame):
1240         (WebCore::RenderLayer::enclosingScrollableLayer):
1241         (WebCore::RenderLayer::resize):
1242         (WebCore::RenderLayer::scrollsOverflow):
1243         (WebCore::computeReferenceBox):
1244         (WebCore::RenderLayer::calculateClipRects):
1245         * rendering/RenderLayer.h:
1246         * rendering/RenderLayerBacking.cpp:
1247         (WebCore::RenderLayerBacking::updateTransform):
1248         (WebCore::RenderLayerBacking::updateGeometry):
1249         (WebCore::RenderLayerBacking::resetContentsRect):
1250         (WebCore::RenderLayerBacking::positionOverflowControlsLayers):
1251         (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage):
1252         (WebCore::RenderLayerBacking::contentsBox):
1253         (WebCore::RenderLayerBacking::backgroundBoxForPainting):
1254         (WebCore::RenderLayerBacking::startAnimation):
1255         (WebCore::RenderLayerBacking::startTransition):
1256         * rendering/RenderLineBoxList.cpp:
1257         (WebCore::RenderLineBoxList::rangeIntersectsRect):
1258         * rendering/RenderMediaControlElements.cpp:
1259         (WebCore::RenderMediaVolumeSliderContainer::layout):
1260         * rendering/RenderMultiColumnFlowThread.cpp:
1261         (WebCore::RenderMultiColumnFlowThread::firstColumnSetOrSpanner):
1262         (WebCore::RenderMultiColumnFlowThread::nextColumnSetOrSpannerSiblingOf):
1263         (WebCore::RenderMultiColumnFlowThread::previousColumnSetOrSpannerSiblingOf):
1264         (WebCore::RenderMultiColumnFlowThread::resolveMovedChild):
1265         (WebCore::isValidColumnSpanner):
1266         (WebCore::RenderMultiColumnFlowThread::handleSpannerRemoval):
1267         * rendering/RenderNamedFlowThread.cpp:
1268         (WebCore::RenderNamedFlowThread::getRanges):
1269         * rendering/RenderObject.cpp:
1270         (WebCore::RenderObject::computeRectForRepaint):
1271         (WebCore::RenderObject::showRegionsInformation):
1272         (WebCore::RenderObject::showRenderObject):
1273         (WebCore::RenderObject::mapLocalToContainer):
1274         (WebCore::RenderObject::pushMappingToContainer):
1275         (WebCore::RenderObject::mapAbsoluteToLocalPoint):
1276         (WebCore::RenderObject::addAnnotatedRegions):
1277         * rendering/RenderTable.cpp:
1278         (WebCore::RenderTable::nodeAtPoint):
1279         * rendering/RenderTextControlMultiLine.cpp:
1280         (WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild):
1281         * rendering/RenderTheme.cpp:
1282         (WebCore::RenderTheme::baselinePosition):
1283         * rendering/RenderThemeGtk.cpp:
1284         (WebCore::RenderThemeGtk::baselinePosition):
1285         (WebCore::centerRectVerticallyInParentInputElement):
1286         * rendering/RenderThemeIOS.mm:
1287         (WebCore::RenderThemeIOS::baselinePosition):
1288         * rendering/RenderThemeSafari.cpp:
1289         (WebCore::RenderThemeSafari::baselinePosition):
1290         * rendering/RenderThemeWin.cpp:
1291         (WebCore::RenderThemeWin::paintSearchFieldCancelButton):
1292         (WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart):
1293         (WebCore::RenderThemeWin::paintSearchFieldResultsButton):
1294         * rendering/RenderTreeAsText.cpp:
1295         (WebCore::RenderTreeAsText::writeRenderObject):
1296         (WebCore::externalRepresentation):
1297         * rendering/RenderView.cpp:
1298         (WebCore::RenderView::paintBoxDecorations):
1299         * rendering/RootInlineBox.cpp:
1300         (WebCore::RootInlineBox::setLineBreakInfo):
1301         * rendering/line/BreakingContextInlineHeaders.h:
1302         (WebCore::BreakingContext::handleOutOfFlowPositioned):
1303         (WebCore::BreakingContext::handleFloat):
1304         (WebCore::BreakingContext::handleReplaced):
1305         * rendering/line/LineBreaker.cpp:
1306         (WebCore::LineBreaker::skipTrailingWhitespace):
1307         (WebCore::LineBreaker::skipLeadingWhitespace):
1308         * rendering/mathml/RenderMathMLUnderOver.cpp:
1309         (WebCore::RenderMathMLUnderOver::layout):
1310         * svg/graphics/SVGImage.cpp:
1311         (WebCore::SVGImage::embeddedContentBox):
1312
1313 2014-10-17  Andreas Kling  <akling@apple.com>
1314
1315         Get rid of wrapperContext() in DOM bindings.
1316         <https://webkit.org/b/137834>
1317
1318         Reviewed by Chris Dumez.
1319
1320         The "wrapper context" is always the DOMWrapperWorld, and since we're passing that around
1321         already, we don't need a separate mechanism to get at the context.
1322
1323         The context is extra data stored in the DOM object's JSC::Weak (the wrapper GC object.)
1324
1325         * bindings/js/JSDOMBinding.h:
1326         (WebCore::setInlineCachedWrapper):
1327         (WebCore::cacheWrapper):
1328         (WebCore::wrapperContext): Deleted.
1329         * bindings/scripts/CodeGeneratorJS.pm:
1330         (GenerateHeader):
1331
1332 2014-10-17  Benjamin Poulain  <benjamin@webkit.org>
1333
1334         Make a better use of the available registers when compiling nested selector lists
1335         https://bugs.webkit.org/show_bug.cgi?id=137802
1336
1337         Reviewed by Andreas Kling.
1338
1339         Previously, when compiling a nested selector list, the compiler would start by pushing all
1340         the allocated registers to the stack to free them for the compiled selector list.
1341         While neat to ensure register allocation is correct, this is very inefficient.
1342
1343         This patch brings the first step for reducing the overhead. Instead of pushing everything
1344         to the stack, we just push as many registers as we need for compiling the selector list.
1345
1346         In most cases, we have so many registers that we don't even need to push anything to the stack.
1347
1348         Test: fast/selectors/nth-child-of-register-requirement.html
1349
1350         * cssjit/SelectorCompiler.cpp:
1351         Add an explicit type for SelectorList to keep information aggregated from all
1352         SelectorFragmentList inside it.
1353
1354         SelectorFragmentList is also extended to include its register and stack requirements.
1355         This information is then used to create a SelectorList and to compile the SelectorFragmentList.
1356
1357         (WebCore::SelectorCompiler::hasAnyCombinators):
1358         We only change the elementAddressRegister when moving over combinators. This is used to detect
1359         if a selector list clobber the elementAddressRegister or leave it untouched.
1360
1361         (WebCore::SelectorCompiler::computeBacktrackingMemoryRequirements):
1362         (WebCore::SelectorCompiler::computeBacktrackingInformation):
1363         Instead of returning a BacktrackingMemoryRequirements, update the SelectorFragmentList and SelectorList directly.
1364
1365         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatchesSelectorList):
1366         This is where the fun happen.
1367         First step is keep the input untouched. For now it is simply pushed on the stack. This can be improved later.
1368
1369         Then we find how many allocated registers we need to save to compile the input selector list. We push those registers
1370         to the stack and give them back to the register allocator.
1371
1372         With enough registers we can now compile the nested selector list. The code has changed a bit for efficiency. Instead
1373         of creating a shortcut for success case, the code now exit on error and proceed on success. This is the general pattern
1374         of SelectorCompiler and it is quite a bit more efficient in the common cases.
1375
1376         Finally, we reallocate the registers and get their values back from the stack. The "tail" is duplicated but that's fine
1377         because in the vast majority of cases it is 1 or 2 pop.
1378
1379         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
1380         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
1381         * cssjit/StackAllocator.h:
1382         (WebCore::StackAllocator::push):
1383
1384 2014-10-17  Chris Dumez  <cdumez@apple.com>
1385
1386         Use is<>() / downcast<>() for StyleImage
1387         https://bugs.webkit.org/show_bug.cgi?id=137824
1388
1389         Reviewed by Andreas Kling.
1390
1391         Use is<>() / downcast<>() for StyleImage and clean up the surrouding
1392         code.
1393
1394         No new tests, no behavior change.
1395
1396         * css/CSSCursorImageValue.cpp:
1397         (WebCore::CSSCursorImageValue::detachPendingImage):
1398         (WebCore::CSSCursorImageValue::cachedImage):
1399         (WebCore::CSSCursorImageValue::cachedImageURL):
1400         * css/CSSImageSetValue.cpp:
1401         (WebCore::CSSImageSetValue::detachPendingImage):
1402         (WebCore::CSSImageSetValue::~CSSImageSetValue):
1403         (WebCore::CSSImageSetValue::cachedImageSet):
1404         (WebCore::CSSImageSetValue::hasFailedOrCanceledSubresources):
1405         * css/CSSImageValue.cpp:
1406         (WebCore::CSSImageValue::detachPendingImage):
1407         (WebCore::CSSImageValue::cachedImage):
1408         (WebCore::CSSImageValue::hasFailedOrCanceledSubresources):
1409         * css/StyleResolver.cpp:
1410         (WebCore::StyleResolver::loadPendingShapeImage):
1411         (WebCore::StyleResolver::loadPendingImages):
1412         * page/PageSerializer.cpp:
1413         (WebCore::PageSerializer::retrieveResourcesForProperties):
1414         * page/animation/CSSPropertyAnimation.cpp:
1415         (WebCore::blendFunc):
1416         * rendering/style/StyleCachedImage.h:
1417         * rendering/style/StyleCachedImageSet.h:
1418         * rendering/style/StyleGeneratedImage.h:
1419         * rendering/style/StyleImage.h:
1420         * rendering/style/StylePendingImage.h:
1421
1422 2014-10-17  Dean Jackson  <dino@apple.com>
1423
1424         [Media] Always update controls for <audio> since they are always visible
1425         https://bugs.webkit.org/show_bug.cgi?id=137829
1426         <rdar://problem/18693987>
1427
1428         Reviewed by Brent Fulgham.
1429
1430         Revision 174756 made a change to only update the display of the controls
1431         while they are visible. However, <audio> elements didn't detect visibility
1432         the same way, since their controls do not auto-hide.
1433
1434         Change controlsAreHidden to check if we're an audio element.
1435
1436         * Modules/mediacontrols/mediaControlsApple.js:
1437         (Controller.prototype.controlsAreHidden): Audio elements do not auto-hide their controls.
1438
1439 2014-10-17  peavo@outlook.com  <peavo@outlook.com>
1440
1441         [WinCairo] Accelerated compositing is not implemented.
1442         https://bugs.webkit.org/show_bug.cgi?id=137345
1443
1444         Reviewed by Brent Fulgham.
1445
1446         This patch is based on GTK, and the texture mapper graphics layer type.
1447
1448         * WebCore.vcxproj/copyForwardingHeaders.cmd: Copy texmap headers.
1449         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: Added method and flag indicating whether animation has started.
1450         (WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper):
1451         (WebCore::GraphicsLayerTextureMapper::addAnimation):
1452         * platform/graphics/texmap/GraphicsLayerTextureMapper.h: Ditto.
1453         (WebCore::GraphicsLayerTextureMapper::startedAnimation):
1454         * platform/graphics/texmap/TextureMapperShaderProgram.cpp: Use same precision for uniform in vertex shader as in fragment shader.
1455         Otherwise glLinkProgram() will fail, and nothing will be rendered.
1456
1457 2014-10-17  Alexey Proskuryakov  <ap@apple.com>
1458
1459         [iOS] Crash when load is canceled while waiting for the user to type HTTP authentication credentials
1460         https://bugs.webkit.org/show_bug.cgi?id=137826
1461         rdar://problem/17329599
1462
1463         Reviewed by Brady Eidson.
1464
1465         No new tests, as we don't have a way to simulate details of user interaction with
1466         an auth dialog.
1467
1468         * platform/network/cf/ResourceHandleCFNet.cpp:
1469         (WebCore::ResourceHandle::receivedCredential):
1470         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
1471         (WebCore::ResourceHandle::receivedRequestToPerformDefaultHandling):
1472         (WebCore::ResourceHandle::receivedChallengeRejection):
1473         Added null checks before passing m_connection for CFNetwork functions, making this
1474         match what Mac code does when sending a message to a nil receiver.
1475
1476 2014-10-17  Simon Fraser  <simon.fraser@apple.com>
1477
1478         Fix the iOS build.
1479
1480         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
1481         (WebCore::AVTrackPrivateAVFObjCImpl::languageForAVMediaSelectionOption):
1482
1483 2014-10-16  Jer Noble  <jer.noble@apple.com>
1484
1485         [Mac] Represent AVMediaSelectionOptions as AudioTracks
1486         https://bugs.webkit.org/show_bug.cgi?id=137474
1487
1488         Reviewed by Brent Fulgham.
1489
1490         Test: http/tests/media/hls/hls-audio-tracks.html
1491
1492         Support selecting audio "tracks" in HLS streams by exposing AVMediaSelectionOptions
1493         as entries in the video's AudioTrackList.
1494
1495         AVMediaSessionGroups and AVPlayerItems don't have KVO or notifications to track when options
1496         are selected and deselected, so wrap AVMediaSessionGroup and AVMediaSessionOption in C++
1497         wrappers. Each AVMediaSelectionGroup can have only one AVMediaSelectionOption selected at a
1498         time, so the wrapper will take care of answering which AVMediaSelectionOption is currently
1499         selected, as without KVO notifications, asking the AVMediaSelectionGroup directly is
1500         inconsistent. Because setting the selected option multiple times in the same run-loop can
1501         cause flakiness, coalesce calls to setSelectedOption() by setting a one-shot timer to do
1502         the actual selection in the next run-loop.
1503
1504         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h: Added.
1505         (WebCore::MediaSelectionOptionAVFObjC::avMediaSelectionOption):
1506         (WebCore::MediaSelectionOptionAVFObjC::clearGroup): Clear backpointer to group from option.
1507         (WebCore::MediaSelectionGroupAVFObjC::selectedOption): Simple accessor.
1508         (WebCore::MediaSelectionGroupAVFObjC::options):  Simple accessor.
1509         (WebCore::MediaSelectionGroupAVFObjC::avMediaSelectionGroup): Simple accessor.
1510         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm: Added.
1511         (WebCore::MediaSelectionOptionAVFObjC::create): Simple factory method.
1512         (WebCore::MediaSelectionOptionAVFObjC::MediaSelectionOptionAVFObjC): Simple constructor.
1513         (WebCore::MediaSelectionOptionAVFObjC::setSelected): Pass through to MediaSelectionGroupAVFObjC.
1514         (WebCore::MediaSelectionOptionAVFObjC::selected): Ditto.
1515         (WebCore::MediaSelectionOptionAVFObjC::index): Return index of this object in the group's object.
1516         (WebCore::MediaSelectionGroupAVFObjC::create):
1517         (WebCore::MediaSelectionGroupAVFObjC::MediaSelectionGroupAVFObjC):
1518         (WebCore::MediaSelectionGroupAVFObjC::~MediaSelectionGroupAVFObjC):
1519         (WebCore::MediaSelectionGroupAVFObjC::updateOptions): Discover added or removed options.
1520         (WebCore::MediaSelectionGroupAVFObjC::setSelectedOption): Set a one shot timer to coalesce multiple calls.
1521         (WebCore::MediaSelectionGroupAVFObjC::selectionTimerFired): Set the selected AVSelectionOption.
1522
1523         Modify AVTrackPrivateAVFObjCImpl to support both AVPlayerItemTracks and these new
1524         MediaSelectionOptionAVFObjC objects.
1525
1526         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.h:
1527         (WebCore::AVTrackPrivateAVFObjCImpl::mediaSelectionOption): Simple accessor.
1528         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
1529         (WebCore::AVTrackPrivateAVFObjCImpl::AVTrackPrivateAVFObjCImpl):  Simple constructor.
1530         (WebCore::AVTrackPrivateAVFObjCImpl::~AVTrackPrivateAVFObjCImpl): Simple destructor.
1531         (WebCore::AVTrackPrivateAVFObjCImpl::enabled): Use MediaSelectionOptionAVFObjC, if present.
1532         (WebCore::AVTrackPrivateAVFObjCImpl::setEnabled): Ditto.
1533         (WebCore::AVTrackPrivateAVFObjCImpl::audioKind): Ditto.
1534         (WebCore::AVTrackPrivateAVFObjCImpl::videoKind): Ditto.
1535         (WebCore::AVTrackPrivateAVFObjCImpl::index): Ditto.
1536         (WebCore::AVTrackPrivateAVFObjCImpl::id): Ditto.
1537         (WebCore::AVTrackPrivateAVFObjCImpl::label): Ditto.
1538         (WebCore::AVTrackPrivateAVFObjCImpl::language): Ditto.
1539         (WebCore::AVTrackPrivateAVFObjCImpl::languageForAVMediaSelectionOption): Ditto.
1540         (WebCore::AVTrackPrivateAVFObjCImpl::trackID): Ditto.
1541
1542         Allow AudioTrackPrivateAVFObjC and VideoTrackPrivateAVFObjC to be created with
1543         a MediaSelectionOptionAVFObjC.
1544
1545         * platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.h:
1546         (WebCore::AudioTrackPrivateAVFObjC::create): Takes a MediaSelectionOptionAVFObjC.
1547         * platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.mm:
1548         (WebCore::AudioTrackPrivateAVFObjC::AudioTrackPrivateAVFObjC): Simple constructor.
1549         (WebCore::AudioTrackPrivateAVFObjC::setMediaSelectionOption): Create a new AVTrackPrivateAVFObjCImpl.
1550         (WebCore::AudioTrackPrivateAVFObjC::mediaSelectionOption): Simple accessor.
1551         * platform/graphics/avfoundation/objc/VideoTrackPrivateAVFObjC.cpp:
1552         (WebCore::VideoTrackPrivateAVFObjC::VideoTrackPrivateAVFObjC): Simple constructor.
1553         (WebCore::VideoTrackPrivateAVFObjC::setMediaSelectonOption): Create a new AVTrackPrivateAVFObjCImpl.
1554         (WebCore::VideoTrackPrivateAVFObjC::mediaSelectionOption): Simple accessor.
1555         * platform/graphics/avfoundation/objc/VideoTrackPrivateAVFObjC.h:
1556
1557         Because IDs are not necessarily unique across AVPlayerItemTracks and AVMediaSelectionOptions,
1558         use the index of the track or option instead of it's self-declared ID for ordering for the
1559         trackIndex.
1560
1561         * platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.mm:
1562         (WebCore::AudioTrackPrivateAVFObjC::resetPropertiesFromTrack):
1563         * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm:
1564         (WebCore::VideoTrackPrivateMediaSourceAVFObjC::resetPropertiesFromTrack):
1565
1566         Rather than making allowing the AVPlayerItem to automatically select the "best"
1567         AVMediaSelectionOption, select the automatic options when creating the AVPlayerItem
1568         and thereafter allow the users manual selections "stick".
1569
1570         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1571         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1572         (WebCore::MediaPlayerPrivateAVFoundationObjC::ensureAVPlayer):
1573         (WebCore::MediaPlayerPrivateAVFoundationObjC::ensureAVPlayerItem):
1574
1575         Determine whether any MediaSelectionOptionsAVFObjC have been added or removed and send trackChange events accordingly.
1576
1577         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1578         (WebCore::determineChangedTracksFromNewTracksAndOldItems): Added.
1579         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks): Search for updated selection options.
1580         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks): Ditto.
1581         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForAudibleMedia): Return selection group, if available.
1582         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForVisualMedia): Ditto.
1583         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange): Filter out AVPlayerItemTracks without
1584             AVAssetTracks, as these will be represented by MediaSelectionGroupObjCs instead.
1585         
1586         Add new files to project.
1587         * WebCore.xcodeproj/project.pbxproj:
1588
1589 2014-10-17  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
1590
1591         [EFL] window.screen.width returns wrong value if more displays are available
1592         https://bugs.webkit.org/show_bug.cgi?id=137778
1593
1594         Reviewed by Gyuyoung Kim.
1595
1596         ecore_x_screen_size_get() retrieves the size of Ecore_X_Screen, for example,
1597         having two displays of 1680x1050, it will return 3360x1050.
1598
1599         Unlike EFL's MiniBrowser, Firefox and Chrome return screen of the current display.
1600
1601         No new tests. Hardware specific bug including multiple displays.
1602
1603         * platform/efl/PlatformScreenEfl.cpp:
1604         (WebCore::screenRect):
1605         Use ecore's xrandr to determine the screen on which browser window is displayed.
1606
1607 2014-10-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1608
1609         [GLIB] Add API to GMainLoopSource to schedule sources after a delay in microseconds
1610         https://bugs.webkit.org/show_bug.cgi?id=137782
1611
1612         Reviewed by Sergio Villar Senin.
1613
1614         * platform/gtk/SharedTimerGtk.cpp:
1615         (WebCore::setSharedTimerFireInterval): Use microseconds instead of
1616         milliseconds.
1617
1618 2014-10-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1619
1620         [GTK] Move touch events handling from Platform to WebKit2
1621         https://bugs.webkit.org/show_bug.cgi?id=137735
1622
1623         Reviewed by Sergio Villar Senin.
1624
1625         Remove GtkTouchContextHelper.
1626
1627         * PlatformGTK.cmake:
1628         * platform/gtk/GtkTouchContextHelper.cpp: Removed.
1629         * platform/gtk/GtkTouchContextHelper.h: Removed.
1630
1631 2014-10-17  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1632
1633         Remove unused function in WorkerThreadableLoader.h 
1634         https://bugs.webkit.org/show_bug.cgi?id=137811
1635
1636         Reviewed by Csaba Osztrogon√°c.
1637
1638         mainThreadCreateLoader() isn't used anywhere. Even there is no implementation.
1639
1640         * loader/WorkerThreadableLoader.h:
1641
1642 2014-10-15  Yusuke Suzuki  <utatane.tea@gmail.com>
1643
1644         CSS Selectors Level 4: Implement :matches in SelectorChecker
1645         https://bugs.webkit.org/show_bug.cgi?id=137393
1646
1647         Reviewed by Benjamin Poulain.
1648
1649         In this patch, we introduce initial :matches implementation.
1650         In this current implementation, we don't consider pseudo elements.
1651
1652         Test: fast/selectors/querySelector-matches.html
1653
1654         * css/SelectorChecker.cpp:
1655         (WebCore::SelectorChecker::checkOne):
1656
1657 2014-10-16  Yusuke Suzuki  <utatane.tea@gmail.com>
1658
1659         CSS JIT: Introduce StackAllocator::addressOf
1660         https://bugs.webkit.org/show_bug.cgi?id=137771
1661
1662         Reviewed by Benjamin Poulain.
1663
1664         Introduce StackAllocator::addressOf and drop offsetToStackReference, it's too primitive.
1665
1666         * cssjit/SelectorCompiler.cpp:
1667         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
1668         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateParentElementTreeWalker):
1669         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateDirectAdjacentTreeWalker):
1670         (WebCore::SelectorCompiler::SelectorCodeGenerator::loadCheckingContext):
1671         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAdjacentBacktrackingTail):
1672         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateDescendantBacktrackingTail):
1673         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsFirstLink):
1674         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateStoreLastVisitedElement):
1675         * cssjit/StackAllocator.h:
1676         (WebCore::StackAllocator::addressOf):
1677         (WebCore::StackAllocator::offsetToStackReference):
1678
1679 2014-10-16  Alexey Proskuryakov  <ap@apple.com>
1680
1681         REGRESSION (r169024): Undetermined text is not displayed in the search field of Adobe Help Website
1682         https://bugs.webkit.org/show_bug.cgi?id=137679
1683         rdar://problem/18450335
1684
1685         Reviewed by Enrica Casucci.
1686
1687         Test: platform/mac/editing/input/selected-composed-text-painting.html
1688
1689         * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paint): We do not paint
1690         selection beckground for unconfirmed text with underlines, so we should use a regular
1691         style for text painting, as well.
1692
1693 2014-10-16  Chris Dumez  <cdumez@apple.com>
1694
1695         Use is<>() / downcast<>() for BasicShape subclasses
1696         https://bugs.webkit.org/show_bug.cgi?id=137766
1697
1698         Reviewed by Andreas Kling.
1699
1700         Use is<>() / downcast<>() for BasicShape subclasses and clean up the
1701         surrounding code.
1702
1703         No new tests, no behavior change.
1704
1705         * css/BasicShapeFunctions.cpp:
1706         (WebCore::valueForBasicShape):
1707         (WebCore::basicShapeForValue):
1708         * css/BasicShapeFunctions.h:
1709         * css/CSSComputedStyleDeclaration.cpp:
1710         (WebCore::shapePropertyValue):
1711         * page/animation/CSSPropertyAnimation.cpp:
1712         (WebCore::blendFunc):
1713         * rendering/ClipPathOperation.h:
1714         (WebCore::ShapeClipPathOperation::create):
1715         Take a PassRef<BasicShape> in argument to make it obvious it is never
1716         null.
1717
1718         (WebCore::ShapeClipPathOperation::basicShape):
1719         Return a reference instead of a pointer as it can never return null.
1720
1721         (WebCore::ShapeClipPathOperation::windRule):
1722         (WebCore::ShapeClipPathOperation::pathForReferenceRect):
1723         Make it non-const due to the const-correctness of Ref::get().
1724
1725         (WebCore::ShapeClipPathOperation::ShapeClipPathOperation):
1726         * rendering/RenderBlock.cpp:
1727         (WebCore::RenderBlock::nodeAtPoint):
1728         * rendering/RenderLayer.cpp:
1729         (WebCore::RenderLayer::setupClipPath):
1730         * rendering/shapes/Shape.cpp:
1731         (WebCore::Shape::createShape):
1732         * rendering/shapes/Shape.h:
1733         * rendering/shapes/ShapeOutsideInfo.cpp:
1734         (WebCore::ShapeOutsideInfo::computedShape):
1735         * rendering/style/BasicShapes.cpp:
1736         (WebCore::BasicShape::canBlend):
1737         (WebCore::BasicShapeCircle::blend):
1738         (WebCore::BasicShapeEllipse::blend):
1739         (WebCore::BasicShapePolygon::blend):
1740         (WebCore::BasicShapeInset::blend):
1741         * rendering/style/BasicShapes.h:
1742         * rendering/svg/SVGRenderingContext.cpp:
1743         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
1744
1745 2014-10-16  Chris Dumez  <cdumez@apple.com>
1746
1747         Leverage the new RenderElement::m_isCSSAnimating flag in more places
1748         https://bugs.webkit.org/show_bug.cgi?id=137786
1749
1750         Reviewed by Simon Fraser.
1751
1752         Leverage the new RenderElement::m_isCSSAnimating flag that was introduced
1753         in r174703 in more places, for performance. This avoids doing extra work
1754         for renderers on which we are not running animations on. This patch also
1755         updates the API a bit to use more references instead of pointers, making
1756         it clear the RenderElement cannot be null and thus avoiding unnecessary
1757         null checks.
1758
1759         No new tests, no behavior change.
1760
1761         * css/CSSComputedStyleDeclaration.cpp:
1762         (WebCore::computeRenderStyleForProperty):
1763         * page/animation/AnimationController.cpp:
1764         (WebCore::AnimationControllerPrivate::ensureCompositeAnimation):
1765         (WebCore::AnimationControllerPrivate::clear):
1766         (WebCore::AnimationControllerPrivate::updateAnimationTimerForRenderer):
1767         (WebCore::AnimationControllerPrivate::isRunningAnimationOnRenderer):
1768         (WebCore::AnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer):
1769         (WebCore::AnimationControllerPrivate::pauseAnimationAtTime):
1770         (WebCore::AnimationControllerPrivate::pauseTransitionAtTime):
1771         (WebCore::AnimationControllerPrivate::getAnimatedStyleForRenderer):
1772         (WebCore::AnimationController::cancelAnimations):
1773         (WebCore::AnimationController::updateAnimations):
1774         (WebCore::AnimationController::getAnimatedStyleForRenderer):
1775         (WebCore::AnimationController::notifyAnimationStarted):
1776         (WebCore::AnimationController::isRunningAnimationOnRenderer):
1777         (WebCore::AnimationController::isRunningAcceleratedAnimationOnRenderer):
1778         * page/animation/AnimationController.h:
1779         * page/animation/AnimationControllerPrivate.h:
1780         * rendering/RenderElement.cpp:
1781         (WebCore::RenderElement::willBeDestroyed):
1782         * rendering/RenderLayer.cpp:
1783         (WebCore::RenderLayer::currentTransform):
1784         * rendering/RenderLayerBacking.cpp:
1785         (WebCore::RenderLayerBacking::updateGeometry):
1786         (WebCore::RenderLayerBacking::notifyAnimationStarted):
1787         * rendering/RenderLayerCompositor.cpp:
1788         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
1789         (WebCore::RenderLayerCompositor::isRunningAcceleratedTransformAnimation):
1790
1791 2014-10-16  Adrien Destugues  <pulkomandy@gmail.com>
1792
1793         Missing RefPtr.release() calls in TextureMapper
1794         https://bugs.webkit.org/show_bug.cgi?id=137777
1795
1796         Reviewed by Chris Dumez.
1797
1798         No new tests: no functional change, cleanup/optimization.
1799
1800         Avoids useless ref/deref cycle when returning from functions.
1801
1802         * platform/graphics/texmap/TextureMapper.cpp:
1803         (WebCore::TextureMapper::acquireTextureFromPool):
1804         * platform/graphics/texmap/TextureMapperLayer.cpp:
1805         (WebCore::TextureMapperLayer::paintIntoSurface):
1806
1807 2014-10-16  Chris Dumez  <cdumez@apple.com>
1808
1809         Use is<>() / downcast<>() for ContentData subclasses
1810         https://bugs.webkit.org/show_bug.cgi?id=137768
1811
1812         Reviewed by Andreas Kling.
1813
1814         Use is<>() / downcast<>() for ContentData subclasses.
1815
1816         No new tests, no behavior change.
1817
1818         * css/CSSComputedStyleDeclaration.cpp:
1819         (WebCore::contentToCSSValue):
1820         * css/StyleResolver.cpp:
1821         (WebCore::StyleResolver::loadPendingImages):
1822         * rendering/RenderElement.cpp:
1823         (WebCore::RenderElement::createFor):
1824         * rendering/style/ContentData.h:
1825         (WebCore::operator==):
1826         * rendering/style/RenderStyle.cpp:
1827         (WebCore::RenderStyle::setContent):
1828
1829 2014-10-16  Commit Queue  <commit-queue@webkit.org>
1830
1831         Unreviewed, rolling out r174744.
1832         https://bugs.webkit.org/show_bug.cgi?id=137790
1833
1834         Caused another WebGL conformance test to fail (Requested by
1835         rfong on #webkit).
1836
1837         Reverted changeset:
1838
1839         "glReadPixels on NVIDIA cards returns the wrong values for the
1840         alpha channel when alpha is off."
1841         https://bugs.webkit.org/show_bug.cgi?id=137752
1842         http://trac.webkit.org/changeset/174744
1843
1844 2014-10-16  Tim Horton  <timothy_horton@apple.com>
1845
1846         Implement selection services menu for Legacy WebKit
1847         https://bugs.webkit.org/show_bug.cgi?id=137582
1848         <rdar://problem/18604241>
1849
1850         Reviewed by Brady Eidson.
1851
1852         * WebCore.exp.in:
1853         * editing/Editor.h:
1854         * editing/ios/EditorIOS.mm:
1855         (WebCore::Editor::replaceSelectionWithAttributedString):
1856         * editing/mac/EditorMac.mm:
1857         (WebCore::Editor::replaceSelectionWithAttributedString):
1858         Add replaceSelectionWithAttributedString, which replaces the selection
1859         with the given attributed string (converting to plain text if the destination
1860         is not richly editable).
1861
1862 2014-10-16  Alexey Proskuryakov  <ap@apple.com>
1863
1864         Crashes in ResourceHandleCFURLConnectionDelegateWithOperationQueue due to unimplemented retain/release
1865         https://bugs.webkit.org/show_bug.cgi?id=137779
1866         rdar://problem/18679320
1867
1868         Reviewed by Brady Eidson.
1869
1870         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
1871         (WebCore::ResourceHandleCFURLConnectionDelegate::retain):
1872         (WebCore::ResourceHandleCFURLConnectionDelegate::release):
1873         (WebCore::ResourceHandleCFURLConnectionDelegate::makeConnectionClient):
1874         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
1875         Implemented retain/release. They are necessary, as ResourceHandle goes away when
1876         it's canceled, and there is noone else to keep the client object alive but
1877         CFURLConnection itself.
1878
1879         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1880         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
1881         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
1882         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
1883         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
1884         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFail):
1885         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
1886         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveChallenge):
1887         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData):
1888         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
1889         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveDataArray):
1890         Added a FIXME about potential improvements that I spotted while invsestigating this.
1891
1892 2014-10-15  Andrei Bucur  <abucur@adobe.com>
1893
1894         ASSERTION  FAILED in WebCore::RenderFlowThread::getRegionRangeForBox
1895         https://bugs.webkit.org/show_bug.cgi?id=135563
1896
1897         Reviewed by David Hyatt.
1898
1899         The new multi-column code doesn't work correctly when the document contains nested fragmentation
1900         contexts. The problem is the current flow thread concept that can store only one RenderFlowThread
1901         at a time and use it during layout.
1902
1903         The stored flow thread is always correct for regions because named flow threads are absolutley positioned
1904         so every child renderer is contained inside them (with the expcetion of fixed positioned elements which are
1905         treated separately).
1906
1907         For multi-column elements this is no longer the case. An absolutely positioned element inside a static
1908         multi-column element will be contained by a block outside the fragmentation context. It can even be
1909         contained by a different multi-column element in the case of nested flow threads.
1910
1911         The patch below explores a solution that's not based on a current flow thread stored globally. The proposed
1912         patch makes every block to store a pointer to its fragmentation context and a flag that states if this pointer
1913         needs to be updated or not. If the renderer is not a block it will get its flow thread from the containing
1914         block. Once the containing flow thread is requested for the block, the pointer is computed and cached until
1915         invalidated:
1916         - when a subtree is removed from a flow thread
1917         - when the position property of an element inside a flow thread changes
1918
1919         The process is recursive and it doesn't affect elements that are not nested inside a flow thread. If a block
1920         changes position from relative to static, any element that was contained by it can only be contained by an
1921         ancestor of the block. This ancestor will still be outside of any flow thread. This ensures that non-fragmentation
1922         code is not affected from a performance perspective.
1923
1924         The patch affects the results of the performance tests:
1925         - the regions layout tests have a decreased performance raging from 2% to 5-6%
1926         - the regions selection tests have an increased performance raging from 1-2% to 10%
1927         - the multicolumn layout tests (now pending review in b137687) have an increased performance
1928         raging from 1.8% to 5%
1929
1930         Tests: fast/multicol/multicol-all-positioned-crash.html
1931                fast/multicol/multicol-transform-containing-block.html
1932
1933         * rendering/FlowThreadController.cpp:
1934         (WebCore::FlowThreadController::FlowThreadController):
1935         * rendering/FlowThreadController.h:
1936         (WebCore::FlowThreadController::currentRenderFlowThread): Deleted.
1937         (WebCore::FlowThreadController::setCurrentRenderFlowThread): Deleted.
1938         * rendering/LayoutState.h:
1939         (WebCore::LayoutState::currentRenderFlowThread):
1940         (WebCore::LayoutState::setCurrentRenderFlowThread):
1941         * rendering/RenderBlock.cpp:
1942         (WebCore::RenderBlockRareData::RenderBlockRareData):
1943         (WebCore::RenderBlock::styleWillChange):
1944         (WebCore::RenderBlock::styleDidChange):
1945         (WebCore::RenderBlock::collapseAnonymousBoxChild):
1946         (WebCore::RenderBlock::cachedFlowThreadContainingBlock):
1947         (WebCore::RenderBlock::cachedFlowThreadContainingBlockNeedsUpdate):
1948         (WebCore::RenderBlock::setCachedFlowThreadContainingBlockNeedsUpdate):
1949         (WebCore::RenderBlock::updateCachedFlowThreadContainingBlock):
1950         (WebCore::RenderBlock::locateFlowThreadContainingBlock):
1951         * rendering/RenderBlock.h:
1952         * rendering/RenderBlockFlow.cpp:
1953         (WebCore::RenderBlockFlow::styleWillChange):
1954         * rendering/RenderBox.cpp:
1955         (WebCore::RenderBox::borderBoxRectInRegion):
1956         * rendering/RenderFlowThread.cpp:
1957         (WebCore::RenderFlowThread::layout):
1958         (WebCore::RenderFlowThread::updateAllLayerToRegionMappings):
1959         (WebCore::RenderFlowThread::repaintRectangleInRegions):
1960         (WebCore::CurrentRenderFlowThreadMaintainer::CurrentRenderFlowThreadMaintainer): Deleted.
1961         (WebCore::CurrentRenderFlowThreadMaintainer::~CurrentRenderFlowThreadMaintainer): Deleted.
1962         (WebCore::CurrentRenderFlowThreadDisabler::CurrentRenderFlowThreadDisabler): Deleted.
1963         (WebCore::CurrentRenderFlowThreadDisabler::~CurrentRenderFlowThreadDisabler): Deleted.
1964         * rendering/RenderFlowThread.h:
1965         * rendering/RenderLayer.cpp:
1966         (WebCore::RenderLayer::paintLayer):
1967         (WebCore::RenderLayer::hitTestLayer):
1968         (WebCore::RenderLayer::mapLayerClipRectsToFragmentationLayer):
1969         (WebCore::RenderLayer::calculateClipRects):
1970         * rendering/RenderObject.cpp:
1971         (WebCore::RenderObject::showRegionsInformation):
1972         (WebCore::RenderObject::insertedIntoTree):
1973         (WebCore::RenderObject::removeFromRenderFlowThread):
1974         (WebCore::RenderObject::removeFromRenderFlowThreadIncludingDescendants):
1975         (WebCore::RenderObject::invalidateFlowThreadContainingBlockIncludingDescendants):
1976         (WebCore::RenderObject::currentRenderNamedFlowFragment):
1977         (WebCore::RenderObject::locateFlowThreadContainingBlock):
1978         (WebCore::RenderObject::locateFlowThreadContainingBlockNoCache): Deleted.
1979         (WebCore::RenderObject::removeFromRenderFlowThreadRecursive): Deleted.
1980         * rendering/RenderObject.h:
1981         (WebCore::RenderObject::flowThreadContainingBlock):
1982         * rendering/RenderRegion.cpp:
1983         (WebCore::RenderRegion::computeOverflowFromFlowThread):
1984         * rendering/RenderView.cpp:
1985         (WebCore::RenderView::pushLayoutStateForCurrentFlowThread):
1986         (WebCore::RenderView::popLayoutStateForCurrentFlowThread):
1987         * rendering/RenderView.h:
1988
1989 2014-10-15  Chris Dumez  <cdumez@apple.com>
1990
1991         Use is<>() / downcast<>() for list-related render objects
1992         https://bugs.webkit.org/show_bug.cgi?id=137764
1993
1994         Reviewed by Benjamin Poulain.
1995
1996         Use is<>() / downcast<>() for list-related render objects and clean up
1997         the surrounding code.
1998
1999         No new tests, no behavior change.
2000
2001         * accessibility/AccessibilityListBox.cpp:
2002         (WebCore::AccessibilityListBox::visibleChildren):
2003         (WebCore::AccessibilityListBox::elementAccessibilityHitTest):
2004         * accessibility/AccessibilityListBoxOption.cpp:
2005         (WebCore::AccessibilityListBoxOption::elementRect):
2006         * accessibility/AccessibilityObject.cpp:
2007         (WebCore::renderListItemContainerForNode):
2008         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
2009         (getRangeLengthForObject):
2010         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
2011         (accessibilityObjectLength):
2012         (offsetAdjustmentForListItem):
2013         (webkitAccessibleTextGetText):
2014         * editing/BreakBlockquoteCommand.cpp:
2015         (WebCore::BreakBlockquoteCommand::doApply):
2016         * html/HTMLLIElement.cpp:
2017         (WebCore::HTMLLIElement::didAttachRenderers):
2018         (WebCore::HTMLLIElement::parseValue):
2019         * html/HTMLSelectElement.cpp:
2020         (WebCore::HTMLSelectElement::nextSelectableListIndexPageAway):
2021         (WebCore::HTMLSelectElement::scrollToSelection):
2022         (WebCore::HTMLSelectElement::setOptionsChangedOnRenderer):
2023         (WebCore::HTMLSelectElement::selectOption):
2024         (WebCore::HTMLSelectElement::platformHandleKeydownEvent):
2025         (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
2026         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
2027         * html/HTMLSelectElementWin.cpp:
2028         (WebCore::HTMLSelectElement::platformHandleKeydownEvent):
2029         * page/mac/EventHandlerMac.mm:
2030         (WebCore::EventHandler::platformPrepareForWheelEvents):
2031         * rendering/InlineFlowBox.cpp:
2032         (WebCore::InlineFlowBox::addToLine):
2033         (WebCore::InlineFlowBox::placeBoxRangeInInlineDirection):
2034         * rendering/RenderCounter.cpp:
2035         (WebCore::planCounter):
2036         * rendering/RenderListBox.h:
2037         * rendering/RenderListItem.cpp:
2038         (WebCore::nextListItem):
2039         (WebCore::previousListItem):
2040         * rendering/RenderListItem.h:
2041         * rendering/RenderListMarker.h:
2042         * rendering/RenderMenuList.h:
2043         * rendering/RenderTreeAsText.cpp:
2044         (WebCore::markerTextForListItem):
2045         * rendering/TextAutoSizing.cpp:
2046         (WebCore::TextAutoSizingValue::adjustNodeSizes):
2047         * rendering/line/BreakingContextInlineHeaders.h:
2048         (WebCore::BreakingContext::handleReplaced):
2049         (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
2050         * testing/Internals.cpp:
2051         (WebCore::Internals::isSelectPopupVisible):
2052
2053 2014-10-15  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2054
2055         Use std::unique_ptr for CachedResource
2056         https://bugs.webkit.org/show_bug.cgi?id=137736
2057
2058         Reviewed by Darin Adler.
2059
2060         No new tests, no behavior change.
2061
2062         * loader/cache/CachedResource.cpp: Use std::unique_ptr instead of PassOwnPtr|OwnPtr.
2063         (WebCore::CachedResource::removeClient):
2064         * loader/cache/CachedResource.h: Set ctor from private to public.
2065         (WebCore::CachedResource::CachedResourceCallback::schedule):
2066
2067 2014-10-15  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2068
2069         Move TextCodec classes to std::unique_ptr
2070         https://bugs.webkit.org/show_bug.cgi?id=137738
2071
2072         Reviewed by Darin Adler.
2073
2074         Replace uses of PassOwnPtr in code under TextCodecFoo class with std::unique_ptr.
2075         To do this, ctor of TextCodecFoo classes is changed from private to public. Besides
2076         related classes follow this change as well.
2077
2078         No new tests, no behavior change.
2079
2080         * html/parser/HTMLMetaCharsetParser.h:
2081         * loader/TextResourceDecoder.cpp:
2082         (WebCore::TextResourceDecoder::setEncoding):
2083         (WebCore::TextResourceDecoder::flush):
2084         * loader/TextResourceDecoder.h:
2085         * platform/text/TextCodec.h:
2086         * platform/text/TextCodecICU.cpp:
2087         (WebCore::TextCodecICU::create):
2088         * platform/text/TextCodecICU.h:
2089         * platform/text/TextCodecLatin1.cpp:
2090         (WebCore::newStreamingTextDecoderWindowsLatin1):
2091         * platform/text/TextCodecUTF16.cpp:
2092         (WebCore::newStreamingTextDecoderUTF16LE):
2093         (WebCore::newStreamingTextDecoderUTF16BE):
2094         * platform/text/TextCodecUTF8.cpp:
2095         (WebCore::TextCodecUTF8::create):
2096         * platform/text/TextCodecUTF8.h:
2097         * platform/text/TextCodecUserDefined.cpp:
2098         (WebCore::newStreamingTextDecoderUserDefined):
2099         * platform/text/TextEncodingRegistry.cpp:
2100         (WebCore::newTextCodec):
2101         * platform/text/TextEncodingRegistry.h:
2102         * platform/text/mac/TextCodecMac.cpp:
2103         (WebCore::newTextCodecMac):
2104
2105 2014-10-15  Dean Jackson  <dino@apple.com>
2106
2107         [Media] Reduce style updates (painting) in controls
2108         https://bugs.webkit.org/show_bug.cgi?id=137763
2109         <rdar://problem/17833045>
2110
2111         Reviewed by Simon Fraser.
2112
2113         Media controls were causing a lot of repaints they were
2114         constantly updating the style of the widgets, the value
2115         of the forms, or the text in the display.
2116
2117         This is necessary when the controls are visible, but not
2118         necessary when they are hidden. Return immediately in that case.
2119
2120         * Modules/mediacontrols/mediaControlsApple.js:
2121         (Controller.prototype.createControls): Initialise the slider to a zero value.
2122         (Controller.prototype.handleDurationChange): Force an update even though we might be hidden.
2123         (Controller.prototype.updateProgress): Don't update if we're hidden.
2124         (Controller.prototype.updateTime): Ditto.
2125         * Modules/mediacontrols/mediaControlsiOS.js:
2126         (ControllerIOS.prototype.updateProgress): Ditto.
2127
2128 2014-10-15  Chris Dumez  <cdumez@apple.com>
2129
2130         [Mac] Fix inefficiencies in ResourceResponse::platformLazyInit(InitLevel) - Part 2
2131         https://bugs.webkit.org/show_bug.cgi?id=137721
2132
2133         Reviewed by Darin Adler.
2134
2135         Follow-up patch to r174717 addressing review comments made after the patch landed:
2136         - Use modern C++ loop
2137         - Remove explicit calls to String(NSString*) constructor
2138
2139         No new tests, no new tests.
2140
2141         * platform/network/mac/ResourceResponseMac.mm:
2142         (WebCore::ResourceResponse::platformLazyInit):
2143
2144 2014-10-15  Chris Dumez  <cdumez@apple.com>
2145
2146         Use is<>() / downcast<>() for InlineBox subclasses
2147         https://bugs.webkit.org/show_bug.cgi?id=137749
2148
2149         Reviewed by Darin Adler.
2150
2151         Use is<>() / downcast<>() for InlineBox subclasses and clean up the
2152         surrounding code.
2153
2154         No new tests, no behavior change.
2155
2156         * dom/Position.cpp:
2157         (WebCore::Position::upstream):
2158         (WebCore::Position::downstream):
2159         * editing/VisibleUnits.cpp:
2160         (WebCore::wordBreakIteratorForMinOffsetBoundary):
2161         (WebCore::wordBreakIteratorForMaxOffsetBoundary):
2162         (WebCore::visualWordPosition):
2163         (WebCore::startPositionForLine):
2164         (WebCore::endPositionForLine):
2165         * rendering/InlineBox.cpp:
2166         (WebCore::InlineBox::root):
2167         (WebCore::InlineBox::nextLeafChild):
2168         (WebCore::InlineBox::prevLeafChild):
2169         (WebCore::InlineBox::nextLeafChildIgnoringLineBreak):
2170         * rendering/InlineBox.h:
2171         * rendering/InlineElementBox.h:
2172         * rendering/InlineFlowBox.cpp:
2173         (WebCore::InlineFlowBox::getFlowSpacingLogicalWidth):
2174         (WebCore::InlineFlowBox::addToLine):
2175         (WebCore::InlineFlowBox::determineSpacingForFlowBoxes):
2176         (WebCore::InlineFlowBox::placeBoxRangeInInlineDirection):
2177         (WebCore::InlineFlowBox::requiresIdeographicBaseline):
2178         (WebCore::InlineFlowBox::adjustMaxAscentAndDescent):
2179         (WebCore::InlineFlowBox::computeLogicalBoxHeights):
2180         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
2181         (WebCore::InlineFlowBox::computeMaxLogicalTop):
2182         (WebCore::InlineFlowBox::flipLinesInBlockDirection):
2183         (WebCore::InlineFlowBox::computeOverflow):
2184         (WebCore::InlineFlowBox::firstLeafChild):
2185         (WebCore::InlineFlowBox::lastLeafChild):
2186         (WebCore::InlineFlowBox::computeOverAnnotationAdjustment):
2187         (WebCore::InlineFlowBox::computeUnderAnnotationAdjustment):
2188         * rendering/InlineFlowBox.h:
2189         * rendering/InlineTextBox.h:
2190         * rendering/RenderBlockFlow.cpp:
2191         (WebCore::RenderBlockFlow::positionForBox):
2192         * rendering/RenderBlockFlow.h:
2193         (WebCore::RenderBlockFlow::firstRootBox):
2194         (WebCore::RenderBlockFlow::lastRootBox):
2195         * rendering/RenderBlockLineLayout.cpp:
2196         (WebCore::RenderBlockFlow::createLineBoxes):
2197         (WebCore::RenderBlockFlow::constructLine):
2198         (WebCore::setLogicalWidthForTextRun):
2199         (WebCore::computeExpansionForJustifiedText):
2200         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
2201         (WebCore::RenderBlockFlow::computeBlockDirectionPositionsForLine):
2202         (WebCore::RenderBlockFlow::createLineBoxesFromBidiRuns):
2203         * rendering/RenderText.cpp:
2204         (WebCore::RenderText::localCaretRect):
2205         * rendering/RootInlineBox.cpp:
2206         (WebCore::RootInlineBox::isHyphenated):
2207         (WebCore::RootInlineBox::ascentAndDescentForBox):
2208         * rendering/RootInlineBox.h:
2209         (WebCore::RootInlineBox::nextRootBox):
2210         (WebCore::RootInlineBox::prevRootBox):
2211         * rendering/svg/RenderSVGInlineText.cpp:
2212         (WebCore::RenderSVGInlineText::localCaretRect):
2213         (WebCore::RenderSVGInlineText::positionForPoint):
2214         * rendering/svg/RenderSVGText.cpp:
2215         (WebCore::RenderSVGText::positionForPoint):
2216         * rendering/svg/SVGInlineFlowBox.cpp:
2217         (WebCore::SVGInlineFlowBox::paintSelectionBackground):
2218         (WebCore::SVGInlineFlowBox::paint):
2219         (WebCore::SVGInlineFlowBox::computeTextMatchMarkerRectForRenderer):
2220         * rendering/svg/SVGInlineFlowBox.h:
2221         * rendering/svg/SVGInlineTextBox.h:
2222         * rendering/svg/SVGRenderTreeAsText.cpp:
2223         (WebCore::writeRenderSVGTextBox):
2224         (WebCore::writeSVGInlineTextBoxes):
2225         * rendering/svg/SVGRootInlineBox.cpp:
2226         (WebCore::SVGRootInlineBox::paint):
2227         (WebCore::SVGRootInlineBox::layoutCharactersInTextBoxes):
2228         (WebCore::SVGRootInlineBox::layoutChildBoxes):
2229         (WebCore::reverseInlineBoxRangeAndValueListsIfNeeded):
2230         * rendering/svg/SVGRootInlineBox.h:
2231         * rendering/svg/SVGTextQuery.cpp:
2232         (WebCore::SVGTextQuery::collectTextBoxesInFlowBox):
2233
2234 2014-10-15  Roger Fong  <roger_fong@apple.com>
2235
2236         glReadPixels on NVIDIA cards returns the wrong values for the alpha channel when alpha is off.
2237         https://bugs.webkit.org/show_bug.cgi?id=137752.
2238         <rdar://problem/15408133>
2239
2240         Reviewed by Brent Fulgham.
2241
2242         This change fixed the 1.0.2 conformance test: context/context-attribute-preserve-drawing-buffer.html
2243
2244         * platform/graphics/GraphicsContext3D.h:
2245         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
2246         Manually set the alpha channel to 255 when alpha is off on the rendering context.
2247
2248 2014-10-13  Chris Fleizach  <cfleizach@apple.com>
2249
2250         AX: Going back is broken for VoiceOver
2251         https://bugs.webkit.org/show_bug.cgi?id=137382
2252
2253         Reviewed by Darin Adler.
2254
2255         There were two issues preventing VoiceOver from navigating when using page history to go back/forward.
2256           1) Existing AXLoadComplete does not get fired when you just move through page history. 
2257                There were existing frameLoad notifications used by GTK. I think we should use those which seem more reliable.
2258           2) The AccessibilityScrollView cached its children, but on some history page loads, that cache was never cleared out.
2259                Rather than trying to find those places to clear out the cache, it's easier to just add the elements to the children
2260                array everytime it's asked for. Since there's only ever 3 elements (web area + 2 scroll bars) this should not be a performance hit.
2261
2262         Tests are not possible since they require monitoring notifications across multiple page loads.
2263
2264         * accessibility/AXObjectCache.h:
2265         * accessibility/AccessibilityScrollView.cpp:
2266         (WebCore::AccessibilityScrollView::updateChildrenIfNecessary):
2267         * accessibility/ios/AXObjectCacheIOS.mm:
2268         (WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
2269         * accessibility/mac/AXObjectCacheMac.mm:
2270         (WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
2271         * dom/Document.cpp:
2272         (WebCore::Document::implicitClose):
2273
2274 2014-10-15  Simon Fraser  <simon.fraser@apple.com>
2275
2276         Sometimes can't scroll overflow:scroll areas in subframes
2277         https://bugs.webkit.org/show_bug.cgi?id=137746
2278         rdar://problem/18603560
2279
2280         Reviewed by Tim Horton.
2281         
2282         r169733 introduced a regression which caused us to no longer update the non-fast
2283         scrollable region on every layout in subframes, by adding a bogus isMainFrame() check.
2284         Revert to the previous code.
2285
2286         Test: platform/mac-wk2/tiled-drawing/scrolling/frames/scroll-region-after-frame-layout.html
2287
2288         * page/scrolling/AsyncScrollingCoordinator.cpp:
2289         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
2290
2291 2014-10-15  Chris Dumez  <cdumez@apple.com>
2292
2293         Use is<>() / downcast<>() for TransformOperation subclasses
2294         https://bugs.webkit.org/show_bug.cgi?id=137731
2295
2296         Reviewed by Darin Adler.
2297
2298         Use is<>() / downcast<>() for TransformOperation subclasses and clean
2299         up the surrounding code.
2300
2301         No new tests, no behavior change.
2302
2303         * platform/graphics/GraphicsLayer.cpp:
2304         (WebCore::GraphicsLayer::validateTransformOperations):
2305         * platform/graphics/ca/GraphicsLayerCA.cpp:
2306         (WebCore::getTransformFunctionValue):
2307         * platform/graphics/transforms/IdentityTransformOperation.h:
2308         * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
2309         (WebCore::Matrix3DTransformOperation::operator==):
2310         * platform/graphics/transforms/Matrix3DTransformOperation.h:
2311         * platform/graphics/transforms/MatrixTransformOperation.cpp:
2312         (WebCore::MatrixTransformOperation::operator==):
2313         (WebCore::MatrixTransformOperation::blend):
2314         * platform/graphics/transforms/MatrixTransformOperation.h:
2315         * platform/graphics/transforms/PerspectiveTransformOperation.cpp:
2316         (WebCore::PerspectiveTransformOperation::operator==):
2317         (WebCore::PerspectiveTransformOperation::blend):
2318         * platform/graphics/transforms/PerspectiveTransformOperation.h:
2319         * platform/graphics/transforms/RotateTransformOperation.cpp:
2320         (WebCore::RotateTransformOperation::operator==):
2321         (WebCore::RotateTransformOperation::blend):
2322         * platform/graphics/transforms/RotateTransformOperation.h:
2323         * platform/graphics/transforms/ScaleTransformOperation.cpp:
2324         (WebCore::ScaleTransformOperation::operator==):
2325         (WebCore::ScaleTransformOperation::blend):
2326         * platform/graphics/transforms/ScaleTransformOperation.h:
2327         * platform/graphics/transforms/SkewTransformOperation.cpp:
2328         (WebCore::SkewTransformOperation::operator==):
2329         (WebCore::SkewTransformOperation::blend):
2330         * platform/graphics/transforms/SkewTransformOperation.h:
2331         * platform/graphics/transforms/TransformOperation.h:
2332         * platform/graphics/transforms/TranslateTransformOperation.cpp:
2333         (WebCore::TranslateTransformOperation::operator==):
2334         (WebCore::TranslateTransformOperation::blend):
2335         * platform/graphics/transforms/TranslateTransformOperation.h:
2336
2337 2014-10-15  Chris Dumez  <cdumez@apple.com>
2338
2339         Use is<>() / downcast<>() for RenderTextControl / RenderTextControlSingleLine
2340         https://bugs.webkit.org/show_bug.cgi?id=137727
2341
2342         Reviewed by Darin Adler.
2343
2344         Use is<>() / downcast<>() for RenderTextControl / RenderTextControlSingleLine.
2345
2346         No new tests, no behavior change.
2347
2348         * accessibility/AccessibilityRenderObject.cpp:
2349         (WebCore::AccessibilityRenderObject::selectedText):
2350         (WebCore::AccessibilityRenderObject::selectedTextRange):
2351         (WebCore::AccessibilityRenderObject::setSelectedTextRange):
2352         (WebCore::AccessibilityRenderObject::visiblePositionForIndex):
2353         (WebCore::AccessibilityRenderObject::indexForVisiblePosition):
2354         * editing/TextIterator.cpp:
2355         (WebCore::TextIterator::handleReplacedElement):
2356         * html/TextFieldInputType.cpp:
2357         (WebCore::TextFieldInputType::forwardEvent):
2358         * html/shadow/TextControlInnerElements.cpp:
2359         (WebCore::TextControlInnerElement::customStyleForRenderer):
2360         * page/EventHandler.cpp:
2361         (WebCore::EventHandler::capsLockStateMayHaveChanged):
2362         * page/ios/FrameIOS.mm:
2363         (WebCore::ancestorRespondingToScrollWheelEvents):
2364         * rendering/RenderTextControl.h:
2365         * rendering/RenderTextControlSingleLine.h:
2366         * rendering/SimpleLineLayout.cpp:
2367         (WebCore::SimpleLineLayout::canUseFor):
2368
2369 2014-10-15  Chris Dumez  <cdumez@apple.com>
2370
2371         Use is<>() / downcast<>() for ClipPathOperation subclasses
2372         https://bugs.webkit.org/show_bug.cgi?id=137733
2373
2374         Reviewed by Mihnea Ovidenie.
2375
2376         Use is<>() / downcast<>() for ClipPathOperation subclasses.
2377
2378         No new tests, no behavior change.
2379
2380         * css/CSSComputedStyleDeclaration.cpp:
2381         (WebCore::ComputedStyleExtractor::propertyValue):
2382         * css/DeprecatedStyleBuilder.cpp:
2383         (WebCore::ApplyPropertyClipPath::applyValue):
2384         * rendering/ClipPathOperation.h:
2385         * rendering/RenderBlock.cpp:
2386         (WebCore::RenderBlock::nodeAtPoint):
2387         * rendering/RenderLayer.cpp:
2388         (WebCore::RenderLayer::setupClipPath):
2389         * rendering/svg/SVGRenderingContext.cpp:
2390         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
2391
2392 2014-10-15  Chris Dumez  <cdumez@apple.com>
2393
2394         [Mac] Use CFDictionaryContainsKey() in ImageSource::isSizeAvailable()
2395         https://bugs.webkit.org/show_bug.cgi?id=137723
2396
2397         Reviewed by Simon Fraser.
2398
2399         Use CFDictionaryContainsKey() in ImageSource::isSizeAvailable() instead
2400         of CFDictionaryGetValue() as we are not actually interested in the
2401         value.
2402
2403         No new tests, no behavior change.
2404
2405         * platform/graphics/cg/ImageSourceCG.cpp:
2406         (WebCore::ImageSource::isSizeAvailable):
2407
2408 2014-10-15  Mihnea Ovidenie  <mihnea@adobe.com>
2409
2410         Use modern loops in subtrees selection code
2411         https://bugs.webkit.org/show_bug.cgi?id=137688
2412
2413         Reviewed by Andreas Kling.
2414
2415         No new tests as no change in functionality.
2416
2417         * rendering/RenderView.cpp:
2418         (WebCore::RenderView::splitSelectionBetweenSubtrees):
2419         (WebCore::RenderView::updateSelectionForSubtrees):
2420         (WebCore::RenderView::clearSubtreeSelection):
2421         (WebCore::RenderView::applySubtreeSelection):
2422         * rendering/RenderView.h:
2423
2424 2014-10-14  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2425
2426         Clean up unnecessary PassOwnPtr.h inclusion
2427         https://bugs.webkit.org/show_bug.cgi?id=137726
2428
2429         Reviewed by Chris Dumez.
2430
2431         No new tests, no behavior changes.
2432
2433         * dom/Document.h: Remove PassOwnPtr.h inclusion.
2434         * loader/ResourceBuffer.h: ditto.
2435         * loader/cocoa/DiskCacheMonitorCocoa.mm: ditto.
2436         * page/scrolling/AxisScrollSnapOffsets.h: ditto.
2437         * page/scrolling/ScrollingStateScrollingNode.h: ditto.
2438         * platform/ColorChooserClient.h: ditto.
2439         * platform/ScrollableArea.cpp: ditto.
2440         * platform/ScrollbarThemeClient.h: ditto.
2441         * platform/SharedBuffer.cpp: ditto.
2442         * platform/Supplementable.h: ditto.
2443         * platform/graphics/surfaces/GraphicsSurface.h: ditto.
2444         * platform/graphics/surfaces/GraphicsSurfaceToken.h: ditto.
2445         * platform/graphics/win/WKCAImageQueue.cpp: ditto.
2446         * platform/win/CursorWin.cpp: ditto.
2447
2448 2014-10-14  Chris Dumez  <cdumez@apple.com>
2449
2450         Have offsetFromContainer() / offsetFromAncestorContainer() take a RenderElement&
2451         https://bugs.webkit.org/show_bug.cgi?id=137728
2452
2453         Reviewed by Benjamin Poulain.
2454
2455         Have offsetFromContainer() / offsetFromAncestorContainer() take a RenderElement&
2456         instead of a RenderObject*. The argument passed is never null and the type
2457         should be a RenderElement as the argument is a container.
2458
2459         No new tests, no behavior change.
2460
2461         * editing/htmlediting.cpp:
2462         (WebCore::localCaretRectInRendererForCaretPainting):
2463         * page/GestureTapHighlighter.cpp:
2464         * rendering/RenderBox.cpp:
2465         (WebCore::RenderBox::mapLocalToContainer):
2466         (WebCore::RenderBox::pushMappingToContainer):
2467         (WebCore::RenderBox::offsetFromContainer):
2468         (WebCore::RenderBox::computeRectForRepaint):
2469         * rendering/RenderBox.h:
2470         * rendering/RenderBoxModelObject.cpp:
2471         (WebCore::RenderBoxModelObject::mapAbsoluteToLocalPoint):
2472         * rendering/RenderInline.cpp:
2473         (WebCore::RenderInline::computeRectForRepaint):
2474         (WebCore::RenderInline::offsetFromContainer):
2475         (WebCore::RenderInline::mapLocalToContainer):
2476         (WebCore::RenderInline::pushMappingToContainer):
2477         * rendering/RenderInline.h:
2478         * rendering/RenderMultiColumnFlowThread.cpp:
2479         (WebCore::RenderMultiColumnFlowThread::offsetFromContainer):
2480         * rendering/RenderMultiColumnFlowThread.h:
2481         * rendering/RenderNamedFlowFragment.cpp:
2482         (WebCore::RenderNamedFlowFragment::offsetFromContainer):
2483         * rendering/RenderNamedFlowFragment.h:
2484         * rendering/RenderObject.cpp:
2485         (WebCore::RenderObject::offsetFromContainer):
2486         (WebCore::RenderObject::offsetFromAncestorContainer):
2487         * rendering/RenderObject.h:
2488         * rendering/RenderTableCell.cpp:
2489         (WebCore::RenderTableCell::offsetFromContainer):
2490         * rendering/RenderTableCell.h:
2491         * rendering/RenderThemeMac.mm:
2492         (WebCore::RenderThemeMac::convertToPaintingRect):
2493
2494 2014-10-14  Jer Noble  <jer.noble@apple.com>
2495
2496         REGRESSION (r159208): Crash when clicking scrubber after navigating away/back to video
2497         https://bugs.webkit.org/show_bug.cgi?id=137715
2498
2499         Reviewed by Darin Adler.
2500
2501         Simple null-check of m_player in refreshCachedTime.
2502
2503         * html/HTMLMediaElement.cpp:
2504         (WebCore::HTMLMediaElement::refreshCachedTime):
2505
2506 2014-10-14  Chris Dumez  <cdumez@apple.com>
2507
2508         [Mac] Fix inefficiencies in ResourceResponse::platformLazyInit(InitLevel)
2509         https://bugs.webkit.org/show_bug.cgi?id=137721
2510
2511         Reviewed by Geoffrey Garen.
2512
2513         There were several inefficiencies with the Mac implementation of
2514         ResourceResponse::platformLazyInit(InitLevel):
2515         1. We end up initializing uncommon fields even if called with
2516            'CommonFieldsOnly' initLevel.
2517         2. If called with 'AllFields' initLevel (and if currently
2518            uninitialized), we end up populating m_httpHeaderFields twice, once
2519            with only the common headers, then a second time with ALL the
2520            headers. We can skip the common-header case in this case to avoid
2521            wasting CPU time.
2522
2523         This patch addresses both inefficiencies and cleans up the code a
2524         little bit to reduce variable scope and to use fast enumeration of
2525         header names.
2526
2527         As a result, we spend almost twice as little time in platformLazyInit()
2528         when loading msn.com (~30ms -> ~18ms).
2529
2530         No new tests, no behavior change.
2531
2532         * platform/network/mac/ResourceResponseMac.mm:
2533         (WebCore::ResourceResponse::platformLazyInit):
2534
2535 2014-10-14  Zalan Bujtas  <zalan@apple.com>
2536
2537         REGRESSION (Safari 7.1/8.0): Border-radius and overflow hidden renders incorrectly.
2538         https://bugs.webkit.org/show_bug.cgi?id=137205
2539
2540         Reviewed by Simon Fraser.
2541
2542         Child layer should not reset radius clipping behaviour.
2543
2544         Test: fast/layers/parent-clipping-overflow-is-overwritten-by-child-clipping.html
2545
2546         * rendering/RenderLayer.cpp:
2547         (WebCore::RenderLayer::calculateClipRects):
2548
2549 2014-10-14  Chris Dumez  <cdumez@apple.com>
2550
2551         Use is<>() / downcast<>() for PlatformCAAnimation subclasses
2552         https://bugs.webkit.org/show_bug.cgi?id=137722
2553
2554         Reviewed by Simon Fraser.
2555
2556         Use is<>() / downcast<>() for PlatformCAAnimation subclasses and clean
2557         up the surrounding code.
2558
2559         No new tests, no behavior change.
2560
2561         * page/mac/ServicesOverlayController.mm:
2562         (WebCore::ServicesOverlayController::Highlight::fadeIn):
2563         (WebCore::ServicesOverlayController::Highlight::fadeOut):
2564         * platform/graphics/ca/GraphicsLayerCA.cpp:
2565         (WebCore::GraphicsLayerCA::moveOrCopyLayerAnimation):
2566         (WebCore::GraphicsLayerCA::updateAnimations):
2567         (WebCore::GraphicsLayerCA::setAnimationOnLayer):
2568         (WebCore::GraphicsLayerCA::pauseCAAnimationOnLayer):
2569         * platform/graphics/ca/GraphicsLayerCA.h:
2570         * platform/graphics/ca/PlatformCAAnimation.h:
2571         * platform/graphics/ca/PlatformCALayer.h:
2572         * platform/graphics/ca/mac/PlatformCAAnimationMac.h:
2573         * platform/graphics/ca/mac/PlatformCAAnimationMac.mm:
2574         (PlatformCAAnimationMac::copy):
2575         (PlatformCAAnimationMac::copyTimingFunctionFrom):
2576         (PlatformCAAnimationMac::copyFromValueFrom):
2577         (PlatformCAAnimationMac::copyToValueFrom):
2578         (PlatformCAAnimationMac::copyValuesFrom):
2579         (PlatformCAAnimationMac::copyKeyTimesFrom):
2580         (PlatformCAAnimationMac::copyTimingFunctionsFrom):
2581         * platform/graphics/ca/mac/PlatformCALayerMac.h:
2582         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
2583         (PlatformCALayerMac::addAnimationForKey):
2584         * platform/graphics/ca/win/PlatformCAAnimationWin.cpp:
2585         (PlatformCAAnimationWin::copy):
2586         (PlatformCAAnimationWin::copyTimingFunctionFrom):
2587         (PlatformCAAnimationWin::copyFromValueFrom):
2588         (PlatformCAAnimationWin::copyToValueFrom):
2589         (PlatformCAAnimationWin::copyValuesFrom):
2590         (PlatformCAAnimationWin::copyKeyTimesFrom):
2591         (PlatformCAAnimationWin::copyTimingFunctionsFrom):
2592         * platform/graphics/ca/win/PlatformCAAnimationWin.h:
2593         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2594         (PlatformCALayerWin::addAnimationForKey):
2595         * platform/graphics/ca/win/PlatformCALayerWin.h:
2596
2597 2014-10-14  Chris Dumez  <cdumez@apple.com>
2598
2599         Use is<>() / downcast<>() for RenderInline
2600         https://bugs.webkit.org/show_bug.cgi?id=137704
2601
2602         Reviewed by Darin Adler.
2603
2604         Use is<>() / downcast<>() for RenderInline and clean up the surrounding
2605         code.
2606
2607         No new tests, no behavior change.
2608
2609         * accessibility/AccessibilityRenderObject.cpp:
2610         (WebCore::firstChildInContinuation):
2611         * editing/SimplifyMarkupCommand.cpp:
2612         (WebCore::SimplifyMarkupCommand::doApply):
2613         * inspector/InspectorOverlay.cpp:
2614         (WebCore::buildRendererHighlight):
2615         * page/FrameView.cpp:
2616         (WebCore::FrameView::paintContents):
2617         * rendering/InlineFlowBox.cpp:
2618         (WebCore::InlineFlowBox::removeLineBoxFromRenderObject):
2619         (WebCore::InlineFlowBox::extractLineBoxFromRenderObject):
2620         (WebCore::InlineFlowBox::attachLineBoxToRenderObject):
2621         (WebCore::InlineFlowBox::determineSpacingForFlowBoxes):
2622         (WebCore::InlineFlowBox::nodeAtPoint):
2623         (WebCore::InlineFlowBox::paint):
2624         * rendering/InlineIterator.h:
2625         (WebCore::bidiFirstSkippingEmptyInlines):
2626         * rendering/LayoutState.cpp:
2627         (WebCore::LayoutState::LayoutState):
2628         * rendering/RenderBlock.cpp:
2629         (WebCore::RenderBlock::willBeDestroyed):
2630         (WebCore::RenderBlock::paintObject):
2631         (WebCore::RenderBlock::inlineElementContinuation):
2632         (WebCore::RenderBlock::addFocusRingRects):
2633         * rendering/RenderBlockFlow.cpp:
2634         (WebCore::RenderBlockFlow::willBeDestroyed):
2635         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
2636         * rendering/RenderBlockFlow.h:
2637         * rendering/RenderBlockLineLayout.cpp:
2638         (WebCore::constructBidiRunsForSegment):
2639         (WebCore::RenderBlockFlow::layoutLineBoxes):
2640         * rendering/RenderBox.cpp:
2641         (WebCore::RenderBox::offsetFromContainer):
2642         (WebCore::RenderBox::computeRectForRepaint):
2643         (WebCore::RenderBox::containingBlockLogicalWidthForPositioned):
2644         (WebCore::RenderBox::containingBlockLogicalHeightForPositioned):
2645         (WebCore::RenderBox::computePositionedLogicalWidthUsing):
2646         (WebCore::RenderBox::computePositionedLogicalWidthReplaced):
2647         (WebCore::RenderBox::layoutOverflowRectForPropagation):
2648         * rendering/RenderBoxModelObject.cpp:
2649         (WebCore::accumulateInFlowPositionOffsets):
2650         * rendering/RenderElement.cpp:
2651         (WebCore::RenderElement::willBeRemovedFromTree):
2652         * rendering/RenderElement.h:
2653         (WebCore::RenderElement::dirtyLinesFromChangedChild):
2654         * rendering/RenderFlowThread.cpp:
2655         (WebCore::RenderFlowThread::addRegionsOverflowFromChild):
2656         * rendering/RenderInline.cpp:
2657         (WebCore::RenderInline::willBeDestroyed):
2658         (WebCore::RenderInline::updateAlwaysCreateLineBoxes):
2659         (WebCore::RenderInline::clippedOverflowRectForRepaint):
2660         * rendering/RenderInline.h:
2661         * rendering/RenderLayer.cpp:
2662         (WebCore::RenderLayer::updateLayerPosition):
2663         (WebCore::RenderLayer::calculateClipRects):
2664         * rendering/RenderLineBoxList.cpp:
2665         (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
2666         * rendering/RenderLineBoxList.h:
2667         * rendering/RenderNamedFlowThread.cpp:
2668         (WebCore::RenderNamedFlowThread::decorationsClipRectForBoxInNamedFlowFragment):
2669         * rendering/RenderObject.cpp:
2670         (WebCore::RenderObject::insertedIntoTree):
2671         * rendering/RenderRegion.cpp:
2672         (WebCore::RenderRegion::overflowRectForFlowThreadPortion):
2673         (WebCore::RenderRegion::visualOverflowRectForBox):
2674         (WebCore::RenderRegion::visualOverflowRectForBoxForPropagation):
2675         * rendering/RenderRegion.h:
2676         * rendering/RenderReplaced.cpp:
2677         (WebCore::RenderReplaced::willBeDestroyed):
2678         * rendering/RenderTextLineBoxes.cpp:
2679         (WebCore::RenderTextLineBoxes::removeAllFromParent):
2680         (WebCore::RenderTextLineBoxes::dirtyRange):
2681         * rendering/line/BreakingContextInlineHeaders.h:
2682         (WebCore::inlineLogicalWidth):
2683         (WebCore::BreakingContext::handleEmptyInline):
2684         * rendering/line/LineInlineHeaders.h:
2685         (WebCore::requiresLineBox):
2686         (WebCore::setStaticPositions):
2687         * rendering/svg/SVGInlineTextBox.cpp:
2688         (WebCore::SVGInlineTextBox::paint):
2689
2690 2014-10-14  Brent Fulgham  <bfulgham@apple.com>
2691
2692         [Win] Unreviewed build fix after r174710.
2693
2694         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2695         (WebCore::MediaPlayerPrivateAVFoundationCF::createSession):
2696
2697 2014-10-14  Dan Bernstein  <mitz@apple.com>
2698
2699         URLs that start with http:/// and https:/// lose two slashes when parsed, causing assertion failure and inconsistent behavior
2700         https://bugs.webkit.org/show_bug.cgi?id=137718
2701
2702         Reviewed by Alexey Proskuryakov.
2703
2704         Added cases to fast/loader/url-parse-1.html.
2705
2706         * platform/URL.cpp:
2707         (WebCore::URL::parse): In hierarchical schemes other than file:, ignore any additional
2708         slashes after the ://, as prescribed by the authority-ignore-slashes state in the current
2709         URL spec.
2710
2711 2014-10-14  Brent Fulgham  <bfulgham@apple.com>
2712
2713         [Win] Unreviewed build fix after r174698 and r174709.
2714
2715         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
2716         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
2717         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2718         (WebCore::MediaPlayerPrivateAVFoundationCF::supportsKeySystem):
2719         (WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
2720         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
2721
2722 2014-10-14  Brent Fulgham  <bfulgham@apple.com>
2723
2724         [Win] Unreviewed build fix after r174698
2725
2726         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
2727         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
2728         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2729         (WebCore::MediaPlayerPrivateAVFoundationCF::createSession):
2730
2731 2014-10-14  Myles C. Maxfield  <mmaxfield@apple.com>
2732
2733         Improve debug description of WAKViews
2734         https://bugs.webkit.org/show_bug.cgi?id=137716
2735
2736         Reviewed by Simon Fraser.
2737
2738         No new tests because there is no behavior change.
2739
2740         * platform/ios/wak/WAKView.mm:
2741         (-[WAKView description]):
2742         * platform/ios/wak/WKView.h:
2743         * platform/ios/wak/WKView.mm:
2744         (WKViewGetOrigin):
2745
2746 2014-10-14  Chris Dumez  <cdumez@apple.com>
2747
2748         Introduce an isCSSAnimated flag on RenderElement for performance
2749         https://bugs.webkit.org/show_bug.cgi?id=137583
2750
2751         Reviewed by Simon Fraser.
2752
2753         I noticed when profiling the ebay.com page load that isRunningAnimationOnRenderer()
2754         and isRunningAcceleratedAnimationOnRenderer() were called frequently, causing
2755         ~4.7 millions m_compositeAnimations HashMap lookups.
2756
2757         This patch introduces an isCSSAnimated flag on RenderElement to return early if
2758         there is no animation on the renderer, thus avoiding HashMap lookups. This reduces
2759         the number of HashMap lookups from ~4.7 millions to ~68k. On my machine, I see
2760         the following performance improvements:
2761         - isRunning*AnimationOnRenderer() / computeCompositingRequirements()
2762           - before: ~45ms  / ~90ms
2763           - after:  ~4ms / ~30ms
2764
2765         No new tests, no behavior change.
2766
2767         * page/animation/AnimationController.cpp:
2768         (WebCore::AnimationControllerPrivate::ensureCompositeAnimation):
2769         (WebCore::AnimationControllerPrivate::clear):
2770         (WebCore::AnimationControllerPrivate::isRunningAnimationOnRenderer):
2771         (WebCore::AnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer):
2772         (WebCore::AnimationController::isRunningAnimationOnRenderer):
2773         (WebCore::AnimationController::isRunningAcceleratedAnimationOnRenderer):
2774         * rendering/RenderElement.cpp:
2775         (WebCore::RenderElement::RenderElement):
2776         * rendering/RenderElement.h:
2777         (WebCore::RenderElement::isCSSAnimating):
2778         (WebCore::RenderElement::setIsCSSAnimating):
2779
2780 2014-10-14  Dean Jackson  <dino@apple.com>
2781
2782         Crash in WebCore::UserGestureIndicator::processingUserGesture with WebWorkers
2783         https://bugs.webkit.org/show_bug.cgi?id=137676
2784         <rdar://problem/15735049>
2785
2786         Reviewed by Alexey Proskuryakov.
2787
2788         Remove the code I added that tracks the timestamp of the most recent
2789         user gesture from the event handling dispatch, as it was both
2790         a silly place to do it and it originally crashed when events were fired from
2791         Worker threads (although this was fixed in r152238).
2792
2793         It's now recorded by going through UserGestureIndicator, which is good because
2794         it knows when a user has triggered an event. Its constructor now takes
2795         a pointer to Document, and updates the timestamp there if necessary.
2796
2797         Not all UserGestureIndicator instances needed to reset the timestamp; Those did
2798         not have to pass along the Document.
2799
2800         This is untestable due to the fix mentioned above.
2801
2802         * WebCore.exp.in: Change constructor signature.
2803
2804         * accessibility/AccessibilityNodeObject.cpp: Pass a pointer to the Document into the UserGestureIndicator.
2805         (WebCore::AccessibilityNodeObject::increment):
2806         (WebCore::AccessibilityNodeObject::decrement):
2807         * accessibility/AccessibilityObject.cpp: Ditto.
2808         (WebCore::AccessibilityObject::press):
2809
2810         * dom/Document.cpp:
2811         (WebCore::Document::updateLastHandledUserGestureTimestamp): Renamed.
2812         * dom/Document.h:
2813
2814         * dom/EventTarget.cpp: Remove the code to update the timestamp.
2815         (WebCore::EventTarget::fireEventListeners):
2816
2817         * dom/UserGestureIndicator.cpp:
2818         (WebCore::UserGestureIndicator::UserGestureIndicator): If there is a Document and
2819         this is a user gesture, then reset the timestamp.
2820         * dom/UserGestureIndicator.h:
2821
2822         * page/EventHandler.cpp: Pass a pointer to the Document.
2823         (WebCore::EventHandler::handleMousePressEvent):
2824         (WebCore::EventHandler::handleMouseDoubleClickEvent):
2825         (WebCore::EventHandler::handleMouseReleaseEvent):
2826         (WebCore::EventHandler::keyEvent):
2827         (WebCore::EventHandler::handleTouchEvent):
2828
2829         * rendering/HitTestResult.cpp: Ditto.
2830         (WebCore::HitTestResult::toggleMediaFullscreenState):
2831         (WebCore::HitTestResult::enterFullscreenForVideo):
2832
2833 2014-10-14  Brent Fulgham  <bfulgham@apple.com>
2834
2835         [Win] Unreviewed gardening. Ignore Visual Studio *.sdf files.
2836
2837         * WebCore.vcxproj: Modified property svn:ignore.
2838
2839 2014-10-14  Brent Fulgham  <bfulgham@apple.com>
2840
2841         [Win] Enable Encrypted Media Support
2842         https://bugs.webkit.org/show_bug.cgi?id=137710
2843         <rdar://problem/18652699>
2844
2845         Reviewed by Jer Noble.
2846
2847         This feature is covered by existing media tests.
2848
2849         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2850         (WebCore::destroyAVFWrapper): Remove redundant ASSERT.
2851         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
2852         (displayOnMainThreadContext::displayOnMainThreadContext): Added.
2853         (redispatchOnMainQueue): Added.
2854         (PlatformCALayerWinInternal::displayCallback): Check if a display
2855         call is happening on a background queue, and re-dispatch on the
2856         main thread if necessary.
2857
2858 2014-10-14  Chris Dumez  <cdumez@apple.com>
2859
2860         [Mac] Avoid unnecessary dictionary lookup in ImageSource::isSizeAvailable()
2861         https://bugs.webkit.org/show_bug.cgi?id=137701
2862
2863         Reviewed by Simon Fraser.
2864
2865         The CG implementation of ImageSource::isSizeAvailable() was looking up
2866         both the width and the height keys in the dictionary before determining
2867         if the size is available. We can abort early and return false if the
2868         first key (the width) is missing, thus avoiding an extra dictionary
2869         lookup in this case.
2870
2871         This is a small win but ImageSource::isSizeAvailable() is called quite
2872         frequently during page loads
2873
2874         No new tests, no behavior change.
2875
2876         * platform/graphics/cg/ImageSourceCG.cpp:
2877         (WebCore::ImageSource::isSizeAvailable):
2878
2879 2014-10-14  Myles C. Maxfield  <mmaxfield@apple.com>
2880
2881         Remove unnecessary logging from SimpleFontData
2882         https://bugs.webkit.org/show_bug.cgi?id=137699
2883
2884         Reviewed by Andreas Kling.
2885
2886         Because of web fonts, fonts that don't have a glyph page 0 are common and expected. Printing out a
2887         message is not helpful, especially if you're not dealing with a font-related piece of WebKit.
2888
2889         No new tests because there is no behavior change.
2890
2891         * platform/graphics/SimpleFontData.cpp:
2892         (WebCore::SimpleFontData::platformGlyphInit):
2893
2894 2014-10-14  Martin Hock  <mhock@apple.com>
2895
2896         Update ViewportConfiguration whenever its size attributes change
2897         https://bugs.webkit.org/show_bug.cgi?id=137682
2898         rdar://problem/18643655
2899
2900         Reviewed by Benjamin Poulain.
2901
2902         * page/ViewportConfiguration.cpp:
2903         (WebCore::ViewportConfiguration::setMinimumLayoutSize):
2904         (WebCore::ViewportConfiguration::setMinimumLayoutSizeForMinimalUI):
2905
2906 2014-10-14  Joseph Pecoraro  <pecoraro@apple.com>
2907
2908         Web Inspector: Processing Instruction Nodes appear poorly in DOM Tree
2909         https://bugs.webkit.org/show_bug.cgi?id=137681
2910
2911         Reviewed by Timothy Hatcher.
2912
2913         * inspector/InspectorDOMAgent.cpp:
2914         (WebCore::InspectorDOMAgent::buildObjectForNode):
2915         Include the nodeName, localName, and nodeValue (string data)
2916         properties for processing instruction nodes.
2917
2918 2014-10-14  Chris Dumez  <cdumez@apple.com>
2919
2920         Use is<>() / downcast<>() for RenderFrame / RenderFrameSet
2921         https://bugs.webkit.org/show_bug.cgi?id=137696
2922
2923         Reviewed by Darin Adler.
2924
2925         Use is<>() / downcast<>() for RenderFrame / RenderFrameSet.
2926
2927         No new tests, no behavior change.
2928
2929         * html/HTMLFrameSetElement.cpp:
2930         (WebCore::HTMLFrameSetElement::defaultEventHandler):
2931         * rendering/RenderFrame.cpp:
2932         (WebCore::RenderFrame::updateFromElement):
2933         * rendering/RenderFrame.h:
2934         * rendering/RenderFrameSet.cpp:
2935         (WebCore::RenderFrameSet::computeEdgeInfo):
2936         (WebCore::RenderFrameSet::positionFramesWithFlattening):
2937         * rendering/RenderFrameSet.h:
2938
2939 2014-10-14  Youenn Fablet  <youennf@gmail.com>
2940
2941         [XHR] Abort method execution when m_loader->cancel() in internalAbort() caused reentry
2942         https://bugs.webkit.org/show_bug.cgi?id=126975
2943
2944         Reviewed by Alexey Proskuryakov.
2945
2946         Merging https://chromium.googlesource.com/chromium/blink/+/0d75daf2053631518606ae15daaece701a25b2c4
2947         Ensuring new test from https://codereview.chromium.org/76133002/ is passing.
2948
2949         Test: http/tests/xmlhttprequest/reentrant-cancel-abort.html
2950
2951         * xml/XMLHttpRequest.cpp:
2952         (WebCore::XMLHttpRequest::open): exit early if internalAbort asks so
2953         (WebCore::XMLHttpRequest::abort): exit early if internalAbort asks so
2954         (WebCore::XMLHttpRequest::internalAbort): ask calling function to exit early if a new loader is created during the cancellation of the loader (potential reentrant case through window.onload callback)   
2955         (WebCore::XMLHttpRequest::didTimeout): exit early if internalAbort asks so
2956         * xml/XMLHttpRequest.h:
2957
2958 2014-10-14  Alejandro G. Castro  <alex@igalia.com>
2959
2960         Multiple refactors in RenderMathMLOperator
2961         https://bugs.webkit.org/show_bug.cgi?id=137611
2962
2963         Reviewed by Darin Adler.
2964
2965         The changes include:
2966         - Rename m_operator to m_textContent.
2967         - Make most of the functions private, we needed to create some
2968         public member functions to be able to make the some funtions private
2969         and move trailingSpaceError to RenderMathMLOperator.
2970         - Fix incorrect capitalization of setOperatorProperties function.
2971         - Make all data members private and move them to the end of the
2972         class defition.
2973
2974         No new tests as no change in functionality.
2975
2976         * rendering/mathml/RenderMathMLOperator.cpp:
2977         (WebCore::RenderMathMLOperator::RenderMathMLOperator):
2978         (WebCore::RenderMathMLOperator::setOperatorProperties): Renamed,
2979         incorrect capitalization
2980         (WebCore::RenderMathMLOperator::stretchTo):
2981         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths):
2982         (WebCore::RenderMathMLOperator::rebuildTokenContent):
2983         (WebCore::RenderMathMLOperator::updateFromElement):
2984         (WebCore::RenderMathMLOperator::updateOperatorProperties):
2985         (WebCore::RenderMathMLOperator::shouldAllowStretching):
2986         (WebCore::RenderMathMLOperator::updateStyle):
2987         (WebCore::RenderMathMLOperator::trailingSpaceError):
2988         (WebCore::RenderMathMLOperator::SetOperatorProperties): Deleted.
2989         (WebCore::RenderMathMLOperator::advanceForGlyph): Deleted.
2990         (WebCore::RenderMathMLOperator::updateTokenContent): Deleted.
2991         (WebCore::RenderMathMLOperator::getGlyphAssemblyFallBack): Deleted.
2992         * rendering/mathml/RenderMathMLOperator.h:
2993         (WebCore::RenderMathMLOperator::setLeadingSpace): Added.
2994         (WebCore::RenderMathMLOperator::setTrailingSpace):  Added.
2995         (WebCore::RenderMathMLOperator::textContent): Added.
2996         (WebCore::RenderMathMLOperator::isInvisibleOperator):
2997         * rendering/mathml/RenderMathMLRadicalOperator.cpp:
2998         (WebCore::RenderMathMLRadicalOperator::setOperatorProperties):
2999         Renamed, incorrect capitalization
3000         (WebCore::RenderMathMLRadicalOperator::SetOperatorProperties): Deleted.
3001         (WebCore::RenderMathMLRadicalOperator::trailingSpaceError): Deleted.
3002         * rendering/mathml/RenderMathMLRadicalOperator.h:
3003
3004 2014-10-14  Alejandro G. Castro  <alex@igalia.com>
3005
3006         Changes in the stretchy attribute do not update rendering
3007         https://bugs.webkit.org/show_bug.cgi?id=136883
3008
3009         Reviewed by Darin Adler.
3010
3011         Test: mathml/presentation/mo-stretch-update.html
3012
3013         We need to relayout when a change in the stretchy attribute
3014         happens.
3015
3016         * mathml/MathMLTextElement.cpp:
3017         (WebCore::MathMLTextElement::parseAttribute): Parse the
3018         modifications of the stretchy attribute.
3019         * mathml/MathMLTextElement.h:
3020         * rendering/mathml/RenderMathMLOperator.cpp:
3021         (WebCore::RenderMathMLOperator::setOperatorFlagAndScheduleLayoutIfNeeded):
3022         Add function that receives the value instead of looking for it and
3023         checks if the change should schedule a layout.
3024         (WebCore::RenderMathMLOperator::setOperatorFlagFromAttribute):
3025         (WebCore::RenderMathMLOperator::setOperatorFlagFromAttributeValue):
3026         Add function that receives the value instead of looking for it.
3027         * rendering/mathml/RenderMathMLOperator.h:
3028
3029 2014-10-14  Chris Dumez  <cdumez@apple.com>
3030
3031         Use is<>() / downcast<>() for RenderImage
3032         https://bugs.webkit.org/show_bug.cgi?id=137683
3033
3034         Reviewed by Mihnea Ovidenie.
3035
3036         Use is<>() / downcast<>() for RenderImage.
3037
3038         No new tests, no behavior change.
3039
3040         * accessibility/AccessibilityNodeObject.cpp:
3041         (WebCore::AccessibilityNodeObject::alternativeText):
3042         * accessibility/AccessibilityRenderObject.cpp:
3043         (WebCore::AccessibilityRenderObject::addImageMapChildren):
3044         (WebCore::AccessibilityRenderObject::remoteSVGRootElement):
3045         * bindings/objc/DOM.mm:
3046         (-[DOMElement image]):
3047         (-[DOMElement _imageTIFFRepresentation]):
3048         * editing/TextIterator.cpp:
3049         (WebCore::TextIterator::handleReplacedElement):
3050         * editing/cocoa/HTMLConverter.mm:
3051         (fileWrapperForElement):
3052         * editing/gtk/EditorGtk.cpp:
3053         (WebCore::getImageForElement):
3054         * editing/ios/EditorIOS.mm:
3055         (WebCore::getImage):
3056         * editing/mac/EditorMac.mm:
3057         (WebCore::getImage):
3058         * html/HTMLAnchorElement.cpp:
3059         (WebCore::appendServerMapMousePosition):
3060         * html/HTMLAreaElement.cpp:
3061         (WebCore::HTMLAreaElement::setFocus):
3062         * html/HTMLImageElement.cpp:
3063         (WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
3064         (WebCore::HTMLImageElement::parseAttribute):
3065         (WebCore::HTMLImageElement::didAttachRenderers):
3066         (WebCore::HTMLImageElement::createImageControls):
3067         (WebCore::HTMLImageElement::destroyImageControls):
3068         * html/HTMLVideoElement.cpp:
3069         (WebCore::HTMLVideoElement::didAttachRenderers):
3070         (WebCore::HTMLVideoElement::parseAttribute):
3071         * html/ImageInputType.cpp:
3072         (WebCore::ImageInputType::altAttributeChanged):
3073         (WebCore::ImageInputType::attach):
3074         * html/canvas/CanvasRenderingContext2D.cpp:
3075         (WebCore::size):
3076         * html/shadow/mac/ImageControlsRootElementMac.cpp:
3077         (WebCore::RenderImageControls::updateLogicalWidth):
3078         (WebCore::RenderImageControls::computeLogicalHeight):
3079         * loader/ImageLoader.cpp:
3080         (WebCore::ImageLoader::renderImageResource):
3081         * page/ContextMenuController.cpp:
3082         (WebCore::imageFromImageElementNode):
3083         * page/DragController.cpp:
3084         (WebCore::getCachedImage):
3085         (WebCore::getImage):
3086         * platform/win/PasteboardWin.cpp:
3087         (WebCore::Pasteboard::writeImage):
3088         (WebCore::getCachedImage):
3089         * rendering/HitTestResult.cpp:
3090         (WebCore::HitTestResult::image):
3091         * rendering/RenderImage.h:
3092         * rendering/RenderImageResource.cpp:
3093         (WebCore::RenderImageResource::getImageSize):
3094         * rendering/RenderLayerBacking.cpp:
3095         (WebCore::RenderLayerBacking::isDirectlyCompositedImage):
3096         (WebCore::RenderLayerBacking::updateImageContents):
3097         * rendering/RenderReplaced.cpp:
3098         (WebCore::RenderReplaced::computeAspectRatioInformationForRenderBox):
3099         * rendering/shapes/ShapeOutsideInfo.cpp:
3100         (WebCore::ShapeOutsideInfo::createShapeForImage):
3101
3102 2014-10-14  Andrzej Badowski  <a.badowski@samsung.com>
3103
3104         [AX] Improve AccessibilityTableCell columnHeaders and rowHeaders functions.
3105         https://bugs.webkit.org/show_bug.cgi?id=136818
3106
3107         Reviewed by Chris Fleizach.
3108
3109         Take into account that <th> elements can be both the column headers and row headers 
3110         improved the operation of two functions: columnHeaders and rowHeaders.
3111
3112         Test: accessibility/table-headers.html
3113
3114         * accessibility/AccessibilityTableCell.cpp:
3115         (WebCore::AccessibilityTableCell::isColumnHeaderCell):
3116         A new function that helps the main goal.
3117         (WebCore::AccessibilityTableCell::isRowHeaderCell):
3118         A new function that helps the main goal.
3119         (WebCore::AccessibilityTableCell::columnHeaders):
3120         Use isColumnHeaderCell instead of isTableHeaderCell.
3121         (WebCore::AccessibilityTableCell::rowHeaders):
3122         Use isRowHeaderCell also includes <th> row header element next to the scope attribute.
3123         * accessibility/AccessibilityTableCell.h:
3124         Adds new functions to the header file.
3125
3126 2014-10-14  Csaba Osztrogon√°c  <ossy@webkit.org>
3127
3128         Fix the !ENABLE(VIDEO) build after r174353
3129         https://bugs.webkit.org/show_bug.cgi?id=137655
3130
3131         Reviewed by Darin Adler.
3132
3133         * dom/Document.cpp:
3134         * dom/Document.h:
3135         * page/Page.cpp:
3136         * page/Page.h:
3137
3138 2014-10-14  peavo@outlook.com  <peavo@outlook.com>
3139
3140         [Curl] Compile error in CurlDownload.cpp.
3141         https://bugs.webkit.org/show_bug.cgi?id=137654
3142
3143         Reviewed by Philippe Normand.
3144
3145         A template specialization is not needed anymore.
3146
3147         * platform/network/curl/CurlDownload.cpp:
3148
3149 2014-10-13  Joseph Pecoraro  <pecoraro@apple.com>
3150
3151         Web Inspector: Remove unused stale Page protocol methods
3152         https://bugs.webkit.org/show_bug.cgi?id=137678
3153
3154         Reviewed by Andreas Kling.
3155
3156         * inspector/InspectorClient.h:
3157         (WebCore::InspectorClient::canShowDebugBorders): Deleted.
3158         (WebCore::InspectorClient::setShowDebugBorders): Deleted.
3159         (WebCore::InspectorClient::canShowFPSCounter): Deleted.
3160         (WebCore::InspectorClient::setShowFPSCounter): Deleted.
3161         (WebCore::InspectorClient::canContinuouslyPaint): Deleted.
3162         (WebCore::InspectorClient::setContinuousPaintingEnabled): Deleted.
3163         * inspector/InspectorPageAgent.cpp:
3164         (WebCore::InspectorPageAgent::disable):
3165         (WebCore::InspectorPageAgent::canShowDebugBorders): Deleted.
3166         (WebCore::InspectorPageAgent::setShowDebugBorders): Deleted.
3167         (WebCore::InspectorPageAgent::canShowFPSCounter): Deleted.
3168         (WebCore::InspectorPageAgent::setShowFPSCounter): Deleted.
3169         (WebCore::InspectorPageAgent::canContinuouslyPaint): Deleted.
3170         (WebCore::InspectorPageAgent::setContinuousPaintingEnabled): Deleted.
3171         * inspector/InspectorPageAgent.h:
3172         * inspector/protocol/Page.json:
3173
3174 2014-10-13  Eric Carlson  <eric.carlson@apple.com>
3175
3176         [iOS] Refactor AirPlay monitoring code
3177         https://bugs.webkit.org/show_bug.cgi?id=137645
3178         <rdar://problem/18444817>
3179
3180         Reviewed by Jer Noble.
3181
3182         Refactor AirPlay route change monitoring code:
3183         + Have MediaSessionManager register/unregister for route changes depending on the state of
3184             all sessions so it does the right thing when there is more than one media element.
3185         + Make HTMLMediaElement unregister with MediaSession as soon as the media player is cleared
3186             because there can be no wireless playback without a player.
3187
3188         * html/HTMLMediaElement.cpp:
3189         (WebCore::HTMLMediaElement::~HTMLMediaElement): Call mediaSession->setHasPlaybackTargetAvailabilityListeners
3190             when there are target availability changed listeners.
3191         (WebCore::HTMLMediaElement::clearMediaPlayer): Ditto.
3192         (WebCore::HTMLMediaElement::wirelessRoutesAvailableDidChange): New, media session client method.
3193         * html/HTMLMediaElement.h:
3194
3195         * html/HTMLMediaSession.cpp:
3196         (WebCore::HTMLMediaSession::HTMLMediaSession): Initialize m_hasPlaybackTargetAvailabilityListeners.
3197         (WebCore::HTMLMediaSession::setHasPlaybackTargetAvailabilityListeners): Remember whether or not
3198             the client has a target availability listener and tell the media session manager to reconfigure
3199             itself instead of telling it to start or stop listening for route changes so it does the 
3200             right thing when there is more than one media element.
3201         * html/HTMLMediaSession.h:
3202         (WebCore::HTMLMediaSession::requiresPlaybackTargetRouteMonitoring): Return true when the client 
3203             has a target availability listener, false otherwise.
3204
3205         * platform/audio/MediaSession.cpp:
3206         (WebCore::MediaSession::wirelessRoutesAvailableDidChange): Inform the client that routes have changed.
3207         * platform/audio/MediaSession.h:
3208         (WebCore::MediaSession::requiresPlaybackTargetRouteMonitoring):
3209         (WebCore::MediaSessionClient::wirelessRoutesAvailableDidChange):
3210
3211         * platform/audio/MediaSessionManager.cpp:
3212         (WebCore::MediaSessionManager::wirelessRoutesAvailableChanged): Implement it.
3213         * platform/audio/MediaSessionManager.h:
3214         (WebCore::MediaSessionManager::configureWireLessTargetMonitoring):
3215         (WebCore::MediaSessionManager::hasWirelessTargetsAvailable):
3216         (WebCore::MediaSessionManager::sessions):
3217         (WebCore::MediaSessionManager::startMonitoringAirPlayRoutes): Deleted.
3218         (WebCore::MediaSessionManager::stopMonitoringAirPlayRoutes): Deleted.
3219
3220         * platform/audio/ios/MediaSessionManagerIOS.h:
3221         * platform/audio/ios/MediaSessionManagerIOS.mm:
3222         (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring): Start or stop monitoring
3223             for route changes depending on client state.
3224         (WebCore::MediaSessionManageriOS::startMonitoringAirPlayRoutes): Deleted.
3225         (WebCore::MediaSessionManageriOS::stopMonitoringAirPlayRoutes): Deleted.
3226
3227 2014-10-13  Chris Dumez  <cdumez@apple.com>
3228
3229         [Mac] Return value of createImageSourceOptions() is leaked in ImageSourceCG
3230         https://bugs.webkit.org/show_bug.cgi?id=137677
3231
3232         Reviewed by Simon Fraser.
3233
3234         The return value of createImageSourceOptions() was leaked in
3235         ImageSourceCG.cpp. It was returning a CFDictionaryRef created using
3236         CFDictionaryCreate(). Therefore, the return value should have been
3237         released but wasn't.
3238
3239         This patch makes createImageSourceOptions() return a
3240         RetainPtr<CFDictionaryRef> to make sure the CFDictionaryRef properly
3241         gets released after use.
3242
3243         No new tests, no behavior change.
3244
3245         * platform/graphics/cg/ImageSourceCG.cpp:
3246         (WebCore::createImageSourceOptions):
3247         (WebCore::imageSourceOptions):
3248         (WebCore::ImageSource::isSizeAvailable):
3249         (WebCore::ImageSource::allowSubsamplingOfFrameAtIndex):
3250         (WebCore::ImageSource::frameSizeAtIndex):
3251         (WebCore::ImageSource::orientationAtIndex):
3252         (WebCore::ImageSource::getHotSpot):
3253         (WebCore::ImageSource::repetitionCount):
3254         (WebCore::ImageSource::createFrameAtIndex):
3255         (WebCore::ImageSource::frameDurationAtIndex):
3256
3257 2014-10-13  Yusuke Suzuki  <utatane.tea@gmail.com>
3258
3259         CSS JIT: Implement :visited pseudo class
3260         https://bugs.webkit.org/show_bug.cgi?id=135293
3261
3262         Reviewed by Benjamin Poulain.
3263
3264         This patch implements CSS JIT for :visited. And it makes :not(:link) JIT-ed.
3265         Following the design discussed at the other bug[1], implemented :visited JIT
3266         without tracking VisitedMatchEnabled state.
3267
3268         In this patch, we change the semantics of :visited / :link
3269         inside functional pseudo classes for further CSS Selector Level 4 extensions.
3270
3271         Edge cases are tested by the existing tests.
3272         :not(:link)
3273             fast/history/link-inside-not.html
3274         :not(:visited)
3275             fast/history/visited-inside-not.html
3276         :-webkit-any(:link)
3277             fast/history/link-inside-any.html
3278         :-webkit-any(:visited)
3279             fast/history/visited-inside-any.html
3280
3281         [1]: https://bugs.webkit.org/show_bug.cgi?id=135639
3282
3283         Test: fast/history/link-inside-not-inside-any.html
3284             To cover the :-webkit-any(:not(:link)), added new tests.
3285
3286         * css/SelectorChecker.cpp:
3287         (WebCore::SelectorChecker::checkOne):
3288         * cssjit/SelectorCompiler.cpp:
3289         (WebCore::SelectorCompiler::addPseudoClassType):
3290         (WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
3291         (WebCore::SelectorCompiler::constructFragments):
3292         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
3293         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorCheckerExcludingPseudoElements):
3294         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateRightmostTreeWalker):
3295         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
3296         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementLinkMatching):
3297         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsFirstLink):
3298         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateStoreLastVisitedElement):
3299
3300 2014-10-13  Chris Dumez  <cdumez@apple.com>
3301
3302         Use modern loops in RenderLayerCompositor
3303         https://bugs.webkit.org/show_bug.cgi?id=137670
3304
3305         Reviewed by Simon Fraser.
3306
3307         Use modern range for-loops in RenderLayerCompositor.
3308
3309         No new tests, no behavior change.
3310
3311         * rendering/RenderLayerCompositor.cpp:
3312         (WebCore::OverlapMapContainer::overlapsLayers):
3313         (WebCore::RenderLayerCompositor::OverlapMap::RectList::intersects):
3314         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush):
3315         (WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush):
3316         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
3317         (WebCore::RenderLayerCompositor::computeCompositingRequirementsForNamedFlowFixed):
3318         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
3319         (WebCore::RenderLayerCompositor::computeRegionCompositingRequirements):
3320         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTreeForNamedFlowFixed):
3321         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
3322         (WebCore::RenderLayerCompositor::rebuildRegionCompositingLayerTree):
3323         (WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
3324         (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
3325         (WebCore::RenderLayerCompositor::recursiveRepaintLayer):
3326         (WebCore::resetTrackedRepaintRectsRecursive):
3327         (WebCore::RenderLayerCompositor::layerHas3DContent):
3328         (WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers):
3329         (WebCore::RenderLayerCompositor::registerAllScrollingLayers):
3330         (WebCore::RenderLayerCompositor::unregisterAllScrollingLayers):
3331
3332 2014-10-13  Chris Dumez  <cdumez@apple.com>
3333
3334         Drop unnecessary overlapMap null checks in computeCompositingRequirements()
3335         https://bugs.webkit.org/show_bug.cgi?id=137668
3336
3337         Reviewed by Andreas Kling.
3338
3339         Drop unnecessary overlapMap null checks in computeCompositingRequirements().
3340         The function is never called with a null overlapMap so we can make the
3341         argument a reference and drop all the null checks.
3342
3343         No new tests, no behavior change.
3344
3345         * rendering/RenderLayerCompositor.cpp:
3346         (WebCore::RenderLayerCompositor::updateCompositingLayers):
3347         (WebCore::RenderLayerCompositor::computeCompositingRequirementsForNamedFlowFixed):
3348         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
3349         (WebCore::RenderLayerCompositor::computeRegionCompositingRequirements):
3350         * rendering/RenderLayerCompositor.h:
3351
3352 2014-10-13  Chris Dumez  <cdumez@apple.com>
3353
3354         Use is<>() / downcast<>() for PlatformCALayer subclasses
3355         https://bugs.webkit.org/show_bug.cgi?id=137661
3356
3357         Reviewed by Simon Fraser.
3358
3359         Use is<>() / downcast<>() for PlatformCALayer subclasses and clean up
3360         the surrounding code.
3361
3362         No new tests, no behavior change.
3363
3364         * platform/graphics/ca/GraphicsLayerCA.cpp:
3365         (WebCore::GraphicsLayerCA::ensureStructuralLayer):
3366         (WebCore::GraphicsLayerCA::updateContentsRects):
3367         (WebCore::GraphicsLayerCA::updateReplicatedLayers):
3368         (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
3369         (WebCore::GraphicsLayerCA::fetchCloneLayers): Deleted.
3370         * platform/graphics/ca/PlatformCALayer.h:
3371         * platform/graphics/ca/TileCoverageMap.cpp:
3372         (WebCore::TileCoverageMap::TileCoverageMap):
3373         * platform/graphics/ca/TileGrid.cpp:
3374         (WebCore::TileGrid::ensureTilesForRect):
3375         * platform/graphics/ca/mac/PlatformCALayerMac.h:
3376         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
3377         (PlatformCALayerMac::clone):
3378         (PlatformCALayerMac::appendSublayer):
3379         (PlatformCALayerMac::insertSublayer):
3380         (PlatformCALayerMac::replaceSublayer):
3381         (PlatformCALayerMac::adoptSublayers):
3382         (PlatformCALayerMac::copyFiltersFrom):
3383         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
3384         (WebCore::CACFLayerTreeHost::setRootChildLayer):
3385         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
3386         (PlatformCALayerWin::clone):
3387         (PlatformCALayerWin::rootLayer):
3388         (PlatformCALayerWin::appendSublayer):
3389         (PlatformCALayerWin::insertSublayer):
3390         (PlatformCALayerWin::replaceSublayer):
3391         (PlatformCALayerWin::adoptSublayers):
3392         (PlatformCALayerWin::copyFiltersFrom):
3393         * platform/graphics/ca/win/PlatformCALayerWin.h:
3394         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
3395         (PlatformCALayerWinInternal::insertSublayer):
3396         * platform/graphics/ca/win/PlatformCALayerWinInternal.h:
3397
3398 2014-10-13  Chris Dumez  <cdumez@apple.com>
3399
3400         Use is<>() / downcast<>() for Filter / FilterOperation subclasses
3401         https://bugs.webkit.org/show_bug.cgi?id=137644
3402
3403         Reviewed by Darin Adler.
3404
3405         Use is<>() / downcast<>() for Filter / FilterOperation subclasses.
3406
3407         No new tests, no behavior change.
3408
3409         * css/CSSComputedStyleDeclaration.cpp:
3410         (WebCore::ComputedStyleExtractor::valueForFilter):
3411         * platform/graphics/ca/mac/PlatformCAFiltersMac.mm:
3412         (PlatformCAFilters::filterValueForOperation):
3413         (PlatformCAFilters::colorMatrixValueForFilter):
3414         * platform/graphics/filters/Filter.h:
3415         * platform/graphics/filters/FilterOperation.cpp:
3416         (WebCore::DefaultFilterOperation::operator==):
3417         (WebCore::ReferenceFilterOperation::operator==):
3418         (WebCore::BasicColorMatrixFilterOperation::blend):
3419         (WebCore::BasicColorMatrixFilterOperation::operator==):
3420         (WebCore::BasicComponentTransferFilterOperation::blend):
3421         (WebCore::BasicComponentTransferFilterOperation::operator==):
3422         (WebCore::BlurFilterOperation::operator==):
3423         (WebCore::BlurFilterOperation::blend):
3424         (WebCore::DropShadowFilterOperation::operator==):
3425         (WebCore::DropShadowFilterOperation::blend):
3426         * platform/graphics/filters/FilterOperation.h:
3427         * platform/graphics/filters/FilterOperations.cpp:
3428         (WebCore::FilterOperations::outsets):
3429         * rendering/FilterEffectRenderer.cpp:
3430         (WebCore::FilterEffectRenderer::build):
3431         * rendering/RenderLayerFilterInfo.cpp:
3432         (WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients):
3433         * rendering/svg/RenderSVGResourceFilterPrimitive.cpp:
3434         (WebCore::RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion):
3435         * svg/graphics/filters/SVGFilter.h:
3436         (isType):
3437
3438 2014-10-13  Chris Dumez  <cdumez@apple.com>
3439
3440         Use is<>() / downcast<>() for Table render objects
3441         https://bugs.webkit.org/show_bug.cgi?id=137641
3442
3443         Reviewed by Mihnea Ovidenie.
3444
3445         Use is<>() / downcast<>() for table-related render objects and clean
3446         up the surrounding code.
3447
3448         No new tests, no behavior change.
3449
3450         * accessibility/AccessibilityARIAGrid.cpp:
3451         (WebCore::AccessibilityARIAGrid::addChildren):
3452         * accessibility/AccessibilityTable.cpp:
3453         (WebCore::AccessibilityTable::tableElement):
3454         (WebCore::AccessibilityTable::isDataTable):
3455         (WebCore::AccessibilityTable::isTableExposableThroughAccessibility):
3456         (WebCore::AccessibilityTable::addChildren):
3457         * accessibility/AccessibilityTableCell.cpp:
3458         (WebCore::AccessibilityTableCell::parentTable):
3459         (WebCore::AccessibilityTableCell::rowIndexRange):
3460         (WebCore::AccessibilityTableCell::columnIndexRange):
3461         (WebCore::AccessibilityTableCell::titleUIElement):
3462         * accessibility/AccessibilityTableColumn.cpp:
3463         (WebCore::AccessibilityTableColumn::headerObject):
3464         * editing/DeleteSelectionCommand.cpp:
3465         (WebCore::DeleteSelectionCommand::removeNode):
3466         * editing/TextIterator.cpp:
3467         (WebCore::shouldEmitTabBeforeNode):
3468         (WebCore::shouldEmitNewlinesBeforeAndAfterNode):
3469         * html/HTMLTableCellElement.cpp:
3470         (WebCore::HTMLTableCellElement::parseAttribute):
3471         (WebCore::HTMLTableCellElement::cellAbove):
3472         * html/HTMLTableColElement.cpp:
3473         (WebCore::HTMLTableColElement::parseAttribute):
3474         * mathml/MathMLElement.cpp:
3475         (WebCore::MathMLElement::parseAttribute):
3476         * rendering/AutoTableLayout.cpp:
3477         (WebCore::AutoTableLayout::recalcColumn):
3478         (WebCore::shouldScaleColumns):
3479         * rendering/RenderBlockFlow.cpp:
3480         (WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths):
3481         * rendering/RenderBox.cpp:
3482         (WebCore::RenderBox::computePercentageLogicalHeight):
3483         (WebCore::RenderBox::layoutOverflowRectForPropagation):
3484         * rendering/RenderElement.cpp:
3485         (WebCore::RenderElement::addChild):
3486         * rendering/RenderLayer.cpp:
3487         (WebCore::RenderLayer::calculateClipRects):
3488         * rendering/RenderTable.cpp:
3489         (WebCore::RenderTable::addChild):
3490         (WebCore::RenderTable::layout):
3491         (WebCore::RenderTable::firstColumn):
3492         (WebCore::RenderTable::recalcSections):
3493         (WebCore::RenderTable::sectionAbove):
3494         (WebCore::RenderTable::sectionBelow):
3495         (WebCore::RenderTable::bottomSection):
3496         * rendering/RenderTable.h:
3497         * rendering/RenderTableCaption.cpp:
3498         (WebCore::RenderTableCaption::table):
3499         * rendering/RenderTableCell.h:
3500         (WebCore::RenderTableCell::nextCell):
3501         (WebCore::RenderTableCell::previousCell):
3502         (WebCore::RenderTableRow::firstCell):
3503         (WebCore::RenderTableRow::lastCell):
3504         * rendering/RenderTableCol.cpp:
3505         (WebCore::RenderTableCol::table):
3506         (WebCore::RenderTableCol::enclosingColumnGroup):
3507         (WebCore::RenderTableCol::nextColumn):
3508         * rendering/RenderTableCol.h:
3509         Make updateFromElement() public to allow the callers to use tighter
3510         typing and devitualize the call as the class is final.
3511
3512         * rendering/RenderTableRow.cpp:
3513         (WebCore::RenderTableRow::addChild):
3514         * rendering/RenderTableRow.h:
3515         (WebCore::RenderTableSection::firstRow):
3516         (WebCore::RenderTableSection::lastRow):
3517         (WebCore::RenderTableRow::nextRow):
3518         (WebCore::RenderTableRow::previousRow):
3519         * rendering/RenderTableSection.cpp:
3520         (WebCore::RenderTableSection::addChild):
3521         (WebCore::RenderTableSection::layoutRows):
3522         (WebCore::RenderTableSection::paintCell):
3523         * rendering/RenderTableSection.h:
3524         * rendering/RenderTreeAsText.cpp:
3525         (WebCore::writeTextRun):
3526         (WebCore::writeSimpleLine):
3527
3528 2014-10-08  Jer Noble  <jer.noble@apple.com>
3529
3530         MediaPlayer::characteristicChanged() is not called when new tracks are found in SourceBufferPrivateAVFObjC
3531         https://bugs.webkit.org/show_bug.cgi?id=137533
3532
3533         Reviewed by Darin Adler.
3534
3535         When a new AVAsset is returned out of the AVStreamDataParser, notify the HTMLMediaElement that
3536         characteristics of the player may have changed.
3537
3538         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3539         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3540         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::characteristicsChanged):
3541         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3542         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
3543
3544 2014-10-13  Jer Noble  <jer.noble@apple.com>
3545
3546         [iOS] Stop listening for wireless playback target availability when the default controls are hidden.
3547         https://bugs.webkit.org/show_bug.cgi?id=137633
3548
3549         Reviewed by Dean Jackson.
3550
3551         In order to minimize the excess bandwidth and power consumption required for actively listening
3552         for wireless playback target availablity, unregister for those notifications while the controls
3553         are hidden due to playback, or when the element's document is hidden.
3554
3555         * Modules/mediacontrols/mediaControlsiOS.js:
3556         (ControllerIOS.prototype.createBase): Register for document visiblity change notfications.
3557         (ControllerIOS.prototype.setControlsType): Call updateShouldListenForPlaybackTargetAvailabilityEvent()
3558             instead of setShouldListenForPlaybackTargetAvailabilityEvent()
3559         (ControllerIOS.prototype.hideControls): Ditto.
3560         (ControllerIOS.prototype.showControls): Ditto.
3561         (ControllerIOS.prototype.updateStatusDisplay): Ditto.
3562         (ControllerIOS.prototype.handleVisibilityChange): Ditto.
3563         (ControllerIOS.prototype.updateShouldListenForPlaybackTargetAvailabilityEvent): Added. Only listen
3564             for target availability when the video has no errors, is not in the initial "big play button"
3565             controls state, and when the controls are not hidden.
3566         * platform/audio/ios/MediaSessionManagerIOS.mm:
3567         (-[WebMediaSessionHelper stopMonitoringAirPlayRoutes]): Explicitly set the discoveryMode to "disabled"
3568             rather than waiting for the autoreleasepool to destroy our routing controller.
3569
3570 2014-10-13  Simon Fraser  <simon.fraser@apple.com>
3571
3572         iOS DRT snapshots are limited to the page visible area
3573         https://bugs.webkit.org/show_bug.cgi?id=137650
3574
3575         Reviewed by Daniel Bates.
3576
3577         LegacyTileCache drawing was limited to the window's visible area, found by
3578         crawling up the layer hierarchy to the root layer. This caused test snapshots to
3579         be missing non-composited content outside the iPhone visible area, which hinders
3580         testing.
3581         
3582         Fix by adding a test-only mode where the window visible area is the entire window.
3583
3584         * platform/ios/wak/WAKWindow.h:
3585         * platform/ios/wak/WAKWindow.mm:
3586         (-[WAKWindow setEntireWindowVisibleForTesting:]):
3587         (-[WAKWindow _visibleRectRespectingMasksToBounds:]):
3588
3589 2014-10-13  Mihnea Ovidenie  <mihnea@adobe.com>
3590
3591         [CSSRegions] Make RenderNamedFlowFragment::computeStyleInRegion const
3592         https://bugs.webkit.org/show_bug.cgi?id=137604
3593
3594         Reviewed by Andrei Bucur.
3595
3596         The method computeStyleInRegion should be const as it does not modify
3597         the state of the RenderNamedFlowFragment instance. Make pointers to
3598         the region used for styling const along the way. No new tests as no
3599         change in functionality.
3600
3601         * css/ElementRuleCollector.h:
3602         (WebCore::ElementRuleCollector::ElementRuleCollector):
3603         (WebCore::ElementRuleCollector::setRegionForStyling):
3604         * css/StyleResolver.cpp:
3605         (WebCore::StyleResolver::State::initForStyleResolve):
3606         (WebCore::StyleResolver::styleForElement):
3607         * css/StyleResolver.h:
3608         * rendering/RenderNamedFlowFragment.cpp:
3609         (WebCore::RenderNamedFlowFragment::computeStyleInRegion):
3610         * rendering/RenderNamedFlowFragment.h:
3611
3612 2014-09-30  Sergio Villar Senin  <svillar@igalia.com>
3613
3614         [CSS Grid Layout] Pass the valid set of tracks to grow beyond growth limits
3615         https://bugs.webkit.org/show_bug.cgi?id=137253
3616
3617         Reviewed by Darin Adler.
3618
3619         Section 10.4 of the specs describe how to resolve content based
3620         track sizing functions. Among others it describes the "distribute
3621         extra space" algorithm. The 3rd bullet of that algorithm specifies
3622         how to distribute (and also the target tracks) the extra space
3623         once all the tracks have reached their growth limits.
3624
3625         Our implementation had 2 problems. First we were not passing a
3626         valid subset of tracks (instead we were always using all of
3627         them). Now we use a function that filters the right tracks to be
3628         the target of the extra space distribution depending on whether
3629         we're computing the min track function or the max track function.
3630
3631         Secondly the algorithm that was distributing the extra space was
3632         not using that list of passed in tracks (it iterated over all of
3633         them). From now on it will use the set of tracks selected using
3634         the filter function described above.
3635
3636         * rendering/RenderGrid.cpp:
3637         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
3638         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
3639         (WebCore::RenderGrid::distributeSpaceToTracks):
3640         * rendering/RenderGrid.h:
3641         * rendering/style/GridTrackSize.h:
3642         (WebCore::GridTrackSize::hasMinContentMinTrackBreadthAndMinOrMaxContentMaxTrackBreadth):
3643         (WebCore::GridTrackSize::hasMaxContentMinTrackBreadthAndMaxContentMaxTrackBreadth):
3644
3645 2014-10-12  Mike West  <mkwst@chromium.org>
3646
3647         Referrer Policy: Update <meta name="referrer"> values to match the spec
3648         https://bugs.webkit.org/show_bug.cgi?id=137635
3649
3650         Reviewed by Jochen Eisinger.
3651
3652         The Referrer Policy specification ([Working Draft][WD], [Editor's
3653         draft[ED]) defines different keywords than we originally
3654         implemented. We should support them in the interests of clarity and
3655         interoperability with other browsers implementing the specification.
3656
3657         [WD]: http://www.w3.org/TR/referrer-policy/#referrer-policy-delivery-meta
3658         [ED]: http://w3c.github.io/webappsec/specs/referrer-policy/#referrer-policy-delivery-meta
3659
3660         This patch is a port of Blink's https://codereview.chromium.org/607433002/
3661
3662         Tests: http/tests/security/referrer-policy-conflicting-policies.html
3663                http/tests/security/referrer-policy-https-no-referrer-when-downgrade.html
3664                http/tests/security/referrer-policy-https-no-referrer.html
3665                http/tests/security/referrer-policy-https-unsafe-url.html
3666                http/tests/security/referrer-policy-no-referrer-when-downgrade.html
3667                http/tests/security/referrer-policy-no-referrer.html
3668
3669         * dom/Document.cpp:
3670         (WebCore::Document::processReferrerPolicy):
3671
3672 2014-10-12  Dhi Aurrahman  <diorahman@rockybars.com>
3673
3674         Support activation behavior of link element
3675         https://bugs.webkit.org/show_bug.cgi?id=137597
3676
3677         Reviewed by Benjamin Poulain.
3678
3679         Support activation behavior of link elements as defined in [1],
3680         i.e. to follow the hyperlink created by the link element when it is fully active.
3681
3682         [1] https://html.spec.whatwg.org/multipage/semantics.html#the-link-element
3683
3684         Tests: fast/dom/html-link-element-activation-behavior-on-element-click.html
3685                fast/dom/html-link-element-activation-behavior-on-mouse-click.html
3686                fast/dom/html-link-element-activation-behavior-url-is-null.html
3687
3688         * dom/MouseEvent.cpp:
3689         (WebCore::MouseEvent::triggerActivationBehavior):
3690         * dom/MouseEvent.h:
3691         * html/HTMLAnchorElement.cpp:
3692         (WebCore::HTMLAnchorElement::defaultEventHandler):
3693         (WebCore::isLinkClick): Deleted.
3694         * html/HTMLAnchorElement.h:
3695         * html/HTMLLinkElement.cpp:
3696         (WebCore::HTMLLinkElement::defaultEventHandler):
3697         (WebCore::HTMLLinkElement::handleClick):
3698         * html/HTMLLinkElement.h:
3699         * svg/SVGAElement.cpp:
3700         (WebCore::SVGAElement::defaultEventHandler):
3701
3702 2014-10-11  KwangHyuk Kim  <hyuki.kim@samsung.com>
3703
3704         [EFL] Enable WebP support.
3705         https://bugs.webkit.org/show_bug.cgi?id=136156
3706
3707         Reviewed by Gyuyoung Kim.
3708
3709         Add WebP library and inlcude path to WebCore path for WK2 Efl.
3710         No new tests since existing feature is just enabled for WK2 Efl.
3711
3712         * PlatformEfl.cmake:
3713
3714 2014-10-11  Carlos Garcia Campos  <cgarcia@igalia.com>
3715
3716         [GLIB] Split GMainLoopSource moving thread safe implementation to its own class GThreadSafeMainLoopSource
3717         https://bugs.webkit.org/show_bug.cgi?id=137485
3718
3719         Reviewed by Sergio Villar Senin.
3720
3721         Use GThreadSafeMainLoopSource for GStreamer sources, since they
3722         can be used from different threads. Also update GMutexLocker
3723         usages, since it's now a template.
3724
3725         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
3726         (WebCore::AudioFileReader::createBus):
3727         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
3728         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3729         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3730         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture):
3731         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
3732         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
3733         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3734         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
3735         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
3736         (webkitVideoSinkTimeoutCallback):
3737         (webkitVideoSinkRender):
3738         (unlockBufferMutex):
3739         (webkitVideoSinkUnlockStop):
3740         (webkitVideoSinkStart):
3741         * platform/graphics/gstreamer/WebKitMediaSourceGStreamer.cpp:
3742         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3743         (webKitWebSrcGetProperty):
3744         (webKitWebSrcStop):
3745         (webKitWebSrcStart):
3746         (webKitWebSrcChangeState):
3747         (webKitWebSrcQueryWithParent):
3748         (webKitWebSrcGetUri):
3749         (webKitWebSrcSetUri):
3750         (webKitWebSrcNeedDataMainCb):
3751         (webKitWebSrcNeedDataCb):
3752         (webKitWebSrcEnoughDataMainCb):
3753         (webKitWebSrcEnoughDataCb):
3754         (webKitWebSrcSeekDataCb):
3755         (webKitWebSrcSetMediaPlayer):
3756         (StreamingClient::createReadBuffer):
3757         (StreamingClient::handleResponseReceived):
3758         (StreamingClient::handleDataReceived):
3759         (StreamingClient::handleNotifyFinished):
3760         (ResourceHandleStreamingClient::wasBlocked):
3761         (ResourceHandleStreamingClient::cannotShowURL):
3762
3763 2014-10-10  Chris Dumez  <cdumez@apple.com>
3764
3765         Use is<>() / downcast<>() for Image subclasses
3766         https://bugs.webkit.org/show_bug.cgi?id=137625
3767
3768         Reviewed by Andreas Kling.
3769
3770         Use is<>() / downcast<>() for Image subclasses.
3771
3772         No new tests, no behavior change.
3773
3774         * accessibility/AccessibilityRenderObject.cpp:
3775         (WebCore::AccessibilityRenderObject::remoteSVGRootElement):
3776         * loader/cache/CachedImage.cpp:
3777         (WebCore::CachedImage::imageSizeForRenderer):
3778         (WebCore::CachedImage::createImage):
3779         * platform/graphics/BitmapImage.h:
3780         * platform/graphics/Image.h:
3781         * platform/mac/DragImageMac.mm:
3782         (WebCore::createDragImageFromImage):
3783         * rendering/RenderImage.cpp:
3784         (WebCore::RenderImage::embeddedContentBox):
3785         * svg/graphics/SVGImage.h:
3786
3787 2014-10-10  Chris Dumez  <cdumez@apple.com>
3788
3789         Use is<>() / downcast<>() for RenderElement
3790         https://bugs.webkit.org/show_bug.cgi?id=137622
3791
3792         Reviewed by Benjamin Poulain.
3793
3794         Use is<>() / downcast<>() for RenderElement and clean up the
3795         surrounding code.
3796
3797         No new tests, no behavior change.
3798
3799         * accessibility/AccessibilityImageMapLink.cpp:
3800         (WebCore::AccessibilityImageMapLink::imageMapLinkRenderer):
3801         * accessibility/AccessibilityRenderObject.cpp:
3802         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
3803         * css/CSSComputedStyleDeclaration.cpp:
3804         (WebCore::computeRenderStyleForProperty):
3805         * dom/Node.cpp:
3806         (WebCore::Node::materializeRareData):
3807         * dom/Position.cpp:
3808         (WebCore::isNonTextLeafChild):
3809         (WebCore::searchAheadForBetterMatch):
3810         * dom/PseudoElement.cpp:
3811         (WebCore::PseudoElement::didRecalcStyle):
3812         * editing/CompositeEditCommand.cpp:
3813         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
3814         * editing/htmlediting.cpp:
3815         (WebCore::isEmptyTableCell):
3816         * rendering/InlineIterator.h:
3817         (WebCore::bidiNextShared):
3818         * rendering/RenderBlock.cpp:
3819         (WebCore::RenderBlock::getFirstLetter):
3820         * rendering/RenderBox.cpp:
3821         (WebCore::RenderBox::layout):
3822         * rendering/RenderCounter.cpp:
3823         (WebCore::RenderCounter::rendererRemovedFromTree):
3824         (WebCore::RenderCounter::rendererSubtreeAttached):
3825         (showCounterRendererTree):
3826         * rendering/RenderElement.cpp:
3827         (WebCore::RenderElement::insertChildInternal):
3828         (WebCore::RenderElement::removeChildInternal):
3829         (WebCore::RenderElement::findNextLayer):
3830         (WebCore::RenderElement::layout):
3831         * rendering/RenderElement.h:
3832         (WebCore::RenderObject::isRenderLayerModelObject):
3833         (WebCore::RenderObject::isBoxModelObject):
3834         (WebCore::RenderObject::isRenderBlock):
3835         (WebCore::RenderObject::isRenderBlockFlow):
3836         (WebCore::RenderObject::isRenderReplaced):
3837         (WebCore::RenderObject::isRenderInline):
3838         (WebCore::RenderObject::style):
3839         (WebCore::RenderObject::firstLineStyle):
3840         (WebCore::ContainerNode::renderer):
3841         * rendering/RenderFrameSet.cpp:
3842         (WebCore::RenderFrameSet::paint):
3843         * rendering/RenderLayer.cpp:
3844         (WebCore::RenderLayer::calculateClipRects):
3845         * rendering/RenderNamedFlowFragment.cpp:
3846         (WebCore::RenderNamedFlowFragment::computeChildrenStyleInRegion):
3847         (WebCore::RenderNamedFlowFragment::setObjectStyleInRegion):
3848         (WebCore::RenderNamedFlowFragment::restoreRegionObjectsOriginalStyle):
3849         * rendering/RenderObject.cpp:
3850         (WebCore::RenderObject::clearNeedsLayout):
3851         (WebCore::RenderObject::willBeDestroyed):
3852         (WebCore::RenderObject::collectAnnotatedRegions):
3853         * rendering/RenderVTTCue.cpp:
3854         (WebCore::RenderVTTCue::initializeLayoutParameters):
3855         (WebCore::RenderVTTCue::repositionGenericCue):
3856         * rendering/mathml/RenderMathMLFraction.cpp:
3857         (WebCore::RenderMathMLFraction::addChild):
3858         * rendering/mathml/RenderMathMLMenclose.cpp:
3859         (WebCore::RenderMathMLMenclose::addChild):
3860         * rendering/mathml/RenderMathMLOperator.cpp:
3861         (WebCore::RenderMathMLOperator::rebuildTokenContent):
3862         (WebCore::RenderMathMLOperator::updateStyle):
3863         * rendering/mathml/RenderMathMLRoot.cpp:
3864         (WebCore::RenderMathMLRoot::addChild):
3865         (WebCore::RenderMathMLRoot::layout):
3866         * rendering/mathml/RenderMathMLToken.cpp:
3867         (WebCore::RenderMathMLToken::addChild):
3868         (WebCore::RenderMathMLToken::updateTokenContent):
3869         (WebCore::RenderMathMLToken::updateStyle):
3870         * rendering/mathml/RenderMathMLUnderOver.cpp:
3871         (WebCore::RenderMathMLUnderOver::layout):
3872         * rendering/svg/RenderSVGResource.cpp:
3873         (WebCore::RenderSVGResource::markForLayoutAndParentResourceInvalidation):
3874         * rendering/svg/RenderSVGText.cpp:
3875         (WebCore::findPreviousAndNextAttributes):
3876         (WebCore::RenderSVGText::subtreeStyleDidChange):
3877         (WebCore::updateFontInAllDescendants):
3878         * rendering/svg/SVGRenderSupport.cpp:
3879         (WebCore::SVGRenderSupport::layoutChildren):
3880         * rendering/svg/SVGResourcesCache.cpp:
3881         (WebCore::SVGResourcesCache::clientWasAddedToTree):
3882         (WebCore::SVGResourcesCache::clientWillBeRemovedFromTree):
3883         * rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
3884         (WebCore::SVGTextLayoutAttributesBuilder::buildLayoutAttributesForTextRenderer):
3885         (WebCore::SVGTextLayoutAttributesBuilder::buildLayoutAttributesForForSubtree):
3886         (WebCore::SVGTextLayoutAttributesBuilder::rebuildMetricsForTextRenderer):
3887         * rendering/svg/SVGTextLayoutAttributesBuilder.h:
3888         * rendering/svg/SVGTextMetricsBuilder.cpp:
3889         (WebCore::SVGTextMetricsBuilder::initializeMeasurementWithTextRenderer):
3890         (WebCore::SVGTextMetricsBuilder::measureTextRenderer):
3891         (WebCore::SVGTextMetricsBuilder::walkTree):
3892         (WebCore::SVGTextMetricsBuilder::buildMetricsAndLayoutAttributes):
3893         * rendering/svg/SVGTextMetricsBuilder.h:
3894         * rendering/svg/SVGTextRunRenderingContext.cpp:
3895         (WebCore::SVGTextRunRenderingContext::createGlyphToPathTranslator):
3896         (WebCore::SVGTextRunRenderingContext::drawSVGGlyphs):
3897         (WebCore::SVGTextRunRenderingContext::glyphDataForCharacter):
3898         * svg/SVGFontData.cpp:
3899         (WebCore::SVGFontData::applySVGGlyphSelection):
3900
3901 2014-10-10  Benjamin Poulain  <benjamin@webkit.org>
3902
3903         Update :nth-child(An+B of selector-list) to the latest specification
3904         https://bugs.webkit.org/show_bug.cgi?id=137593
3905
3906         Reviewed by Andreas Kling.
3907
3908         Following my implementation feedback on :nth-child(An+B of selector-list),
3909         the CSS WG decided to change the definition such that the current element on which
3910         the selector is matched must also match the selector list in :nth-child().
3911
3912         This patch updates the implementation accordingly.
3913
3914         Test: fast/selectors/nth-child-of-chained-3.html
3915
3916         * css/SelectorChecker.cpp:
3917         (WebCore::SelectorChecker::checkOne):
3918         (WebCore::SelectorChecker::matchSelectorList):
3919         * css/SelectorChecker.h:
3920         * cssjit/SelectorCompiler.cpp:
3921         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatchesSelectorList):
3922         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
3923
3924 2014-10-10  Chris Dumez  <cdumez@apple.com>
3925
3926         Drop RENDER_OBJECT_TYPE_CASTS() for a lot of RenderObject subclasses
3927         https://bugs.webkit.org/show_bug.cgi?id=137594
3928
3929         Reviewed by Darin Adler.
3930
3931         Drop RENDER_OBJECT_TYPE_CASTS() for RenderObject subclasses that no
3932         longer needed it or that required very few changes to do so. This will
3933         make sure developers start using is<>() / downcast<>() for those
3934         classes.
3935
3936         No new tests, no behavior change.
3937
3938         * accessibility/AccessibilityRenderObject.cpp:
3939         (WebCore::AccessibilityRenderObject::textUnderElement):
3940         (WebCore::AccessibilityRenderObject::stringValue):
3941         (WebCore::AccessibilityRenderObject::titleUIElement):
3942         * dom/PseudoElement.cpp:
3943         (WebCore::PseudoElement::didAttachRenderers):
3944         * html/HTMLCanvasElement.cpp:
3945         (WebCore::HTMLCanvasElement::reset):
3946         * html/HTMLPlugInElement.cpp:
3947         (WebCore::HTMLPlugInElement::defaultEventHandler):
3948         * html/HTMLPlugInImageElement.cpp:
3949         (WebCore::HTMLPlugInImageElement::updateSnapshot):
3950         (WebCore::HTMLPlugInImageElement::checkSnapshotStatus):
3951         * html/SearchInputType.cpp:
3952         (WebCore::SearchInputType::addSearchResult):
3953         (WebCore::SearchInputType::didSetValueByUserEdit):
3954         * html/shadow/TextControlInnerElements.cpp:
3955         (WebCore::TextControlInnerTextElement::renderer):
3956         (WebCore::TextControlInnerTextElement::customStyleForRenderer):
3957         (WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
3958         * page/FrameView.cpp:
3959         (WebCore::FrameView::isInChildFrameWithFrameFlattening):
3960         * rendering/RenderButton.h:
3961         * rendering/RenderCounter.h:
3962         * rendering/RenderDetailsMarker.h:
3963         * rendering/RenderFieldset.h:
3964         * rendering/RenderFileUploadControl.cpp:
3965         (WebCore::RenderFileUploadControl::paintObject):
3966         * rendering/RenderFileUploadControl.h:
3967         * rendering/RenderFlexibleBox.h:
3968         * rendering/RenderFullScreen.h:
3969         * rendering/RenderGrid.h:
3970         * rendering/RenderHTMLCanvas.h:
3971         * rendering/RenderIFrame.h:
3972         * rendering/RenderLayerBacking.cpp:
3973         (WebCore::RenderLayerBacking::contentsBox):
3974         * rendering/RenderMedia.h:
3975         * rendering/RenderQuote.cpp:
3976         (WebCore::RenderQuote::attachQuote):
3977         * rendering/RenderQuote.h:
3978         * rendering/RenderReplaced.h:
3979         * rendering/RenderScrollbarPart.h:
3980         * rendering/RenderSearchField.h:
3981         * rendering/RenderSnapshottedPlugIn.h:
3982         * rendering/RenderTableCaption.h:
3983         * rendering/RenderTextControlMultiLine.h:
3984         * rendering/RenderTextControlSingleLine.h:
3985         * rendering/RenderThemeMac.mm:
3986         (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
3987         * rendering/RenderTreeAsText.cpp:
3988         (WebCore::RenderTreeAsText::writeRenderObject):
3989         * rendering/RenderVideo.cpp:
3990         (WebCore::rendererPlaceholder):
3991         * rendering/line/BreakingContextInlineHeaders.h:
3992         (WebCore::updateCounterIfNeeded):
3993         * rendering/svg/RenderSVGContainer.h:
3994         * rendering/svg/RenderSVGGradientStop.h:
3995         * rendering/svg/RenderSVGModelObject.h:
3996         * rendering/svg/RenderSVGPath.h:
3997         * rendering/svg/RenderSVGResourceFilter.h:
3998         * rendering/svg/RenderSVGResourceFilterPrimitive.cpp:
3999         (WebCore::RenderSVGResourceFilterPrimitive::styleDidChange):
4000         * rendering/svg/RenderSVGTextPath.h:
4001         * rendering/svg/RenderSVGTransformableContainer.h:
4002         * rendering/svg/RenderSVGViewportContainer.h:
4003         * rendering/svg/SVGRenderSupport.cpp:
4004         (WebCore::SVGRenderSupport::repaintRectForRendererInLocalCoordinatesExcludingSVGShadow):
4005         (WebCore::SVGRenderSupport::checkForSVGRepaintDuringLayout):
4006         (WebCore::updateObjectBoundingBox):
4007         (WebCore::layoutSizeOfNearestViewportChanged):
4008         (WebCore::SVGRenderSupport::transformToRootChanged):
4009         (WebCore::SVGRenderSupport::rendererHasSVGShadow):
4010         (WebCore::SVGRenderSupport::setRendererHasSVGShadow):
4011         * rendering/svg/SVGTextLayoutEngine.cpp:
4012         (WebCore::SVGTextLayoutEngine::beginTextPathLayout):
4013         * svg/SVGPathElement.cpp:
4014         (WebCore::SVGPathElement::svgAttributeChanged):
4015         (WebCore::SVGPathElement::pathSegListChanged):
4016         (WebCore::SVGPathElement::getBBox):
4017         * svg/SVGSVGElement.cpp:
4018         (WebCore::SVGSVGElement::currentViewportSize):
4019
4020 2014-10-10  Chris Dumez  <cdumez@apple.com>
4021
4022         Use is<>() / downcast<>() for GraphicsLayer subclasses
4023         https://bugs.webkit.org/show_bug.cgi?id=137595
4024
4025         Reviewed by Darin Adler.
4026
4027         Use is<>() / downcast<>() for GraphicsLayer subclasses and clean up the
4028         surrounding code.
4029
4030         No new tests, no beha