5526b81a771c181fd5226c6dbb0a35c3b84f189e
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2014-09-17  Iago Toral  <itoral@igalia.com> and Zan Dobersek  <zdobersek@igalia.com>
2
3         [GTK] Add Wayland support to GLContextEGL
4         https://bugs.webkit.org/show_bug.cgi?id=136829
5
6         Reviewed by Martin Robinson.
7
8         * platform/graphics/egl/GLContextEGL.cpp:
9         (WebCore::sharedEGLDisplay): Special-case the shared EGL display initialization
10         for the GTK port when running under Wayland. In that case the pointer to the
11         native wl_display object should be passed to eglGetDisplay(). If not running
12         under Wayland we should fall back to using the shared X11 display (if support
13         for that display system is enabled) or the EGL_DEFAULT_DISPLAY.
14
15 2014-09-17  Daniel Bates  <dabates@apple.com>
16
17         Unreviewed, rolling out r173695.
18
19         Broke building third-party Legacy WebKit apps; will
20         investigate offline
21
22         Reverted changeset:
23
24         "[iOS] Make WebCore build with public iOS SDK"
25         https://bugs.webkit.org/show_bug.cgi?id=136487
26         http://trac.webkit.org/changeset/173695
27
28 2014-09-17  Roger Fong  <roger_fong@apple.com>
29
30         Speculative fix for a fast\dom\html-collections-named-getter failing only in Debug builds.
31
32         * dom/Node.cpp:
33         (WebCore::Document::invalidateNodeListAndCollectionCaches):
34
35 2014-09-17  Benjamin Poulain  <bpoulain@apple.com>
36
37         Add parsing for :nth-child(An+B of selector)
38         https://bugs.webkit.org/show_bug.cgi?id=136845
39
40         Reviewed by Antti Koivisto.
41
42         Add support for parsing :nth-child(of). The implementation of selector matching
43         will be in a follow up, there are enough edge cases here already.
44
45         Spec here: http://dev.w3.org/csswg/selectors4/#the-nth-child-pseudo
46
47         Test: fast/css/parsing-css-nth-child-of.html
48
49         * css/CSSParser.cpp:
50         (WebCore::CSSParser::detectFunctionTypeToken):
51         (WebCore::CSSParser::realLex):
52         The parser generate two new kinds of tokens:
53         -NTHCHILDFUNCTION, matching the "nth-child" identifier.
54         -NTHCHILDSELECTORSEPARATOR, matching the "of" keyword separating An+B from the selector list.
55
56         NTHCHILDFUNCTION is used to extend the new syntax only for :nth-child() and not all the "nth" functions
57         (e.g. :nth-of-type()).
58
59         NTHCHILDSELECTORSEPARATOR exists for two reasons:
60         -We must clear the "parsingMode" before parsing selectorList. If we failed to do that, the complex selectors
61          would be parsed in NthChildMode, which has all kind of bad side effects.
62         -The second reason is differentiacting "of" for all the other identifiers. Arguably, this could have been done
63          in the grammar, but it is clearer this way since we already need the branches for the parsingMode.
64
65         * css/CSSGrammar.y.in:
66         Those are pretty much duplicates of the existing FUNCTION rules but supporting the new syntax.
67
68         * css/CSSParserValues.cpp:
69         (WebCore::selectorListMatchesPseudoElement):
70         (WebCore::CSSParserSelector::matchesPseudoElement):
71         Matching pseudo elements does not make much sense for those selectorList (e.g. :nth-child(2n of ::before)).
72         Add helper function to fail parsing of those cases.
73
74         * css/CSSParserValues.h:
75         * css/CSSSelector.cpp:
76         (WebCore::CSSSelector::selectorText):
77         * css/CSSSelector.h:
78         (WebCore::CSSSelector::selectorList):
79         Updated serialization code for CSS OM.
80
81 2014-09-17  Benjamin Poulain  <bpoulain@apple.com>
82
83         CSS value in whitespace-separated list attribute selector (~=) mishandles tab/newline/etc.
84         https://bugs.webkit.org/show_bug.cgi?id=136807
85
86         Reviewed by Antti Koivisto.
87
88         The spec defines selector lists as token separated by white space.
89
90         The definition of white space for CSS Selectors is:
91         "White space in Selectors consists of the code points SPACE (U+0020),
92         TAB (U+0009), LINE FEED (U+000A), CARRIAGE RETURN (U+000D), and FORM FEED (U+000C)
93         can occur in whitespace. Other space-like code points, such as EM SPACE (U+2003)
94         and IDEOGRAPHIC SPACE (U+3000), are never part of white space."
95
96         The old code was only matching SPACE (U+0020) which is buggy. This patch
97         adds support for the other caracters.
98
99         Tests: fast/selectors/attr-list-01.html
100                fast/selectors/attribute-list-with-whitespace-in-selector.html
101                fast/selectors/attribute-list-with-whitespace-in-value.html
102
103         * css/SelectorChecker.cpp:
104         (WebCore::attributeValueMatches):
105         * cssjit/SelectorCompiler.cpp:
106         (WebCore::SelectorCompiler::constructFragments):
107         (WebCore::SelectorCompiler::attributeValueSpaceSeparetedListContains):
108         Add the missing checks.
109
110         * html/track/VTTRegion.cpp:
111         (WebCore::VTTRegion::setRegionSettings):
112         (WebCore::VTTRegion::parseSettingValue):
113         * html/track/WebVTTParser.cpp:
114         (WebCore::WebVTTParser::hasRequiredFileIdentifier):
115         (WebCore::WebVTTParser::collectTimingsAndSettings):
116         * html/track/WebVTTParser.h:
117         While looking for affected code, I discovered WebVTT redefines isHTMLSpace().
118         I cleaned that code.
119
120 2014-09-17  Gavin Barraclough  <baraclough@apple.com>
121
122         Aways have a PageThrottler (sometimes have a UserActivity::Impl)
123         https://bugs.webkit.org/show_bug.cgi?id=136892
124
125         Reviewed by Geoffrey Garen.
126
127         Some instances of Page have a PageThrottler to track activity on the Page, and some do not.
128         (Specifically, those created from WebPage in WK2 do, those related to WK1, SVG & inspector do not).
129
130         We do this for three reasons:
131             * We do not need to take AppNap assertions on WK1.
132             * Some Pages do not track their visibility correctly, and would always claim to be visible.
133             * Page VisibilityState is not set until after construction, so if we instantiate
134
135         Creating the entire PageThrottler lazily has the drawback that we have to check for its existence at
136         numerous points throughout the code, and we'll miss activity that occurs between the Page being created
137         & the PageThrottler added to it (really a theoretical problem right now, since they're currently always
138         created pretty much back to back).
139
140         Instead, Page should always have a PageThrottler, & instead make the UserActivity::Impl on the
141         PageThrottler be added later.
142
143         * WebCore.exp.in:
144             - createPageThrottler -> enablePageThrottler
145         * html/HTMLMediaElement.cpp:
146         (WebCore::HTMLMediaElement::parseAttribute):
147             - Page::pageThrottler now returns a reference rather than a pointer
148         * loader/FrameLoader.cpp:
149         (WebCore::FrameLoader::started):
150             - Page::pageThrottler now returns a reference rather than a pointer
151         * page/Page.cpp:
152         (WebCore::Page::Page):
153             - instantiate PageThrottler in constructor
154         (WebCore::Page::enablePageThrottler):
155             - renamed from createPageThrottler, instead of creating the PageThrottler this method now
156               instruct PageThrottler to create a UserActivity::Impl
157         (WebCore::Page::setViewState):
158             - m_pageThrottler is not a pointer
159         (WebCore::Page::createPageThrottler): Deleted.
160             - renamed to enablePageThrottler
161         * page/Page.h:
162         (WebCore::Page::pageThrottler):
163             - now returns a reference
164         * page/PageThrottler.cpp:
165         (WebCore::PageThrottler::PageThrottler):
166             - no longer instantiate m_activity
167         (WebCore::PageThrottler::createUserActivity):
168             - lazily instantiate m_activity, call updateUserActivity
169         (WebCore::PageThrottler::updateUserActivity):
170             - m_activity may not yet be instantiated; added early return
171         * page/PageThrottler.h:
172             - m_activity becomes a std::unique_ptr, added createUserActivity
173
174 2014-09-17  Daniel Bates  <dabates@apple.com>
175
176         [iOS] Make WebCore build with public iOS SDK
177         https://bugs.webkit.org/show_bug.cgi?id=136487
178
179         Reviewed by David Kilzer.
180
181         Add headers that wrap Mac and iOS SPIs and update WebCore source files to include these
182         headers instead of the corresponding actual SPI header(s).
183
184         * WebCore.vcxproj/WebCore.vcxproj:
185         * WebCore.vcxproj/WebCore.vcxproj.filters:
186         * WebCore.vcxproj/WebCoreCG.props:
187         * WebCore.vcxproj/copyForwardingHeaders.cmd:
188         * WebCore.xcodeproj/project.pbxproj:
189         * bindings/objc/DOMInternal.mm:
190         * bridge/objc/objc_instance.mm:
191         * platform/audio/ios/MediaSessionManagerIOS.mm:
192         * platform/cocoa/DisplaySleepDisablerCocoa.cpp:
193         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
194         * platform/graphics/SimpleFontData.h:
195         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
196         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
197         * platform/graphics/cg/BitmapImageCG.cpp:
198         * platform/graphics/cg/ColorCG.cpp:
199         * platform/graphics/cg/GraphicsContextCG.cpp:
200         * platform/graphics/cg/ImageSourceCG.cpp:
201         * platform/graphics/cg/PDFDocumentImage.cpp:
202         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
203         * platform/graphics/ios/FontCacheIOS.mm:
204         * platform/graphics/ios/FontServicesIOS.mm:
205         * platform/graphics/ios/SimpleFontDataIOS.mm:
206         * platform/graphics/mac/FontMac.mm:
207         * platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
208         * platform/graphics/mac/MediaPlayerProxy.h:
209         * platform/graphics/mac/SimpleFontDataMac.mm:
210         * platform/ios/LegacyTileCache.mm:
211         * platform/ios/LegacyTileGrid.mm:
212         * platform/ios/LegacyTileGridTile.mm:
213         * platform/ios/PlatformEventFactoryIOS.mm:
214         * platform/ios/PlatformScreenIOS.mm:
215         * platform/ios/WebEvent.mm:
216         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
217         * platform/ios/wak/WAKAppKitStubs.h:
218         * platform/ios/wak/WAKView.h:
219         * platform/ios/wak/WKGraphics.h:
220         * platform/ios/wak/WKGraphics.mm:
221         * platform/ios/wak/WebCoreThread.mm:
222         * platform/network/ios/QuickLook.mm:
223         * platform/spi/ca/CALayerSPI.h: Added.
224         * platform/spi/ca/CATiledLayerSPI.h: Added.
225         * platform/spi/cf/CFLocaleSPI.h: Modified to use EXTERN_C.
226         * platform/spi/cf/CFNetworkConnectionCacheSPI.h: Ditto. Also changed header visibility from private to project.
227         * platform/spi/cf/CFURLRequestSPI.h: Ditto. Also modified to unconditionally include header <CoreFoundation/CFBase.h>.
228         * platform/spi/cg/CGColorTransformSPI.h: Added.
229         * platform/spi/cg/CGContextSPI.h: Added.
230         * platform/spi/cg/CGFloatSPI.h: Added.
231         * platform/spi/cg/CGFontGlyphSupportSPI.h: Added.
232         * platform/spi/cg/CGFontInfoSPI.h: Added.
233         * platform/spi/cg/CGFontRenderingSPI.h: Added.
234         * platform/spi/cg/CGFontUnicodeSupportSPI.h: Added.
235         * platform/spi/cg/CGImageSPI.h: Added.
236         * platform/spi/cg/CGSRegionSPI.h: Added.
237         * platform/spi/cocoa/DispatchSPI.h: Added.
238         * platform/spi/cocoa/IOPMLibSPI.h: Added.
239         * platform/spi/cocoa/MachVMSPI.h: Added.
240         * platform/spi/cocoa/NSFileManagerSPI.h: Added.
241         * platform/spi/cocoa/NSGeometrySPI.h: Added.
242         * platform/spi/cocoa/NSPointerFunctionsSPI.h: Added.
243         * platform/spi/cocoa/dyldSPI.h: Added.
244         * platform/spi/ios/AVPlayerControllerSPI.h: Added.
245         * platform/spi/ios/AVPlayerViewControllerSPI.h: Added.
246         * platform/spi/ios/AVValueTimingSPI.h: Added.
247         * platform/spi/ios/AVVideoLayerSPI.h: Added.
248         * platform/spi/ios/CTFontDescriptorSPI.h: Added.
249         * platform/spi/ios/CTFontSPI.h: Added.
250         * platform/spi/ios/CUICatalogSPI.h: Added.
251         * platform/spi/ios/CUIStyleEffectConfigurationSPI.h: Added.
252         * platform/spi/ios/MPAVRoutingControllerSPI.h: Added.
253         * platform/spi/ios/MobileGestaltSPI.h: Added.
254         * platform/spi/ios/QLPreviewConverterSPI.h: Added.
255         * platform/spi/ios/QuickLookSPI.h: Added.
256         * rendering/RenderThemeIOS.mm:
257
258 2014-09-17  Gavin Barraclough  <barraclough@apple.com>
259
260         DOM timer throttling for hidden plugins
261         https://bugs.webkit.org/show_bug.cgi?id=136197
262
263         Reviewed by Geoff Garen & Andreas Kling.
264
265         For non-visible web pages we slow timers (since they can't be driving animations, etc).
266         We should do the same for plugins.
267
268         There are a few steps to this:
269             - JSPluginElementFunctions notifies DOMTimer when script interacts with a plugin.
270             - DOMTimerFireState keeps a record of events that occur while a timer is firing.
271             - DOMTimer::fired detects timers that interact with invisible/inaudible plugins, and flags itself for throtting.
272             - DOMTimer::intervalClampedToMinimum sets timer intervals appropriately.
273
274         * bindings/js/JSPluginElementFunctions.cpp:
275         (WebCore::pluginScriptObject):
276             - notify DOMTimer when script interacts with a plugin.
277         * html/HTMLPlugInElement.cpp:
278         (WebCore::HTMLPlugInElement::isDetectable):
279         * html/HTMLPlugInElement.h:
280             - added isDetectable, to check for visible / audible plugins.
281         * page/DOMTimer.cpp:
282         (WebCore::DOMTimerFireState::DOMTimerFireState):
283         (WebCore::DOMTimerFireState::~DOMTimerFireState):
284             - track current DOMTimerFireState.
285         (WebCore::DOMTimer::DOMTimer):
286             - initialize m_throttleState.
287         (WebCore::DOMTimer::scriptDidInteractWithPlugin):
288             - if interaction with a plugin occurs while a timer is firing, record on the DOMTimerFireState.
289         (WebCore::DOMTimer::fired):
290             - set DOMTimerFireState, and update m_throttleState accordingly.
291         (WebCore::DOMTimer::updateTimerIntervalIfNecessary):
292             - remove redundant check of maxTimerNestingLevel (covered by intervalClampedToMinimum).
293         (WebCore::DOMTimer::intervalClampedToMinimum):
294             - Also take m_throttleState into account when throttling.
295         * page/DOMTimer.h:
296             - added scriptDidInteractWithPlugin, m_throttleState.
297         * platform/audio/AudioHardwareListener.h:
298             - enum -> enum class.
299         * plugins/PluginViewBase.h:
300         (WebCore::PluginViewBase::audioHardwareActivity):
301             - expose audioHardwareActivity on PluginViewBase (previously available in subclass).
302
303 2014-09-16  Gavin Barraclough  <baraclough@apple.com>
304
305         Exclude page visibility from PageThrottler's hysteresis
306         https://bugs.webkit.org/show_bug.cgi?id=136866
307
308         Reviewed by Geoff Garen.
309
310         Including visibility in the hysteresis mechanism has the effect of prolonging the visually
311         idle timeout, and causing the page hide event to be run at foreground priority. Neither of
312         these are particularly desirable. Instead separate visibility from the rest of the page
313         activities we track (and apply hysteresis to), and feed this directly into determination
314         of the UserActivity state.
315
316         * page/PageThrottler.cpp:
317         (WebCore::PageThrottler::PageThrottler):
318             - when the PageThrottler is instantiated call updateUserActivity to set initial UserActivity.
319         (WebCore::PageThrottler::incrementActivityCount):
320             - simplified - when m_activityCount becomes non-zero, start m_hysteresis.
321         (WebCore::PageThrottler::decrementActivityCount):
322             - simplified - when m_activityCount becomes zero, stop m_hysteresis.
323         (WebCore::PageThrottler::updateUserActivity):
324             - end the UserActivity (allow AppNap) if visually idle and no page activity is taking place.
325         (WebCore::PageThrottler::setViewState):
326             - when the visually idle state changed call updateUserActivity to update the UserActivity.
327         (WebCore::PageThrottler::started):
328         (WebCore::PageThrottler::stopped):
329             - when the hysteresis state changed call updateUserActivity to update the UserActivity.
330         (WebCore::PageThrottler::updateHysteresis): Deleted.
331             - removed: simplified the hysteresis trigger, we now incorporate visually idle state in updateUserActivity.
332         * page/PageThrottler.h:
333             - removed updateHysteresis, added updateUserActivity.
334         * platform/HysteresisActivity.h:
335         (WebCore::HysteresisActivity::state):
336             - determine the curent state of the HysteresisActivity - started, waiting, or stopped.
337
338 2014-09-17  Carlos Garcia Campos  <cgarcia@igalia.com>
339
340         [GTK] Fix runtime critical warnings when writing to the clipboard after r173687
341         https://bugs.webkit.org/show_bug.cgi?id=136891
342
343         Reviewed by Philippe Normand.
344
345         * platform/gtk/PasteboardHelper.cpp:
346         (WebCore::PasteboardHelper::writeClipboardContents): Check passed
347         callback is not null before trying to ref/unref it since
348         g_closure_ref/unref are not null safe.
349
350 2014-09-17  Zan Dobersek  <zdobersek@igalia.com>
351
352         [GTK] Add a helper function for display system deduction
353         https://bugs.webkit.org/show_bug.cgi?id=136849
354
355         Reviewed by Martin Robinson.
356
357         getDisplaySystemType() is a helper function that checks the type of the
358         default GdkDisplay object and initializes a static variable to the
359         corresponding value. It then returns the value of that variable.
360
361         When building with the GTK+2 API (still the case with the GTK+2 plugin
362         process) we default to X11.
363
364         The function is declared and implemented in GtkUtilities files.
365
366         * platform/gtk/GtkUtilities.cpp:
367         (WebCore::widgetIsOnscreenToplevelWindow):
368         (WebCore::getDisplaySystemType):
369         * platform/gtk/GtkUtilities.h:
370
371 2014-09-16  Yusuke Suzuki  <utatane.tea@gmail.com>
372
373         filterRootById accidentally clears inAdjacentChain flag
374         https://bugs.webkit.org/show_bug.cgi?id=136851
375
376         Reviewed by Benjamin Poulain.
377
378         Test: fast/selectors/filter-root-node-with-selector-contains-adjacents.html
379
380         * dom/SelectorQuery.cpp:
381         (WebCore::filterRootById):
382
383 2014-09-16  Carlos Garcia Campos  <cgarcia@igalia.com>
384
385         [GTK] Fix layering violations in PasteboardGtk
386         https://bugs.webkit.org/show_bug.cgi?id=136802
387
388         Reviewed by Darin Adler.
389
390         Refactor the Pasteboard code moving the WebCore parts to the Editor.
391
392         * PlatformGTK.cmake: Add new file to compilation.
393         * editing/Editor.cpp:
394         (WebCore::Editor::performCutOrCopy):
395         (WebCore::Editor::copyImage):
396         * editing/Editor.h:
397         * editing/gtk/EditorGtk.cpp: Added.
398         (WebCore::createFragmentFromPasteBoardData):
399         (WebCore::Editor::pasteWithPasteboard):
400         (WebCore::getImageAndURLForElement):
401         (WebCore::Editor::writeImageToPasteboard):
402         (WebCore::Editor::writeSelectionToPasteboard):
403         * page/DragController.cpp:
404         (WebCore::DragController::startDrag):
405         * page/gtk/DragControllerGtk.cpp:
406         (WebCore::DragController::declareAndWriteDragImage):
407         * platform/Pasteboard.h:
408         * platform/gtk/DataObjectGtk.cpp: Remove range member, the caller
409         should call setText() + setMarkup() intead.
410         (WebCore::DataObjectGtk::setText):
411         (WebCore::DataObjectGtk::setMarkup):
412         (WebCore::DataObjectGtk::clearText):
413         (WebCore::DataObjectGtk::clearMarkup):
414         (WebCore::DataObjectGtk::clearAllExceptFilenames):
415         * platform/gtk/DataObjectGtk.h:
416         (WebCore::DataObjectGtk::hasText):
417         (WebCore::DataObjectGtk::hasMarkup):
418         (WebCore::DataObjectGtk::clearImage):
419         (WebCore::DataObjectGtk::text):
420         (WebCore::DataObjectGtk::markup):
421         (WebCore::DataObjectGtk::setRange): Deleted.
422         * platform/gtk/GtkDragAndDropHelper.h:
423         * platform/gtk/PasteboardGtk.cpp:
424         (WebCore::PasteboardImage::PasteboardImage):
425         (WebCore::PasteboardImage::~PasteboardImage):
426         (WebCore::Pasteboard::write):
427         (WebCore::Pasteboard::writeSelection): Deleted.
428         (WebCore::getURLForImageElement): Deleted.
429         (WebCore::Pasteboard::writeImage): Deleted.
430         (WebCore::Pasteboard::documentFragment): Deleted.
431         * platform/gtk/PasteboardHelper.cpp:
432         (WebCore::displayFromFrame): Deleted.
433         (WebCore::PasteboardHelper::getPrimarySelectionClipboard): Deleted.
434         * platform/gtk/PasteboardHelper.h:
435
436 2014-09-16  Carlos Garcia Campos  <cgarcia@igalia.com>
437
438         DragData should not depend on Clipboard, DocumentFragment, and Document
439         https://bugs.webkit.org/show_bug.cgi?id=21358
440
441         Reviewed by Darin Adler.
442
443         Refactor DragData to not depend on Frame, DocumentFragment,
444         Document and Range. DragData::asFragment() has been moved to
445         DragController and implemented in the platform specific file.
446         DragData methods using Frame has been reworked in Mac to not use
447         Frame, since all other ports were ignoreing the frame parameter.
448
449         * page/DragController.cpp:
450         (WebCore::DragController::documentFragmentFromDragData): Make it
451         a static member to be able to use createFragmentFromDragData().
452         (WebCore::DragController::performDragOperation): Update to
453         DragData API changes.
454         (WebCore::DragController::dispatchTextInputEventFor): Ditto.
455         (WebCore::DragController::concludeEditDrag): Ditto.
456         (WebCore::documentFragmentFromDragData): Deleted.
457         * page/DragController.h:
458         * page/efl/DragControllerEfl.cpp:
459         (WebCore::DragController::createFragmentFromDragData): Move
460         DragData::asFragment() implementation here.
461         * page/gtk/DragControllerGtk.cpp:
462         (WebCore::DragController::dragOperation):
463         (WebCore::DragController::createFragmentFromDragData): Ditto.
464         * page/mac/DragControllerMac.mm:
465         (WebCore::DragController::dragOperation):
466         (WebCore::DragController::createFragmentFromDragData): Ditto.
467         * page/win/DragControllerWin.cpp:
468         (WebCore::DragController::createFragmentFromDragData): Ditto.
469         * platform/DragData.h:
470         * platform/efl/DragDataEfl.cpp:
471         (WebCore::DragData::asPlainText): Remove Frame parameter.
472         (WebCore::DragData::containsURL): Ditto.
473         (WebCore::DragData::asURL): Ditto.
474         (WebCore::DragData::asFragment): Deleted.
475         * platform/gtk/DragDataGtk.cpp:
476         (WebCore::DragData::asPlainText): Remove Frame parameter.
477         (WebCore::DragData::containsCompatibleContent):
478         (WebCore::DragData::containsURL): Ditto.
479         (WebCore::DragData::asURL): Ditto.
480         (WebCore::DragData::asFragment): Deleted.
481         * platform/mac/DragDataMac.mm:
482         (WebCore::DragData::asPlainText): Same implementation as the
483         Editor.
484         (WebCore::DragData::containsURL): Remove Frame parameter.
485         (WebCore::DragData::asURL): Use URLByCanonicalizingURL() instead
486         of using the Editor client.
487         (WebCore::DragData::asFragment): Deleted.
488         * platform/win/DragDataWin.cpp:
489         (WebCore::DragData::containsURL): Remove Frame parameter.
490         (WebCore::DragData::asURL): Ditto.
491         (WebCore::DragData::asPlainText): Ditto.
492         (WebCore::DragData::containsCompatibleContent):
493         (WebCore::DragData::asFragment): Deleted.
494
495 2014-09-16  Chris Dumez  <cdumez@apple.com>
496
497         Rename Node::childNode(index) to traverseToChildAt(index) for clarity
498         https://bugs.webkit.org/show_bug.cgi?id=136825
499
500         Reviewed by Benjamin Poulain.
501
502         Rename Node::childNode(index) to traverseToChildAt(index) to make it
503         clearer that the method is actually traversing the children and thus
504         potentially expensive.
505
506         This patch also avoids calling traverseToChildAt() in a couple of
507         easily avoidable cases.
508
509         No new tests, no behavior change.
510
511         * WebCore.exp.in:
512         * WebCore.order:
513         Remove symbol for ContainerNode::childNode() as it was renamed. It does
514         not seem we need to expose ContainerNode::traverseToChildAt().
515
516         * accessibility/AccessibilityObject.cpp:
517         (WebCore::AccessibilityObject::stringForVisiblePositionRange):
518         (WebCore::AccessibilityObject::lengthForVisiblePositionRange):
519         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
520         (-[WebAccessibilityObjectWrapper arrayOfTextForTextMarkers:attributed:]):
521         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
522         (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:]):
523         Mechanical renaming.
524
525         * dom/ContainerNode.cpp:
526         (WebCore::ContainerNode::traverseToChildAt):
527         (WebCore::ContainerNode::childNode): Deleted.
528         * dom/ContainerNode.h:
529         (WebCore::Node::traverseToChildAt):
530         (WebCore::Node::childNode): Deleted.
531         * dom/Node.h:
532         - Rename Node / ContainerNode's childNode(index) to
533           traverseToChildAt(index) to make it clear that it is actually
534           traversing the children and thus potentially expensive.
535         - Clean up the implementation of ContainerNode::traverseToChildAt()
536           to avoid the use of an extra |i| variable.
537
538         * dom/Position.cpp:
539         (WebCore::Position::computeNodeBeforePosition):
540         Avoid calling traverseToChildAt(-1). Relying on the unsigned argument
541         wrapping and the method returning null in this case is a bit obscure
542         and causes unnecessary traversal of all children.
543
544         (WebCore::Position::computeNodeAfterPosition):
545         (WebCore::Position::previous):
546         (WebCore::Position::next):
547         Mechanical renaming and update variable names to stop using
548         abbreviations as per coding style.
549
550         * dom/PositionIterator.h:
551         (WebCore::PositionIterator::PositionIterator):
552         * dom/Range.cpp:
553         (WebCore::Range::insertNode):
554         (WebCore::Range::checkNodeWOffset):
555         (WebCore::Range::firstNode):
556         (WebCore::Range::pastLastNode):
557         * dom/RangeBoundaryPoint.h:
558         (WebCore::RangeBoundaryPoint::set):
559         * editing/BreakBlockquoteCommand.cpp:
560         (WebCore::BreakBlockquoteCommand::doApply):
561         * editing/CompositeEditCommand.cpp:
562         (WebCore::CompositeEditCommand::removeChildrenInRange):
563         * editing/DeleteSelectionCommand.cpp:
564         (WebCore::DeleteSelectionCommand::handleGeneralDelete):
565         * editing/InsertParagraphSeparatorCommand.cpp:
566         (WebCore::InsertParagraphSeparatorCommand::doApply):
567         * editing/TextIterator.cpp:
568         (WebCore::nextInPreOrderCrossingShadowBoundaries):
569         (WebCore::TextIterator::node):
570         (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
571         * editing/VisibleUnits.cpp:
572         (WebCore::nextLinePosition):
573         * editing/cocoa/HTMLConverter.mm:
574         (WebCore::editingAttributedStringFromRange):
575         Mechanical renaming.
576
577         * inspector/DOMPatchSupport.cpp:
578         (WebCore::DOMPatchSupport::innerPatchChildren):
579         Iterate over children while incrementing the |i| variable to avoid
580         calling traverseToChildAt(index) repeatedly and thus traversing the
581         children from the beginning every time.
582
583 2014-09-16  Joseph Pecoraro  <pecoraro@apple.com>
584
585         Web Inspector: Reduce a bit of churn setting initial remote inspection state
586         https://bugs.webkit.org/show_bug.cgi?id=136875
587
588         Reviewed by Timothy Hatcher.
589
590         * bindings/js/JSDOMGlobalObject.cpp:
591         (WebCore::JSDOMGlobalObject::finishCreation):
592         We no longer need to toggle this state.
593
594 2014-09-16  Enrica Casucci  <enrica@apple.com>
595
596         Should have an editing behavior specific for IOS.
597         https://bugs.webkit.org/show_bug.cgi?id=136876
598
599         Reviewed by Sam Weinig.
600
601         This patch introduces a new editing behavior type to be able
602         to perform editing tasks that are specific to iOS.
603         All the existing EditingBehavior methods return the same boolean
604         value for for Mac and iOS. A new one has been introduced to support
605         a specific behavior in the DeleteSelectionCommand.
606
607         * editing/DeleteSelectionCommand.cpp:
608         (WebCore::DeleteSelectionCommand::doApply):
609         * editing/EditingBehavior.h:
610         (WebCore::EditingBehavior::shouldConsiderSelectionAsDirectional):
611         (WebCore::EditingBehavior::shouldCenterAlignWhenSelectionIsRevealed):
612         (WebCore::EditingBehavior::shouldToggleStyleBasedOnStartOfSelection):
613         (WebCore::EditingBehavior::shouldAlwaysGrowSelectionWhenExtendingToBoundary):
614         (WebCore::EditingBehavior::shouldSelectOnContextualMenuClick):
615         (WebCore::EditingBehavior::shouldExtendSelectionByWordOrLineAcrossCaret):
616         (WebCore::EditingBehavior::shouldRebalanceWhiteSpacesInSecureField):
617         * editing/EditingBehaviorTypes.h:
618         * editing/FrameSelection.cpp:
619         (WebCore::FrameSelection::positionForPlatform):
620         * page/Settings.cpp:
621         (WebCore::editingBehaviorTypeForPlatform):
622         * testing/InternalSettings.cpp:
623         (WebCore::InternalSettings::setEditingBehavior):
624
625 2014-09-16  Commit Queue  <commit-queue@webkit.org>
626
627         Unreviewed, rolling out r173670.
628         https://bugs.webkit.org/show_bug.cgi?id=136871
629
630         Creates layering violation (Requested by enrica on #webkit).
631
632         Reverted changeset:
633
634         "Move HTMLConverter from editing/cocoa to platform/cocoa."
635         https://bugs.webkit.org/show_bug.cgi?id=136474
636         http://trac.webkit.org/changeset/173670
637
638 2014-09-16  Eric Carlson  <eric.carlson@apple.com>
639
640         [Mac] MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput doesn't work with rotated movies
641         https://bugs.webkit.org/show_bug.cgi?id=136872
642
643         Reviewed by Tim Horton.
644
645         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
646         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator): Add logging.
647         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput): Apply the video track
648             preferred transform.
649
650 2014-09-16  Enrica Casucci  <enrica@apple.com>
651
652         Move HTMLConverter from editing/cocoa to platform/cocoa.
653         https://bugs.webkit.org/show_bug.cgi?id=136474
654
655         Reviewed by Benjamin Poulain.
656
657         This is a platform specific class and it belongs to the platform folder.
658
659         * WebCore.xcodeproj/project.pbxproj:
660         * editing/cocoa: Removed.
661         * editing/cocoa/HTMLConverter.h: Removed.
662         * editing/cocoa/HTMLConverter.mm: Removed.
663         * platform/cocoa/HTMLConverter.h: Copied from editing/cocoa/HTMLConverter.h.
664         * platform/cocoa/HTMLConverter.mm: Copied from editing/cocoa/HTMLConverter.mm.
665
666 2014-09-16  Enrica Casucci  <enrica@apple.com>
667
668         Remove PLATFORM(IOS) from WebCore/editing (Part 3).
669         https://bugs.webkit.org/show_bug.cgi?id=136474
670
671         Reviewed by Benjamin Poulain.
672
673         This is the updated version of the patch that was landed in r173340.
674         This patch removes the use of PLATFORM(IOS) from TextAffinity.h
675         and removes the assumption that EAffinity values match NSSelectionAffinity
676         values. It also removes the includes in TextAffinity.h, creating the need to
677         include explicitly the files when necessary.
678
679         * editing/TextAffinity.h:
680         (kit): Deleted.
681         (core): Deleted.
682         * editing/cocoa/HTMLConverter.mm:
683         * page/mac/WebCoreFrameView.h:
684
685 2014-09-16  Beth Dakin  <bdakin@apple.com>
686
687         overflow:scroll should not leave space for a scroll corner with overlay scrollbars
688         https://bugs.webkit.org/show_bug.cgi?id=136861
689
690         Reviewed by Sam Weinig.
691
692         overflow:scroll should behave like overflow:auto when the scrollbar will render as 
693         an overlay scrollbar.
694
695         Re-name hasAutoVerticalScrollbar()/Horizontal to 
696         hasVerticalScrollbarWithAutoBehavior()/Horizontal, and return true for 
697         overflow:scroll scrollbars that will render as overlay scrollbars.
698         * rendering/RenderBox.cpp:
699         (WebCore::RenderBox::hasVerticalScrollbarWithAutoBehavior):
700         (WebCore::RenderBox::hasHorizontalScrollbarWithAutoBehavior):
701         * rendering/RenderBox.h:
702         (WebCore::RenderBox::scrollsOverflowX):
703         (WebCore::RenderBox::scrollsOverflowY):
704         (WebCore::RenderBox::hasAutoVerticalScrollbar): Deleted.
705         (WebCore::RenderBox::hasAutoHorizontalScrollbar): Deleted.
706
707         Re-name overflowRequiresScrollbar() to styleRequiresScrollbar() and also re-name 
708         overflowDefinesAutomaticScrollbar() to styleDefinesAutomaticScrollbar(), and make         
709         these functions take into account the fact that overflow:scroll should act like 
710         overflow:auto when the scrollbar will render as an overlay scrollbar.
711         * rendering/RenderLayer.cpp:
712         (WebCore::styleRequiresScrollbar):
713         (WebCore::styleDefinesAutomaticScrollbar):
714         (WebCore::RenderLayer::updateScrollbarsAfterLayout):
715         (WebCore::RenderLayer::calculateClipRects):
716
717 2014-09-16  peavo@outlook.com  <peavo@outlook.com>
718
719         [Curl] Sometimes incomplete or empty content can be loaded from cache.
720         https://bugs.webkit.org/show_bug.cgi?id=136855
721
722         Reviewed by Alex Christensen.
723
724         Sometimes, when two requests with the same url are started at the same time,
725         there is a possibility of loading incomplete or empty content from the cache.
726         This happens because the method CurlCacheEntry::isLoading() is returning the wrong status
727         in the time period between the headers are received, and the content data is received.
728         This can be fixed by using a flag for the load status, instead of checking whether
729         the content file is open. 
730
731         * platform/network/curl/CurlCacheEntry.cpp:
732         (WebCore::CurlCacheEntry::CurlCacheEntry): Initialize loading flag.
733         (WebCore::CurlCacheEntry::isLoading): Return loading flag.
734         (WebCore::CurlCacheEntry::didFail): Call new method to set loading flag.
735         (WebCore::CurlCacheEntry::didFinishLoading): Ditto.
736         (WebCore::CurlCacheEntry::setIsLoading): Added new method to set loading flag.
737         * platform/network/curl/CurlCacheEntry.h: Added loading flag and new method to set it.
738         * platform/network/curl/CurlCacheManager.cpp:
739         (WebCore::CurlCacheManager::didReceiveResponse): Call new method to set loading flag.
740
741 2014-09-16  Chris Dumez  <cdumez@apple.com>
742
743         Rename Node::nodeIndex() to computeNodeIndex() for clarity
744         https://bugs.webkit.org/show_bug.cgi?id=136826
745
746         Reviewed by Benjamin Poulain.
747
748         Rename Node::nodeIndex() to computeNodeIndex() to make it clear that
749         index is being computed and that calling this method is potentially
750         expensive.
751
752         No new tests, no behavior change.
753
754         * WebCore.exp.in:
755         * WebCore.order:
756         Rename exported symbol for Node::nodeIndex() as well.
757
758         * dom/Document.cpp:
759         (WebCore::Document::caretRangeFromPoint):
760         * dom/Node.cpp:
761         (WebCore::Node::computeNodeIndex):
762         (WebCore::Node::nodeIndex): Deleted.
763         * dom/Node.h:
764         * dom/NodeWithIndex.h:
765         (WebCore::NodeWithIndex::index):
766         Clean up implementation to reduce the scope of the Node variable and
767         to follow coding style (variable naming, spacing, star placement).
768
769         * dom/Position.cpp:
770         (WebCore::Position::computeOffsetInContainerNode):
771         (WebCore::Position::previous):
772         (WebCore::Position::next):
773         (WebCore::Position::upstream):
774         (WebCore::Position::downstream):
775         * dom/Position.h:
776         (WebCore::positionInParentBeforeNode):
777         (WebCore::positionInParentAfterNode):
778         * dom/Range.cpp:
779         (WebCore::Range::compareNode):
780         (WebCore::Range::intersectsNode):
781         (WebCore::Range::processContents):
782         (WebCore::Range::insertNode):
783         (WebCore::Range::setStartAfter):
784         (WebCore::Range::setEndBefore):
785         (WebCore::Range::setEndAfter):
786         (WebCore::Range::setStartBefore):
787         * dom/RangeBoundaryPoint.h:
788         (WebCore::RangeBoundaryPoint::ensureOffsetIsValid):
789         * editing/ApplyStyleCommand.cpp:
790         (WebCore::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
791         (WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical):
792         * editing/DeleteSelectionCommand.cpp:
793         (WebCore::DeleteSelectionCommand::handleGeneralDelete):
794         * editing/Editor.cpp:
795         (WebCore::Editor::avoidIntersectionWithDeleteButtonController):
796         * editing/FrameSelection.cpp:
797         (WebCore::FrameSelection::selectFrameElementInParentIfFullySelected):
798         * editing/ReplaceSelectionCommand.cpp:
799         (WebCore::ReplaceSelectionCommand::doApply):
800         * editing/TextIterator.cpp:
801         (WebCore::TextIterator::range):
802         (WebCore::SimplifiedBackwardsTextIterator::handleReplacedElement):
803         (WebCore::SimplifiedBackwardsTextIterator::handleNonTextNode):
804         * editing/htmlediting.cpp:
805         (WebCore::updatePositionForNodeRemoval):
806         * html/HTMLTextFormControlElement.cpp:
807         (WebCore::setContainerAndOffsetForRange):
808         * page/DOMSelection.cpp:
809         (WebCore::DOMSelection::getRangeAt):
810         (WebCore::DOMSelection::containsNode):
811         (WebCore::DOMSelection::shadowAdjustedOffset):
812         * rendering/RenderBlock.cpp:
813         (WebCore::positionForPointRespectingEditingBoundaries):
814         * rendering/RenderTreeAsText.cpp:
815         (WebCore::nodePosition):
816
817 2014-09-16  Jer Noble  <jer.noble@apple.com>
818
819         Videos with controls enabled never receive 'dragstart' events.
820         https://bugs.webkit.org/show_bug.cgi?id=136837
821
822         Reviewed by Eric Carlson.
823
824         Fixes a crash regression introduced by r173631. Node::contains() has an interesting property of returning false
825         if `this` is NULL. Rather than depending on this behavior, explicitly NULL-check state.source and bail early.
826
827         * page/DragController.cpp:
828         (WebCore::DragController::startDrag):
829
830 2014-09-16  Csaba Osztrogon√°c  <ossy@webkit.org>
831
832         URTBF after r173659.
833
834         After r173659 convertToIntLength() is used only inside ENABLE(DASHBOARD_SUPPORT), so it
835         became unused function and caused build failure if ENABLE(DASHBOARD_SUPPORT) is false.
836
837         Source/WebCore/css/StyleResolver.cpp:1471:15: error: 'WebCore::Length WebCore::convertToIntLength(const WebCore::CSSPrimitiveValue*, const WebCore::CSSToLengthConversionData&)'
838         defined but not used [-Werror=unused-function] cc1plus: all warnings being treated as errors
839
840         * css/StyleResolver.cpp: Missing ENABLE(DASHBOARD_SUPPORT) guard added.
841
842 2014-09-14  Darin Adler  <darin@apple.com>
843
844         Scroll snap properties don't handle inherit and initial propertly.
845         https://bugs.webkit.org/show_bug.cgi?id=136643
846
847         Reviewed by Beth Dakin.
848
849         Restructured scroll snap code both to handle inherit and initial, and to reduce the
850         total code size a bit, fixing a few minor bugs along the way. Updated the regression
851         tests to cover the new parts.
852
853         * css/CSSComputedStyleDeclaration.cpp:
854         (WebCore::addValuesForNamedGridLinesAtIndex): Use a modern for loop.
855         (WebCore::scrollSnapDestination): Changed to take a LengthSize. Also streamlined.
856         (WebCore::scrollSnapPoints): Changed to to take a ScrollSnapPoints. Also streamlined and
857         added code to handle the "uses elements" case; serialize that as an identifier, not the
858         string "elements", fixing a minor bug.
859         (WebCore::scrollSnapCoordinates): Changed to take a Vector<LengthSize>. Also streamlined
860         and added code to handle the empty vector case; serialize that as an identifier, not the
861         string "none", fixing a minor bug.
862         (WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword): Use nullptr.
863         (WebCore::counterToCSSValue): Use nullptr.
864         (WebCore::ComputedStyleExtractor::styledNode): Use nullptr.
865         (WebCore::ComputedStyleExtractor::propertyValue): Use nullptr. Moved CSS_SCROLL_SNAP
866         to a more appropriate section of the switch statement. Made it just call through to
867         the functions above in a more straightforward way.
868         (WebCore::CSSComputedStyleDeclaration::getPropertyValue): Reversed logic to use early
869         return and to call emptyString.
870         (WebCore::CSSComputedStyleDeclaration::item): Use emptyString.
871         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForSidesShorthand): Use nullptr.
872         (WebCore::CSSComputedStyleDeclaration::parentRule): Use nullptr.
873         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Use nullptr.
874         (WebCore::CSSComputedStyleDeclaration::getPropertyPriority): Use emptyString.
875         (WebCore::CSSComputedStyleDeclaration::getPropertyShorthand): Use emptyString.
876
877         * css/DeprecatedStyleBuilder.cpp:
878         (WebCore::ApplyPropertyMarqueeIncrement::applyValue): Use the switch statement for the
879         invalid value as well as for the valid values, rather than a separate if statement.
880         Call convertToLength directly rather than through a StyleResolver static member function.
881
882         * css/PropertySetCSSStyleDeclaration.cpp:
883         (WebCore::PropertySetCSSStyleDeclaration::getPropertyValue): Fixed a formatting mistake.
884
885         * css/StyleResolver.cpp:
886         (WebCore::convertToIntLength): Made this function local to this file instead of a
887         static member function.
888         (WebCore::convertToFloatLength): Ditto.
889         (WebCore::StyleResolver::parseSnapCoordinate): Added. Used to keep snap point parsing
890         code small.
891         (WebCore::StyleResolver::parseSnapCoordinatePair): Ditto.
892         (WebCore::StyleResolver::parseSnapPoints): Added. Parses an entire snap points property.
893         (WebCore::StyleResolver::applyProperty): Removed various bits of redundant code that
894         were not using the primitiveValue value already in a local variable. Added the
895         HANDLE_INHERIT_AND_INITIAL to all the scroll snap properties and updated since the
896         RenderStyle structure now more closely matches the CSS properties.
897
898         * css/StyleResolver.h: Updated for above changes, and removed a redundant "private:".
899
900         * page/scrolling/AxisScrollSnapOffsets.cpp:
901         (WebCore::appendChildSnapOffsets): Use auto& instead of SnapCoordinate since that type
902         is now gone. Updated since coordinates are now LengthSize.
903         (WebCore::updateFromStyle): Changed to take a reference instead of a pointer and
904         also to fetch the data from RenderStyle in a new way that more closely matches the
905         CSS properties.
906         (WebCore::updateSnapOffsetsForScrollableArea): Ditto. Also moved some memory allocation
907         inside if statements so we don't wastefully allocate and destroy.
908
909         * rendering/style/RenderStyle.cpp: Added an include of StyleScrollSnapPoints.h now
910         that the header doesn't include them. Moved the conditional includes out of the main
911         include paragraph (even though I don't think conditional includes are usually a good
912         idea).
913         (WebCore::RenderStyle::initialScrollSnapPointsX): Added.
914         (WebCore::RenderStyle::initialScrollSnapPointsY): Added.
915         (WebCore::RenderStyle::initialScrollSnapDestination): Added.
916         (WebCore::RenderStyle::initialScrollSnapCoordinates): Added.
917         (WebCore::RenderStyle::scrollSnapPointsX): Added.
918         (WebCore::RenderStyle::scrollSnapPointsY): Added.
919         (WebCore::RenderStyle::scrollSnapDestination): Added.
920         (WebCore::RenderStyle::scrollSnapCoordinates): Added.
921         (WebCore::RenderStyle::setScrollSnapPointsX): Added.
922         (WebCore::RenderStyle::setScrollSnapPointsY): Added.
923         (WebCore::RenderStyle::setScrollSnapDestination): Added.
924         (WebCore::RenderStyle::setScrollSnapCoordinates): Added.
925
926         * rendering/style/RenderStyle.h: Replaced the include of StyleScrollSnapPoints.h with
927         a forward declaration of ScrollSnapPoints. Removed getters and setters for the old
928         style properties and replaced them with new ones that match the CSS properties more
929         closely. Tweaked formatting a bit. Added initial value functions for the the scroll snap
930         properties.
931
932         * rendering/style/StyleRareNonInheritedData.cpp: Added include of StyleScrollSnapPoints.h
933         now that RenderStyle.h doesn't include it.
934         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): Updated since
935         m_scrollSnapType is now unsigned instead of ScrollSnapType.
936
937         * rendering/style/StyleRareNonInheritedData.h: Fixed type of m_scrollSnapType to be
938         unsigned instead of ScrollSnapType. This should have been causing problems on Windows,
939         but I think we got lucky and had no detectable problems.
940
941         * rendering/style/StyleScrollSnapPoints.cpp:
942         (WebCore::ScrollSnapPoints::ScrollSnapPoints): Added.
943         (WebCore::operator==): Added overloads for both ScrollSnapPoints and also for
944         StyleScrollSnapPoints; using a free function for both since both have public data.
945         (WebCore::defaultScrollSnapDestination): Added, replaces a static member function.
946         (WebCore::StyleScrollSnapPoints::StyleScrollSnapPoints): Updated both the default
947         constructor and the copy constructor for the new design.
948
949         * rendering/style/StyleScrollSnapPoints.h: Added a ScrollSnapPoints struct for the
950         type of the snap-points-x and snap-points-y CSS properties. Changed the data members
951         of StyleScrollSnapPoints to match the various CSS properties rather than breaking
952         out all the data into separate data members.
953         (WebCore::StyleScrollSnapPoints::defaultRepeatOffset): Deleted. Replaced by the
954         default constructor for ScrollSnapPoints.
955         (WebCore::StyleScrollSnapPoints::defaultDestinationOffset): Deleted. Replaced by
956         a function inside the .cpp file.
957
958 2014-09-16  Youenn Fablet  <youenn.fablet@crf.canon.fr>
959
960         [GStreamer] http/tests/media/video-auth.html is failing
961         https://bugs.webkit.org/show_bug.cgi?id=126619
962
963         Reviewed by Philippe Normand.
964
965         Test: http/tests/media/video-auth-cors.html
966
967         Use stored credentials when retrieving videos following image loading behavior
968         (i.e. stored credentials are always used except when in cors anonymous mode),
969         except that requesting credentials from user remains disabled for cross-origin requests.
970
971         Patch is covered by http/tests/media/video-auth.html.
972
973         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
974         (CachedResourceStreamingClient::CachedResourceStreamingClient): Enable using stored credentials except when using cors anonymous mode.
975
976 2014-09-16  Jinho Bang  <jinho.bang@samsung.com>
977
978         Add version of drawFocusIfNeeded that take a Path2D parameter.
979         https://bugs.webkit.org/show_bug.cgi?id=136846
980
981         Reviewed by Dirk Schulze.
982
983         Tests: fast/canvas/draw-focus-if-needed-with-path.html
984
985         * html/canvas/CanvasRenderingContext2D.cpp:
986         (WebCore::CanvasRenderingContext2D::drawFocusIfNeeded):
987         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
988         * html/canvas/CanvasRenderingContext2D.h:
989         * html/canvas/CanvasRenderingContext2D.idl:
990
991 2014-09-15  Iago Toral  <itoral@igalia.com> and Zan Dobersek  <zdobersek@igalia.com>
992
993         [GTK] Add WaylandDisplay
994         https://bugs.webkit.org/show_bug.cgi?id=136216
995
996         Reviewed by Martin Robinson.
997
998         Add the WaylandDisplay class. This class is used in the LayerTreeHostGtk,
999         in the WebProcess, and controls the connection to the nested Wayland
1000         compositor in the UIProcess. Only one instance of the class is used in the
1001         WebProcess, accessible via the static WaylandDisplay::instance() method.
1002
1003         The WaylandDisplay constructor performs the EGL initialization while also
1004         querying the Wayland register, resulting in initializing client-side objects
1005         that can interact with the wl_compositor and wl_webkitgtk interfaces
1006         implemented in the nested Wayland compositor. The single class instance is
1007         only deemed properly initialized if it picked up the Wayland interface objects
1008         and has properly acquired the EGL display and config.
1009
1010         WaylandDisplay::createSurface() is called by the LayerTreeHostGtk during
1011         its own initialization. The method creates a new wl_surface object via the
1012         wl_compositor interface and a new wl_egl_window object that's based on that
1013         surface. For the wl_egl_window object, we fall back to a width or height of 1
1014         in case the passed-in value for either is 0. This avoids problems in Mesa
1015         where widths or heights of 0 are not supported.
1016
1017         We associate the created surface with the passed-in widget ID, as provided
1018         by LayerTreeHostGtk, via the wl_webkitgtk interface. This enables proper
1019         mapping of Wayland surfaces and the GtkWidgets in the UIProcess and makes
1020         it possible for the nested Wayland compositor to correctly determine which
1021         GtkWidget has to be redrawn after some surface has been committed.
1022
1023         WaylandDisplay::createSharingGLContext() creates a new GLContextEGL object
1024         that's to be used as a sharing context. The method creates a new surface
1025         via the wl_compositor interface and uses it to create a dummy native EGL
1026         window that's 1x1px in size. The GLContextEGL object is then created
1027         through the static GLContextEGL::createWindowContext() method.
1028
1029         * PlatformGTK.cmake:
1030         * platform/graphics/wayland/WaylandDisplay.cpp: Added.
1031         (WebCore::WaylandDisplay::globalCallback):
1032         (WebCore::WaylandDisplay::globalRemoveCallback):
1033         (WebCore::WaylandDisplay::instance):
1034         (WebCore::WaylandDisplay::WaylandDisplay):
1035         (WebCore::WaylandDisplay::createSurface):
1036         (WebCore::WaylandDisplay::createSharingGLContext):
1037         * platform/graphics/wayland/WaylandDisplay.h: Added.
1038         (WebCore::WaylandDisplay::nativeDisplay):
1039         (WebCore::WaylandDisplay::eglDisplay):
1040         * platform/graphics/wayland/WaylandSurface.cpp:
1041         (WebCore::WaylandSurface::~WaylandSurface): Assert that the WaylandDisplay
1042         instance is present before going on to destroy the surface resources.
1043
1044 2014-09-15  Chris Dumez  <cdumez@apple.com>
1045
1046         Rename LiveNodeLists / HTMLCollections's nodeMatches() to elementMatches()
1047         https://bugs.webkit.org/show_bug.cgi?id=136844
1048
1049         Reviewed by Sam Weinig.
1050
1051         Rename LiveNodeLists / HTMLCollections's nodeMatches() to elementMatches()
1052         for clarity as the argument is an Element.
1053
1054         No new tests, no behavior change.
1055
1056         * dom/ClassNodeList.h:
1057         (WebCore::ClassNodeList::elementMatches):
1058         (WebCore::ClassNodeList::nodeMatches): Deleted.
1059         * dom/DocumentOrderedMap.cpp:
1060         (WebCore::keyMatchesWindowNamedItem):
1061         (WebCore::keyMatchesDocumentNamedItem):
1062         * dom/Element.cpp:
1063         (WebCore::Element::updateNameForDocument):
1064         (WebCore::Element::updateIdForDocument):
1065         * dom/LiveNodeList.cpp:
1066         (WebCore::LiveNodeList::namedItem):
1067         * dom/LiveNodeList.h:
1068         (WebCore::CachedLiveNodeList<NodeListType>::collectionBegin):
1069         (WebCore::CachedLiveNodeList<NodeListType>::collectionLast):
1070         (WebCore::CachedLiveNodeList<NodeListType>::collectionTraverseForward):
1071         (WebCore::CachedLiveNodeList<NodeListType>::collectionTraverseBackward):
1072         * dom/NameNodeList.h:
1073         (WebCore::NameNodeList::elementMatches):
1074         (WebCore::NameNodeList::nodeMatches): Deleted.
1075         * dom/TagNodeList.h:
1076         (WebCore::TagNodeList::elementMatches):
1077         (WebCore::HTMLTagNodeList::elementMatches):
1078         (WebCore::TagNodeList::nodeMatches): Deleted.
1079         (WebCore::HTMLTagNodeList::nodeMatches): Deleted.
1080         * html/HTMLCollection.cpp:
1081         (WebCore::isMatchingElement):
1082         * html/HTMLNameCollection.cpp:
1083         (WebCore::WindowNameCollection::elementMatchesIfNameAttributeMatch):
1084         (WebCore::WindowNameCollection::elementMatches):
1085         (WebCore::DocumentNameCollection::elementMatchesIfIdAttributeMatch):
1086         (WebCore::DocumentNameCollection::elementMatchesIfNameAttributeMatch):
1087         (WebCore::DocumentNameCollection::elementMatches):
1088         (WebCore::WindowNameCollection::nodeMatchesIfNameAttributeMatch): Deleted.
1089         (WebCore::WindowNameCollection::nodeMatches): Deleted.
1090         (WebCore::DocumentNameCollection::nodeMatchesIfIdAttributeMatch): Deleted.
1091         (WebCore::DocumentNameCollection::nodeMatchesIfNameAttributeMatch): Deleted.
1092         (WebCore::DocumentNameCollection::nodeMatches): Deleted.
1093         * html/HTMLNameCollection.h:
1094         * html/LabelsNodeList.cpp:
1095         (WebCore::LabelsNodeList::elementMatches):
1096         (WebCore::LabelsNodeList::nodeMatches): Deleted.
1097         * html/LabelsNodeList.h:
1098         * html/RadioNodeList.cpp:
1099         (WebCore::RadioNodeList::elementMatches):
1100         (WebCore::RadioNodeList::nodeMatches): Deleted.
1101         * html/RadioNodeList.h:
1102
1103 2014-09-15  Chris Dumez  <cdumez@apple.com>
1104
1105         Use an AtomicString as key for caching ClassNodeList objects
1106         https://bugs.webkit.org/show_bug.cgi?id=136830
1107
1108         Reviewed by Benjamin Poulain.
1109
1110         Use an AtomicString as key for caching ClassNodeList objects instead of
1111         a String. ClassNodeList is the only type using a String instead of an
1112         AtomicString as key in the cache HashTable. This brings some
1113         complexity.
1114
1115         I believe this was done to avoid unnecessarily atomizing the String,
1116         for performance reasons. However, at the moment, the String gets
1117         atomized anyway when constructing the ClassNodeList object. This is
1118         because the ClassNodeList::m_classNames member is of SpaceSplitString
1119         type and the SpaceSplitString constructor takes an AtomicString in
1120         argument.
1121
1122         Using an AtomicString to cache ClassNodeLists simplifies the code quite
1123         a bit and decreases the size of NodeListsNodeData as well.
1124
1125         Test: fast/dom/getElementsByClassName/conflict-tag-name.html
1126
1127         * WebCore.order:
1128         Remove symbol corresponding to addCacheWithName() as it was removed.
1129
1130         * dom/ClassNodeList.cpp:
1131         (WebCore::ClassNodeList::~ClassNodeList):
1132         Update the constructor to take an AtomicString in argument instead of
1133         a String, for clarity. The String gets atomized when initializing
1134         m_classNames anyway.
1135
1136         (WebCore::ClassNodeList::ClassNodeList):
1137         Call removeCacheWithAtomicName() instead of removeCacheWithName() now
1138         that m_originalClassNames is an AtomicString.
1139
1140         * dom/ClassNodeList.h:
1141         Use AtomicString instead of String type for classNames, in both the
1142         constructor argument and the m_originalClassNames data member.
1143
1144         * dom/ContainerNode.cpp:
1145         (WebCore::ContainerNode::getElementsByClassName):
1146         Call addCacheWithAtomicName() instead of addCacheWithName() now that
1147         addCacheWithName() has been removed.
1148
1149         * dom/Node.cpp:
1150         (WebCore::NodeListsNodeData::invalidateCaches):
1151         Stop invalidating m_nameCaches as this HashMap no longer exists.
1152
1153         * dom/NodeRareData.h:
1154         (WebCore::NodeListsNodeData::NodeListCacheMapEntryHash::hash):
1155         (WebCore::NodeListsNodeData::NodeListCacheMapEntryHash::equal):
1156         (WebCore::NodeListsNodeData::isEmpty):
1157         (WebCore::NodeListsNodeData::adoptDocument):
1158         (WebCore::NodeListsNodeData::namedNodeListKey):
1159         (WebCore::NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList):
1160         (WebCore::NodeListsNodeData::addCacheWithName): Deleted.
1161         (WebCore::NodeListsNodeData::removeCacheWithName): Deleted.
1162         - Drop addCacheWithName() / removeCacheWithName() now that no NodeList
1163           uses a String as HashMap key.
1164         - Drop m_nameCaches now that ClassNodeLists are cached in
1165           m_atomicNameCaches instead.
1166         - Remove StringType template parameter and hardcode AtomicString
1167           instead.
1168
1169 2014-09-15  Chris Dumez  <cdumez@apple.com>
1170
1171         Return early in SelectorChecker::checkOne() if selector.isAttributeSelector() is true
1172         https://bugs.webkit.org/show_bug.cgi?id=136838
1173
1174         Reviewed by Benjamin Poulain.
1175
1176         Return early in SelectorChecker::checkOne() if selector.isAttributeSelector()
1177         is true and the selector matched. Previously, we were only returning early if
1178         the selector did not match and we were falling through if it did. This means
1179         that we ended up doing the 2 if() checks below in the method unnecessarily:
1180         - selector.m_match == CSSSelector::PseudoClass
1181         - selector.m_match == CSSSelector::PseudoElement
1182
1183         No new tests, no behavior change.
1184
1185         * css/SelectorChecker.cpp:
1186         (WebCore::SelectorChecker::checkOne):
1187
1188 2014-09-15  Chris Dumez  <cdumez@apple.com>
1189
1190         Un-inline the Node constructor
1191         https://bugs.webkit.org/show_bug.cgi?id=136842
1192
1193         Reviewed by Benjamin Poulain.
1194
1195         Un-inline the Node constructor as it does not seem to impact
1196         performance, based on my testing:
1197         http://dromaeo.com/?id=226992,226998
1198
1199         This reduces the stripped binary size by ~4Kb.
1200
1201         No new tests, no behavior change.
1202
1203         * dom/Document.h:
1204         (WebCore::Node::Node): Deleted.
1205         * dom/Node.cpp:
1206         (WebCore::Node::Node):
1207
1208 2014-09-15  Shivakumar JM  <shiva.jm@samsung.com>
1209
1210         Web Core: Websocket state should be set to closed in didReceiveMessage call back.
1211         https://bugs.webkit.org/show_bug.cgi?id=136219
1212
1213         Reviewed by Alexey Proskuryakov.
1214
1215         Set the Websocket state to closed in didReceiveMessage call back.
1216
1217         Test: http/tests/websocket/tests/hybi/error-event-ready-state.html
1218
1219         * Modules/websockets/WebSocket.cpp:
1220         (WebCore::WebSocket::didReceiveMessageError):
1221
1222 2014-09-15  Jon Honeycutt  <jhoneycutt@apple.com>
1223
1224         Naming clean-up.
1225
1226         Rubber-stamped by Andy Estes.
1227
1228         * html/HTMLFormElement.cpp:
1229         (WebCore::HTMLFormElement::requestAutocomplete):
1230         (WebCore::HTMLFormElement::finishRequestAutocomplete):
1231         Remove superfluous "AutocompleteResult".
1232
1233         * html/HTMLFormElement.h:
1234         Ditto.
1235
1236 2014-09-15  Alexey Proskuryakov  <ap@apple.com>
1237
1238         Crash when logging in to optionshouse.com
1239         https://bugs.webkit.org/show_bug.cgi?id=136834
1240
1241         Reviewed by Anders Carlsson.
1242
1243         No test, because I couldn't make one. I don't have a way to reproduce first-hand.
1244
1245         * platform/network/cf/SocketStreamHandleCFNet.cpp:
1246         (WebCore::SocketStreamHandle::readStreamCallback):
1247         (WebCore::SocketStreamHandle::writeStreamCallback):
1248
1249 2014-09-15  Jer Noble  <jer.noble@apple.com>
1250
1251         Unreviewed build fix for 32-bit builds.
1252
1253         Make casts from unsigned long long -> size_t explicit, rather than implicit. Also
1254         make CARingBuffer be protected by USING_MEDIA_TOOLBOX so ports without that flag
1255         won't try to compile unused code.
1256
1257         * platform/audio/mac/CARingBuffer.cpp:
1258         (WebCore::CARingBuffer::fetch):
1259         * platform/audio/mac/CARingBuffer.h:
1260         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
1261         (WebCore::AudioSourceProviderAVFObjC::provideInput):
1262
1263 2014-09-15  Jer Noble  <jer.noble@apple.com>
1264
1265         Unreviewed logic fix from r173631. Logic for includeShadowDOM was reversed.
1266
1267         * page/DragController.cpp:
1268         (WebCore::DragController::startDrag):
1269
1270 2014-09-15  Jer Noble  <jer.noble@apple.com>
1271
1272         Videos with controls enabled never receive 'dragstart' events.
1273         https://bugs.webkit.org/show_bug.cgi?id=136837
1274
1275         Reviewed by Simon Fraser.
1276
1277         When initiating a drag, the DragController checks whether the hit-tested element at a
1278         drag location is a child of the drag source, and bails if early if that is not the case.
1279         For a <video> element with controls, the hit-tested element is an element within the
1280         <video> element's Shadow DOM. Because the DragController uses a method which does not
1281         take Shadow DOM into account when determining a child-parent relationship, this test fails
1282         and all drag operations fail as well.
1283
1284         For <video> elements only, when testing whether the drag source is an ancestor of the
1285         hit-tested element, use containsIncludingShadowDOM() instead of contains(). To ensure that
1286         the controls are still usable when a drag listener is active on a <video> element, mark
1287         the controls as a draggable element, but simply call preventDefault() in the controls'
1288         'dragstart' handler, ensuring the timeline and volume controls are themselves still draggable.
1289
1290         * Modules/mediacontrols/mediaControlsApple.css:
1291         (audio::-webkit-media-controls-panel):
1292         * Modules/mediacontrols/mediaControlsApple.js:
1293         (Controller.prototype.createControls):
1294         (Controller.prototype.handlePanelDragStart):
1295         * page/DragController.cpp:
1296         (WebCore::DragController::startDrag):
1297
1298 2014-09-15  Roger Fong  <roger_fong@apple.com>
1299
1300         Unreviewed. Add an unimplemented case to handle CSSPropertyWebkitInitialLetter so we don't get an assertion failure.
1301
1302         * css/SVGCSSStyleSelector.cpp:
1303         (WebCore::StyleResolver::applySVGProperty):
1304
1305 2014-09-15  Jer Noble  <jer.noble@apple.com>
1306
1307         [Mac] Support audioSourceProvider() in MediaPlayerPrivateAVFoundationObjC
1308         https://bugs.webkit.org/show_bug.cgi?id=135042
1309
1310         Reviewed by Eric Carlson.
1311
1312         Add support for AudioSourceProvider in MediaPlayerPrivateAVFoundationObjC, thereby
1313         supporting MediaElementAudioSourceNode.
1314
1315         Import the CARingBuffer from CoreAudio sample code, making the necessary modifications
1316         for WebKit style and coding conventions. The threading assumptions for this class are
1317         that there will be a single writer thread and a single reader thread.
1318
1319         * platform/audio/mac/CARingBuffer.cpp: Added.
1320         (WebCore::CARingBuffer::create): Create a unique_ptr.
1321         (WebCore::CARingBuffer::CARingBuffer): Simple constructor.
1322         (WebCore::CARingBuffer::~CARingBuffer): Simple destructor.
1323         (WebCore::CARingBuffer::allocate): Initialize the buffers and time bounds structures.
1324         (WebCore::CARingBuffer::deallocate): Destroy same.
1325         (WebCore::ZeroRange): Static utility method.
1326         (WebCore::StoreABL): Ditto.
1327         (WebCore::FetchABL): Ditto.
1328         (WebCore::ZeroABL): Ditto.
1329         (WebCore::CARingBuffer::store): Store the passed in buffer in the ring buffer, wrapping
1330             if necessary.
1331         (WebCore::CARingBuffer::setTimeBounds): Set the new time bounds by incrementing the
1332             bounds index locally, filling in the new values, then atomically incrementing the
1333             reader-visible index.
1334         (WebCore::CARingBuffer::getTimeBounds): Get the new time bounds by masking the time
1335             bounds index, and using it as an offset to the time bounds array. Protect against
1336             CPU starvation on the reading thread by checking the index against the stored
1337             index in the array entry. This check will fail if the writing thread has wrapped
1338             more than the size of the array.
1339         (WebCore::CARingBuffer::clipTimeBounds): Clamp the passed values to the available bounds.
1340         (WebCore::CARingBuffer::startFrame): Simple accessor.
1341         (WebCore::CARingBuffer::endFrame): Ditto.
1342         (WebCore::CARingBuffer::fetch): Read an audio buffer list from the ring buffer, possbily
1343             wrapping around to the start of the ring buffer.
1344         * platform/audio/mac/CARingBuffer.h: Added.
1345         (WebCore::CARingBuffer::numberOfChannels): Simple accessor.
1346         (WebCore::CARingBuffer::frameOffset): Ditto.
1347         (WebCore::CARingBuffer::TimeBounds::TimeBounds): Struct holding the start and end frame values.
1348
1349         Add an implementation of AudioSourceProvider, using AVAudioMix and MTAudioProcessingTap
1350         to tap an AVPlayerItem's audio output and feed it to a MediaElementAudioSourceNode.
1351
1352         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h: Added.
1353         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm: Added.
1354         (WebCore::AudioSourceProviderAVFObjC::create): Simple factory.
1355         (WebCore::AudioSourceProviderAVFObjC::AudioSourceProviderAVFObjC): Simple constructor.
1356         (WebCore::AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC): Simple destructor.
1357         (WebCore::AudioSourceProviderAVFObjC::provideInput): Push audio into the ring buffer.
1358         (WebCore::AudioSourceProviderAVFObjC::setClient): Call destroyMix()/createMix() as appropriate.
1359         (WebCore::AudioSourceProviderAVFObjC::setPlayerItem): Ditto.
1360         (WebCore::AudioSourceProviderAVFObjC::destroyMix): Detach and destroy the AVAudioMix and tap.
1361         (WebCore::AudioSourceProviderAVFObjC::createMix): Set up the AVAudioMix and tap and attach to
1362             the AVPlayerItem.
1363         (WebCore::AudioSourceProviderAVFObjC::initCallback): Pass to class method.
1364         (WebCore::AudioSourceProviderAVFObjC::finalizeCallback): Ditto.
1365         (WebCore::AudioSourceProviderAVFObjC::prepareCallback): Ditto.
1366         (WebCore::AudioSourceProviderAVFObjC::unprepareCallback): Ditto.
1367         (WebCore::AudioSourceProviderAVFObjC::processCallback): Ditto.
1368         (WebCore::AudioSourceProviderAVFObjC::init): Set up the storage pointer for the tap.
1369         (WebCore::AudioSourceProviderAVFObjC::finalize): No-op.
1370         (WebCore::operator==): Compare two AudioStreamBasicDescription objects.
1371         (WebCore::operator!=): Ditto.
1372         (WebCore::AudioSourceProviderAVFObjC::prepare): Create an AudioCoverter object if necessary,
1373             create the ring buffer, and notify the client of format changes.
1374         (WebCore::AudioSourceProviderAVFObjC::unprepare): Destroy same.
1375         (WebCore::AudioSourceProviderAVFObjC::process): Copy samples out of the ring buffer,
1376             format converting them if necessary. Mute original audio.
1377
1378         Create the AudioSourceProviderAVFObjC object and notify it when the current AVPlayerItem changes.
1379
1380         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1381         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1382         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
1383         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
1384         (WebCore::MediaPlayerPrivateAVFoundationObjC::audioSourceProvider):
1385
1386         Enable SOFT_LINK_MAY_FAIL on the Mac platform.
1387
1388         * platform/mac/SoftLinking.h:
1389
1390         Add new files to the project.
1391
1392         * WebCore.xcodeproj/project.pbxproj:
1393
1394 2014-09-15  Chris Dumez  <cdumez@apple.com>
1395
1396         Avoid redundant isElementNode() checks in Traversal<HTML*Element> / Traversal<SVG*Element>
1397         https://bugs.webkit.org/show_bug.cgi?id=136719
1398
1399         Reviewed by Darin Adler.
1400
1401         Avoid redundant isElementNode() checks in Traversal<HTML*Element> /
1402         Traversal<SVG*Element>.  We used to iterate through Elements, and then
1403         call isElementOfType<HTML*Element>()  on each Element. This made sense
1404         because hasTagName() used to be defined on Element. However, after
1405         http://trac.webkit.org/changeset/165699, hasTagName() is now defined on
1406         Node for HTMLQualifiedName / SVGQualifiedName arguments.
1407
1408         Node::hasTagName(HTMLQualifiedName) basically does the following check
1409         "isHTMLElement() &&  toHTMLElement(*this).hasTagName(tagName)". As a
1410         consequence, doing an isElementNode() check is now redundant as
1411         isHTMLElement() is defined on Node.
1412
1413         This patch adds a template parameter to isElementOfType() so that it can
1414         take any type in argument (particulaly Node, Element, HTMLElement,
1415         SVGElement, MathMLElement), not just an Element. I had to add an
1416         ElementTypeCastTraits struct to support partial specialization as C++
1417         does not support partial specialization of template functions.
1418         This patch also updates Traversal<ElementType> so that the methods use
1419         NodeTraversal internally instead of Traversal<ElementType>. As a result,
1420         we now iterate over Nodes (not Elements) and call the new
1421         isElementOfType<ElementType>(Node) helpers (which are efficient after
1422         r165699).
1423
1424         Before the patch, the code ended up doing the following checks for
1425         Traversal<HTML*element>:
1426         node.isElementNode() && toElement(node).isHTMLElement()
1427             && toHTMLElement(node).hasTagName(HTMLNames::fooTag)
1428
1429         After the patch, the code only does:
1430         node.isHTMLElement()
1431             && toHTMLElement(node).hasTagName(HTMLNames::fooTag)
1432
1433         No new tests, no behavior change.
1434
1435         * dom/Element.h:
1436         (WebCore::Element>):
1437         (WebCore::isElementOfType):
1438         Add template parameter to isElementOfType() function so that it can
1439         handle any argument type, not just Elements. Also introduce an
1440         ElementTypeCastTraits struct that is called by isElementOfType()
1441         function so that we can so partial template specialization.
1442
1443         * dom/ElementTraversal.h:
1444         (WebCore::Traversal<ElementType>::firstWithinTemplate):
1445         (WebCore::Traversal<ElementType>::lastWithinTemplate):
1446         (WebCore::Traversal<ElementType>::nextTemplate):
1447         (WebCore::Traversal<ElementType>::previousTemplate):
1448         Use NodeTraversal API internally instead of Traversal<Element> to avoid
1449         redundant isElementNode() checks.
1450
1451         (WebCore::Traversal<Element>::lastWithinTemplate): Deleted.
1452         The code is now identical to the generic version.
1453
1454         (WebCore::Traversal<Element>::previousTemplate): Deleted.
1455         The code is now identical to the generic version.
1456
1457         * dom/make_names.pl:
1458         (printTypeHelpers):
1459         - Generate template specializations for ElementTypeCastTraits struct
1460           instead of isElementOfType(). This avoids having to provide overloads
1461           for specific argument types (e.g. Node, Element, HTMLElement, ...).
1462         - Share more code between HTML code path and the other path (for SVG,
1463           MTHML).
1464
1465         * html/HTMLElement.h:
1466         (WebCore::HTMLElement>):
1467         Provide HTMLElement template specialization for ElementTypeCastTraits
1468         struct instead of isElementOfType().
1469
1470         * html/HTMLFormControlElement.h:
1471         (WebCore::HTMLFormControlElement>):
1472         Provide HTMLFormControlElement template specialization for
1473         ElementTypeCastTraits struct instead of isElementOfType().
1474
1475         * html/HTMLFrameElementBase.h:
1476         (WebCore::isHTMLFrameElementBase):
1477         - Remove helper taking an Element in argument as it does not bring any
1478           benefit. Instead, update the overload taking a Node in argument to
1479           remove the unnecessary isElementNode() check as isHTMLFrameElement(Node)
1480           is now efficient.
1481         - Add an overload taking an HTMLElement in argument so that we can bypass
1482           the isHTMLElement() check when we know the input is an HTMLElement.
1483
1484         * html/HTMLMediaElement.h:
1485         (WebCore::HTMLMediaElement>):
1486         Provide HTMLMediaElement template specialization for ElementTypeCastTraits
1487         struct instead of isElementOfType().
1488
1489         * html/HTMLPlugInImageElement.h:
1490         (WebCore::HTMLPlugInImageElement>):
1491         Provide HTMLPlugInImageElement template specialization for
1492         ElementTypeCastTraits struct instead of isElementOfType().
1493
1494         * html/LabelableElement.h:
1495         (WebCore::LabelableElement>):
1496         Provide LabelableElement template specialization for ElementTypeCastTraits
1497         struct instead of isElementOfType().
1498
1499         * mathml/MathMLElement.h:
1500         (WebCore::MathMLElement>):
1501         Provide MathMLElement template specialization for ElementTypeCastTraits
1502         struct for consistency with HTMLElement / SVGElement.
1503
1504         * svg/SVGElement.h:
1505         (WebCore::SVGElement>):
1506         - Provide SVGElement template specialization for ElementTypeCastTraits
1507           struct instead of isElementOfType().
1508         - include SVGElementTypeHelpers.h at the end of the file (similarly to
1509           what is already done in HTMLElement.h because
1510           isElementOfType(const SVGElement&) needs to be defiend because the
1511           include.
1512
1513         * svg/SVGFilterPrimitiveStandardAttributes.h:
1514         (WebCore::SVGFilterPrimitiveStandardAttributes>):
1515         Provide SVGFilterPrimitiveStandardAttributes template specialization for
1516         ElementTypeCastTraits struct instead of isElementOfType().
1517
1518         * svg/animation/SVGSMILElement.h:
1519         (WebCore::SVGSMILElement>):
1520         Provide SVGSMILElement template specialization for ElementTypeCastTraits
1521         struct instead of isElementOfType().
1522
1523
1524 2014-08-07  Sergio Villar Senin  <svillar@igalia.com>
1525
1526         [CSS Grid Layout] Sort items by span when resolving content-based track sizing functions
1527         https://bugs.webkit.org/show_bug.cgi?id=135701
1528
1529         Reviewed by Darin Adler.
1530
1531         Section 10.4 of the specs mentions that we should first treat non
1532         spanning items and then incrementally proceed with items with
1533         greater spans when resolving the track breaths in the Track Sizing
1534         Algorithm.
1535
1536         As a nice side effect we're removing the multiple processing of
1537         spanning grid items caused by GridIterator (it returns the same
1538         item as many times as the number of cells it spans). This adds a
1539         ~4% performance penalty in auto-grid-lots-of-data.html mainly due
1540         to the use of a hash to remove duplicates.
1541
1542         Test: fast/css-grid-layout/grid-item-order-in-content-sized-columns-resolution.html
1543
1544         * rendering/RenderGrid.cpp:
1545         (WebCore::RenderGrid::gridItemSpan):
1546         (WebCore::gridItemWithSpanSorter):
1547         (WebCore::uniquePointerInPair):
1548         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
1549         * rendering/RenderGrid.h:
1550
1551 2014-09-15  Zan Dobersek  <zdobersek@igalia.com>
1552
1553         [GTK][CMake] Build WebCore with Wayland-specific include directories, libraries
1554         https://bugs.webkit.org/show_bug.cgi?id=136815
1555
1556         Reviewed by Philippe Normand.
1557
1558         * PlatformGTK.cmake: Add the platform/graphics/wayland/ directory to the list of
1559         WebCore's include directories. Add include directories of the Wayland dependency
1560         to the list of WebCore's include directories. Same for the Wayland libraries.
1561
1562 2014-09-15  peavo@outlook.com  <peavo@outlook.com>
1563
1564         [WinCairo] Make it easier to enable/disable GStreamer.
1565         https://bugs.webkit.org/show_bug.cgi?id=135766
1566
1567         Reviewed by Brent Fulgham.
1568
1569         Make it possible to enable/disable GStreamer by editing the new user macro ENABLE_GSTREAMER_WINCAIRO.
1570
1571         * WebCore.vcxproj/WebCoreDebugWinCairo.props: Import GStreamer property file.
1572         * WebCore.vcxproj/WebCoreReleaseWinCairo.props: Ditto.
1573
1574 2014-09-12  Sergio Villar Senin  <svillar@igalia.com>
1575
1576         [CSS Grid Layout] Crash at CSSParser::parseGridTemplateRowsAndAreas
1577         https://bugs.webkit.org/show_bug.cgi?id=136778
1578
1579         Reviewed by Darin Adler.
1580
1581         An empty list of grid line names (represented by "()") does not
1582         add anything to the list of parsed values. That's why trying to
1583         concatenate an adjacent list of grid line names was failing,
1584         because we were trying to concatenate a list with the last parsed
1585         CSSValue which was not the expected grid line names list.
1586
1587         * css/CSSParser.cpp:
1588         (WebCore::CSSParser::parseGridTemplateRowsAndAreas):
1589         (WebCore::CSSParser::parseGridLineNames):
1590         * css/CSSParser.h:
1591
1592 2014-09-15  Andres Gomez  <agomez@igalia.com>
1593
1594         [GStreamer] don't send transferMode HTTP header
1595         https://bugs.webkit.org/show_bug.cgi?id=136781
1596
1597         Reviewed by Philippe Normand.
1598
1599         No header at all is better than having the wrong header as DLNA
1600         mandates that a missing header has to be tolerated while a wrong
1601         header is an error.
1602
1603         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1604         (webKitWebSrcStart):
1605         * platform/network/HTTPHeaderNames.in:
1606
1607 2014-09-14  Christophe Dumez  <cdumez@apple.com>
1608
1609         Fix post-mortem nits for r173528 & r173549
1610         https://bugs.webkit.org/show_bug.cgi?id=136808
1611
1612         Reviewed by Darin Adler.
1613
1614         Fix post-mortem nits for r173528 & r173549.
1615
1616         No new tests, no behavior change.
1617
1618         * accessibility/AccessibilityNodeObject.cpp:
1619         (WebCore::AccessibilityNodeObject::alternativeTextForWebArea):
1620         - Use auto* instead of more specific types.
1621         - Use fastGetAttribute() instead of getAttribute() as this is
1622           supported for the "title" attribute.
1623
1624         * editing/FrameSelection.cpp:
1625         (WebCore::FrameSelection::setSelectionFromNone):
1626         Use auto* instead of more specific types.
1627
1628 2014-09-14  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1629
1630         Introduce FONT_DATA_TYPE_CASTS, and use it
1631         https://bugs.webkit.org/show_bug.cgi?id=136766
1632
1633         Reviewed by Darin Adler.
1634
1635         As a step to use toFoo, this patch introduces FONT_DATA_TYPE_CASTS macro for toFooFontData().
1636         This will help to detect wrong type cast.
1637
1638         * platform/graphics/FontData.h:
1639         * platform/graphics/FontGlyphs.cpp:
1640         (WebCore::FontGlyphs::releaseFontData):
1641         (WebCore::FontGlyphs::determinePitch):
1642         * platform/graphics/GlyphPageTreeNode.cpp:
1643         (WebCore::GlyphPageTreeNode::initializePage):
1644         * platform/graphics/SegmentedFontData.h:
1645         * platform/graphics/SimpleFontData.h:
1646         * platform/graphics/mac/SimpleFontDataMac.mm:
1647         (WebCore::SimpleFontData::getCompositeFontReferenceFontData):
1648
1649 2014-09-14  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1650
1651         Generate toCSSStyleSheet using STYLE_SHEET_TYPE_CASTS
1652         https://bugs.webkit.org/show_bug.cgi?id=136774
1653
1654         Reviewed by Darin Adler.
1655
1656         As a step to use toFoo, this patch introduces STYLE_SHEET_TYPE_CASTS for toCSSStyleSheet().
1657         This will help to detect wrong type cast. Additonally this patch helps to remove argument type of RefPtr.
1658
1659         No new tests, no behavior changes.
1660
1661         * bindings/gobject/WebKitDOMPrivate.cpp:
1662         (WebKit::wrap):
1663         * css/CSSStyleSheet.h:
1664         * css/StyleSheet.h:
1665         * dom/DocumentStyleSheetCollection.cpp:
1666         (WebCore::filterEnabledNonemptyCSSStyleSheets):
1667         * dom/ProcessingInstruction.cpp:
1668         (WebCore::ProcessingInstruction::parseStyleSheet):
1669         * inspector/InspectorCSSAgent.cpp:
1670         (WebCore::InspectorCSSAgent::getAllStyleSheets):
1671         (WebCore::InspectorCSSAgent::collectStyleSheets):
1672
1673 2014-09-14  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1674
1675         Generate toFooElementData() using ELEMENT_DATA_TYPE_CASTS
1676         https://bugs.webkit.org/show_bug.cgi?id=136775
1677
1678         Reviewed by Darin Adler.
1679
1680         As a step to use toFoo, this patch introduces ELEMENT_DATA_TYPE_CASTS for toFooElementData().
1681         This will help to detect wrong type cast. Additonally this patch helps to remove argument type of RefPtr.
1682
1683         No new tests, no behavior changes.
1684
1685         * dom/Element.cpp:
1686         (WebCore::Element::cloneAttributesFromElement):
1687         (WebCore::Element::createUniqueElementData):
1688         * dom/ElementData.cpp:
1689         (WebCore::ElementData::destroy):
1690         * dom/ElementData.h:
1691         (WebCore::ElementData::length):
1692         (WebCore::ElementData::attributeBase):
1693         (WebCore::ElementData::presentationAttributeStyle):
1694         (WebCore::ElementData::attributesIterator):
1695         * svg/SVGSVGElement.cpp:
1696         (WebCore::SVGSVGElement::setupInitialView): Remove static_cast<SVGSVGElement*>
1697
1698 2014-09-14  Chris Dumez  <cdumez@apple.com>
1699
1700         Remove unnecessary overloads taking a ContainerNode in Element Traversal
1701         https://bugs.webkit.org/show_bug.cgi?id=136767
1702
1703         Reviewed by Darin Adler.
1704
1705         Remove unnecessary overloads taking a ContainerNode in Element Traversal.
1706         Several of those don't bring any performance improvements as the needed
1707         methods are defined on Node (not ContainerNode).
1708
1709         No new tests, no behavior change.
1710
1711         * dom/ElementTraversal.h:
1712         (WebCore::Traversal<Element>::previous):
1713         NodeTraversal::previous() takes a const Node* in argument so the
1714         ContainerNode overload is not needed.
1715
1716         (WebCore::Traversal<ElementType>::previous):
1717         Unnecessary now that Traversal<Element>::previous() takes a const Node*
1718         in argument.
1719
1720         (WebCore::Traversal<ElementType>::nextSibling):
1721         nextSibling() is defined on Node, not ContainerNode, so the overload
1722         is not needed.
1723
1724         (WebCore::Traversal<ElementType>::previousSibling):
1725         previousSibling() is defined on Node, not ContainerNode, so the overload
1726         is not needed.
1727
1728         (WebCore::Traversal<Element>::previousTemplate): Deleted.
1729         (WebCore::Traversal<ElementType>::previousTemplate): Deleted.
1730         (WebCore::Traversal<ElementType>::nextSiblingTemplate): Deleted.
1731         (WebCore::Traversal<ElementType>::previousSiblingTemplate): Deleted.
1732         No need to have those functions templated anymore.
1733
1734 2014-09-14  Daniel Bates  <dabates@apple.com>
1735
1736         [iOS] Attempt to fix the iOS build after <http://trac.webkit.org/changeset/173606>
1737         (https://bugs.webkit.org/show_bug.cgi?id=136789)
1738
1739         Substitute Node::countChildNodes() for Node::childNodeCount() in more places.
1740
1741         Although I updated a comment in WebCore::lastOffsetForEditing() (defined in file
1742         editing/htmlediting.cpp) to refer to Node::countChildNodes(), I'm unclear what the
1743         comment is trying to explain that isn't otherwise explained by the code or the
1744         comments that precede this function. Specifically, I don't understand the use of
1745         the word "preempt" in the comment. We should look to improve the readability of
1746         this comment.
1747
1748         * editing/htmlediting.cpp:
1749         (WebCore::lastOffsetForEditing):
1750         * page/ios/FrameIOS.mm:
1751         (WebCore::Frame::interpretationsForCurrentRoot):
1752
1753 2014-09-14  Chris Dumez  <cdumez@apple.com>
1754
1755         Drop NodeTraversal::nextSkippingChildren() overload taking a ContainerNode
1756         https://bugs.webkit.org/show_bug.cgi?id=136764
1757
1758         Reviewed by Darin Adler.
1759
1760         Drop NodeTraversal::nextSkippingChildren() overload taking a
1761         ContainerNode argument. This one does not bring any performance
1762         improvement because nextSibling() is defined on Node and
1763         nextAncestorSibling() takes a Node in argument.
1764
1765         Also remove the overload in ElementTraversal as it no longer makes
1766         sense after this change.
1767
1768         No new tests, no behavior change.
1769
1770         * dom/ElementTraversal.h:
1771         (WebCore::Traversal<ElementType>::nextSkippingChildren):
1772         (WebCore::Traversal<ElementType>::nextSkippingChildrenTemplate): Deleted.
1773         * dom/NodeTraversal.h:
1774         (WebCore::NodeTraversal::nextSkippingChildren):
1775         (WebCore::NodeTraversal::next):
1776         (WebCore::NodeTraversal::traverseNextSkippingChildrenTemplate): Deleted.
1777
1778 2014-09-14  Chris Dumez  <cdumez@apple.com>
1779
1780         Rename Node::childNodeCount() to countChildNodes() and avoid inefficient uses
1781         https://bugs.webkit.org/show_bug.cgi?id=136789
1782
1783         Reviewed by Darin Adler.
1784
1785         Rename Node::childNodeCount() to countChildNodes() to make it clearer
1786         that the method actually computes the result rather than returning a
1787         cached value.
1788
1789         This patch also introduces a new Node::hasOneChild() method that is
1790         used to check if a Node has a single child. This is much more efficient
1791         than calling countChildNodes() == 1.
1792
1793         The patch also leverages Node::hasChildNodes() in a lot of places
1794         instead of calling countChildNodes().
1795
1796         Finally, in a couple of places, we now use childrenOfType() to iterate
1797         over children more efficient than using countChildNodes() and
1798         childNode(index).
1799
1800         No new tests, no behavior change.
1801
1802         * WebCore.exp.in:
1803         * WebCore.order:
1804         Update the name of the exposed symbol for countChildNodes().
1805
1806         * dom/ContainerNode.cpp:
1807         (WebCore::ContainerNode::removeChildren):
1808         (WebCore::ContainerNode::countChildNodes):
1809         (WebCore::ContainerNode::childNodeCount): Deleted.
1810         Rename childNodeCount() to countChildNodes() to make it obvious it is
1811         computing the result rather than returning a cached value.
1812
1813         * dom/ContainerNode.h:
1814         (WebCore::ContainerNode::hasOneChild):
1815         Introduce an efficient way to check in a ContainerNode has a single
1816         child as "countChildNodes() == 1" calls were frequent and inefficient.
1817
1818         (WebCore::Node::countChildNodes):
1819         (WebCore::Node::childNodeCount): Deleted.
1820         * dom/Node.h:
1821         Rename childNodeCount() to countChildNodes().
1822
1823         * dom/Position.cpp:
1824         (WebCore::Position::parentAnchoredEquivalent):
1825         * dom/Position.h:
1826         (WebCore::lastOffsetInNode):
1827         * dom/Range.cpp:
1828         Mechanical renaming.
1829
1830         (WebCore::lengthOfContentsInNode):
1831         * editing/ApplyStyleCommand.cpp:
1832         (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
1833         (WebCore::ApplyStyleCommand::shouldApplyInlineStyleToRun):
1834         (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
1835         (WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical):
1836         (WebCore::ApplyStyleCommand::applyInlineStyleChange):
1837         Call hasChildNodes() rather than countChildNodes() as it is a lot more
1838         efficient.
1839
1840         * editing/Editor.cpp:
1841         (WebCore::Editor::setTextAsChildOfElement):
1842         (WebCore::Editor::rangeOfString):
1843         (WebCore::Editor::countMatchesForText):
1844         * editing/FrameSelection.cpp:
1845         (WebCore::FrameSelection::elementRangeContainingCaretSelection):
1846         Mechanical renaming.
1847
1848         * editing/ReplaceSelectionCommand.cpp:
1849         (WebCore::ReplaceSelectionCommand::insertAsListItems):
1850         Call hasOneChild() instead of countChildNodes() == 1. Also remove
1851         redundant listElement->hasChildNodes() check as hasOneChild() takes
1852         care of this already.
1853
1854         * editing/TextIterator.cpp:
1855         (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
1856         * editing/VisibleUnits.cpp:
1857         (WebCore::endOfDocument):
1858         * editing/htmlediting.cpp:
1859         (WebCore::lastOffsetForEditing):
1860         Mechanical renaming.
1861
1862         (WebCore::visiblePositionBeforeNode):
1863         (WebCore::visiblePositionAfterNode):
1864         Call hasChildNodes() instead of converting countChildNodes() to a
1865         boolean.
1866
1867         * editing/markup.cpp:
1868         (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
1869         Call !hasChildNodes() instead of !countChildNodes().
1870
1871         (WebCore::isPlainTextMarkup):
1872         - Drop !node->isElementNode() check as !node->hasTagName(divTag) takes
1873           care of discarding non-Element Nodes already.
1874         - Cast the Node to an HTMLDivElement as soon as possible to avoid
1875           calling calling the slower Node APIs in several cases.
1876         - Call hasOneChild() instead of countChildNodes() == 1.
1877
1878         * html/HTMLDivElement.h:
1879         * html/HTMLTagNames.in:
1880         Generate casting helpers as I use them in WebCore::isPlainTextMarkup().
1881
1882         * html/HTMLScriptElement.cpp:
1883         (WebCore::HTMLScriptElement::setText):
1884         * html/HTMLTitleElement.cpp:
1885         (WebCore::HTMLTitleElement::setText):
1886         Call hasOneChild() / hasChildNodes() instead of countChildNodes().
1887
1888         * html/shadow/MediaControlElements.cpp:
1889         (WebCore::MediaControlTimelineContainerElement::setTimeDisplaysHidden):
1890         (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
1891         Use childrenOfType<Element>() to iterate of child Elements instead of
1892         slower childNodeCount() + childNode(index) + isElementNode(). Also,
1893         childNodeCount() was not even cached before the loop.
1894
1895         * html/track/VTTRegion.cpp:
1896         (WebCore::VTTRegion::displayLastTextTrackCueBox):
1897         Use childrenOfType<Element>() to iterate of child Elements, thus
1898         avoiding calling childNodeCount() + childNode(index).
1899
1900         * page/DOMSelection.cpp:
1901         (WebCore::DOMSelection::extend):
1902         (WebCore::DOMSelection::selectAllChildren):
1903         * rendering/RenderObject.cpp:
1904         (WebCore::RenderObject::caretMaxOffset):
1905         * rendering/RenderReplaced.cpp:
1906         (WebCore::RenderReplaced::isSelected):
1907         * rendering/RenderView.cpp:
1908         (WebCore::RenderView::splitSelectionBetweenSubtrees):
1909         Mechanical renaming.
1910
1911 2014-09-13  Chris Dumez  <cdumez@apple.com>
1912
1913         Un-inline Element constructor
1914         https://bugs.webkit.org/show_bug.cgi?id=136786
1915
1916         Reviewed by Benjamin Poulain.
1917
1918         Un-inline Element constructor as it is non-trivial and it does not seem
1919         to impact performance based on my testing:
1920         http://dromaeo.com/?id=226865,226869
1921
1922         This reduces the stripped binary size by 8 Kb.
1923
1924         No new tests, no behavior change.
1925
1926         * dom/Element.cpp:
1927         (WebCore::Element::Element):
1928         * dom/Element.h:
1929         (WebCore::Element::Element): Deleted.
1930
1931 2014-09-12  Jon Honeycutt  <jhoneycutt@apple.com>
1932
1933         Build fix with REQUEST_AUTOCOMPLETE enabled
1934
1935         * html/HTMLFormElement.cpp:
1936         (WebCore::HTMLFormElement::requestAutocomplete):
1937         (WebCore::HTMLFormElement::finishRequestAutocomplete):
1938
1939 2014-09-10  Jon Honeycutt  <jhoneycutt@apple.com>
1940
1941         Re-add the request autocomplete feature
1942
1943         <https://bugs.webkit.org/show_bug.cgi?id=136730>
1944
1945         This feature was rolled out in r148731 because it was only used by
1946         Chromium. As we consider supporting this feature, roll it back in, but
1947         leave it disabled.
1948
1949         This rolls out r148731 (which removed the feature) with small changes
1950         needed to make the code build in ToT, to match modern style, to make
1951         the tests run, and to remove unused code.
1952
1953         Reviewed by Andy Estes.
1954
1955         Tests: fast/events/constructors/autocomplete-error-event-constructor.html
1956                fast/forms/form-request-autocomplete.html
1957
1958         * Configurations/FeatureDefines.xcconfig:
1959         * DerivedSources.make:
1960         * WebCore.xcodeproj/project.pbxproj:
1961         * dom/AutocompleteErrorEvent.h: Added.
1962         (WebCore::AutocompleteErrorEvent::create):
1963         (WebCore::AutocompleteErrorEvent::reason):
1964         (WebCore::AutocompleteErrorEvent::AutocompleteErrorEvent):
1965         * dom/AutocompleteErrorEvent.idl: Added.
1966         * dom/EventNames.h:
1967         * dom/EventNames.in:
1968         * html/HTMLAttributeNames.in:
1969         * html/HTMLFormElement.cpp:
1970         (WebCore::HTMLFormElement::HTMLFormElement):
1971         (WebCore::HTMLFormElement::requestAutocomplete):
1972         (WebCore::HTMLFormElement::finishRequestAutocomplete):
1973         (WebCore::HTMLFormElement::requestAutocompleteTimerFired):
1974         (WebCore::HTMLFormElement::parseAttribute):
1975         * html/HTMLFormElement.h:
1976         * html/HTMLFormElement.idl:
1977         * loader/EmptyClients.h:
1978         * loader/FrameLoaderClient.h:
1979         * page/DOMWindow.idl:
1980
1981 2014-09-12  Vivek Galatage  <vivek.vg@samsung.com>
1982
1983         CanvasRenderingContext2D should update the computed style while setting the font
1984         https://bugs.webkit.org/show_bug.cgi?id=136737
1985
1986         Reviewed by Darin Adler.
1987
1988         Before accessing the computed style for populating 'font' property of CanvasRenderingContext2D
1989         make sure to have an up-to-date computed style avoiding any stale reference.
1990
1991         Test: fast/canvas/canvas-set-font-with-updated-style.html
1992
1993         * html/canvas/CanvasRenderingContext2D.cpp:
1994         (WebCore::CanvasRenderingContext2D::setFont):
1995
1996 2014-09-12  Yusuke Suzuki  <utatane.tea@gmail.com>
1997
1998         CSS JIT: Apply CSS JIT to SelectorQuery with multiple selectors
1999         https://bugs.webkit.org/show_bug.cgi?id=135255
2000
2001         Reviewed by Benjamin Poulain.
2002
2003         After dropping SelectorCheckerFastPath, Dromaeo cssquery-jquery test
2004         result becomes significantly worse. 400.26/s to 348.16/s, 13%
2005         performance regression.
2006
2007         Investigated the cause of it and we found that the test results for
2008         querySelector with multiple selectors causes performance regressions.
2009
2010         To solve this, we attempt to JIT compile all selectors in multiple
2011         selectors. And if compiling some selectors is failed, SelectorQuery
2012         fallbacks to the slower implementation.
2013
2014         This change improves the performance. After applying this patch,
2015         cssquery-jquery test result becomes 418.71/s, 4.61% better than the
2016         previous good performance case.
2017
2018         Test: fast/selectors/querySelector-multiple-selectors.html
2019
2020         * dom/SelectorQuery.cpp:
2021         (WebCore::SelectorDataList::SelectorDataList):
2022         (WebCore::SelectorDataList::executeCompiledSingleMultiSelectorData):
2023         (WebCore::SelectorDataList::execute):
2024         * dom/SelectorQuery.h:
2025
2026 2014-09-12  Jer Noble  <jer.noble@apple.com>
2027
2028         [Fullscreen] Taking embedded youtube video full screen takes the whole page full screen
2029         https://bugs.webkit.org/show_bug.cgi?id=136792
2030
2031         Reviewed by Beth Dakin.
2032
2033         Recalculate style after beginning the enter fullscreen animation, but before sending the
2034         "webkitfullscreenchange" event to listeners.
2035
2036         * dom/Document.cpp:
2037         (WebCore::Document::webkitWillEnterFullScreenForElement):
2038
2039 2014-09-12  Commit Queue  <commit-queue@webkit.org>
2040
2041         Unreviewed, rolling out r173575.
2042         https://bugs.webkit.org/show_bug.cgi?id=136790
2043
2044         Failing tests (Requested by enrica on #webkit).
2045
2046         Reverted changeset:
2047
2048         "Remove PLATFORM(IOS) from WebCore/editing (Part 3)."
2049         https://bugs.webkit.org/show_bug.cgi?id=136474
2050         http://trac.webkit.org/changeset/173575
2051
2052 2014-09-12  Enrica Casucci  <enrica@apple.com>
2053
2054         Remove PLATFORM(IOS) from WebCore/editing (Part 3).
2055         https://bugs.webkit.org/show_bug.cgi?id=136474
2056
2057         Reviewed by Benjamin Poulain.
2058
2059         This is the updated version of the patch that was landed in r173340.
2060         I changed the use of IntPoint to FloatPoint since it was causing tests
2061         to fail.
2062         This patch removes the use of PLATFORM(IOS) from TextAffinity.h
2063         and removes the assumption that EAffinity values match NSSelectionAffinity
2064         values. It also removes the includes in TextAffinity.h, creating the need to
2065         include explicitly the files when necessary. It also removes the unnecessary
2066         use of platform specific types, replacing them with WebCore types.
2067
2068         * WebCore.exp.in:
2069         * editing/TextAffinity.h:
2070         (kit): Deleted.
2071         (core): Deleted.
2072         * editing/cocoa/HTMLConverter.mm:
2073         * page/mac/WebCoreFrameView.h:
2074         * platform/ios/ScrollViewIOS.mm:
2075         (WebCore::ScrollView::platformSetScrollPosition):
2076         * platform/ios/wak/WAKScrollView.mm:
2077         (-[WAKScrollView setScrollOrigin:updatePositionAtAll:immediately:]):
2078         (-[WAKScrollView scrollOrigin]):
2079         * platform/mac/ScrollViewMac.mm:
2080         (WebCore::ScrollView::platformSetScrollPosition):
2081
2082 2014-09-12  Dean Jackson  <dino@apple.com>
2083
2084         Unprefix the flexbox CSS properties
2085         https://bugs.webkit.org/show_bug.cgi?id=98420
2086
2087         Unreviewed fix up, that missed the original
2088         commit. Tony Chang made some comments
2089         on the bugzilla.
2090
2091         "justify-self" should not have been unprefixed.
2092
2093         * css/CSSComputedStyleDeclaration.cpp:
2094         (WebCore::ComputedStyleExtractor::propertyValue):
2095         * css/CSSParser.cpp:
2096         (WebCore::isValidKeywordPropertyAndValue):
2097         (WebCore::CSSParser::parseValue):
2098         * css/CSSPropertyNames.in:
2099         * css/StyleResolver.cpp:
2100         (WebCore::StyleResolver::applyProperty):
2101
2102 2014-09-12  Dean Jackson  <dino@apple.com>
2103
2104         Unprefix the flexbox CSS properties
2105         https://bugs.webkit.org/show_bug.cgi?id=98420
2106
2107         Reviewed by Benjamin Poulain.
2108
2109         Remove the need for a "-webkit-" prefix on flexbox
2110         and related properties. This includes:
2111         - align-content
2112         - align-items
2113         - align-self
2114         - flex-basis
2115         - flex-direction
2116         - flex-wrap
2117         - flex-grow
2118         - flex-shrink
2119         - flex
2120         - flex-flow
2121         - justify-content
2122         - order
2123
2124         ... as well as the display keyword values "flex" and
2125         "inline-flex".
2126
2127         * css/CSSComputedStyleDeclaration.cpp:  Change names.
2128         (WebCore::ComputedStyleExtractor::propertyValue):
2129         * css/CSSParser.cpp: Ditto.
2130         (WebCore::isValidKeywordPropertyAndValue):
2131         (WebCore::isKeywordPropertyID):
2132         (WebCore::CSSParser::parseValue):
2133         (WebCore::CSSParser::parseFlex):
2134         * css/CSSPrimitiveValueMappings.h: Since we need to still handle the old
2135         keywords for display, this has added two new keywords.
2136         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2137         (WebCore::CSSPrimitiveValue::operator EDisplay): If the older keywords were used in
2138         content, map them to the new value names.
2139         * css/CSSPropertyNames.in: Add aliases for the prefixed properties.
2140         * css/CSSValueKeywords.in: Add "flex" and "inline-flex".
2141         * css/DeprecatedStyleBuilder.cpp: Change names.
2142         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
2143         * css/StyleProperties.cpp: Change names.
2144         (WebCore::StyleProperties::getPropertyValue):
2145         (WebCore::StyleProperties::asText):
2146         * css/StylePropertyShorthand.cpp: Rename shorthand methods to remove the prefix.
2147         (WebCore::flexFlowShorthand):
2148         (WebCore::flexShorthand):
2149         (WebCore::shorthandForProperty):
2150         (WebCore::matchingShorthandsForLonghand):
2151         (WebCore::webkitFlexFlowShorthand): Deleted.
2152         (WebCore::webkitFlexShorthand): Deleted.
2153         * css/StylePropertyShorthand.h:
2154         * css/StyleResolver.cpp:
2155         (WebCore::equivalentBlockDisplay):
2156         (WebCore::StyleResolver::applyProperty):
2157         * page/animation/CSSPropertyAnimation.cpp: Change names.
2158         (WebCore::PropertyWrapperFlex::PropertyWrapperFlex):
2159         * rendering/RenderElement.cpp:
2160         (WebCore::RenderElement::createFor): Handle the two new display values (the same way as
2161         the old values).
2162         * rendering/style/RenderStyleConstants.h: Add constants for the new display values.
2163
2164 2014-09-12  Yusuke Suzuki  <utatane.tea@gmail.com>
2165
2166         ASSERTION FAILED: e in WebCore::StyleResolver::adjustRenderStyle
2167         https://bugs.webkit.org/show_bug.cgi?id=136366
2168
2169         Reviewed by Benjamin Poulain.
2170
2171         Since element becomes nullptr when resolving styles for pseudo elements,
2172         so don't do `ASSERT(e)` and use pointer for that.
2173
2174         Test: fast/css/appearance-with-pseudo-elements.html
2175
2176         * css/StyleResolver.cpp:
2177         (WebCore::StyleResolver::adjustRenderStyle):
2178         * html/shadow/SliderThumbElement.cpp:
2179         (WebCore::RenderSliderThumb::updateAppearance):
2180         * platform/efl/RenderThemeEfl.cpp:
2181         (WebCore::RenderThemeEfl::adjustSliderTrackStyle):
2182         (WebCore::RenderThemeEfl::adjustSliderThumbStyle):
2183         (WebCore::RenderThemeEfl::adjustSliderThumbSize):
2184         (WebCore::RenderThemeEfl::adjustCheckboxStyle):
2185         (WebCore::RenderThemeEfl::adjustRadioStyle):
2186         (WebCore::RenderThemeEfl::adjustButtonStyle):
2187         (WebCore::RenderThemeEfl::adjustMenuListStyle):
2188         (WebCore::RenderThemeEfl::adjustMenuListButtonStyle):
2189         (WebCore::RenderThemeEfl::adjustTextFieldStyle):
2190         (WebCore::RenderThemeEfl::adjustTextAreaStyle):
2191         (WebCore::RenderThemeEfl::adjustSearchFieldResultsButtonStyle):
2192         (WebCore::RenderThemeEfl::adjustSearchFieldResultsDecorationPartStyle):
2193         (WebCore::RenderThemeEfl::adjustSearchFieldCancelButtonStyle):
2194         (WebCore::RenderThemeEfl::adjustSearchFieldStyle):
2195         (WebCore::RenderThemeEfl::adjustInnerSpinButtonStyle):
2196         (WebCore::RenderThemeEfl::adjustProgressBarStyle):
2197         * platform/efl/RenderThemeEfl.h:
2198         * platform/gtk/RenderThemeGtk.h:
2199         * rendering/RenderTheme.cpp:
2200         (WebCore::RenderTheme::adjustStyle):
2201         (WebCore::RenderTheme::adjustCheckboxStyle):
2202         (WebCore::RenderTheme::adjustRadioStyle):
2203         (WebCore::RenderTheme::adjustButtonStyle):
2204         (WebCore::RenderTheme::adjustInnerSpinButtonStyle):
2205         (WebCore::RenderTheme::adjustTextFieldStyle):
2206         (WebCore::RenderTheme::adjustTextAreaStyle):
2207         (WebCore::RenderTheme::adjustMenuListStyle):
2208         (WebCore::RenderTheme::adjustMeterStyle):
2209         (WebCore::RenderTheme::adjustProgressBarStyle):
2210         (WebCore::RenderTheme::adjustMenuListButtonStyle):
2211         (WebCore::RenderTheme::adjustMediaControlStyle):
2212         (WebCore::RenderTheme::adjustSliderTrackStyle):
2213         (WebCore::RenderTheme::adjustSliderThumbStyle):
2214         (WebCore::RenderTheme::adjustSliderThumbSize):
2215         (WebCore::RenderTheme::adjustSearchFieldStyle):
2216         (WebCore::RenderTheme::adjustSearchFieldCancelButtonStyle):
2217         (WebCore::RenderTheme::adjustSearchFieldDecorationPartStyle):
2218         (WebCore::RenderTheme::adjustSearchFieldResultsDecorationPartStyle):
2219         (WebCore::RenderTheme::adjustSearchFieldResultsButtonStyle):
2220         * rendering/RenderTheme.h:
2221         * rendering/RenderThemeGtk.cpp:
2222         (WebCore::RenderThemeGtk::adjustButtonStyle):
2223         (WebCore::RenderThemeGtk::adjustMenuListStyle):
2224         (WebCore::RenderThemeGtk::adjustMenuListButtonStyle):
2225         (WebCore::RenderThemeGtk::adjustSearchFieldResultsButtonStyle):
2226         (WebCore::RenderThemeGtk::adjustSearchFieldResultsDecorationPartStyle):
2227         (WebCore::RenderThemeGtk::adjustSearchFieldCancelButtonStyle):
2228         (WebCore::RenderThemeGtk::adjustSearchFieldStyle):
2229         (WebCore::RenderThemeGtk::adjustSliderTrackStyle):
2230         (WebCore::RenderThemeGtk::adjustSliderThumbStyle):
2231         (WebCore::RenderThemeGtk::adjustSliderThumbSize):
2232         (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):
2233         (WebCore::RenderThemeGtk::adjustProgressBarStyle):
2234         * rendering/RenderThemeIOS.h:
2235         * rendering/RenderThemeIOS.mm:
2236         (WebCore::RenderThemeIOS::adjustCheckboxStyle):
2237         (WebCore::RenderThemeIOS::adjustRadioStyle):
2238         (WebCore::RenderThemeIOS::adjustMenuListButtonStyle):
2239         (WebCore::RenderThemeIOS::adjustSliderTrackStyle):
2240         (WebCore::RenderThemeIOS::adjustSliderThumbSize):
2241         (WebCore::RenderThemeIOS::adjustSearchFieldStyle):
2242         (WebCore::RenderThemeIOS::adjustButtonStyle):
2243         * rendering/RenderThemeMac.h:
2244         * rendering/RenderThemeMac.mm:
2245         (WebCore::RenderThemeMac::adjustTextFieldStyle):
2246         (WebCore::RenderThemeMac::adjustTextAreaStyle):
2247         (WebCore::RenderThemeMac::adjustProgressBarStyle):
2248         (WebCore::RenderThemeMac::adjustMenuListStyle):
2249         (WebCore::RenderThemeMac::adjustMenuListButtonStyle):
2250         (WebCore::RenderThemeMac::adjustSliderTrackStyle):
2251         (WebCore::RenderThemeMac::adjustSliderThumbStyle):
2252         (WebCore::RenderThemeMac::adjustSearchFieldStyle):
2253         (WebCore::RenderThemeMac::adjustSearchFieldCancelButtonStyle):
2254         (WebCore::RenderThemeMac::adjustSearchFieldDecorationPartStyle):
2255         (WebCore::RenderThemeMac::adjustSearchFieldResultsDecorationPartStyle):
2256         (WebCore::RenderThemeMac::adjustSearchFieldResultsButtonStyle):
2257         (WebCore::RenderThemeMac::adjustSliderThumbSize):
2258         * rendering/RenderThemeSafari.cpp:
2259         (WebCore::RenderThemeSafari::adjustButtonStyle):
2260         (WebCore::RenderThemeSafari::adjustTextFieldStyle):
2261         (WebCore::RenderThemeSafari::adjustTextAreaStyle):
2262         (WebCore::RenderThemeSafari::adjustMenuListStyle):
2263         (WebCore::RenderThemeSafari::adjustMenuListButtonStyle):
2264         (WebCore::RenderThemeSafari::adjustSliderThumbStyle):
2265         (WebCore::RenderThemeSafari::adjustSliderThumbSize):
2266         (WebCore::RenderThemeSafari::adjustSearchFieldStyle):
2267         (WebCore::RenderThemeSafari::adjustSearchFieldCancelButtonStyle):
2268         (WebCore::RenderThemeSafari::adjustSearchFieldDecorationPartStyle):
2269         (WebCore::RenderThemeSafari::adjustSearchFieldResultsDecorationPartStyle):
2270         (WebCore::RenderThemeSafari::adjustSearchFieldResultsButtonStyle):
2271         (WebCore::RenderThemeSafari::adjustMeterStyle):
2272         * rendering/RenderThemeSafari.h:
2273         * rendering/RenderThemeWin.cpp:
2274         (WebCore::RenderThemeWin::adjustInnerSpinButtonStyle):
2275         (WebCore::RenderThemeWin::adjustMenuListStyle):
2276         (WebCore::RenderThemeWin::adjustMenuListButtonStyle):
2277         (WebCore::RenderThemeWin::adjustSliderThumbSize):
2278         (WebCore::RenderThemeWin::adjustSearchFieldStyle):
2279         (WebCore::RenderThemeWin::adjustSearchFieldCancelButtonStyle):
2280         (WebCore::RenderThemeWin::adjustSearchFieldDecorationPartStyle):
2281         (WebCore::RenderThemeWin::adjustSearchFieldResultsDecorationPartStyle):
2282         (WebCore::RenderThemeWin::adjustSearchFieldResultsButtonStyle):
2283         (WebCore::RenderThemeWin::adjustMeterStyle):
2284         * rendering/RenderThemeWin.h:
2285
2286 2014-09-12  Joseph Pecoraro  <pecoraro@apple.com>
2287
2288         Fix casing in method name - formatNumberForCustomCSSText
2289         https://bugs.webkit.org/show_bug.cgi?id=136758
2290
2291         Reviewed by Benjamin Poulain.
2292
2293         * css/CSSPrimitiveValue.cpp:
2294         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
2295         (WebCore::CSSPrimitiveValue::customCSSText):
2296         (WebCore::CSSPrimitiveValue::formatNumberForcustomCSSText): Deleted.
2297         * css/CSSPrimitiveValue.h:
2298
2299 2014-09-12  Chris Dumez  <cdumez@apple.com>
2300
2301         Make all CSSSelector data members private
2302         https://bugs.webkit.org/show_bug.cgi?id=136784
2303
2304         Reviewed by Benjamin Poulain.
2305
2306         Make all CSSSelector data members private. Previously, some of the data
2307         members such as m_relation / m_match / m_pseudoType were public and
2308         accessed directly from outside the class. The new approach is better
2309         because:
2310         - Those members are bit fields so by using getters, we can hide the
2311           casts inside the getters. The setters can now also check that the
2312           bitfield is big enough to actually store the enum value.
2313         - When using those in switch() statements, the compiler now complains
2314           if we fail to test some of the enum values as the value is now an
2315           enum, and not merely an unsigned integer.
2316         - Some of these members already has getters (e.g. relation()).
2317         - Better encapsulation.
2318
2319         No new tests, no behavior change.
2320
2321         * css/CSSParserValues.cpp:
2322         (WebCore::CSSParserSelector::parsePagePseudoSelector):
2323         (WebCore::CSSParserSelector::parsePseudoElementSelector):
2324         (WebCore::CSSParserSelector::parsePseudoElementCueFunctionSelector):
2325         (WebCore::CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector):
2326         (WebCore::CSSParserSelector::setPseudoClassValue):
2327         (WebCore::CSSParserSelector::isSimple):
2328         (WebCore::CSSParserSelector::prependTagSelector):
2329         * css/CSSParserValues.h:
2330         (WebCore::CSSParserSelector::setMatch):
2331         (WebCore::CSSParserSelector::setRelation):
2332         (WebCore::CSSParserSelector::isPseudoElementCueFunction):
2333         * css/CSSSelector.cpp:
2334         (WebCore::CSSSelector::createRareData):
2335         (WebCore::CSSSelector::specificityForOneSelector):
2336         (WebCore::CSSSelector::specificityForPage):
2337         (WebCore::CSSSelector::operator==):
2338         (WebCore::CSSSelector::selectorText):
2339         * css/CSSSelector.h:
2340         (WebCore::CSSSelector::setPseudoElementType):
2341         (WebCore::CSSSelector::setPagePseudoType):
2342         (WebCore::CSSSelector::pseudoClassType):
2343         (WebCore::CSSSelector::setPseudoClassType):
2344         (WebCore::CSSSelector::pseudoElementType):
2345         (WebCore::CSSSelector::pagePseudoClassType):
2346         (WebCore::CSSSelector::setRelation):
2347         (WebCore::CSSSelector::match):
2348         (WebCore::CSSSelector::setMatch):
2349         (WebCore::CSSSelector::matchesPseudoElement):
2350         (WebCore::CSSSelector::isUnknownPseudoElement):
2351         (WebCore::CSSSelector::isCustomPseudoElement):
2352         (WebCore::CSSSelector::isSiblingSelector):
2353         (WebCore::CSSSelector::isAttributeSelector):
2354         (WebCore::CSSSelector::setValue):
2355         (WebCore::CSSSelector::CSSSelector):
2356         (WebCore::CSSSelector::~CSSSelector):
2357         (WebCore::CSSSelector::tagQName):
2358         (WebCore::CSSSelector::value):
2359         * css/CSSSelectorList.cpp:
2360         (WebCore::SelectorNeedsNamespaceResolutionFunctor::operator()):
2361         * css/PageRuleCollector.cpp:
2362         (WebCore::checkPageSelectorComponents):
2363         * css/RuleFeature.cpp:
2364         (WebCore::RuleFeatureSet::collectFeaturesFromSelector):
2365         * css/RuleSet.cpp:
2366         (WebCore::isSelectorMatchingHTMLBasedOnRuleHash):
2367         (WebCore::determinePropertyWhitelistType):
2368         (WebCore::RuleSet::addRule):
2369         * css/SelectorChecker.cpp:
2370         (WebCore::SelectorChecker::matchRecursively):
2371         (WebCore::anyAttributeMatches):
2372         (WebCore::canMatchHoverOrActiveInQuirksMode):
2373         (WebCore::SelectorChecker::checkOne):
2374         (WebCore::SelectorChecker::checkScrollbarPseudoClass):
2375         (WebCore::SelectorChecker::determineLinkMatchType):
2376         * css/SelectorChecker.h:
2377         (WebCore::SelectorChecker::isCommonPseudoClassSelector):
2378         * css/SelectorFilter.cpp:
2379         (WebCore::collectDescendantSelectorIdentifierHashes):
2380         * cssjit/SelectorCompiler.cpp:
2381         (WebCore::SelectorCompiler::constructFragments):
2382         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching):
2383         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueMatching):
2384         * dom/SelectorQuery.cpp:
2385         (WebCore::isSingleTagNameSelector):
2386         (WebCore::isSingleClassNameSelector):
2387         (WebCore::findIdMatchingType):
2388         (WebCore::SelectorDataList::SelectorDataList):
2389         (WebCore::selectorForIdLookup):
2390         (WebCore::filterRootById):
2391
2392 2014-09-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2393
2394         REGRESSION(r173441): [GTK] All buttons appear insensitive
2395         https://bugs.webkit.org/show_bug.cgi?id=136614
2396
2397         Reviewed by Sergio Villar Senin.
2398
2399         Do not use RenderTheme::isReadOnlyControl() to decide whether to
2400         render non text based forms sensitive or unsensitive, isEnabled()
2401         is enough in those cases.
2402
2403         * rendering/RenderThemeGtk.cpp:
2404         (WebCore::paintToggle):
2405         (WebCore::renderButton):
2406         (WebCore::RenderThemeGtk::paintSliderTrack):
2407         (WebCore::RenderThemeGtk::paintSliderThumb):
2408
2409 2014-09-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2410
2411         REGRESSION(r173423): CertificateInfo is never sent to the UI process when using shared secondary process model
2412         https://bugs.webkit.org/show_bug.cgi?id=136669
2413
2414         Reviewed by Antti Koivisto.
2415
2416         Add CertificateInfoPolicy option to ResourceLoaderOptions. It's
2417         set to DoNotIncludeCertificateInfo for all loads except the main
2418         resource load.
2419
2420         * loader/DocumentLoader.cpp:
2421         (WebCore::DocumentLoader::startLoadingMainResource): Pass
2422         IncludeCertificateInfo to ResourceLoaderOptions.
2423         * loader/NetscapePlugInStreamLoader.cpp:
2424         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
2425         Pass DoNotIncludeCertificateInfo to ResourceLoaderOptions().
2426         * loader/ResourceLoader.h:
2427         (WebCore::ResourceLoader::shouldIncludeCertificateInfo): Return
2428         true if IncludeCertificateInfo option was given.
2429         * loader/ResourceLoaderOptions.h:
2430         (WebCore::ResourceLoaderOptions::ResourceLoaderOptions):
2431         (WebCore::ResourceLoaderOptions::certificateInfoPolicy):
2432         (WebCore::ResourceLoaderOptions::setCertificateInfoPolicy):
2433         * loader/SubresourceLoader.cpp:
2434         (WebCore::SubresourceLoader::didReceiveResponse): If
2435         IncludeCertificateInfo option is present, call
2436         includeCertificateInfo() on the response.
2437         * loader/cache/CachedResourceLoader.cpp:
2438         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet): Pass
2439         DoNotIncludeCertificateInfo to ResourceLoaderOptions().
2440         (WebCore::CachedResourceLoader::defaultCachedResourceOptions): Ditto.
2441         * loader/icon/IconLoader.cpp:
2442         (WebCore::IconLoader::startLoading): Ditto.
2443         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
2444         (WebCore::WebCoreAVCFResourceLoader::startLoading): Ditto.
2445         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2446         (WebCore::WebCoreAVFResourceLoader::startLoading): Ditto.
2447         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2448         (CachedResourceStreamingClient::CachedResourceStreamingClient): Ditto.
2449
2450 2014-09-11  Ryuan Choi  <ryuan.choi@gmail.com>
2451
2452         Unreviewed build fix attempt on windows port since r173553.
2453
2454         * WebCore.vcxproj/WebCore.vcxproj:
2455         * WebCore.vcxproj/WebCore.vcxproj.filters:
2456
2457 2014-09-11  Brian J. Burg  <burg@cs.washington.edu>
2458
2459         Web Inspector: disambiguate integral and real number primitive types in the protocol
2460         https://bugs.webkit.org/show_bug.cgi?id=136606
2461
2462         Reviewed by Timothy Hatcher.
2463
2464         Update clients of InspectorValue to disambiguate integer and double primitive types.
2465
2466         No new tests, no behavior changed.
2467
2468         * inspector/InspectorDOMAgent.cpp:
2469         (WebCore::parseColor):
2470         (WebCore::parseQuad):
2471         (WebCore::InspectorDOMAgent::performSearch):
2472         * inspector/InspectorDOMDebuggerAgent.cpp:
2473         (WebCore::InspectorDOMDebuggerAgent::descriptionForDOMEvent):
2474         * inspector/InspectorIndexedDBAgent.cpp:
2475         * inspector/InspectorOverlay.cpp:
2476         (WebCore::buildObjectForPoint):
2477         (WebCore::buildObjectForRect):
2478         (WebCore::buildObjectForSize):
2479         (WebCore::appendPathCommandAndPoints):
2480         (WebCore::InspectorOverlay::reset):
2481         * inspector/InspectorReplayAgent.cpp:
2482         (WebCore::InspectorReplayAgent::replayToPosition):
2483         * inspector/InspectorStyleSheet.h:
2484         (WebCore::InspectorCSSId::InspectorCSSId):
2485         * inspector/InspectorTimelineAgent.cpp:
2486         (WebCore::InspectorTimelineAgent::didWriteHTML):
2487         (WebCore::InspectorTimelineAgent::didCompleteRecordEntry):
2488         * inspector/TimelineRecordFactory.cpp:
2489         (WebCore::TimelineRecordFactory::createGenericRecord):
2490         (WebCore::TimelineRecordFactory::createBackgroundRecord):
2491         (WebCore::TimelineRecordFactory::createGCEventData):
2492         (WebCore::TimelineRecordFactory::createFunctionCallData):
2493         (WebCore::TimelineRecordFactory::createProbeSampleData):
2494         (WebCore::TimelineRecordFactory::createGenericTimerData):
2495         (WebCore::TimelineRecordFactory::createTimerInstallData):
2496         (WebCore::TimelineRecordFactory::createXHRReadyStateChangeData):
2497         (WebCore::TimelineRecordFactory::createEvaluateScriptData):
2498         (WebCore::TimelineRecordFactory::createResourceReceiveResponseData):
2499         (WebCore::TimelineRecordFactory::createResourceFinishData):
2500         (WebCore::TimelineRecordFactory::createReceiveResourceData):
2501         (WebCore::TimelineRecordFactory::createLayoutData):
2502         (WebCore::TimelineRecordFactory::createParseHTMLData):
2503         (WebCore::TimelineRecordFactory::createAnimationFrameData):
2504         (WebCore::createQuad):
2505         * inspector/TimelineRecordFactory.h:
2506         (WebCore::TimelineRecordFactory::createWebSocketCreateData):
2507         (WebCore::TimelineRecordFactory::createGenericWebSocketData):
2508         * page/ContentSecurityPolicy.cpp:
2509         (WebCore::ContentSecurityPolicy::reportViolation):
2510
2511 2014-09-11  Ryuan Choi  <ryuan.choi@gmail.com>
2512
2513         [EFL][CoordinatedGraphics] Move CoordinatedGraphicsScene and CoordinatedBackingStore to WebKit2
2514         https://bugs.webkit.org/show_bug.cgi?id=136770
2515
2516         Reviewed by Gyuyoung Kim.
2517
2518         CoordinatedGraphicsScene and CoordinatedBackingStore is only for UIProcess.
2519         This patch moved them from WebCore to WebKit2/UIProcess/CoordinatedGraphics/.
2520
2521         No new tests, no behavior change.
2522
2523         * PlatformEfl.cmake:
2524
2525 2014-09-11  Shivakumar JM  <shiva.jm@samsung.com>
2526
2527         The overrideMimeType in XMLHttpRequest should throw the exception.
2528         https://bugs.webkit.org/show_bug.cgi?id=136699
2529
2530         Reviewed by Darin Adler.
2531
2532         No new tests, modifed test http/tests/xmlhttprequest/exceptions.html.
2533
2534         Set XMLHttpRequest::overrideMimeType to throw an "InvalidStateError" exception, if the state is LOADING or DONE.
2535
2536         * xml/XMLHttpRequest.cpp:
2537         (WebCore::XMLHttpRequest::overrideMimeType):
2538         * xml/XMLHttpRequest.h:
2539         * xml/XMLHttpRequest.idl:
2540
2541 2014-09-11  Joseph Pecoraro  <pecoraro@apple.com>
2542
2543         Web Inspector: Occasional ASSERT closing web inspector
2544         https://bugs.webkit.org/show_bug.cgi?id=136762
2545
2546         Reviewed by Timothy Hatcher.
2547
2548         * bindings/js/WorkerScriptDebugServer.h:
2549         * inspector/PageScriptDebugServer.h:
2550
2551 2014-09-11  Chris Dumez  <cdumez@apple.com>
2552
2553         Simplify DOM tree traversal in FrameSelection::setSelectionFromNone()
2554         https://bugs.webkit.org/show_bug.cgi?id=136763
2555
2556         Reviewed by Ryosuke Niwa.
2557
2558         We only need to traverse the direct children of the Document element to
2559         find the body. The previous code was potentially traversing descendants.
2560         The new code is consistent with Document::body() except that we only
2561         look for an HTMLBodyElement (and ignore HTMLFrameSetElement).
2562
2563         Also update the code to use tighter typing for clarity.
2564
2565         No new tests, no behavior change.
2566
2567         * editing/FrameSelection.cpp:
2568         (WebCore::FrameSelection::setSelectionFromNone):
2569
2570 2014-09-11  Chris Fleizach  <cfleizach@apple.com>
2571
2572         AX: Size of web view in Safari as reported by AX changes when adding/removing bars is wrong
2573         https://bugs.webkit.org/show_bug.cgi?id=136756
2574
2575         Reviewed by Beth Dakin.
2576
2577         topContentInset not only seems to push the scroll view's origin down, but it also shrinks its height as well, which
2578         was not accounted for in the original fix.
2579
2580         Modified: platform/mac-wk2/accessibility/content-inset-scrollview-frame.html
2581
2582         * accessibility/AccessibilityScrollView.cpp:
2583         (WebCore::AccessibilityScrollView::elementRect):
2584
2585 2014-09-11  Roger Fong  <roger_fong@apple.com>
2586
2587         [Windows] Unreviewed build fix.
2588
2589         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2590         (WebCore::GraphicsContext3D::checkVaryingsPacking):
2591
2592 2014-09-11  Beth Dakin  <bdakin@apple.com>
2593
2594         WebKit scrollbars flash in non-dominant spaces when entering Mission Control
2595         https://bugs.webkit.org/show_bug.cgi?id=136761
2596         -and corresponding-
2597         rdar://problem/18195616
2598
2599         Reviewed by Tim Horton.
2600
2601         This patch makes our logic about when to call ScrollableArea::contentAreaDidHide/
2602         Show match the logic in AppKit. We only want these notifications when the window 
2603         has become both visible and active (or lost both, in the case of hide).
2604
2605         Re-name setIsVisibleInternal() to setIsVisibleAndActiveInternal(), and call it 
2606         only when both visibility and active-state have changed.
2607         * page/FocusController.cpp:
2608         (WebCore::FocusController::setViewState):
2609         (WebCore::FocusController::setIsVisibleAndActiveInternal):
2610         (WebCore::FocusController::setIsVisibleInternal): Deleted.
2611         * page/FocusController.h:
2612
2613         FocusController::setViewState() is the only place that needs to call 
2614         ScrollableArea::contentAreaDidHide/Show, so remove these callers.
2615         * page/FrameView.cpp:
2616         (WebCore::FrameView::didMoveOnscreen): Deleted.
2617         (WebCore::FrameView::willMoveOffscreen): Deleted.
2618         * page/FrameView.h:
2619         * page/Page.cpp:
2620         (WebCore::Page::setIsVisibleInternal):
2621
2622 2014-09-10  Michael Saboff  <msaboff@apple.com>
2623
2624         Move JSScope out of JSFunction into separate JSCallee class
2625         https://bugs.webkit.org/show_bug.cgi?id=136725
2626
2627         Reviewed by Oliver Hunt.
2628
2629         Created new JSCallee class that contains a JSScope*.  Changed JSFunction to inherit from
2630         JSCallee.
2631
2632         * ForwardingHeaders/runtime/JSCallee.h: New forwarding header.
2633
2634 2014-09-11  Roger Fong  <roger_fong@apple.com>
2635
2636         Unreviewed build fix iOS.
2637
2638         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2639         (WebCore::GraphicsContext3D::checkVaryingsPacking):
2640
2641 2014-09-11  Jer Noble  <jer.noble@apple.com>
2642
2643         Add site-specific quirk for entering fullscreen on YouTube.com.
2644         https://bugs.webkit.org/show_bug.cgi?id=136742
2645
2646         Reviewed by Eric Carlson.
2647
2648         YouTube only resizes its <video> content when entering fullscreen after receiving the "webkitfullscreenchange"
2649         event, which is fired once the animation to enter fullscreen completes. This leaves the apparent <video> content
2650         too small during the animation, especially at the beginning of the animation. Add a site-specific hack for
2651         YouTube sites which fires the "webkitfullscreenchange" event synchronously with the beginning of the enter
2652         fullscreen animation. This will cause YouTube to resize their <video> content during the period of time where we
2653         disable screen updates, and makes the enter fullscreen animation seamless.
2654
2655         Add a static utility method, hostIsYouTube(), for the various pieces of this site-specific hack, and expand it
2656         to match youtube.co.uk, youtube.fr, etc.
2657
2658         * dom/Document.cpp:
2659         (WebCore::hostIsYouTube): Added.
2660         (WebCore::Document::webkitWillEnterFullScreenForElement): Fire fullscreenchange event if hacks are enabled.
2661         (WebCore::Document::webkitDidEnterFullScreenForElement): Don't fire the event if same.
2662         (WebCore::Document::webkitDidExitFullScreenForElement): Use hostIsYouTube().
2663         
2664 2014-09-11  Bear Travis  <betravis@adobe.com>
2665
2666         [CSS Font Loading] Enable CSS Font Loading on Mac
2667         https://bugs.webkit.org/show_bug.cgi?id=135473
2668
2669         Reviewed by Antti Koivisto.
2670
2671         Enable CSS Font Loading in FeatureDefines, and in
2672         RuntimeEnabledFeatures.
2673
2674         Font Loading tests have been toggled back on in the Mac
2675         TestExpectations file.
2676
2677         * Configurations/FeatureDefines.xcconfig:
2678         * bindings/generic/RuntimeEnabledFeatures.cpp:
2679         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
2680
2681 2014-09-11  Chris Dumez  <cdumez@apple.com>
2682
2683         Use tighter typing for Document::ownerElement() return value
2684         https://bugs.webkit.org/show_bug.cgi?id=136746
2685
2686         Reviewed by Ryosuke Niwa.
2687
2688         Use tighter typing for Document::ownerElement() return value at call
2689         sites to increase code readability a bit and allow the compiler to
2690         generate slightly more efficient code in some cases. In particular,
2691         the more efficient HTMLElement::hasTagName(HTMLQualifiedName) is
2692         now called in several cases instead of the one on Node. This bypasses
2693         unnecessary isHTMLElement() checks.
2694
2695         No new tests, no behavior change.
2696
2697         * accessibility/AccessibilityNodeObject.cpp:
2698         (WebCore::AccessibilityNodeObject::alternativeTextForWebArea):
2699         * dom/Document.cpp:
2700         (WebCore::Document::updateLayout):
2701         (WebCore::Document::topDocument):
2702         * html/HTMLBodyElement.cpp:
2703         (WebCore::HTMLBodyElement::insertedInto):
2704         * rendering/RenderBoxModelObject.cpp:
2705         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
2706         * rendering/RenderLayer.cpp:
2707         (WebCore::RenderLayer::scrollRectToVisible):
2708         * rendering/RenderView.cpp:
2709         (WebCore::RenderView::paintBoxDecorations):
2710
2711 2014-09-10  Roger Fong  <roger_fong@apple.com>
2712
2713         Check for varying packing restrictions per program instead of per shader.
2714         https://bugs.webkit.org/show_bug.cgi?id=136585.
2715         <rdar://problem/16308409>.
2716
2717         Reviewed by Dean Jackson.
2718
2719         Covered by webgl/1.0.2/conformance/ogles/GL/build/build_009_to_016.html.
2720
2721         * html/canvas/WebGLRenderingContext.cpp:
2722         (WebCore::WebGLRenderingContext::linkProgram): 
2723         Check for varying packing restrictions when linking the program.
2724
2725         * platform/graphics/GraphicsContext3D.h:
2726         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2727         (WebCore::GraphicsContext3D::checkVaryingsPacking): 
2728         Checks varyings shared by both vertex and fragment shaders and makes sure
2729         they satisfy packing restrictions.
2730
2731 2014-09-11  Beth Dakin  <bdakin@apple.com>
2732
2733         Support rubber-banding in sub-frames
2734         https://bugs.webkit.org/show_bug.cgi?id=136726
2735         -and corresponding-
2736         rdar://problem/10011924
2737
2738         Reviewed by Tim Horton.
2739
2740         Set the appropriate scroll elasticity for all frames! As long as its enabled, sub-
2741         frames want an elasticity of ScrollElasticityAutomatic, which will allow for 
2742         latching. 
2743         * page/FrameView.cpp:
2744         (WebCore::FrameView::FrameView):
2745
2746         Account for rubber-banding in sub-frames.
2747         (WebCore::FrameView::isScrollableOrRubberbandable):
2748         (WebCore::FrameView::hasScrollableOrRubberbandableAncestor):
2749
2750         This patch also re-names rubberBandingForOverflowScrollEnabled to 
2751         rubberBandingForSubScrollableRegionsEnabled
2752         * page/Settings.in:
2753         * rendering/RenderLayer.cpp:
2754         (WebCore::RenderLayer::overhangAmount):
2755         (WebCore::RenderLayer::setHasHorizontalScrollbar):
2756         (WebCore::RenderLayer::setHasVerticalScrollbar):
2757
2758 2014-09-11  Myles C. Maxfield <mmaxfield@apple.com>  <litherum@gmail.com>
2759
2760         Initial implementation of SVG to OTF font converter
2761         https://bugs.webkit.org/show_bug.cgi?id=136688
2762
2763         Reviewed by Darin Adler.
2764
2765         This patch creates a new file and new function which turns an SVG font into an OpenType font.
2766         This function is not very full featured, and as such is never called. However, it works with
2767         fonts that only support simple horizontal basic multilingual plane codepoints. It has only
2768         been tested on OS X, and does not have any automated tests. This patch is only jumping off
2769         point, laying the basic groundwork for a more robust font converter.
2770
2771         The goal of this patch is to eventually allow us to delete the codepath with which we draw
2772         text using SVG fonts. Using a native codepath instead will allow for better performance,
2773         security, and code clarity. In my initial benchmarks, using this converter instead of the
2774         SVG codepath is at least a 100x speed improvement (after running for 4 hours I stepped
2775         away from my machine).
2776
2777         No new tests because the function is not ready to be called (yet!)
2778         Initial implementation of SVG to OTF font converter
2779         https://bugs.webkit.org/show_bug.cgi?id=136688
2780
2781         * WebCore.xcodeproj/project.pbxproj: Add new file.
2782         * svg/SVGPathBuilder.h: Single function. Takes a SVGFontElement and returns a byte
2783         * svg/SVGToOTFFontConversion.cpp: Added.
2784         (WebCore::write32): Write a big-endian Int32.
2785         (WebCore::write16): Write a big-endian Int16.
2786         (WebCore::overwrite32): Overwrite an existing Int32 in a vector (instead of appending)
2787         (WebCore::SVGToOTFFontConverter::GlyphData::GlyphData): Internal class to hold state during
2788         function calls.
2789         (WebCore::roundDownToPowerOfTwo):
2790         (WebCore::SVGToOTFFontConverter::appendCMAPTable): See function name.
2791         (WebCore::SVGToOTFFontConverter::appendHEADTable): Ditto.
2792         (WebCore::clampTo): Used to clamp data types to fit into other data types.
2793         (WebCore::SVGToOTFFontConverter::appendHHEATable): See function name.
2794         (WebCore::SVGToOTFFontConverter::appendHMTXTable): Ditto.
2795         (WebCore::SVGToOTFFontConverter::appendMAXPTable): Ditto.
2796         (WebCore::SVGToOTFFontConverter::appendNAMETable): Ditto.
2797         (WebCore::SVGToOTFFontConverter::appendOS2Table): Ditto.
2798         (WebCore::SVGToOTFFontConverter::appendPOSTTable): Ditto.
2799         (WebCore::isValidStringForCFF): The CFF font format only allows strings with particular
2800         characters in them.
2801         (WebCore::appendCFFValidString): Append a string assuming it's valid to append.
2802         (WebCore::SVGToOTFFontConverter::appendCFFTable): See function name.
2803         (WebCore::SVGToOTFFontConverter::appendVORGTable): Ditto.
2804         (WebCore::writeCFFEncodedNumber): CFF has this wacky encoding scheme for encoding and
2805         decoding numbers.
2806         (WebCore::CFFBuilder::CFFBuilder): Subclass of SVGPathBuilder, which is used for building
2807         CFF CharStrings (which are glyph path representations).
2808         (WebCore::CFFBuilder::updateForConstituentPoint): Invoked for every point in a path, does
2809         things like updates glyph bounding box information.
2810         (WebCore::CFFBuilder::boundingBox): Getter.
2811         (WebCore::transcodeGlyphPaths): SVG path data string -> CFF CharString
2812         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter): Generate internal state ahead of
2813         time before generating any tables.
2814         (WebCore::isFourByteAligned):
2815         (WebCore::calculateChecksum): OTF files have checksums.
2816         (WebCore::SVGToOTFFontConverter::appendTable): Invoked for each entry in the table of
2817         contents of the OTF font.
2818         (WebCore::SVGToOTFFontConverter::convertSVGToOTFFont): Write out the tables.
2819         (WebCore::convertSVGToOTFFont): Entry point.
2820         * svg/SVGToOTFFontConversion.h: Added.
2821
2822 2014-09-11  Jer Noble  <jer.noble@apple.com>
2823
2824         [EME] REGRESSION(??): test media/encrypted-media/encrypted-media-v2-syntax.html is failing
2825         https://bugs.webkit.org/show_bug.cgi?id=136723
2826
2827         Reviewed by Eric Carlson.
2828
2829         Update a comment to point to the implemented Working Draft 18 Feburary 2014 version of the spec.
2830
2831         * Modules/encryptedmedia/MediaKeys.cpp:
2832         (WebCore::MediaKeys::createSession):
2833
2834 2014-09-11  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2835
2836         [WK2] Authentication dialog is displayed for cross-origin XHR
2837         https://bugs.webkit.org/show_bug.cgi?id=131349
2838
2839         Reviewed by Alexey Proskuryakov.
2840
2841         * WebCore.exp.in: Export of isAllowedToAskUserForCredentials.
2842         * loader/ResourceLoader.cpp:
2843         (WebCore::ResourceLoader::isAllowedToAskUserForCredentials): Replacing clientCredentialPolicy method. Returns true if credentials can be requested to the user.
2844         (WebCore::ResourceLoader::didReceiveAuthenticationChallenge): Updated to use isAllowedToAskUserForCredentials.
2845         * loader/ResourceLoader.h: Removing clientCredentialPolicy method and adding isAllowedToAskUserForCredentials method.
2846
2847 2014-09-11  Chris Fleizach  <cfleizach@apple.com>
2848
2849         AX: Children inside a <legend> are not accessible
2850         https://bugs.webkit.org/show_bug.cgi?id=136735
2851
2852         Reviewed by Mario Sanchez Prada.
2853
2854         The AX children of a <legend> are being hidden currently, which makes it impossible for
2855         VoiceOver to activate control elements inside of a <legend>.
2856         The solution is that legend elements SHOULD be allowed to have children.
2857
2858         Test: accessibility/legend-children-are-visible.html
2859
2860         * accessibility/AccessibilityNodeObject.cpp:
2861         (WebCore::AccessibilityNodeObject::canHaveChildren):
2862
2863 2014-09-11  Brendan Long  <b.long@cablelabs.com>
2864
2865         Fix FIXME's in JSTrackCustom now that AudioTrack and VideoTrack exist.
2866         https://bugs.webkit.org/show_bug.cgi?id=136552
2867
2868         Reviewed by Eric Carlson.
2869
2870         * bindings/js/JSTrackCustom.cpp:
2871         (WebCore::toTrack): Add casts for AudioTrack and VideoTrack.
2872
2873 2014-09-11  Carlos Garcia Campos  <cgarcia@igalia.com>
2874
2875         [GTK] Merge WebKitAuthenticationWidget into WebKitAuthenticationDialog
2876         https://bugs.webkit.org/show_bug.cgi?id=136700
2877
2878         Reviewed by Sergio Villar Senin.
2879
2880         Remove WebKitAuthenticationWidget. The only reason why we had this
2881         widget separated in WebCore was to share it between WebKit1 and
2882         WebKit2, but now it's only used by WebKitAuthenticationDialog in WebKit2.
2883
2884         * PlatformGTK.cmake: Remove files from compilation.
2885         * platform/gtk/WebKitAuthenticationWidget.cpp: Removed.
2886         * platform/gtk/WebKitAuthenticationWidget.h: Removed.
2887
2888 2014-09-10  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2889
2890         Use ASSERT instead of ASSERT_WITH_SECURITY_IMPLICATION
2891         https://bugs.webkit.org/show_bug.cgi?id=136732
2892
2893         Reviewed by Andy Estes.
2894
2895         Since r173458 changed to use static_cast<> with toFoo, ASSERT_WITH_SECURITY_IMPLICATION doesn't
2896         need to be used anymore. ASSERT is enough for it.
2897
2898         * workers/DefaultSharedWorkerRepository.cpp:
2899         (WebCore::SharedWorkerProxy::addToWorkerDocuments):
2900         * workers/WorkerMessagingProxy.cpp:
2901         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
2902         * xml/XMLHttpRequest.cpp:
2903         (WebCore::XMLHttpRequest::document):
2904
2905 2014-09-10  Adenilson Cavalcanti  <cavalcantii@gmail.com>
2906
2907         [SVG] Cleanup iterator code in SMILTimeContainer using range-based loop
2908         https://bugs.webkit.org/show_bug.cgi?id=136720
2909
2910         Reviewed by Filip Pizlo.
2911
2912         No new tests, no change on behavior.
2913
2914         * svg/animation/SMILTimeContainer.cpp:
2915         (WebCore::SMILTimeContainer::setElapsed):
2916         (WebCore::SMILTimeContainer::updateAnimations):
2917
2918 2014-09-10  Timothy Horton  <timothy_horton@apple.com>
2919
2920         Fix the build.
2921
2922         * platform/network/ResourceHandle.h:
2923         * platform/network/mac/ResourceHandleMac.mm:
2924
2925 2014-09-09  Myles C. Maxfield <mmaxfield@apple.com>  <litherum@gmail.com>
2926
2927         Delete class SavedDrawingStateForMask
2928         https://bugs.webkit.org/show_bug.cgi?id=136498
2929
2930         Reviewed by Darin Adler.
2931
2932         This class is left over from when text-decoration-skip: ink used
2933         GraphicsContext masking.
2934
2935         No new tests because there is no behavior change.
2936
2937         * rendering/InlineTextBox.cpp:
2938         (WebCore::InlineTextBox::applyShadowToGraphicsContext):
2939         * rendering/InlineTextBox.h:
2940         * rendering/TextPainter.cpp:
2941         (WebCore::TextPainter::TextPainter):
2942         (WebCore::paintTextWithShadows):
2943         (WebCore::TextPainter::paintText):
2944         * rendering/TextPainter.h:
2945         (WebCore::SavedDrawingStateForMask::SavedDrawingStateForMask): Deleted.
2946         * rendering/svg/SVGInlineTextBox.cpp:
2947         (WebCore::SVGInlineTextBox::paintTextWithShadows):
2948
2949 2014-09-10  Tim Horton  <timothy_horton@apple.com>
2950
2951         Call setCollectsTimingData only once, and before making any {CF,NS}URLConnections
2952         https://bugs.webkit.org/show_bug.cgi?id=136731
2953         <rdar://problem/18252844>
2954
2955         Reviewed by Simon Fraser.
2956
2957         * platform/network/cf/ResourceHandleCFNet.cpp:
2958         (WebCore::ResourceHandle::start):
2959         Move setCollectsTimingData to before createCFURLConnection, so the first connection
2960         has timing data associated with it.
2961
2962         * platform/network/mac/ResourceHandleMac.mm:
2963         (WebCore::ResourceHandle::createNSURLConnection):
2964         Move setCollectsTimingData to before we create our NSURLConnection, so the first connection
2965         has timing data associated with it.
2966         Use setCollectsTimingData instead of the NSURLConnection SPI directly.
2967
2968         (WebCore::ResourceHandle::setCollectsTimingData):
2969         Only call _setCollectsTimingData once.
2970
2971 2014-09-10  Enrica Casucci  <enrica@apple.com>
2972
2973         Remove iOS-only -webkit-composition-fill-color CSS property.
2974         https://bugs.webkit.org/show_bug.cgi?id=136728
2975         rdar://problem/10439154
2976
2977         Reviewed by Tim Horton.
2978
2979         This property is no longer used on iOS.
2980
2981         * css/CSSComputedStyleDeclaration.cpp:
2982         (WebCore::ComputedStyleExtractor::propertyValue):
2983         * css/CSSParser.cpp:
2984         (WebCore::CSSParser::parseValue):
2985         * css/CSSPropertyNames.in:
2986         * css/StyleResolver.cpp:
2987         (WebCore::StyleResolver::applyProperty):
2988         * editing/EditingStyle.cpp:
2989         * platform/graphics/Color.h:
2990         * rendering/InlineTextBox.cpp:
2991         (WebCore::InlineTextBox::paintCompositionBackground):
2992         * rendering/style/RenderStyle.h:
2993         * rendering/style/StyleRareInheritedData.cpp:
2994         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
2995         (WebCore::StyleRareInheritedData::operator==):
2996         * rendering/style/StyleRareInheritedData.h:
2997
2998 2014-09-10  Tim Horton  <timothy_horton@apple.com>
2999
3000         Remove ImageSource::ShouldSkipMetadata
3001         https://bugs.webkit.org/show_bug.cgi?id=136713
3002
3003         Reviewed by Pratik Solanki.
3004
3005         * platform/graphics/ImageSource.h:
3006         * platform/graphics/cg/ImageSourceCG.cpp:
3007         (WebCore::createImageSourceOptions):
3008         (WebCore::imageSourceOptions):
3009         (WebCore::ImageSource::frameSizeAtIndex):
3010         (WebCore::ImageSource::createFrameAtIndex):
3011         (WebCore::ImageSource::frameDurationAtIndex):
3012         Remove ShouldSkipMetadata and users. Nobody ever uses DoNotSkipMetadata.
3013
3014 2014-09-10  Beth Dakin  <bdakin@apple.com>
3015
3016         https://bugs.webkit.org/show_bug.cgi?id=136650
3017         Rubber-banding in the DOM view of the WebInspector is really jumpy
3018         -and corresponding-
3019         rdar://problem/18166043
3020
3021         Reviewed by Darin Adler.
3022
3023         This patch implements the ScrollableArea virtual function isRubberBandInProgress() 
3024         for RenderLayer, and then uses that to determine whether to clamp the scroll 
3025         position in updateScrollInfoAfterLayout().
3026         * rendering/RenderLayer.cpp:
3027         (WebCore::RenderLayer::isRubberBandInProgress):
3028         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
3029         * rendering/RenderLayer.h:
3030
3031 2014-09-10  Tim Horton  <timothy_horton@apple.com>
3032
3033         Remove a workaround in frameIsCompleteAtIndex for a problem that was fixed in Lion
3034         https://bugs.webkit.org/show_bug.cgi?id=136652
3035
3036         Reviewed by Dan Bernstein.
3037
3038         * platform/graphics/cg/ImageSourceCG.cpp:
3039         (WebCore::ImageSource::frameIsCompleteAtIndex):
3040         ImageIO returns the right thing now.
3041
3042 2014-09-10  Myles C. Maxfield  <mmaxfield@apple.com>
3043
3044         Laying out a TextRun using an SVG font is O(n^2)
3045         https://bugs.webkit.org/show_bug.cgi?id=136584
3046
3047         Reviewed by Darin Adler.
3048
3049         Addressing post-commit review from Darin.
3050
3051         No new tests.
3052
3053         * platform/graphics/Font.h:
3054         (WebCore::Font::treatAsSpace): Un-inline.
3055         (WebCore::Font::treatAsZeroWidthSpace): Ditto.
3056         (WebCore::Font::treatAsZeroWidthSpaceInComplexScript): Ditto.
3057         * svg/SVGFontData.cpp:
3058         (WebCore::computeNormalizedSpaces): Avoid unnecessary copy.
3059
3060 2014-09-10  peavo@outlook.com  <peavo@outlook.com>
3061
3062         [Curl] Optimization; avoid reallocating string many times.
3063         https://bugs.webkit.org/show_bug.cgi?id=136704
3064
3065         Reviewed by Alex Christensen.
3066
3067         Adding individual characters to a string is inefficient, the string will be reallocated each time.
3068
3069         * platform/network/curl/CookieJarCurl.cpp:
3070         (WebCore::readCurlCookieToken):
3071
3072 2014-09-10  peavo@outlook.com  <peavo@outlook.com>
3073
3074         [Curl] Compile error, CertificateInfo.h is not found.
3075         https://bugs.webkit.org/show_bug.cgi?id=136703
3076
3077         Reviewed by Alex Christensen.
3078
3079         Curl also needs to implement the CertificateInfo class.
3080
3081         * platform/network/curl/CertificateInfo.h: Added.
3082         (WebCore::CertificateInfo::CertificateInfo):
3083
3084 2014-09-10  Simon Fraser  <simon.fraser@apple.com>
3085
3086         Clean up some ENABLE(PICTURE_SIZES) stuff, don't change function signatures inside #ifdefs
3087         https://bugs.webkit.org/show_bug.cgi?id=136654
3088
3089         Reviewed by Darin Adler.
3090
3091         Adding parameters inside an #ifdef makes for unreadable code, so remove some
3092         #if ENABLE(PICTURE_SIZES) related to the preload scanner and always pass the arguments.
3093         Reduced the argument count on some functions by just passing a Document&. 
3094         
3095         Also fix a couple of uses of #if ENABLE_PICTURE_SIZES.
3096
3097         * html/HTMLImageElement.h:
3098         * html/parser/HTMLDocumentParser.cpp:
3099         (WebCore::HTMLDocumentParser::pumpTokenizer):
3100         (WebCore::HTMLDocumentParser::insert):
3101         (WebCore::HTMLDocumentParser::append):
3102         (WebCore::HTMLDocumentParser::appendCurrentInputStreamToPreloadScannerAndScan):
3103         * html/parser/HTMLPreloadScanner.cpp:
3104         (WebCore::TokenPreloadScanner::scan):
3105         (WebCore::HTMLPreloadScanner::scan):
3106         * html/parser/HTMLPreloadScanner.h:
3107         * html/parser/HTMLSrcsetParser.cpp:
3108         (WebCore::pickBestImageCandidate):
3109         (WebCore::bestFitSourceForImageAttributes):
3110         * html/parser/HTMLSrcsetParser.h:
3111
3112 2014-09-10  Chris Fleizach  <cfleizach@apple.com>
3113
3114         AX: aria-labelledby is not honoring sub-node text
3115         https://bugs.webkit.org/show_bug.cgi?id=136689
3116
3117         Reviewed by Mario Sanchez Prada.
3118
3119         Test: accessibility/aria-labelledby-with-descendants.html
3120
3121         When aria-labelledby retrieves the textUnderElements it needs to consider
3122         all sub-children, including focusable content.
3123
3124         * accessibility/AccessibilityNodeObject.cpp:
3125         (WebCore::accessibleNameForNode):
3126
3127 2014-09-10  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3128
3129         Use toDocument instead of static_cast<Document*>
3130         https://bugs.webkit.org/show_bug.cgi?id=136694
3131
3132         Reviewed by Andy Estes.
3133
3134         Clean up static_cast<Document*>.
3135
3136         * Modules/mediasource/SourceBuffer.cpp:
3137         (WebCore::SourceBuffer::document):
3138         * Modules/webaudio/AudioContext.cpp:
3139         (WebCore::AudioContext::document):
3140         * bindings/gobject/WebKitDOMPrivate.cpp:
3141         (WebKit::wrap):
3142         * dom/ScriptExecutionContext.cpp:
3143         (WebCore::ScriptExecutionContext::dispatchErrorEvent): Add a line to remove .get().
3144         * workers/DefaultSharedWorkerRepository.cpp:
3145         (WebCore::SharedWorkerProxy::addToWorkerDocuments):
3146         * workers/WorkerMessagingProxy.cpp:
3147         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
3148         * xml/XMLHttpRequest.cpp:
3149         (WebCore::XMLHttpRequest::document):
3150         (WebCore::XMLHttpRequest::open):
3151
3152 2014-09-10  Yusuke Suzuki  <utatane.tea@gmail.com>
3153
3154         Merge CheckingContexts from SelectorCompiler and SelectorChecker
3155         https://bugs.webkit.org/show_bug.cgi?id=135255
3156
3157         Reviewed by Benjamin Poulain.
3158
3159         In this patch, we merge SelectorChecker::SelectorCheckingContext and SelectorCompiler::CheckingContext.
3160         We expose only SelectorChecker::CheckingContext. That is the same to the old SelectorCompiler::CheckingContext.
3161
3162         In SelectorChecker.cpp, we define SelectorChecker::CheckingContextWithStatus and use it internally.
3163         And we move VisitedMatchType from SelectorChecker.h to SelectorChecker.cpp.
3164
3165         VisitedMatchType is also explicitly used by SelectorCheckerFastPath. However, SelectorCheckerFastPath is now
3166         used only from SelectorQuery (Style resolution algorithm no longer uses it: r171059).
3167         In this patch, we remove SelectorCheckerFastPath since the major cases are covered by CSS JIT.
3168         In `RightMostWithIdMatch`, `Element#matches` and multiple selectors `querySelector('a, b')` cases,
3169         CSS JIT is not used. So dropping fast path affects them. But 1) these cases are rare or 2) the target node
3170         is typically only one since nodes are filtered before matching. So it doesn't have performance regression.
3171
3172         And now since CheckingContextWithStatus is the derived class of CheckingContext, we can use
3173         the same test functions; template parameter is not necessary. It reduces code size.
3174
3175         * CMakeLists.txt:
3176         * WebCore.xcodeproj/project.pbxproj:
3177         * css/CSSAllInOne.cpp:
3178         * css/ElementRuleCollector.cpp:
3179         (WebCore::ElementRuleCollector::ruleMatches):
3180         * css/SelectorChecker.cpp:
3181         (WebCore::SelectorChecker::CheckingContextWithStatus::CheckingContextWithStatus):
3182         (WebCore::SelectorChecker::match):
3183         (WebCore::checkingContextForParent):
3184         (WebCore::SelectorChecker::matchRecursively):
3185         (WebCore::canMatchHoverOrActiveInQuirksMode):
3186         (WebCore::SelectorChecker::checkOne):
3187         (WebCore::SelectorChecker::checkScrollbarPseudoClass):
3188         * css/SelectorChecker.h:
3189         (WebCore::SelectorChecker::CheckingContext::CheckingContext):
3190         (WebCore::SelectorChecker::SelectorCheckingContext::SelectorCheckingContext): Deleted.
3191         * css/SelectorCheckerFastPath.cpp: Removed.
3192         * css/SelectorCheckerFastPath.h: Removed.
3193         * css/SelectorCheckerTestFunctions.h:
3194         (WebCore::scrollbarMatchesEnabledPseudoClass):
3195         (WebCore::scrollbarMatchesDisabledPseudoClass):
3196         (WebCore::scrollbarMatchesHoverPseudoClass):
3197         (WebCore::scrollbarMatchesActivePseudoClass):
3198         (WebCore::scrollbarMatchesHorizontalPseudoClass):
3199         (WebCore::scrollbarMatchesVerticalPseudoClass):
3200         (WebCore::scrollbarMatchesDecrementPseudoClass):
3201         (WebCore::scrollbarMatchesIncrementPseudoClass):
3202         (WebCore::scrollbarMatchesStartPseudoClass):
3203         (WebCore::scrollbarMatchesEndPseudoClass):
3204         (WebCore::scrollbarMatchesDoubleButtonPseudoClass):
3205         (WebCore::scrollbarMatchesSingleButtonPseudoClass):
3206         (WebCore::scrollbarMatchesNoButtonPseudoClass):
3207         (WebCore::scrollbarMatchesCornerPresentPseudoClass):
3208         * css/StyleResolver.h:
3209         (WebCore::checkRegionSelector):
3210         * cssjit/SelectorCompiler.cpp:
3211         (WebCore::SelectorCompiler::SelectorFragment::appendUnoptimizedPseudoClassWithContext):
3212         (WebCore::SelectorCompiler::addScrollbarPseudoClassType):
3213         (WebCore::SelectorCompiler::SelectorCodeGenerator::addFlagsToElementStyleFromContext):
3214         (WebCore::SelectorCompiler::SelectorCodeGenerator::branchOnResolvingModeWithCheckingContext):
3215         (WebCore::SelectorCompiler::elementIsActiveForStyleResolution):
3216         (WebCore::SelectorCompiler::setElementStyleFromContextIsAffectedByEmptyAndUpdateRenderStyleIfNecessary):
3217         (WebCore::SelectorCompiler::elementIsHoveredForStyleResolution):
3218         (WebCore::SelectorCompiler::makeContextStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
3219         (WebCore::SelectorCompiler::makeElementStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
3220         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateRequestedPseudoElementEqualsToSelectorPseudoElement):
3221         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsScopeRoot):
3222         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateMarkPseudoStyleForPseudoElement):
3223         * cssjit/SelectorCompiler.h:
3224         (WebCore::SelectorCompiler::CheckingContext::CheckingContext): Deleted.
3225         * dom/SelectorQuery.cpp:
3226         (WebCore::SelectorDataList::SelectorDataList):
3227         (WebCore::SelectorDataList::selectorMatches):
3228         (WebCore::SelectorDataList::executeCompiledSelectorCheckerWithCheckingContext):
3229         (WebCore::isCompiledSelector):
3230         (WebCore::SelectorDataList::compileSelector):
3231         (WebCore::SelectorDataList::execute):
3232         * dom/SelectorQuery.h:
3233         (WebCore::SelectorDataList::SelectorData::SelectorData):
3234
3235 2014-09-09  Jer Noble  <jer.noble@apple.com>
3236
3237         [MSE] http/tests/media/media-source/mediasource-config-change-mp4-v-bitrate.html failing after r173318
3238         https://bugs.webkit.org/show_bug.cgi?id=136676
3239
3240         Reviewed by Eric Carlson.
3241
3242         Revert the inadvertant conditional change introduced in r173318.
3243
3244         * Modules/mediasource/MediaSource.cpp:
3245         (WebCore::MediaSource::setDurationInternal):
3246
3247 2014-09-09  Roger Fong  <roger_fong@apple.com>
3248
3249         Unreviewed build fix for Windows.
3250
3251         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
3252         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3253         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
3254
3255 2014-09-09  Dan Bernstein  <mitz@apple.com>
3256
3257         FrameLoader::prepareForHistoryNavigation is unused
3258         https://bugs.webkit.org/show_bug.cgi?id=136683
3259
3260         Reviewed by Tim Horton.
3261
3262         * loader/FrameLoader.cpp:
3263         (WebCore::FrameLoader::prepareForHistoryNavigation): Deleted.
3264         * loader/FrameLoader.h: Removed the declaration.
3265
3266 2014-09-09  Manuel Rego Casasnovas  <rego@igalia.com>
3267
3268         [CSS Grid Layout] Ignore ::first-letter pseudo-element
3269         https://bugs.webkit.org/show_bug.cgi?id=136625
3270
3271         Reviewed by Darin Adler.
3272
3273         According to the spec the ::first-letter pseudo-element do not apply to
3274         grid containers (neither to flexboxes).
3275
3276         Fixed issue in RenderBlock::getFirstLetter() that applies to both grids
3277         and flexboxes. Basically if the grid's or flexbox's container was
3278         defining the ::first-line pseudo-element and the grid or flexbox itself
3279         too, the value from the grid or flexbox was being applied to the items.
3280         Added the proper check to avoid this.
3281
3282         Added two new tests for grid and modified one flexbox test to cover the
3283         issue explained above.
3284
3285         Tests: css3/flexbox/flexbox-ignore-container-firstLetter.html
3286                fast/css-grid-layout/grid-container-ignore-first-letter.html
3287                fast/css-grid-layout/grid-item-first-letter-valid.html
3288
3289         * rendering/RenderBlock.cpp:
3290         (WebCore::isRenderBlockFlowOrRenderButton): New method refactoring
3291         similar calls through the source code.
3292         (WebCore::RenderBlock::firstLineBlock): Use
3293         isRenderBlockFlowOrRenderButton().
3294         (WebCore::findFirstLetterBlock): Modify it to use
3295         isRenderBlockFlowOrRenderButton() in order to include grids and not only
3296         check flexboxes.
3297         (WebCore::RenderBlock::getFirstLetter): Use
3298         isRenderBlockFlowOrRenderButton().
3299         (WebCore::RenderBlock::updateFirstLetter): Early return if
3300         firstLetterContainer is null (in the case of flexboxes or grids).
3301
3302 2014-09-09  Benjamin Poulain  <benjamin@webkit.org>
3303
3304         Add support for :read-write/:read-only matching editable content
3305         https://bugs.webkit.org/show_bug.cgi?id=136668
3306
3307         Reviewed by Antti Koivisto.
3308
3309         This is the second part of the update of :read-write/:read-only to the latest spec
3310         (http://www.whatwg.org/specs/web-apps/current-work/multipage/scripting.html#selectors).
3311
3312         The selectors :read-write/:read-only should match elements that are editable. The exact definition is:
3313         "elements that are editing hosts or editable and are neither input elements nor textarea elements".
3314
3315         Matching that definition is really easy. It was done by updating HTMLElement's matchesReadWritePseudoClass()
3316         to consider both contentEditable and designMode.
3317
3318         The tricky part is making that efficient in all cases. Matching contentEditable is horribly inefficient
3319         compared to the other primitives. We don't want to execute that for every element.
3320
3321         Since matchesReadWritePseudoClass() was used by the theming code, that code was adjusted to
3322         -Avoid calling that on regular HTMLElement, limiting the query to <input> and <textarea> where it is fast.
3323         -Avoid the call entirely when possible.
3324
3325         Tests: fast/css/read-only-read-write-contenteditable-basics.html
3326                fast/css/read-only-read-write-designmode-basics.html
3327                fast/css/read-only-read-write-webkit-user-modify.html
3328                fast/selectors/read-only-read-write-contenteditable-basics.html
3329                fast/selectors/read-only-read-write-contenteditable-svg-foreignObject.html
3330                fast/selectors/read-only-read-write-designmode-basics.html
3331                fast/selectors/read-only-read-write-style-update.html
3332
3333         * html/HTMLElement.cpp:
3334         (WebCore::contentEditableType):
3335         This code is a generalization of the code that was in HTMLElement::contentEditable().
3336         It is used by both matchesReadWritePseudoClass() and contentEditable() to determine
3337         a valid state from the value of contentEditable.
3338
3339         (WebCore::HTMLElement::matchesReadWritePseudoClass):
3340         Per the definition of editable content, we first check if the current element is an editing host,
3341         if not we look for an editing host. If there are none, test for designMode.
3342
3343         (WebCore::HTMLElement::contentEditable):
3344
3345         (WebCore::RenderTheme::isReadOnlyControl):
3346         The old definition would only match <input> and <textarea>. The code was updated to keep the same
3347         behavior after matchesReadWritePseudoClass() is udpated. This avoids the performance problem of calling
3348         matchesReadWritePseudoClass() on regular HTMLElement.
3349
3350         * platform/ControlStates.h:
3351         ReadOnlyState was only used by ThemeMac for convertControlStatesToThemeDrawState().
3352         In turn, convertControlStatesToThemeDrawState() was only used for painting
3353         "-webkit-inner-spin-button". Buttons are not read-write to begin with.
3354         The whole code looks like legacy from styling of input elements and was removed.
3355
3356         Removing ReadOnlyState removes the expensive part of extractControlStatesForRenderer().
3357
3358         * html/HTMLElement.h:
3359         * html/HTMLFormControlElement.cpp:
3360         (WebCore::HTMLFormControlElement::readOnlyAttributeChanged):
3361         * platform/mac/ThemeMac.mm:
3362         (WebCore::convertControlStatesToThemeDrawState):
3363         * rendering/RenderTheme.cpp:
3364         (WebCore::RenderTheme::extractControlStatesForRenderer):
3365
3366 2014-09-09  Jer Noble  <jer.noble@apple.com>
3367
3368         [MSE] media/media-source tests broken after r173318
3369         https://bugs.webkit.org/show_bug.cgi?id=136675
3370
3371         Reviewed by Eric Carlson.
3372
3373         Fixes the following tests:
3374             http/tests/media/media-source/mediasource-play.html
3375             http/tests/media/media-source/mediasource-remove.html
3376             media/media-source/media-source-monitor-source-buffers.html
3377             media/media-source/media-source-overlapping-append-buffered.html   
3378
3379         In r173318, a for loop was converted to a C++11 loop, but in so doing, left
3380         pre-initialized, empty values in the beginning of returned Vector, which caused
3381         the calling algorithm to miscalculate the amount of data buffered by the media
3382         source.
3383
3384         * Modules/mediasource/MediaSource.cpp:
3385         (WebCore::MediaSource::activeRanges):
3386
3387 2014-09-09  Takeshi Kurosawa  <taken.spc@gmail.com>
3388
3389         AX: HTML5 landmark (and related) elements should not be ignored.
3390         https://bugs.webkit.org/show_bug.cgi?id=135116
3391
3392         Reviewed by Chris Fleizach.
3393
3394         Make sure following element should not be ignored in computeAccessibilityIsIgnored
3395         - header, aside, address, main, nav, article, section
3396         - dt, dd
3397
3398         Tests: platform/mac/accessibility/descriptionlist-not-ignored.html
3399                platform/mac/accessibility/landmark-not-ignored.html
3400
3401         * accessibility/AccessibilityRenderObject.cpp:
3402         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
3403
3404 2014-09-08  Sergio Villar Senin  <svillar@igalia.com>
3405
3406         [CSS Grid Layout] RenderGrid methods should take RenderBox references
3407         https://bugs.webkit.org/show_bug.cgi?id=136630
3408
3409         Reviewed by Darin Adler.
3410
3411         RenderGrid has several methods that take pointers to RenderBox
3412         instances but the body of those methods assumes that the objects
3413         will never be NULL. We should replace them by references.
3414
3415         * rendering/RenderGrid.cpp:
3416         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
3417         (WebCore::RenderGrid::logicalContentHeightForChild):
3418         (WebCore::RenderGrid::minContentForChild):
3419         (WebCore::RenderGrid::maxContentForCh