f4775e8f953c2190525f3c2927e351ef71be122e
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2013-05-20  Lamarque V. Souza  <Lamarque.Souza@basyskom.com>
2
3         Add compile asserts for the size of RootInlineBox and InlineTextbox
4         https://bugs.webkit.org/show_bug.cgi?id=116337
5
6         Reviewed by Darin Adler.
7
8         Add compile asserts to ensure RootInlineBox and InlineTextbox stay small.
9
10         * rendering/InlineTextBox.cpp:
11         (SameSizeAsInlineTextBox):
12         (WebCore):
13         * rendering/RootInlineBox.cpp:
14         (SameSizeAsRootInlineBox):
15         (WebCore):
16
17 2013-05-20  Xan Lopez  <xlopez@igalia.com>
18
19         [BlackBerry] LocalizedStringsBlackBerry: add dummy text track strings
20         https://bugs.webkit.org/show_bug.cgi?id=116300
21
22         Reviewed by Rob Buis.
23
24         These are dummy implementations necessary to make WebKit link.
25
26         * platform/blackberry/LocalizedStringsBlackBerry.cpp:
27         (WebCore::weekFormatInLDML):
28         (WebCore):
29         (WebCore::textTrackClosedCaptionsText):
30         (WebCore::textTrackSubtitlesText):
31         (WebCore::textTrackOffText):
32         (WebCore::textTrackNoLabelText):
33
34 2013-05-19  Darin Adler  <darin@apple.com>
35
36         [Mac] Improve string use in PasteboardMac
37         https://bugs.webkit.org/show_bug.cgi?id=116418
38
39         Reviewed by Sam Weinig.
40
41         Did a Ben Poulain all over this file.
42
43         * platform/mac/PasteboardMac.mm:
44         (WebCore::Pasteboard::plainText): Add the newline separately to the string builder.
45         Prepending it to the string first just does more allocations for no good reason.
46         (WebCore::Pasteboard::documentFragment): Use emptyString() instead of "" and use
47         ASCIILiteral where appropriate.
48         (WebCore::cocoaTypeFromHTMLClipboardType): More ASCIILiteral.
49         (WebCore::Pasteboard::clear): Use early return instead of a nested if here.
50         Use emptyString() instead of "".
51         (WebCore::addHTMLClipboardTypesForCocoaType): More ASCIILiteral.
52
53 2013-05-19  Anders Carlsson  <andersca@apple.com>
54
55         Remove link prerendering code
56         https://bugs.webkit.org/show_bug.cgi?id=116415
57
58         Reviewed by Darin Adler.
59
60         * Configurations/FeatureDefines.xcconfig:
61         * GNUmakefile.list.am:
62         * Target.pri:
63         * WebCore.vcproj/WebCore.vcproj:
64         * WebCore.vcxproj/WebCore.vcxproj:
65         * WebCore.vcxproj/WebCore.vcxproj.filters:
66         * WebCore.xcodeproj/project.pbxproj:
67         * dom/Document.cpp:
68         (WebCore::Document::Document):
69         * dom/Document.h:
70         (WebCore):
71         (Document):
72         * dom/EventNames.h:
73         (WebCore):
74         * html/HTMLLinkElement.cpp:
75         * html/HTMLLinkElement.h:
76         * html/LinkRelAttribute.cpp:
77         (WebCore::LinkRelAttribute::LinkRelAttribute):
78         * html/LinkRelAttribute.h:
79         (LinkRelAttribute):
80         * loader/LinkLoader.cpp:
81         (WebCore::LinkLoader::~LinkLoader):
82         (WebCore::LinkLoader::loadLink):
83         (WebCore::LinkLoader::released):
84         * loader/LinkLoader.h:
85         (WebCore):
86         (LinkLoader):
87         * loader/LinkLoaderClient.h:
88         (LinkLoaderClient):
89         * loader/Prerenderer.cpp: Removed.
90         * loader/Prerenderer.h: Removed.
91         * loader/PrerendererClient.cpp: Removed.
92         * loader/PrerendererClient.h: Removed.
93         * platform/PrerenderClient.h: Removed.
94         * platform/PrerenderHandle.h: Removed.
95
96 2013-05-19  Simon Fraser  <simon.fraser@apple.com>
97
98         Change the terminology used by rendering code when painting a given node and its children from "paintingRoot" to "subtreePaintRoot"
99         https://bugs.webkit.org/show_bug.cgi?id=116417
100
101         Reviewed by Sam Weinig.
102         
103         PaintInfo and RenderLayer code referred to a "paintingRoot". This is only set when
104         FrameView::setNodeToDraw() has been called and is used to restrict painting to
105         some part of the subtree, but it could easily be misinterpreted, and confused with
106         the "rootLayer" used by RenderLayer (which is usually not the layer associated with
107         the paintingRoot).
108         
109         Change the terminology from "paintingRoot" to "subtreePaintRoot" root to make the
110         purpose of this variable more obvious.
111
112         No behavior change.
113
114         * page/FrameView.cpp: Add a comment for setNodeToDraw(); in future this should
115         be called setSubtreePaintRoot() or something. Not done in this patch to avoid
116         risk; this function is exported from WebCore.
117         * rendering/InlineFlowBox.cpp:
118         (WebCore::InlineFlowBox::paint):
119         * rendering/PaintInfo.h:
120         (WebCore::PaintInfo::PaintInfo):
121         (WebCore::PaintInfo::updateSubtreePaintRootForChildren):
122         (WebCore::PaintInfo::shouldPaintWithinRoot):
123         * rendering/RenderBlock.cpp:
124         (WebCore::RenderBlock::paintContents):
125         * rendering/RenderBox.cpp:
126         (WebCore::RenderBox::paint):
127         * rendering/RenderLayer.cpp:
128         (WebCore::RenderLayer::paint):
129         (WebCore::RenderLayer::paintOverlayScrollbars):
130         (WebCore::RenderLayer::paintLayerContents):
131         (WebCore::RenderLayer::paintLayerByApplyingTransform):
132         (WebCore::RenderLayer::paintBackgroundForFragments):
133         (WebCore::RenderLayer::paintForegroundForFragments):
134         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
135         (WebCore::RenderLayer::paintOutlineForFragments):
136         (WebCore::RenderLayer::paintMaskForFragments):
137         * rendering/RenderLayer.h:
138         (WebCore::RenderLayer::LayerPaintingInfo::LayerPaintingInfo):
139         * rendering/RenderObject.cpp: Add a comment to recommend changing the name of
140         paintingRootRect() to refer to a subtree paint. Not done in this patch to avoid
141         risk; this function is exported from WebCore.
142         * rendering/RenderSnapshottedPlugIn.cpp:
143         (WebCore::RenderSnapshottedPlugIn::paint):
144         * rendering/RenderTable.cpp:
145         (WebCore::RenderTable::paintObject):
146         * rendering/svg/RenderSVGContainer.cpp:
147         (WebCore::RenderSVGContainer::paint):
148
149 2013-05-19  Darin Adler  <darin@apple.com>
150
151         Use Element instead of Node in DragState, also redo DragState struct
152         https://bugs.webkit.org/show_bug.cgi?id=116411
153
154         Reviewed by Sam Weinig.
155
156         The drag source is an element, so use RefPtr<Element> instead of RefPtr<Node>.
157
158         Also, the entire drag state is about dragging, so no need for the word "drag" in the
159         name of its members. Also, it's a struct, so the members don't need m_ prefixes.
160
161         * page/DragController.cpp: Removed unneeded include of Node.h since it's included by
162         Element.h, which is also included.
163         (WebCore::DragController::draggableElement): Renamed from Node to Element and changed
164         the types and names of arguments accordingly. Also made this function handle a
165         startElement of 0 so callers don't need to. Also updated for changes to DragState members.
166         (WebCore::DragController::startDrag): Updated for changes to DragState members.
167         Since dragSource can only be an element, was able to get rid of isElementNode checks.
168
169         * page/DragController.h: Fixed style of forward declarations of structs. Updated for
170         change of draggableNode to draggableElement. Also removed declarations of nonexistent
171         selectionDraggingRect and doDrag functions.
172
173         * page/DragState.h: Rewrote practically this whole header. Added an include of Element
174         instead of Node since that's what we use now. Removed includes that are redundant.
175         There's no problem copying a DragState, so removed WTF_MAKE_NONCOPYABLE. There's no need
176         to allocate a DragState on the heap, so removed WTF_MAKE_FAST_ALLOCATED. The event dispatch
177         boolean is never set to a constant, so there's no need for a policy enum; it can just be
178         a boolean. Removed the "m_" prefixes from the struct members, since this is a struct with
179         public members and we don't use the prefix in those cases. Removed the word "drag" from the
180         struct member names since this entire struct is about dragging and has drag in its name.
181         Left the comments mostly intact, even though I'm not certain of their value.
182
183         * page/EventHandler.cpp:
184         (WebCore::EventHandler::handleMousePressEvent): Updated for changes to DragState.
185         (WebCore::EventHandler::eventMayStartDrag):
186         Use innerElement instead of innerNode to call draggableElement instead of draggableNode.
187         (WebCore::EventHandler::updateDragAndDrop): Updated for changes to DragState.
188         (WebCore::EventHandler::cancelDragAndDrop): Ditto.
189         (WebCore::EventHandler::handleWheelEvent): Added FIXME.
190         (WebCore::EventHandler::dragHysteresisExceeded): Updated for changes to DragState.
191         (WebCore::EventHandler::freeClipboard): Updated for changes to DragState. Also re-added
192         code to release the clipboard object, which is needed here to avoid keeping it around in
193         memory until the next drag.
194         (WebCore::EventHandler::dragSourceEndedAt): Updated for changes to DragState.
195         (WebCore::EventHandler::updateDragStateAfterEditDragIfNeeded): Ditto.
196         (WebCore::EventHandler::dispatchDragSrcEvent): Ditto.
197         (WebCore::EventHandler::handleDrag): Updated for changes to DragState. Use innerElement
198         instead of innerNode to call draggableElement instead of draggableNode. No longer need to
199         null check innerElement because draggableElement does that. Removed unneeded else that was
200         setting m_dragSrc to zero since it's guaranteed to already be zero.
201
202 2013-05-19  Anders Carlsson  <andersca@apple.com>
203
204         Remove ChromeClient::webView()
205         https://bugs.webkit.org/show_bug.cgi?id=116054
206
207         Reviewed by Darin Adler.
208
209         This blatantly horrible layer violation was only used to know if a ChromeClient is an empty
210         client or not. We already have a (slightly less horrible) way to do that.
211
212         * loader/EmptyClients.h:
213         * page/ChromeClient.h:
214         (ChromeClient):
215
216 2013-05-19  Darin Adler  <darin@apple.com>
217
218         Eliminate the Editor::newGeneralClipboard function
219         https://bugs.webkit.org/show_bug.cgi?id=116410
220
221         Reviewed by Andreas Kling.
222
223         This is one of the clean-ups made possible by the changes to the DOM clipboard class.
224         I had been waiting until all the platforms were moved over to it, but it turns out to be
225         easy to do this now, just with #ifdefs.
226
227         * PlatformBlackBerry.cmake: Deleted EditorBlackBerry.cpp.
228
229         * editing/Editor.cpp:
230         (WebCore::Editor::dispatchCPPEvent): Call Clipboard::createForCopyAndPaste directly when
231         using the new version of the Clipboard class. Also some small style cleanup nearby.
232
233         * editing/blackberry/EditorBlackBerry.cpp: Removed. The only function in this file was
234         newGeneralClipboard.
235
236         * editing/mac/EditorMac.mm: Deleted newGeneralClipboard.
237         * platform/efl/ClipboardEfl.cpp: Ditto.
238         * platform/gtk/ClipboardGtk.cpp: Ditto.
239
240 2013-05-19  Martin Robinson  <mrobinson@igalia.com>
241
242         GtkSelectionData length is off by one
243         https://bugs.webkit.org/show_bug.cgi?id=113962
244
245         Reviewed by Anders Carlsson.
246
247         No new tests. Since drag data is interpreted as a null-terminated string
248         this is difficult to test with a C program and we have no infrastructure
249         built for using GIR tests.
250
251         * platform/gtk/PasteboardHelper.cpp:
252         (WebCore::PasteboardHelper::fillSelectionData): Instead of including the null
253         character in the paste data length, just include the string. This matches the behavior
254         of Firefox.
255
256 2013-05-18  Simon Fraser  <simon.fraser@apple.com>
257
258         Hoist several chunks of code at the top of RenderLayer::paintLayerContents() onto new functions
259         https://bugs.webkit.org/show_bug.cgi?id=116406
260
261         Reviewed by Andreas Kling.
262         
263         RenderLayer::paintLayerContents() was getting polluted with code related to filters,
264         clipping and font subpixel quantization, and hard to follow.
265         
266         Move three hunks of code into new functions:
267         setupFontSubpixelQuantization() now contains the code related to whether we disable
268         font subpixel quantization on the context.
269         setupClipPath() now contains code related to clipping to shapes and references.
270         setupFilters() and applyFilters() contain code related to CSS filters.
271         
272         As part of this, the interaction with FilterEffectRendererHelper was simplified.
273         It was convenient for setupFilters() to return a FilterEffectRendererHelper object
274         if successful, so we use an OwnPtr<FilterEffectRendererHelper> now. In addition,
275         the GraphicsContext swapping was moved from FilterEffectRendererHelper code into RenderLayer
276         to make it easier to follow. FilterEffectRendererHelper no longer holds on to
277         the old GraphicsContext.
278
279         No behavior change.
280
281         * rendering/FilterEffectRenderer.cpp:
282         (WebCore::FilterEffectRendererHelper::filterContext):
283         (WebCore::FilterEffectRendererHelper::beginFilterEffect):
284         (WebCore::FilterEffectRendererHelper::applyFilterEffect):
285         * rendering/FilterEffectRenderer.h:
286         (WebCore::FilterEffectRendererHelper::FilterEffectRendererHelper):
287         (WebCore::FilterEffectRendererHelper::hasStartedFilterEffect):
288         (FilterEffectRendererHelper):
289         * rendering/RenderLayer.cpp:
290         (WebCore::RenderLayer::setupFontSubpixelQuantization):
291         (WebCore::RenderLayer::setupClipPath):
292         (WebCore::RenderLayer::setupFilters):
293         (WebCore::RenderLayer::applyFilters):
294         (WebCore::RenderLayer::paintLayerContents):
295         * rendering/RenderLayer.h:
296
297 2013-05-18  Simon Fraser  <simon.fraser@apple.com>
298
299         Refactor RenderStyle::diff()
300         https://bugs.webkit.org/show_bug.cgi?id=116397
301
302         Reviewed by Andreas Kling.
303         
304         RenderStyle::diff() was prone to being changed incorrectly, since there was
305         a poorly documented ordering requirement: style changes that cause layout
306         have to be detected before those that cause only repainting.
307         
308         In addition, the existing code made it impossible to separately ask whether
309         a given style change requires a repaint, if we've already detected that it
310         requires a positioned-movement-only layout.
311         
312         Fix by factoring the code into member functions that check for each type
313         of style change.
314         
315         No behavior change.
316
317         * rendering/style/RenderStyle.cpp:
318         (WebCore::positionChangeIsMovementOnly):
319         (WebCore::RenderStyle::changeRequiresLayout):
320         (WebCore::RenderStyle::changeRequiresPositionedLayoutOnly):
321         (WebCore::RenderStyle::changeRequiresLayerRepaint):
322         (WebCore::RenderStyle::changeRequiresRepaint):
323         (WebCore::RenderStyle::changeRequiresRepaintIfText):
324         (WebCore::RenderStyle::changeRequiresRecompositeLayer):
325         (WebCore::RenderStyle::diff):
326         * rendering/style/RenderStyle.h:
327
328 2013-05-18  Anders Carlsson  <andersca@apple.com>
329
330         Simplify the StorageArea setter functions
331         https://bugs.webkit.org/show_bug.cgi?id=116402
332
333         Reviewed by Sam Weinig.
334
335         Move more security checking code to Storage so more code can be shared between WebKit1 and WebKit2.
336
337         * inspector/InspectorDOMStorageAgent.cpp:
338         (WebCore::InspectorDOMStorageAgent::setDOMStorageItem):
339         (WebCore::InspectorDOMStorageAgent::removeDOMStorageItem):
340         * storage/Storage.cpp:
341         (WebCore::Storage::setItem):
342         (WebCore::Storage::removeItem):
343         (WebCore::Storage::clear):
344         * storage/StorageArea.h:
345         (StorageArea):
346         * storage/StorageAreaImpl.cpp:
347         (WebCore::StorageAreaImpl::setItem):
348         (WebCore::StorageAreaImpl::removeItem):
349         (WebCore::StorageAreaImpl::clear):
350         * storage/StorageAreaImpl.h:
351         (StorageAreaImpl):
352
353 2013-05-18  Anders Carlsson  <andersca@apple.com>
354
355         Simplify StorageArea getter functions
356         https://bugs.webkit.org/show_bug.cgi?id=116399
357
358         Reviewed by Sam Weinig.
359
360         Move the security and private browsing checks from StorageArea to Storage so we can share
361         more code between WebKit1 and WebKit2.
362
363         * inspector/InspectorDOMStorageAgent.cpp:
364         (WebCore::InspectorDOMStorageAgent::getDOMStorageItems):
365         Update to new StorageArea interface. The security checks are unnecessary here anyway because
366         InspectorDOMStorageAgent::findStorageArea will only return a StorageArea that can be accessed
367         by the frame's security origin.
368         
369         * storage/Storage.cpp:
370         (WebCore::Storage::key):
371         (WebCore::Storage::getItem):
372         (WebCore::Storage::contains):
373         * storage/StorageArea.h:
374         (StorageArea):
375         * storage/StorageAreaImpl.cpp:
376         (WebCore::StorageAreaImpl::key):
377         (WebCore::StorageAreaImpl::item):
378         (WebCore::StorageAreaImpl::contains):
379         * storage/StorageAreaImpl.h:
380         (StorageAreaImpl):
381
382 2013-05-17  Simon Fraser  <simon.fraser@apple.com>
383
384         Garbage on page background while http://canberraballoons.com.au is loading
385         https://bugs.webkit.org/show_bug.cgi?id=116384
386         <rdar://problem/13930328>
387
388         Reviewed by Dan Bernstein.
389
390         This page loads a large JPEG image as the body background.
391         ImageSource::frameHasAlphaAtIndex() always claims that JPEG images
392         are opaque, but this isn't true if the frame is only partially loaded.
393         However, this would cause FillLayer::hasOpaqueImage() to report that the
394         background image is opaque, so we'd skip painting the background color.
395         Unpainted content in an opaque layer results in garbage.
396         
397         Fix by having ImageSource::frameHasAlphaAtIndex() always return true
398         for frames that are not complete. When the image load completes, we
399         recompute metadata and correctly determine that the frame is opaque.
400
401         * platform/graphics/cg/ImageSourceCG.cpp:
402         (WebCore::ImageSource::frameHasAlphaAtIndex):
403
404 2013-05-18  Timothy Hatcher  <timothy@apple.com>
405
406         Simplify EventLoop::cycle() on Mac.
407
408         https://webkit.org/b/116392
409
410         Reviewed by Anders Carlsson.
411
412         * platform/mac/EventLoopMac.mm:
413         (WebCore::EventLoop::cycle): Use CFRunLoopRunInMode instead.
414
415 2013-05-18  Andreas Kling  <akling@apple.com>
416
417         Use CSSParserSelector::appendTagHistory() from CSS grammar.
418         <http://webkit.org/b/116382>
419
420         Reviewed by Antti Koivisto.
421
422         CSSParserSelector already knows how to append another component to itself,
423         no need to duplicate that logic in the grammar.
424
425         * css/CSSGrammar.y.in:
426
427 2013-05-18  Patrick Gansterer  <paroga@webkit.org>
428
429         [CMake] Replace *_LIBRARY_NAME with *_OUTPUT_NAME
430         https://bugs.webkit.org/show_bug.cgi?id=114554
431
432         Reviewed by Gyuyoung Kim.
433
434         Using variables as target names is very uncommon in CMake.
435         The usual way to specify the name of the resulting binary
436         is to set the OUTPUT_NAME target property.
437
438         * CMakeLists.txt:
439
440 2013-05-18  Carlos Garcia Campos  <cgarcia@igalia.com>
441
442         [GTK] Move GTK port off legacy clipboard
443         https://bugs.webkit.org/show_bug.cgi?id=116221
444
445         Reviewed by Martin Robinson.
446
447         Merge clipboard methods into PasteboardGtk that now wraps a
448         DataObjectGtk.
449
450         * GNUmakefile.list.am: Remove ClipboardGtk.h.
451         * dom/Clipboard.h: Remove GTK from the list of ports using legacy
452         clipboard.
453         * page/gtk/EventHandlerGtk.cpp:
454         (WebCore::EventHandler::createDraggingClipboard): Use
455         Clipboard::createForDragAndDrop().
456         * platform/Pasteboard.h:
457         (Pasteboard):
458         * platform/gtk/ClipboardGtk.cpp:
459         (WebCore::Editor::newGeneralClipboard): Use
460         Clipboard::createForCopyAndPaste().
461         (WebCore::Clipboard::createDragImage):
462         (WebCore::Clipboard::declareAndWriteDragImage):
463         * platform/gtk/ClipboardGtk.h: Removed.
464         * platform/gtk/DragDataGtk.cpp:
465         * platform/gtk/PasteboardGtk.cpp:
466         (WebCore::Pasteboard::create): Create a new Pasteboard for a given
467         GtkClipboard or DataObjectGtk.
468         (WebCore::Pasteboard::createForCopyAndPaste): Create a Pasteboard
469         for the GDK_SELECTION_CLIPBOARD clipboard.
470         (WebCore::Pasteboard::createPrivate): Create a Pasteboard without
471         a GtkClipboard associated.
472         (WebCore::Pasteboard::createForDragAndDrop): Create a Pasteboard
473         for drag and drop operations.
474         (WebCore::selectionClipboard): Return a static Pasteboard for the
475         GDK_SELECTION_CLIPBOARD clipboard.
476         (WebCore::primaryClipboard): Return a static Pasteboard for the
477         GDK_SELECTION_PRIMARY clipboard.
478         (WebCore::Pasteboard::generalPasteboard): Return
479         selectionClipboard() or primaryClipboard() depending on whether
480         primary selection clipboard is the active one or not.
481         (WebCore::Pasteboard::Pasteboard):
482         (WebCore::Pasteboard::~Pasteboard):
483         (WebCore::Pasteboard::dataObject): Return the wrapped DataObjectGtk.
484         (WebCore::dataObjectTypeFromHTMLClipboardType): Copied from
485         ClipboardGtk.cpp.
486         (WebCore::Pasteboard::writeString): Adapted to upate the wrapped
487         DataObjectGtk and the GtkClipboard if needed.
488         (WebCore::Pasteboard::writeSelection): Ditto.
489         (WebCore::Pasteboard::writePlainText): Ditto.
490         (WebCore::Pasteboard::writeURL): Ditto.
491         (WebCore::Pasteboard::writeImage): Ditto.
492         (WebCore::Pasteboard::writePasteboard): Copy the wrapped
493         DataObjectGtk from the DataObjectGtk of the given Pasteboard and
494         upsate the GtkClipboard if needed.
495         (WebCore::Pasteboard::clear): Copied from ClipboardGtk.cpp.
496         (WebCore::Pasteboard::canSmartReplace): Check if current
497         GtkClipboard supports smart replace.
498         (WebCore::Pasteboard::setDragImage):
499         (WebCore::Pasteboard::documentFragment): Adapted to use the
500         wrapped DataObjectGtk reading from the current GtkClipboard if
501         present.
502         (WebCore::Pasteboard::plainText): Ditto.
503         (WebCore::Pasteboard::hasData): Copied from ClipboardGtk.cpp.
504         (WebCore::Pasteboard::types): Ditto.
505         (WebCore::Pasteboard::readString): Ditto.
506         (WebCore::Pasteboard::readFilenames): Ditto.
507
508 2013-05-18  Alberto Garcia  <agarcia@igalia.com>
509
510         [GTK] Parallel build fails if gtk-doc is enabled
511         https://bugs.webkit.org/show_bug.cgi?id=116227
512
513         Reviewed by Martin Robinson.
514
515         * GNUmakefile.am:
516         Don't overwrite noinst_DATA, modify its existing value instead.
517
518 2013-05-17  Michelangelo De Simone  <michelangelo@webkit.org>
519
520         CSSParser parsing of CSSPropertyFontStretch falls into CSSPropertyGeometry
521         https://bugs.webkit.org/show_bug.cgi?id=116370
522
523         CSSPropertyFontStretch mistakenly fell through the shader parsing logic.
524
525         Reviewed by Alexandru Chiculita.
526
527         No new test possible, the feature is not implemented nor exposed.
528
529         * css/CSSParser.cpp:
530         (WebCore::CSSParser::parseValue):
531
532 2013-05-17  Timothy Hatcher  <timothy@apple.com>
533
534         Force the script debug server to continue when disabling the debugger.
535
536         There might be some cases where the debugger will stay in the nested run loop
537         which cause weird issues.
538
539         Speculative fix for: https://webkit.org/b/111438
540
541         Reviewed by Joseph Pecoraro.
542
543         * inspector/InspectorDebuggerAgent.cpp:
544         (WebCore::InspectorDebuggerAgent::disable):
545
546 2013-05-16  Darin Adler  <darin@apple.com>
547
548         [BlackBerry] Get BlackBerry port off legacy clipboard
549         https://bugs.webkit.org/show_bug.cgi?id=116287
550
551         Reviewed by Rob Buis.
552
553         * PlatformBlackBerry.cmake: Removed ClipboardBlackBerry.cpp.
554
555         * dom/Clipboard.h: Removed BLACKBERRY from the list of platforms that
556         use the legacy clipboard.
557
558         * editing/blackberry/EditorBlackBerry.cpp:
559         (WebCore::Editor::newGeneralClipboard): Changed to just create a copy
560         and paste clipboard.
561
562         * page/blackberry/EventHandlerBlackBerry.cpp: Removed a drag-related
563         function that wasn't doing any good.
564
565         * platform/blackberry/ClipboardBlackBerry.cpp: Removed.
566         * platform/blackberry/ClipboardBlackBerry.h: Removed.
567
568         * platform/blackberry/PasteboardBlackBerry.cpp:
569         (WebCore::Pasteboard::createForCopyAndPaste): Added.
570         (WebCore::Pasteboard::createPrivate): Added.
571         (WebCore::Pasteboard::hasData): Added. Moved code here from ClipboardBlackBerry.cpp.
572         (WebCore::Pasteboard::clear): Ditto.
573         (WebCore::Pasteboard::readString): Ditto.
574         (WebCore::Pasteboard::writeString): Ditto.
575         (WebCore::Pasteboard::types): Ditto.
576         (WebCore::Pasteboard::readFilenames): Ditto.
577
578 2013-05-17  Andreas Kling  <akling@apple.com>
579
580         Ads on theverge.com cause repaints when hovered, even though content doesn't visibly change.
581         <http://webkit.org/b/116344>
582
583         Reviewed by Darin Adler.
584
585         Teach RenderStyle::diff() to ignore differences in the outline value if both styles have non-visible outlines.
586
587         * rendering/style/RenderStyle.cpp:
588         (WebCore::RenderStyle::diff):
589         * rendering/style/StyleBackgroundData.cpp:
590         (WebCore::StyleBackgroundData::isEquivalentForPainting):
591         * rendering/style/StyleBackgroundData.h:
592         (StyleBackgroundData):
593
594 2013-05-17  Andreas Kling  <akling@apple.com>
595
596         Plug leak in CSSSelectorList::deleteSelectors().
597         <http://webkit.org/b/116371>
598         <rdar://problem/13930698>
599
600         Reviewed by Ryosuke Niwa.
601
602         Don't forget to destroy the very last selector in the list.
603
604         * css/CSSSelectorList.cpp:
605         (WebCore::CSSSelectorList::deleteSelectors):
606
607 2013-05-17  Anders Carlsson  <andersca@apple.com>
608
609         Share code between WebKit1 and WebKit2 StorageArea subclasses
610         https://bugs.webkit.org/show_bug.cgi?id=116367
611
612         Reviewed by Andreas Kling.
613
614         * inspector/InspectorDOMStorageAgent.cpp:
615         (WebCore::InspectorDOMStorageAgent::getDOMStorageItems):
616         Remove ec parameter.
617
618         * inspector/InspectorDOMStorageAgent.h:
619         Add forward declaration.
620
621         * page/DOMWindow.cpp:
622         (WebCore::DOMWindow::sessionStorage):
623         (WebCore::DOMWindow::localStorage):
624         Storage::StorageArea returns a reference now.
625
626         * storage/Storage.cpp:
627         (WebCore::Storage::length):
628         Check that the storage area can be accessed by the frame, and that it's not disabled by private browsing.
629         Then call down to the (now simplified) StorageArea::length().
630
631         (WebCore::Storage::isDisabledByPrivateBrowsing):
632         New helper function that's based on StorageAreaImpl::disabledByPrivateBrowsingInFrame, but reordered
633         to make it easier to follow.
634
635         * storage/Storage.h:
636         (WebCore::Storage::area):
637         Return a reference.
638
639         * storage/StorageAreaImpl.cpp:
640         (WebCore::StorageAreaImpl::storageType):
641         Add this new virtual member funciton that's needed by Storage::isDisabledByPrivateBrowsing.
642
643         (WebCore::StorageAreaImpl::length):
644         Remove unneeded code.
645
646 2013-05-17  Commit Queue  <commit-queue@webkit.org>
647
648         Unreviewed, rolling out r150294.
649         http://trac.webkit.org/changeset/150294
650         https://bugs.webkit.org/show_bug.cgi?id=116369
651
652         Caused 31 tests to fail (Requested by rniwa on #webkit).
653
654         * WebCore.exp.in:
655         * rendering/InlineFlowBox.h:
656         * rendering/InlineTextBox.h:
657         (InlineTextBox):
658         * rendering/RenderApplet.h:
659         * rendering/RenderBR.h:
660         * rendering/RenderBlock.h:
661         (RenderBlock):
662         (WebCore::RenderBlock::virtualContinuation):
663         * rendering/RenderBox.h:
664         (WebCore::RenderBox::borderBoundingBox):
665         (RenderBox):
666         (WebCore::RenderBox::marginLogicalLeft):
667         (WebCore::RenderBox::marginLogicalRight):
668         * rendering/RenderBoxModelObject.h:
669         (WebCore::RenderBoxModelObject::isBoxModelObject):
670         * rendering/RenderButton.h:
671         * rendering/RenderCombineText.h:
672         * rendering/RenderCounter.h:
673         * rendering/RenderDeprecatedFlexibleBox.h:
674         * rendering/RenderDetailsMarker.h:
675         * rendering/RenderEmbeddedObject.h:
676         (RenderEmbeddedObject):
677         (WebCore::RenderEmbeddedObject::isEmbeddedObject):
678         (WebCore::RenderEmbeddedObject::virtualChildren):
679         * rendering/RenderFieldset.h:
680         * rendering/RenderFileUploadControl.h:
681         * rendering/RenderFlexibleBox.h:
682         * rendering/RenderFlowThread.h:
683         * rendering/RenderFrame.h:
684         * rendering/RenderFrameSet.h:
685         * rendering/RenderFullScreen.cpp:
686         * rendering/RenderFullScreen.h:
687         * rendering/RenderGrid.h:
688         * rendering/RenderHTMLCanvas.h:
689         * rendering/RenderIFrame.h:
690         * rendering/RenderImage.h:
691         (RenderImage):
692         (WebCore::RenderImage::isRenderImage):
693         * rendering/RenderInline.h:
694         (RenderInline):
695         (WebCore::RenderInline::virtualContinuation):
696         (WebCore::RenderInline::virtualChildren):
697         (WebCore::RenderInline::isRenderInline):
698         (WebCore::RenderInline::layout):
699         (WebCore::RenderInline::requiresLayer):
700         (WebCore::RenderInline::offsetWidth):
701         (WebCore::RenderInline::offsetHeight):
702         (WebCore::RenderInline::borderBoundingBox):
703         (WebCore::RenderInline::dirtyLinesFromChangedChild):
704         * rendering/RenderLayerModelObject.h:
705         * rendering/RenderListBox.h:
706         * rendering/RenderListItem.h:
707         * rendering/RenderListMarker.h:
708         * rendering/RenderMedia.h:
709         (WebCore::RenderMedia::virtualChildren):
710         (WebCore::RenderMedia::canHaveChildren):
711         (WebCore::RenderMedia::isMedia):
712         (WebCore::RenderMedia::isImage):
713         (WebCore::RenderMedia::requiresForcedStyleRecalcPropagation):
714         * rendering/RenderMediaControlElements.h:
715         * rendering/RenderMenuList.h:
716         * rendering/RenderMeter.h:
717         * rendering/RenderMultiColumnBlock.h:
718         * rendering/RenderMultiColumnFlowThread.h:
719         * rendering/RenderMultiColumnSet.h:
720         * rendering/RenderNamedFlowThread.h:
721         * rendering/RenderPart.h:
722         (RenderPart):
723         (WebCore::RenderPart::isRenderPart):
724         (WebCore::RenderPart::renderName):
725         * rendering/RenderProgress.h:
726         * rendering/RenderRegion.h:
727         (WebCore::RenderRegion::isRenderRegion):
728         * rendering/RenderRegionSet.h:
729         * rendering/RenderReplaced.h:
730         (RenderReplaced):
731         (WebCore::RenderReplaced::renderName):
732         * rendering/RenderReplica.h:
733         * rendering/RenderRuby.h:
734         * rendering/RenderRubyBase.h:
735         * rendering/RenderRubyRun.h:
736         * rendering/RenderRubyText.h:
737         * rendering/RenderScrollbarPart.h:
738         * rendering/RenderSearchField.h:
739         * rendering/RenderSlider.h:
740         * rendering/RenderSnapshottedPlugIn.h:
741         (RenderSnapshottedPlugIn):
742         * rendering/RenderTable.h:
743         (RenderTable):
744         (WebCore::RenderTable::renderName):
745         (WebCore::RenderTable::isTable):
746         (WebCore::RenderTable::avoidsFloats):
747         * rendering/RenderTableCaption.h:
748         * rendering/RenderTableCell.h:
749         * rendering/RenderTableCol.h:
750         * rendering/RenderTableRow.h:
751         * rendering/RenderTableSection.h:
752         * rendering/RenderText.h:
753         (RenderText):
754         (WebCore::RenderText::marginLeft):
755         (WebCore::RenderText::marginRight):
756         (WebCore::RenderText::styleWillChange):
757         (WebCore::RenderText::length):
758         (WebCore::RenderText::paint):
759         (WebCore::RenderText::layout):
760         * rendering/RenderTextControl.h:
761         (RenderTextControl):
762         (WebCore::RenderTextControl::renderName):
763         (WebCore::RenderTextControl::isTextControl):
764         (WebCore::RenderTextControl::avoidsFloats):
765         * rendering/RenderTextControlMultiLine.h:
766         * rendering/RenderTextControlSingleLine.h:
767         (RenderTextControlSingleLine):
768         (WebCore::RenderTextControlSingleLine::isTextField):
769         * rendering/RenderTextFragment.h:
770         * rendering/RenderTextTrackCue.h:
771         * rendering/RenderVideo.h:
772         * rendering/RenderView.h:
773         * rendering/RenderWidget.h:
774         (RenderWidget):
775         (WebCore::RenderWidget::isWidget):
776         * rendering/RenderWordBreak.h:
777         * rendering/RootInlineBox.h:
778         (RootInlineBox):
779         * rendering/mathml/RenderMathMLBlock.h:
780         * rendering/svg/RenderSVGBlock.h:
781         (RenderSVGBlock):
782         * rendering/svg/RenderSVGContainer.h:
783         (WebCore::RenderSVGContainer::setNeedsBoundariesUpdate):
784         (WebCore::RenderSVGContainer::virtualChildren):
785         (WebCore::RenderSVGContainer::isSVGContainer):
786         (WebCore::RenderSVGContainer::renderName):
787         (RenderSVGContainer):
788         (WebCore::RenderSVGContainer::objectBoundingBox):
789         (WebCore::RenderSVGContainer::strokeBoundingBox):
790         (WebCore::RenderSVGContainer::repaintRectInLocalCoordinates):
791         * rendering/svg/RenderSVGEllipse.h:
792         * rendering/svg/RenderSVGForeignObject.h:
793         * rendering/svg/RenderSVGGradientStop.h:
794         * rendering/svg/RenderSVGHiddenContainer.h:
795         (WebCore::RenderSVGHiddenContainer::renderName):
796         (RenderSVGHiddenContainer):
797         (WebCore::RenderSVGHiddenContainer::isSVGHiddenContainer):
798         * rendering/svg/RenderSVGImage.h:
799         * rendering/svg/RenderSVGInline.h:
800         (WebCore::RenderSVGInline::renderName):
801         (WebCore::RenderSVGInline::requiresLayer):
802         (WebCore::RenderSVGInline::isSVGInline):
803         (RenderSVGInline):
804         * rendering/svg/RenderSVGInlineText.h:
805         * rendering/svg/RenderSVGModelObject.h:
806         (WebCore::RenderSVGModelObject::requiresLayer):
807         (RenderSVGModelObject):
808         * rendering/svg/RenderSVGPath.h:
809         * rendering/svg/RenderSVGRect.h:
810         * rendering/svg/RenderSVGResourceClipper.h:
811         * rendering/svg/RenderSVGResourceContainer.h:
812         (RenderSVGResourceContainer):
813         (WebCore::RenderSVGResourceContainer::isSVGResourceContainer):
814         (WebCore::RenderSVGResourceContainer::toRenderSVGResourceContainer):
815         * rendering/svg/RenderSVGResourceFilter.h:
816         * rendering/svg/RenderSVGResourceFilterPrimitive.h:
817         * rendering/svg/RenderSVGResourceGradient.h:
818         (RenderSVGResourceGradient):
819         (WebCore::RenderSVGResourceGradient::resourceBoundingBox):
820         * rendering/svg/RenderSVGResourceLinearGradient.h:
821         * rendering/svg/RenderSVGResourceMarker.h:
822         * rendering/svg/RenderSVGResourceMasker.h:
823         * rendering/svg/RenderSVGResourcePattern.h:
824         * rendering/svg/RenderSVGResourceRadialGradient.h:
825         * rendering/svg/RenderSVGRoot.h:
826         * rendering/svg/RenderSVGShape.h:
827         (WebCore::RenderSVGShape::setNeedsBoundariesUpdate):
828         (WebCore::RenderSVGShape::setNeedsTransformUpdate):
829         (WebCore::RenderSVGShape::repaintRectInLocalCoordinates):
830         (WebCore::RenderSVGShape::localToParentTransform):
831         (WebCore::RenderSVGShape::localTransform):
832         (WebCore::RenderSVGShape::isSVGShape):
833         (RenderSVGShape):
834         (WebCore::RenderSVGShape::objectBoundingBox):
835         (WebCore::RenderSVGShape::strokeBoundingBox):
836         * rendering/svg/RenderSVGTSpan.h:
837         * rendering/svg/RenderSVGText.h:
838         * rendering/svg/RenderSVGTextPath.h:
839         * rendering/svg/RenderSVGTransformableContainer.h:
840         * rendering/svg/RenderSVGViewportContainer.h:
841
842 2013-05-17  Christophe Dumez  <ch.dumez@sisa.samsung.com>
843
844         Get rid of Custom code for Audio global constructor
845         https://bugs.webkit.org/show_bug.cgi?id=116343
846
847         Reviewed by Geoffrey Garen.
848
849         Remove custom code for Audio global constructor. It is no longer needed
850         now that the the bindings generator no longer require custom code for
851         named constructors and now that [EnabledAtRuntime] extended attribute is
852         supported for global constructors.
853
854         HTMLAudioElement global constructors are now automatically generated.
855
856         No new tests, no behavior change for layout tests.
857
858         * bindings/js/JSDOMWindowCustom.cpp:
859         * html/HTMLAudioElement.idl:
860         * page/DOMWindow.idl:
861
862 2013-05-17  Alexey Proskuryakov  <ap@apple.com>
863
864         <rdar://problem/13819878> Disable SharedWorker when in multiple web process model
865         https://bugs.webkit.org/show_bug.cgi?id=116359
866
867         Reviewed by Anders Carlsson.
868
869         This feature was already RuntimeEnabled. Call through layers to get the answer from
870         a platform strategy.
871
872         * workers/DefaultSharedWorkerRepository.cpp:
873         (WebCore::DefaultSharedWorkerRepository::isAvailable):
874         * workers/DefaultSharedWorkerRepository.h:
875         * workers/SharedWorkerRepository.cpp:
876         (WebCore::SharedWorkerRepository::isAvailable):
877         * workers/SharedWorkerStrategy.h:
878         (WebCore::SharedWorkerStrategy::isAvailable):
879
880 2013-05-17  Anders Carlsson  <andersca@apple.com>
881
882         Move Storage member functions out of line
883         https://bugs.webkit.org/show_bug.cgi?id=116364
884
885         Reviewed by Andreas Kling.
886
887         This is preparation for sharing more code between the WebKit1 and WebKit2 storage area subclasses.
888         Also remove unnecessary null checks and make m_storageArea const.
889
890         * storage/Storage.cpp:
891         (WebCore::Storage::length):
892         (WebCore::Storage::key):
893         (WebCore::Storage::getItem):
894         (WebCore::Storage::setItem):
895         (WebCore::Storage::removeItem):
896         (WebCore::Storage::clear):
897         (WebCore::Storage::contains):
898         * storage/Storage.h:
899         (WebCore::Storage::area):
900
901 2013-05-17  Beth Dakin  <bdakin@apple.com>
902
903         Headers and footers will sometimes disappear and re-appear during page loads
904         https://bugs.webkit.org/show_bug.cgi?id=116336
905         -and corresponding-
906         <rdar://problem/13886753>
907
908         Reviewed by Simon Fraser.
909
910         This patch changes the WebCore-level API that WebKit uses to create a banner. 
911         Specifically this patch removes FrameView::setWantsLayerForHeader(), which created 
912         and returned a layer. Instead, WK2 will call Page::addHeaderWithHeight(). When the 
913         layer has been created, it will call back into WK2 via ChromeClient. This will 
914         allow WebCore to re-create the header/footer layers as needed whenever the 
915         FrameView/RenderLayerCompositor have been destroyed and recreated.
916
917         Remove references to old FrameView functions. Add references to new Page 
918         functions.
919         * WebCore.exp.in:
920
921         New ChromeClient functions will pass the new layers up to WK2.
922         * page/ChromeClient.h:
923         (WebCore::ChromeClient::didAddHeaderLayer):
924         (WebCore::ChromeClient::didAddFooterLayer):
925         (ChromeClient):
926
927         Remove setWantsLayerForHeader/Footer.
928         * page/FrameView.cpp:
929         * page/FrameView.h:
930         (FrameView):
931
932         Page now caches the header and footer height. When the FrameView/RLC have been 
933         destroyed, and the cached layer/height information on those classes has been lost, 
934         this data on Page will persist so that we can build the layers back up.
935         * page/Page.cpp:
936         (WebCore::Page::Page):
937         (WebCore::Page::addHeaderWithHeight):
938         (WebCore::Page::addFooterWithHeight):
939         * page/Page.h:
940         (WebCore::Page::headerHeight):
941         (WebCore::Page::footerHeight):
942
943         As soon as the root gets a backing, recreate the header and footer layers if 
944         needed.
945         * rendering/RenderLayerCompositor.cpp:
946         (WebCore::RenderLayerCompositor::updateBacking):
947
948         Call into ChromeClient.
949         (WebCore::RenderLayerCompositor::updateLayerForHeader):
950         (WebCore::RenderLayerCompositor::updateLayerForFooter):
951
952 2013-05-18  Claudio Saavedra  <csaavedra@igalia.com>
953
954         [CSS] Minor cleanups in CSS variables handling
955         https://bugs.webkit.org/show_bug.cgi?id=116318
956
957         Reviewed by Ryosuke Niwa.
958
959         No new tests, only a cleanup.
960
961         * css/CSSParser.cpp:
962         (WebCore::CSSParserString::substring): Optimize.
963         (WebCore::CSSParser::createPrimitiveVariableNameValue):
964         Remove intermediate variable.
965
966 2013-05-17  Alexey Proskuryakov  <ap@apple.com>
967
968         [Mac] Add DOMWindowConstructors.idl to Xcode project file
969         https://bugs.webkit.org/show_bug.cgi?id=116351
970
971         Reviewed by Anders Carlsson.
972
973         * WebCore.xcodeproj/project.pbxproj: Added the file, so that Xcode includes it
974         in searches.
975
976 2013-05-17  Ryosuke Niwa  <rniwa@webkit.org>
977
978         Remove the declaration of Element::detachAttrNodeAtIndex erroneously added in r150072.
979
980         * dom/Element.h:
981         (Element):
982
983 2013-05-17  Anders Carlsson  <andersca@apple.com>
984
985         WKKeyValueStorageManagerGetKeyValueStorageOrigins should get origins from the UI process
986         https://bugs.webkit.org/show_bug.cgi?id=116346
987         <rdar://problem/13852829>
988
989         Reviewed by Andreas Kling.
990
991         Export the UTF8Encoding symbol.
992
993         * WebCore.exp.in:
994
995 2013-05-17  Andreas Kling  <akling@apple.com>
996
997         Apply FINAL to the RenderObject hierarchy.
998         <http://webkit.org/b/115977>
999
1000         Mostly from Blink r148795 by <cevans@chromium.org>
1001         <http://src.chromium.org/viewvc/blink?view=revision&revision=148795>
1002
1003         Re-landing without devirtualization tweaks.
1004
1005         * rendering/: Beat things with the FINAL stick.
1006         * WebCore.exp.in: Export a now-needed symbol.
1007
1008 2013-05-17  Alexey Proskuryakov  <ap@apple.com>
1009
1010         Build fix.
1011
1012         * loader/FrameLoader.cpp: (WebCore::FrameLoader::willTransitionToCommitted):
1013         Frame:editor() now returns a reference.
1014
1015 2013-05-17  Christophe Dumez  <ch.dumez@sisa.samsung.com>
1016
1017         Get rid of [ConstructorParameters] extended attributes
1018         https://bugs.webkit.org/show_bug.cgi?id=116308
1019
1020         Reviewed by Kentaro Hara.
1021
1022         Get rid of WebKit-specific [ConstructorParameters] IDL extended attribute. Instead,
1023         [CustomConstructor] arguments are now explicitly specified, similarly to [Constructor]
1024         arguments and the constructor object's "length" property is now automatically
1025         computed for custom constructors as well.
1026
1027         This is less error-prone as the value is not hardcoded, more consistent with
1028         [Constructor] extended attribute and gives more information about the custom constructor
1029         in the IDL file. We also get rid of a WebKit-specific IDL attribute which is always
1030         nice.
1031
1032         No new tests, already covered by fast/js/constructor-length.html.
1033
1034         * Modules/mediastream/MediaStream.idl:
1035         * Modules/webaudio/AudioContext.idl:
1036         * Modules/websockets/WebSocket.idl:
1037         * bindings/scripts/CodeGeneratorJS.pm:
1038         (GenerateConstructorHelperMethods):
1039         * bindings/scripts/IDLAttributes.txt:
1040         * bindings/scripts/IDLParser.pm:
1041         (applyTypedefs):
1042         (parseAttributeRest):
1043         (copyExtendedAttributes):
1044         (parseExtendedAttributeRest):
1045         (applyExtendedAttributeList):
1046         * bindings/scripts/test/JS/JSFloat64Array.cpp:
1047         (WebCore::JSFloat64ArrayConstructor::finishCreation):
1048         * bindings/scripts/test/TestTypedArray.idl:
1049         * dom/MutationObserver.idl:
1050         * fileapi/Blob.idl:
1051         * html/DOMFormData.idl:
1052         * html/canvas/ArrayBuffer.idl:
1053         * html/canvas/DataView.idl:
1054         * page/WebKitPoint.idl:
1055         * workers/SharedWorker.idl:
1056         * workers/Worker.idl:
1057
1058 2013-05-17  Alexey Proskuryakov  <ap@apple.com>
1059
1060         Text input is largely broken when there are subframes loading
1061         http://bugs.webkit.org/show_bug.cgi?id=59121
1062         <rdar://problem/9320468>
1063
1064         Reviewed by Darin Adler.
1065
1066         This addresses text input being abandoned when another frame in a page is navigated.
1067
1068         There are still many opportunities for improvement:
1069         - Track other cases where WebCore interferes may want to cancel input without
1070         direct user action (e.g. deleting the whole editable element on a timer).
1071         - Fix how dictionary panel and autocorrection are dismissed (they still have the
1072         same issue, and get dismissed with any frame navigation).
1073
1074         Test: platform/mac/editing/input/unconfirmed-text-navigation-with-page-cache.html
1075
1076         * loader/FrameLoader.h:
1077         * loader/FrameLoader.cpp:
1078         (WebCore::FrameLoader::willTransitionToCommitted): Make sure that we
1079         do not keep an inline session in a frame that's no longer active, as WebKit2 no
1080         longer takes care of this case (and more of the logic should be in WebCore anyway).
1081         (WebCore::FrameLoader::commitProvisionalLoad): Added a hook that gets invoked right
1082         before transitioning to committed state starts. We may want to move more code here
1083         eventually, e.g. from Frame::setView.
1084
1085 2013-05-17  Christophe Dumez  <ch.dumez@sisa.samsung.com>
1086
1087         Get rid of [CustomGetter] for global named constructors
1088         https://bugs.webkit.org/show_bug.cgi?id=116116
1089
1090         Reviewed by Geoffrey Garen.
1091
1092         Improve the JSC bindings generator so that global named constructors no longer
1093         require a [CustomGetter] IDL extended attribute. As a consequence, attributes
1094         on the global window object can now be automatically generated for interfaces
1095         that have a [NamedConstructor], namely HTMLOptionElement.
1096
1097         The HTMLAudioElement global constructors are still manually defined because it
1098         requires custom code at the moment to check if the media player is available.
1099
1100         No new tests, no behavior change.
1101
1102         * bindings/js/JSDOMWindowCustom.cpp:
1103         * bindings/scripts/CodeGeneratorJS.pm:
1104         * bindings/scripts/preprocess-idls.pl:
1105         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1106         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
1107         * html/HTMLOptionElement.idl:
1108         * page/DOMWindow.idl:
1109
1110 2013-05-17  Joseph Pecoraro  <pecoraro@apple.com>
1111
1112         Web Inspector: SyntaxError evaluating "1+1; //@ sourceURL=test" in console
1113         https://bugs.webkit.org/show_bug.cgi?id=116292
1114
1115         Add a newline after the expression so a single line comment doesn't
1116         erroneously comment out the closing brace of the with block.
1117
1118         Reviewed by Timothy Hatcher.
1119
1120         Test: inspector/console/console-eval-comment.html
1121
1122         * inspector/InjectedScriptSource.js:
1123
1124 2013-05-17  David Hyatt  <hyatt@apple.com>
1125
1126         fast/flexbox/auto-height-with-flex.html failing only on release builds.
1127         https://bugs.webkit.org/show_bug.cgi?id=116240
1128
1129         Reviewed by Darin Adler.
1130
1131         Fix the mainAxisContentExtent method so no overflow occurs, since it
1132         doesn't work right on release builds.
1133
1134         * rendering/RenderFlexibleBox.cpp:
1135         (WebCore::RenderFlexibleBox::mainAxisContentExtent):
1136
1137 2013-05-17  Christophe Dumez  <ch.dumez@sisa.samsung.com>
1138
1139         Add [EnabledAtRuntime] extended attribute support for global constructors
1140         https://bugs.webkit.org/show_bug.cgi?id=116147
1141
1142         Reviewed by Geoffrey Garen.
1143
1144         Add [EnabledAtRuntime] extended attribute support for global constructors.
1145         This patch adds [EnabledAtRuntime] extended attribute to SharedWorker and
1146         WebSocket IDL interfaces so that their global constructors on the global
1147         Window object can now be automatically generated.
1148
1149         The behavior on JavaScript side is unchanged. We simply leverage
1150         RuntimeEnabledFeatures class and the new [EnabledAtRuntime] IDL extended
1151         attribute to generate the code for global constructors getters instead
1152         of using custom code.
1153
1154         No new tests, no behavior change for layout tests.
1155
1156         * GNUmakefile.list.am:
1157         * Modules/websockets/WebSocket.cpp: Enable WebSockets at runtime by default.
1158         * Modules/websockets/WebSocket.idl:
1159         * Target.pri:
1160         * UseJSC.cmake:
1161         * WebCore.vcproj/WebCore.vcproj:
1162         * WebCore.vcxproj/WebCore.vcxproj:
1163         * WebCore.vcxproj/WebCore.vcxproj.filters:
1164         * WebCore.xcodeproj/project.pbxproj:
1165         * bindings/js/JSBindingsAllInOne.cpp:
1166         * bindings/js/JSDOMWindowCustom.cpp:
1167         (WebCore):
1168         * bindings/js/JSDOMWindowWebSocketCustom.cpp: Removed.
1169         * bindings/scripts/CodeGeneratorJS.pm:
1170         (ToMethodName):
1171         (GetRuntimeEnableFunctionName):
1172         (GenerateImplementation):
1173         * bindings/scripts/IDLAttributes.txt:
1174         * page/DOMWindow.idl:
1175         * workers/SharedWorker.idl:
1176
1177 2013-05-17  Darin Adler  <darin@apple.com>
1178
1179         [EFL] Move EFL port off legacy clipboard
1180         https://bugs.webkit.org/show_bug.cgi?id=116181
1181
1182         Reviewed by Anders Carlsson.
1183
1184         * dom/Clipboard.h: Switched EFL away from "legacy" mode for Clipboard.
1185
1186         * page/efl/EventHandlerEfl.cpp:
1187         (WebCore::EventHandler::createDraggingClipboard): Changed to call Clipboard member function.
1188
1189         * platform/efl/ClipboardEfl.cpp: Deleted most of the functions.
1190         (WebCore::Editor::newGeneralClipboard): Changed to call Clipboard member function.
1191         (WebCore::Clipboard::createDragImage): Moved from ClipboardEfl to Clipboard.
1192         (WebCore::Clipboard::declareAndWriteDragImage): Moved from ClipboardEfl to Clipboard.
1193         (WebCore::Clipboard::items): Ditto.
1194
1195         * platform/efl/PasteboardEfl.cpp: A lot of copyright notices for a file that
1196         has no code in it other than notImplemented lines! I didn't add a new one.
1197         (WebCore::Pasteboard::createForCopyAndPaste): Added.
1198         (WebCore::Pasteboard::createPrivate): Added.
1199         (WebCore::Pasteboard::createForDragAndDrop): Added.
1200         (WebCore::Pasteboard::hasData): Added.
1201         (WebCore::Pasteboard::readString): Added.
1202         (WebCore::Pasteboard::writeString): Added.
1203         (WebCore::Pasteboard::types): Added.
1204         (WebCore::Pasteboard::readFilenames): Added.
1205         (WebCore::Pasteboard::setDragImage): Added.
1206         (WebCore::Pasteboard::writePasteboard): Added.
1207
1208 2013-05-17  Frédéric Wang  <fred.wang@free.fr>
1209
1210         Bad spacing inside MathML formulas when text-indent is specified
1211         https://bugs.webkit.org/show_bug.cgi?id=106600
1212
1213         Reviewed by Martin Robinson.
1214
1215         When MathML is used in a HTML page that modifies the CSS text-indent,
1216         large gaps appear inside the mathematical expressions. Resetting it to
1217         0 on the math root (as Gecko does) fixes the issue.
1218
1219         Tests: mathml/presentation/text-indent.html
1220                mathml/presentation/text-indent-expected.html
1221
1222         * css/mathml.css:
1223         (math): reset text-indent to its default value.
1224
1225 2013-05-17  Alberto Garcia  <agarcia@igalia.com>
1226
1227         Fix code that expects Page::chrome() to return a pointer
1228         https://bugs.webkit.org/show_bug.cgi?id=116313
1229
1230         Reviewed by Darin Adler.
1231
1232         Page::chrome() returns a reference after r150214.
1233
1234         * platform/network/blackberry/NetworkManager.cpp:
1235         (WebCore::NetworkManager::startJob):
1236         * platform/network/blackberry/SocketStreamHandleBlackBerry.cpp:
1237         (WebCore::SocketStreamHandle::SocketStreamHandle):
1238         * testing/Internals.cpp:
1239         (WebCore::Internals::resetToConsistentState):
1240         (WebCore::Internals::setEnableMockPagePopup):
1241
1242 2013-05-17  Alberto Garcia  <agarcia@igalia.com>
1243
1244         [BlackBerry] ImageBlackBerry: add missing BlendMode parameter
1245         https://bugs.webkit.org/show_bug.cgi?id=116316
1246
1247         Reviewed by Carlos Garcia Campos.
1248
1249         When the new BitmapImage::draw() method was added in r147110 it
1250         didn't include the BlendMode parameter, which has been there since
1251         r137011.
1252
1253         * platform/graphics/blackberry/ImageBlackBerry.cpp:
1254         (WebCore::BitmapImage::draw):
1255
1256 2013-05-16  Jer Noble  <jer.noble@apple.com>
1257
1258         Some media/track tests fail or assert on Mac
1259         https://bugs.webkit.org/show_bug.cgi?id=97132
1260
1261         Reviewed by Simon Fraser.
1262
1263         Rationalize the font and padding behavior of cues and cue boxes; ::cue pseudo elements cannot have padding
1264         values applied via CSS (due to padding not being included in the whitelist of applicable CSS properties).
1265         Also, the font values were being applied to the box at one level and the cue at another, leading to incorrect
1266         layout in the snapToLines case. Padding has been removed from the cue, and the font settings are now applied
1267         to the box exclusively.
1268
1269         Additionally, a few drive-by changes were made in TextTrackCue to the return values of displayTreeInternal() &
1270         element(), which previously returned a PassRefPtr<> instead of a plain pointer.
1271
1272         * css/mediaControls.css:
1273         (video::-webkit-media-text-track-container): Move the font size to the display selector.
1274         (video::cue): Remove the display:inline and padding:2px declarations.
1275         (video::-webkit-media-text-track-display): Remove the -webkit-line-content now that the ::cue has no padding.
1276         * html/track/TextTrackCue.cpp:
1277         (WebCore::TextTrackCue::TextTrackCue): The background box is now a span, rather than a forced-inline div.
1278         (WebCore::TextTrackCue::displayTreeInternal): Return a plain pointer.
1279         (WebCore::TextTrackCue::getDisplayTree): Ditto.
1280         (WebCore::TextTrackCue::setFontSize): Set the font on the box, not the cue.
1281         * html/track/TextTrackCue.h:
1282         (WebCore::TextTrackCue::element): Return a plain pointer.
1283         * html/track/TextTrackCueGeneric.cpp:
1284         (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties): The cue element is now a span, not a div.
1285         * page/CaptionUserPreferencesMac.mm:
1286         (WebCore::CaptionUserPreferencesMac::captionsWindowCSS): Whitespace.
1287         (WebCore::CaptionUserPreferencesMac::captionsBackgroundCSS): Do not set padding on the cue.
1288
1289 2013-05-16  Andreas Kling  <akling@apple.com>
1290
1291         Changes in text-only properties shouldn't cause repaints unless there is actually text.
1292         <http://webkit.org/b/116250>
1293
1294         Reviewed by Antti Koivisto.
1295
1296         Add a new StyleDifferenceRepaintIfText value to the repertoire of RenderStyle::diff().
1297         This result means that the renderer only needs to repaint if one of its immediate children contains text.
1298
1299         This lets us avoid repainting the same pixels when hovering over constructs like:
1300
1301             <style>
1302                 a { text-decoration: none; }
1303                 a:hover { text-decoration: underline; }
1304             </style>
1305             <a href="http://is.gd/andersca">
1306                 <img src="cool-hat.jpg">
1307             </a>
1308
1309         Since the change in text-decoration has no effect on the rendering of the <img> element,
1310         we'll now be smart enough to avoid repainting it.
1311
1312         * rendering/style/RenderStyleConstants.h:
1313         * rendering/style/RenderStyle.cpp:
1314         (WebCore::RenderStyle::diff):
1315
1316             Move checking of text-only properties until the very end, and return StyleDifferenceRepaintIfText
1317             in case a difference is found, giving precedence to StyleDifferenceRepaint.
1318
1319         * rendering/RenderObject.h:
1320         * rendering/RenderObject.cpp:
1321         (WebCore::RenderObject::hasImmediateNonWhitespaceTextChild):
1322
1323             Helper to check if a RenderObject has at least one RenderText child containing more than just
1324             collapsible whitespace.
1325
1326         (WebCore::RenderObject::shouldRepaintForStyleDifference):
1327
1328             Helper to check if a StyleDifference is either ...Repaint or ...RepaintIfText and the renderer
1329             has an immediate text child.
1330
1331         (WebCore::RenderObject::styleWillChange):
1332         (WebCore::RenderObject::setStyle):
1333
1334             Don't repaint for StyleDifferenceRepaintIfText unless hasImmediateNonWhitespaceTextChild().
1335
1336         * rendering/RenderBox.cpp:
1337         (WebCore::RenderBox::styleDidChange):
1338         * rendering/svg/SVGResourcesCache.cpp:
1339         (WebCore::SVGResourcesCache::clientStyleChanged):
1340
1341             Tweak for new StyleDifference enum value.
1342
1343         * rendering/RenderText.h:
1344         * rendering/RenderText.cpp:
1345         (WebCore::RenderText::isAllCollapsibleWhitespace):
1346
1347             Made this const.
1348
1349 2013-05-17  Lamarque V. Souza  <Lamarque.Souza@basyskom.com>
1350
1351         Improve -webkit-text-underline-position memory usage.
1352         https://bugs.webkit.org/show_bug.cgi?id=116108
1353
1354         Reviewed by Benjamin Poulain.
1355
1356         Remove m_maxLogicalTop private variable from RootInlineBox to reduce
1357         the overall memory used to render RootInlineBoxes (eight bytes per RootInlineBox
1358         instance in a 64-bit machine). RootInline::maxLogicalTop() now computes
1359         the maxLogicalTop value everytime it is called. In a typical page
1360         computeMaxLogicalTop is called less than 10 times for each
1361         InlineTextBox that uses -webkit-text-underline-position. That is a small
1362         price users of -webkit-text-underline-position will pay so that
1363         everybody can benefit from the memory reduction in RootInlineBox.
1364
1365         No new tests, no change in behavior.
1366
1367         * rendering/InlineFlowBox.cpp:
1368         (WebCore::InlineFlowBox::computeMaxLogicalTop): Make it const.
1369         * rendering/InlineFlowBox.h:
1370         * rendering/RootInlineBox.cpp:
1371         (WebCore::RootInlineBox::RootInlineBox): Remove m_maxLogicalTop.
1372         (WebCore::RootInlineBox::alignBoxesInBlockDirection): Remove
1373         computeMaxLogicalTop call and obsolete comment.
1374         (WebCore):
1375         (WebCore::RootInlineBox::maxLogicalTop): Compute maxLogicalTop before
1376         returning its value.
1377         * rendering/RootInlineBox.h:
1378         (RootInlineBox):
1379
1380 2013-05-17  Alexis Menard  <alexis@webkit.org>
1381
1382         Make sure to call release() on our smart pointers when we should.
1383         https://bugs.webkit.org/show_bug.cgi?id=116307
1384
1385         Reviewed by Andreas Kling.
1386
1387         Call release() when we should call it. There is probably more occurence
1388         of this problem on the codebase but this is a first bunch of fixes.
1389
1390         No new tests : existing ones should cover.
1391
1392         * css/CSSComputedStyleDeclaration.cpp:
1393         (WebCore::valueForNinePieceImage):
1394         (WebCore::getBorderRadiusShorthandValue):
1395         (WebCore::CSSComputedStyleDeclaration::valueForFilter):
1396         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
1397         (WebCore::CSSComputedStyleDeclaration::getCSSPropertyValuesForSidesShorthand):
1398         (WebCore::CSSComputedStyleDeclaration::getCSSPropertyValuesForGridShorthand):
1399         * css/CSSParser.cpp:
1400         (WebCore::CSSParser::parseBorderImage):
1401         * html/HTMLBodyElement.cpp:
1402         (WebCore::HTMLBodyElement::collectStyleForPresentationAttribute):
1403
1404 2013-05-17  Allan Sandfeld Jensen  <allan.jensen@digia.com>
1405
1406         Make PNGImageDecoder::rowAvailable auto-vectorizable
1407         https://bugs.webkit.org/show_bug.cgi?id=116151
1408
1409         Reviewed by Benjamin Poulain.
1410
1411         Changed the main loops under PNGImageDecoder::rowAvailable so that they
1412         avoid branches and non-sequential table look ups.
1413
1414         Together with automatic vectorization by the compiler this provides around
1415         4x speed-up with AVX or 2x speed-up on generic x64. Shaving off 12-40% on
1416         PNG decoding in general.
1417
1418         * platform/graphics/Color.cpp:
1419         (WebCore::premultipliedARGBFromColor):
1420         * platform/graphics/Color.h:
1421         (WebCore::fastDivideBy255):
1422         * platform/graphics/filters/FEBlend.cpp:
1423         * platform/image-decoders/png/PNGImageDecoder.cpp:
1424         (WebCore::setPixelRGB):
1425         (WebCore::setPixelRGBA):
1426         (WebCore::setPixelRGBA_Premultiplied):
1427         (WebCore::PNGImageDecoder::rowAvailable):
1428
1429 2013-05-17  Joseph Pecoraro  <pecoraro@apple.com>
1430
1431         Web Inspector: Allow "//# sourceMappingURL" syntax alongside "//@"
1432         https://bugs.webkit.org/show_bug.cgi?id=116290
1433
1434         Follow an update to the spec and support the new and old syntax.
1435
1436         Reviewed by Timothy Hatcher.
1437
1438         * inspector/ContentSearchUtils.cpp:
1439         (WebCore::ContentSearchUtils::scriptCommentPattern):
1440         (WebCore::ContentSearchUtils::stylesheetCommentPattern):
1441         * inspector/front-end/SASSSourceMapping.js:
1442         (WebInspector.SASSSourceMapping.prototype._loadAndProcessSourceMap):
1443
1444 2013-05-17  Christophe Dumez  <ch.dumez@sisa.samsung.com>
1445
1446         Remove custom code for MessageEvent.ports getter
1447         https://bugs.webkit.org/show_bug.cgi?id=116304
1448
1449         Reviewed by Kentaro Hara.
1450
1451         Remove Custom code for the "ports" attribute getter in MessageEvent
1452         IDL interface. The JSC bindings generator already supports attributes
1453         of type MessagePortArray.
1454
1455         No new tests, already covered by existing layout tests and bindings
1456         tests.
1457
1458         * bindings/js/JSMessageEventCustom.cpp: Remove Custom code for ports getter.
1459         * bindings/scripts/CodeGeneratorJS.pm:
1460         (NativeToJSValue): Small tweak to correctly handle the case where impl->ports()
1461         returns NULL and avoid crashing in this case.
1462         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: Rebaseline due
1463         to bindings generator tweak.
1464         * dom/MessageEvent.idl: Remove [CustomGetter] extended attribute for 'ports' attribute
1465         and switch to MessagePortArray type.
1466
1467 2013-05-16  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
1468
1469         Add stubs for ContextMenu and ContextMenuItem
1470         https://bugs.webkit.org/show_bug.cgi?id=116235
1471
1472         Reviewed by Antonio Gomes.
1473
1474         No new tests needed, only a refactor.
1475
1476         Add ContextMenuNone.cpp and ContextMenuItemNone.cpp
1477         so ports using ENABLE(CROSS_PLATFORM_CONTEXT_MENU) don't
1478         need to replicate these stubs.
1479
1480         * PlatformEfl.cmake:
1481         * Target.pri:
1482         * platform/ContextMenuNone.cpp: Added.
1483         (WebCore):
1484         (WebCore::ContextMenu::ContextMenu):
1485         (WebCore::ContextMenu::getContextMenuItems):
1486         (WebCore::ContextMenu::createPlatformContextMenuFromItems):
1487         (WebCore::ContextMenu::platformContextMenu):
1488         * platform/ContextMenuItemNone.cpp: Added.
1489         (WebCore):
1490         (WebCore::ContextMenuItem::platformContextMenuItem):
1491         * platform/efl/ContextMenuEfl.cpp: Removed.
1492         * platform/efl/ContextMenuItemEfl.cpp: Removed.
1493         * platform/qt/ContextMenuQt.cpp: Removed.
1494         * platform/qt/ContextMenuItemQt.cpp: Removed.
1495
1496 2013-05-16  Alexis Menard  <alexis@webkit.org>
1497
1498         Regression: Event#stopPropagation() does not halt bubbling for webkitTransitionEnd
1499         https://bugs.webkit.org/show_bug.cgi?id=115656
1500
1501         Reviewed by Darin Adler.
1502
1503         If we create a prefixed event to dispatch it (in the case we have only
1504         prefixed event listeners in client's code) then we need to make sure to
1505         keep it in sync with the original unprefixed event after it has been
1506         dispatched. While being dispatched the event can be modified by
1507         client's code and when propagated back to outer elements, attributes were
1508         not updated. This patch changes the old design of creating a separate event
1509         for the prefixed case and now change the type of the event (so the name) before
1510         dispatching it, keeping the attributes if changed and then rename it
1511         back to unprefixed when the dispatching is finished.
1512
1513         Tests: transitions/transition-end-event-prefixed-01.html
1514                transitions/transition-end-event-prefixed-02.html
1515                transitions/transition-end-event-prefixed-03.html
1516
1517         * dom/Event.h:
1518         (WebCore::Event::setType):
1519         * dom/EventTarget.cpp:
1520         (WebCore::EventTarget::fireEventListeners):
1521
1522 2013-05-16  Mike Fenton  <mifenton@rim.com>
1523
1524         [BlackBerry] Strip invoke URLs when writing to the clipboard.
1525         https://bugs.webkit.org/show_bug.cgi?id=116226
1526
1527         Reviewed by Rob Buis.
1528
1529         PR 333516.
1530
1531         Invoke URLs should not be included in the paste data.
1532
1533         Internally Reviewed by Gen Mak.
1534
1535         * platform/blackberry/PasteboardBlackBerry.cpp:
1536         (WebCore::Pasteboard::writeSelection):
1537
1538 2013-05-16  Eduardo Lima Mitev  <elima@igalia.com>
1539
1540         Missing UNUSED_PARAM macro for textPosition argument in WebKitAccessibleInterfaceText
1541         https://bugs.webkit.org/show_bug.cgi?id=116230
1542
1543         Reviewed by Chris Fleizach.
1544
1545         No new functionality, no new tests.
1546
1547         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
1548         (webkitAccessibleTextGetTextForOffset): List textPosition argument as
1549         unused parameter for all platforms except GTK.
1550
1551 2013-05-16  Jaehun Lim  <ljaehun.lim@samsung.com>
1552
1553         Frame flattening prevents <HTML> in <OBJECT> from having scrollbars
1554         https://bugs.webkit.org/show_bug.cgi?id=115884
1555         
1556         Reviewed by Antonio Gomes.
1557
1558         Frame flattening should be applied when the frame owner is frame or iframe. But when
1559         the frame owner is object element, frame flattening prevents it from having scrollbars.
1560         In this situation, we can't scroll the html document in object element.
1561
1562         This patch adds two helper functions to verify flattening conditions.
1563         
1564         Test: fast/frames/flattening/scrolling-in-object.html
1565
1566         * page/FrameView.cpp:
1567         (WebCore::frameFlatteningEnabled): Added. Helper to check whether flattening is enabled or not.
1568         (WebCore::supportsFrameFlattening): Added. Helper to check whether the frame owner is <frame> or <iframe>.
1569         (WebCore::FrameView::avoidScrollbarCreation):
1570         (WebCore::FrameView::calculateScrollbarModesForLayout): Use frameFlatteningEnabled().
1571         (WebCore::FrameView::layout): Use frameFlatteningEnabled().
1572         (WebCore::FrameView::isInChildFrameWithFrameFlattening): Use frameFlatteningEnabled().
1573
1574 2013-05-16  Patrick Gansterer  <paroga@webkit.org>
1575
1576         Port functions for pathhandling to Windows CE in FileSystemWin
1577         https://bugs.webkit.org/show_bug.cgi?id=116208
1578
1579         Reviewed by Darin Adler.
1580
1581         This will allow us to remove FileSystemWinCE in a next step.
1582
1583         * platform/win/FileSystemWin.cpp:
1584         (WebCore::pathByAppendingComponent):
1585         (WebCore::pathGetFileName):
1586
1587 2013-05-16  Tim Horton  <timothy_horton@apple.com>
1588
1589         PDFPlugins don't load when plugins are disabled, but they should
1590         https://bugs.webkit.org/show_bug.cgi?id=75790
1591         <rdar://problem/11650197>
1592
1593         Reviewed by Anders Carlsson.
1594
1595         Make it possible to load "application" plug-ins even if settings or the FrameLoaderClient
1596         say that plug-ins should be disabled, providing a mechanism for WebKit* to offer built-in
1597         functionality which happens to use the plug-in infrastructure, and which also doesn't
1598         unexpectedly disappear for users with plug-ins off.
1599
1600         * WebCore.exp.in:
1601         Export SubframeLoader::allowPlugins().
1602         Update signature for PluginData::supportsMimeType to include the AllowedPluginTypes argument.
1603
1604         * dom/DOMImplementation.cpp:
1605         (WebCore::DOMImplementation::createDocument):
1606         Load PluginData even if plug-ins are disabled, but if that is the case, only
1607         create a PluginDocument for application plug-ins.
1608
1609         * html/PluginDocument.cpp:
1610         (WebCore::PluginDocumentParser::appendBytes):
1611         Don't bail if plug-ins are disabled, because we could still be a PluginDocument
1612         for an application plug-in.
1613
1614         * page/Page.cpp:
1615         (WebCore::Page::pluginData):
1616         Allow PluginData to be constructed even if plug-ins are disabled, as there might
1617         be application plug-ins that we want to load anyway.
1618
1619         * platform/mac/MIMETypeRegistryMac.mm:
1620         (WebCore::MIMETypeRegistry::isApplicationPluginMIMEType):
1621         On Mac, if we have PDFPlugin, we can support PDF and PostScript with a native application plug-in.
1622
1623         * plugins/PluginData.cpp:
1624         (WebCore::PluginData::supportsMimeType):
1625         Add an AllowedPluginTypes argument to supportsMimeType, allowing callers to specify
1626         whether they are looking for any plug-in, or are looking only for application plug-ins.
1627
1628         * plugins/PluginData.h:
1629         (PluginInfo): Added an isApplicationPlugin field, to specify whether this is a "built-in" plug-in.
1630         (PluginData): Add the aforementioned AllowedPluginTypes enum and the argument to supportsMimeType.
1631
1632 2013-05-16  Carlos Garcia Campos  <cgarcia@igalia.com>
1633
1634         [BlackBerry] Crash due to an assert running test editing/execCommand/indent-paragraphs.html
1635         https://bugs.webkit.org/show_bug.cgi?id=114944
1636
1637         Reviewed by Rob Buis.
1638
1639         It crashes in network platform code when trying to save an
1640         invalid URL in the disk cache. That test contains references to
1641         empty URLs like http://. Those empty URLs, are parsed as http:/ by
1642         KURL and considered valid. BlackBerry network platform uses GURL
1643         which considers those URLs invalid. We needed to check that the
1644         URLs are valid for our platform before starting the network
1645         operation.
1646
1647         Fixes a crash running test
1648         editing/execCommand/indent-paragraphs.html.
1649
1650         * platform/network/blackberry/NetworkManager.cpp:
1651         (WebCore::NetworkManager::startJob): Check if the request URL is
1652         valid from the platform point of view right after creating the
1653         platform network request and return early if the URL is invalid
1654         with StatusErrorInvalidUrl error.
1655
1656 2013-05-16  Patrick Gansterer  <paroga@webkit.org>
1657
1658         Remove unused function safeCreateFile() from WebCore
1659         https://bugs.webkit.org/show_bug.cgi?id=116211
1660
1661         Reviewed by Anders Carlsson.
1662
1663         * platform/FileSystem.h:
1664         * platform/win/FileSystemWin.cpp:
1665
1666 2013-05-16  Peter Gal  <galpeter@inf.u-szeged.hu>
1667
1668         [curl] MIME type should be in lowercase
1669         https://bugs.webkit.org/show_bug.cgi?id=116218
1670
1671         Reviewed by Benjamin Poulain.
1672
1673         Existing testcase: http/tests/mime/uppercase-mime-type.html
1674
1675         * platform/network/curl/ResourceHandleManager.cpp:
1676         (WebCore::headerCallback): Convert the MIME type to lowercase.
1677
1678 2013-05-16  Seokju Kwon  <seokju.kwon@gmail.com>
1679
1680         Web Inspector: Fix optional value of promptText in Inspector.json
1681         https://bugs.webkit.org/show_bug.cgi?id=116203
1682
1683         Reviewed by Joseph Pecoraro.
1684
1685         Merge from https://chromiumcodereview.appspot.com/14672031.
1686
1687         No new tests needed.
1688
1689         * inspector/Inspector.json:
1690
1691 2013-05-16  Mary Wu  <mary.wu@torchmobile.com.cn>
1692
1693         [BlackBerry] Unable to download blob resource
1694         https://bugs.webkit.org/show_bug.cgi?id=115888
1695
1696         Reviewed by Benjamin Poulain.
1697
1698         Add BlobStream to handle over blob data from BlobResourceHandle to download stream.
1699         RIM bug 331086, internally reviewed by Charles Wei and Leo Yang.
1700
1701         * PlatformBlackBerry.cmake:
1702         * platform/network/blackberry/BlobStream.cpp: Added.
1703         (WebCore):
1704         (WebCore::BlobStream::BlobStream):
1705         (WebCore::BlobStream::~BlobStream):
1706         (WebCore::BlobStream::didReceiveData):
1707         (WebCore::BlobStream::didFinishLoading):
1708         (WebCore::BlobStream::didFail):
1709         (WebCore::BlobStream::url):
1710         (WebCore::BlobStream::mimeType):
1711         * platform/network/blackberry/BlobStream.h: Added.
1712         (WebCore):
1713         (BlobStream):
1714
1715 2013-05-16  Anders Carlsson  <andersca@apple.com>
1716
1717         Remove SystemTime header and implementations
1718         https://bugs.webkit.org/show_bug.cgi?id=116200
1719
1720         Reviewed by Alexey Proskuryakov.
1721
1722         SystemTim just had a single function that's not called anymore. Remove it.
1723
1724         * GNUmakefile.list.am:
1725         * PlatformBlackBerry.cmake:
1726         * PlatformEfl.cmake:
1727         * PlatformWinCE.cmake:
1728         * Target.pri:
1729         * WebCore.vcproj/WebCore.vcproj:
1730         * WebCore.vcxproj/WebCore.vcxproj:
1731         * WebCore.vcxproj/WebCore.vcxproj.filters:
1732         * WebCore.xcodeproj/project.pbxproj:
1733         * history/PageCache.cpp:
1734         * platform/SystemTime.h: Removed.
1735         * platform/blackberry/SystemTimeBlackBerry.cpp: Removed.
1736         * platform/efl/SystemTimeEfl.cpp: Removed.
1737         * platform/graphics/ca/GraphicsLayerCA.cpp:
1738         * platform/mac/SystemTimeMac.cpp: Removed.
1739         * platform/qt/TemporaryLinkStubsQt.cpp:
1740         * platform/win/SystemTimeWin.cpp: Removed.
1741
1742 2013-05-16  Glenn Adams  <glenn@skynav.com>
1743
1744         [Inspector] Don't filter syntax error caused by asterisk in CSS Property name.
1745         https://bugs.webkit.org/show_bug.cgi?id=116196
1746
1747         Reviewed by Benjamin Poulain.
1748
1749         * inspector/InspectorConsoleAgent.cpp:
1750         (WebCore::InspectorConsoleAgent::addMessageToConsole):
1751             - Remove questionable IE7 related error filtering
1752
1753 2013-05-16  Andreas Kling  <akling@apple.com>
1754
1755         Page::chrome() should return a reference.
1756         <http://webkit.org/b/116185>
1757
1758         Reviewed by Anders Carlsson.
1759
1760         A Page's chrome() can never be null. Change Page::chrome() to return a reference to reflect this.
1761         Also, make Page::m_chrome a const member variable so nobody will accidentally set it to null.
1762
1763 2013-05-16  Simon Fraser  <simon.fraser@apple.com>
1764
1765         Content disappears when scrolling http://www.childrenscancer.org/zach/
1766         https://bugs.webkit.org/show_bug.cgi?id=116206
1767
1768         Reviewed by Darin Adler.
1769         
1770         When a RenderLayerBacking gains or loses a foregroundLayer or backgroundLayer,
1771         we need to repaint the primary layer, since what paints into that primary
1772         layer will change.
1773         
1774         On the page in question, we gained/lost a foreground layer when scrolling because
1775         the page popped an element into position:fixed.
1776
1777         Test: compositing/repaint/foreground-layer-change.html
1778
1779         * rendering/RenderLayerBacking.cpp:
1780         (WebCore::RenderLayerBacking::updateForegroundLayer):
1781         (WebCore::RenderLayerBacking::updateBackgroundLayer):
1782
1783 2013-05-16  Andy Estes  <aestes@apple.com>
1784
1785         Do not indefinitely cache resources from blob URLs.
1786
1787         Reviewed by Alexey Proskuryakov.
1788
1789         Alexey pointed out after I landed r150169 that blob URLs backed by
1790         files should return an error if the file changed after the URL was
1791         created. By indefinitely caching them in memory, we don't give the
1792         loader a chance to check for modification. Remove "blob" from the list
1793         of schemes that should be indefinitely cached.
1794
1795         * platform/SchemeRegistry.cpp:
1796         (WebCore::SchemeRegistry::shouldCacheResponsesFromURLSchemeIndefinitely):
1797
1798 2013-05-16  Claudio Saavedra  <csaavedra@igalia.com>
1799
1800         [CSS] CSS Variables are case-sensitive
1801         https://bugs.webkit.org/show_bug.cgi?id=116239
1802
1803         Reviewed by Ryosuke Niwa.
1804
1805         The CSS Variables specification states that variables are
1806         case-sensitive, unlike other CSS properties.
1807
1808         Test: fast/css/variables/case-sensitive.html
1809
1810         * css/CSSParser.cpp:
1811         (WebCore::CSSParserString::substring): Replace
1812         the now unnecessary lowerSubstring() with this method.
1813         Also, since the method is only used by the CSS variables
1814         implementation, #ifdef it.
1815         (WebCore::CSSParser::createPrimitiveVariableNameValue):
1816         (WebCore::CSSParser::storeVariableDeclaration):
1817         Do not normalize variable declarations to lowercase.
1818         * css/CSSParserValues.h:
1819         (CSSParserString): Replace the lowerSubstring() declaration
1820         and wrap with #if/#endif.
1821
1822 2013-05-16  Brady Eidson  <beidson@apple.com>
1823
1824         svg/as-image/img-zoom-svg-stylesheet.html crashes with NetworkProcess enabled.
1825         <rdar://problem/13837408> and https://bugs.webkit.org/show_bug.cgi?id=115917
1826
1827         Reviewed by Sam Weinig.
1828
1829         Give WebKit2 the ability to not mis-cast.
1830
1831         * loader/FrameLoaderClient.h:
1832         (WebCore::FrameLoaderClient::isEmptyFrameLoaderClient): Defaults to false, and include a FIXME
1833           to remove it once https://bugs.webkit.org/show_bug.cgi?id=116233 is resolved.
1834
1835         * loader/EmptyClients.h: Make isEmptyFrameLoaderClient() return true, and add a FIXME to remove it.
1836
1837 2013-05-14  Martin Robinson  <mrobinson@igalia.com>
1838
1839         [GTK] Add support for building WebCore to the cmake build
1840         https://bugs.webkit.org/show_bug.cgi?id=116128
1841
1842         Reviewed by Gustavo Noronha Silva.
1843
1844         * PlatformGTK.cmake: Added.
1845         * platform/gtk/GtkVersioning.c: Include "config.h" because we removed
1846         the autotoolsconfig.h include from the header.
1847         * platform/gtk/GtkVersioning.h: Remove autotoolsconfig.h include to support for
1848         non-autotools build systems.
1849
1850 2013-05-15  Ryosuke Niwa  <rniwa@webkit.org>
1851
1852         DocumentOrderedMap doesn't need to have two HashMaps
1853         https://bugs.webkit.org/show_bug.cgi?id=116167
1854
1855         Reviewed by Geoffrey Garen.
1856
1857         Previously, we had two hash maps: m_map and m_duplicateCounts in DocumentOrderedMap to keep track
1858         of the first element and the number of duplicates for a given name. This patch simplifies this structure
1859         by having a single hash map that contains both the pointer and the number of duplicates.
1860
1861         In addition, this patch fixes a regression introduced in r149652 that window and document name maps
1862         were not updated for some elements inside a SVG use element, and makes use of the newly added list of
1863         the matching elements in SelectorQuery.
1864
1865         * dom/DocumentOrderedMap.cpp:
1866         (WebCore::DocumentOrderedMap::clear): Updated to use the new hash map.
1867         (WebCore::DocumentOrderedMap::add): Ditto.
1868         (WebCore::DocumentOrderedMap::remove): Ditto.
1869         (WebCore::DocumentOrderedMap::get): Ditto.
1870         (WebCore::DocumentOrderedMap::getAllElementsById): Added.
1871
1872         * dom/DocumentOrderedMap.h:
1873
1874         (WebCore::DocumentOrderedMap::MapEntry::MapEntry): Added.
1875         (WebCore::DocumentOrderedMap::containsSingle): Updated to use new hash map.
1876         (WebCore::DocumentOrderedMap::contains): Ditto.
1877         (WebCore::DocumentOrderedMap::containsMultiple): Ditto.
1878
1879         * dom/Element.cpp:
1880         (WebCore::Element::insertedInto): This function didn't add this element to window and document's name maps
1881         if the element had already been inserted into a tree scope, and the current call was inserting an ancestor
1882         of the tree scope into the document. We were exiting early per scope != treeScope().
1883
1884         Fixed the bug by splitting updateId into two functions updateIdForTreeScope and updateIdForDocument.
1885         The former is called when this element is inserted into a new tree scope, and the latter is called when
1886         this element is inserted into a HTML document even if it had already been inside some tree scope.
1887
1888         (WebCore::Element::removedFrom): This function didn't remove this element from tree scope's id maps if
1889         the tree scope wasn't a document. Fixed the bug by simply checking that the removal happens beneath the
1890         current tree scope.
1891         (WebCore::Element::updateName):
1892         (WebCore::Element::updateNameForTreeScope): Renamed from updateName.
1893         (WebCore::Element::updateNameForDocument): Extracted from updateName.
1894         (WebCore::Element::updateId):
1895         (WebCore::Element::updateIdForTreeScope): Renamed from updateId.
1896         (WebCore::Element::updateIdForDocument): Extracted from updateId.
1897
1898         * dom/Element.h:
1899
1900         * dom/SelectorQuery.cpp:
1901         (WebCore::SelectorDataList::canUseIdLookup): Refactored to return the id subselector instead of checking if
1902         the first subselector happens to be matching an id.
1903         (WebCore::SelectorDataList::execute): Use the subselector canUseIdLookup returned. Also make use of newly
1904         added getAllElementsById when there are multiple matching elements for a given id.
1905
1906         * dom/SelectorQuery.h:
1907
1908         * dom/TreeScope.cpp:
1909         (WebCore::TreeScope::getAllElementsById): Added.
1910
1911         * dom/TreeScope.h:
1912
1913 2013-05-15  Darin Adler  <darin@apple.com>
1914
1915         [Mac] Make Clipboard::create functions for Mac platform independent by moving Pasteboard creation to Pasteboard functions
1916         https://bugs.webkit.org/show_bug.cgi?id=116179
1917
1918         Reviewed by Andreas Kling.
1919
1920         * dom/Clipboard.cpp:
1921         (WebCore::Clipboard::createForCopyAndPaste): Moved the function here from
1922         ClipboardMac, and have it use Pasteboard functions that are not Mac-specific.
1923         (WebCore::Clipboard::create): Ditto.
1924         (WebCore::Clipboard::createForDragAndDrop): Ditto.
1925
1926         * platform/DragData.h:
1927         (WebCore::DragData::pasteboardName): Made this const.
1928
1929         * platform/Pasteboard.h: Added new create functions, used by the clipboard
1930         create functions above.
1931
1932         * platform/mac/ClipboardMac.mm: Removed the functions that were moved to the
1933         Clipboard.cpp file.
1934
1935         * platform/mac/PasteboardMac.mm:
1936         (WebCore::Pasteboard::createForCopyAndPaste): Added.
1937         (WebCore::Pasteboard::createPrivate): Added.
1938         (WebCore::Pasteboard::createForDragAndDrop): Added.
1939
1940 2013-05-15  Anders Carlsson  <andersca@apple.com>
1941
1942         Fix a thinko.
1943
1944         We want to invalidate the file icon loader if it exists, not create it!
1945
1946         * html/FileInputType.cpp:
1947         (WebCore::FileInputType::requestIcon):
1948
1949 2013-05-15  Darin Adler  <darin@apple.com>
1950
1951         Move drag-specific Clipboard functions inside ENABLE(DRAG_SUPPORT)
1952         https://bugs.webkit.org/show_bug.cgi?id=116176
1953
1954         Reviewed by Andreas Kling.
1955
1956         * dom/Clipboard.cpp:
1957         (WebCore::Clipboard::writeRange):
1958         (WebCore::Clipboard::writePlainText):
1959         (WebCore::Clipboard::writeURL):
1960         Move these three functions inside ENABLE(DRAG_SUPPORT). Even though their names do
1961         not make it obvious, these are here only for use by dragging code. Later we may
1962         refactor them away entirely, but for now it's good not to compile them in on any
1963         platform that does not support dragging.
1964
1965 2013-05-15  Andy Estes  <aestes@apple.com>
1966
1967         Resources from non-HTTP schemes should not be cached indefinitely
1968         https://bugs.webkit.org/show_bug.cgi?id=113626
1969
1970         Reviewed by Ryosuke Niwa.
1971
1972         With the exception of schemes that we know will always return the same
1973         result for a given URL, we should not indefinitely cache non-HTTP
1974         resources when their freshness cannot be verified.
1975
1976         Writing a test for this is blocked on https://webkit.org/b/116199.
1977
1978         The following two existing tests of memory cache behavior were
1979         converted to HTTP tests so that they continue to function as expected:
1980
1981         Tests: http/tests/cache/display-image-unset-allows-cached-image-load.html
1982                http/tests/cache/willsendrequest-returns-null-for-memory-cache-load.html
1983
1984         * loader/cache/CachedResource.cpp:
1985         (WebCore::CachedResource::freshnessLifetime): Returned a freshness
1986         lifetime of 0 for non-HTTP schemes that can't be indefinitely cached.
1987         * platform/SchemeRegistry.cpp:
1988         (WebCore::SchemeRegistry::shouldCacheResponsesFromURLSchemeIndefinitely):
1989         Checked whether the scheme is blob:, data:, or applewebdata:.
1990         * platform/SchemeRegistry.h:
1991
1992 2013-05-15  Tim Horton  <timothy_horton@apple.com>
1993
1994         makeRGBAFromNSColor throws an exception if given a color in a greyscale colorspace
1995         https://bugs.webkit.org/show_bug.cgi?id=116198
1996         <rdar://problem/13904395>
1997
1998         Reviewed by Simon Fraser.
1999
2000         Block Objective-C exceptions in makeRGBAFromNSColor.
2001         Remove a comment saying that they're impossible.
2002
2003         Convert the incoming color to the DeviceRGB colorspace to match
2004         existing color sources. Some rare cases (attributed strings that come
2005         from PDFKit) can have DeviceGrayscale color spaces, which would
2006         previously throw an exception here.
2007
2008         * platform/graphics/mac/ColorMac.mm:
2009         (WebCore::makeRGBAFromNSColor):
2010
2011 2013-05-15  David Kilzer  <ddkilzer@apple.com>
2012
2013         BUILD FIX (r150140): Frame::editor() should return a reference for iOS, too
2014
2015         * platform/ios/ClipboardIOS.mm:
2016         (WebCore::ClipboardIOS::ClipboardIOS):
2017         (WebCore::ClipboardIOS::hasData):
2018         (WebCore::ClipboardIOS::clearData):
2019         (WebCore::ClipboardIOS::clearAllData):
2020         (WebCore::ClipboardIOS::getData):
2021         (WebCore::ClipboardIOS::setData):
2022         (WebCore::ClipboardIOS::types):
2023         (WebCore::ClipboardIOS::writeRange):
2024         * platform/ios/PasteboardIOS.mm:
2025         (WebCore::Pasteboard::getStringSelection):
2026         (WebCore::Pasteboard::writeSelection):
2027         (WebCore::Pasteboard::writePlainText):
2028         (WebCore::Pasteboard::writeImage):
2029         (WebCore::Pasteboard::plainText):
2030         (WebCore::documentFragmentWithRTF):
2031         (WebCore::Pasteboard::documentFragmentForPasteboardItemAtIndex):
2032         (WebCore::Pasteboard::documentFragment):
2033
2034 2013-05-15  Anders Carlsson  <andersca@apple.com>
2035
2036         Stop using the factory pattern in FileIconLoaderClient
2037         https://bugs.webkit.org/show_bug.cgi?id=116197
2038
2039         Reviewed by Andreas Kling.
2040
2041         Move the FileIconLoader member out of FileIconLoaderClient and into FileInputType and remove the factory gunk.
2042
2043         * html/FileInputType.cpp:
2044         (WebCore::FileInputType::~FileInputType):
2045         (WebCore::FileInputType::requestIcon):
2046         * html/FileInputType.h:
2047         (FileInputType):
2048         * platform/FileIconLoader.cpp:
2049         (WebCore::FileIconLoader::invalidate):
2050         * platform/FileIconLoader.h:
2051         (WebCore::FileIconLoaderClient::~FileIconLoaderClient):
2052         (FileIconLoader):
2053
2054 2013-05-15  Anders Carlsson  <andersca@apple.com>
2055
2056         Fix FileChooserClient design
2057         https://bugs.webkit.org/show_bug.cgi?id=116195
2058
2059         Reviewed by Andreas Kling.
2060
2061         FileChooserClient doesn't match the standard WebCore client idiom of only having virtual member functions.
2062         Instead it holds on to its FileChooser and it's even a factory for creating new file choosers(!).
2063
2064         Fix this by making it an abstract class, and moving FileChooser into FileInputType.
2065
2066         * html/FileInputType.cpp:
2067         (WebCore::FileInputType::~FileInputType):
2068         Invalidate the file chooser.
2069
2070         (WebCore::FileInputType::handleDOMActivateEvent):
2071         Apply the file chooser settings.
2072
2073         (WebCore::FileInputType::applyFileChooserSettings):
2074         Recreate the file chooser with new settings.
2075
2076         (WebCore::FileInputType::receiveDropForDirectoryUpload):
2077         Apply the settings.
2078
2079         * platform/FileChooser.cpp:
2080         (WebCore::FileChooser::invalidate):
2081         Set m_client to null.
2082
2083         (WebCore::FileChooser::chooseFiles):
2084         Early return.
2085
2086         * platform/FileChooser.h:
2087
2088 2013-05-15  Gavin Barraclough  <barraclough@apple.com>
2089
2090         ScriptedAnimationController::setThrottled should extend MinimumAnimationInterval
2091         https://bugs.webkit.org/show_bug.cgi?id=116193
2092
2093         Reviewed by Darin Adler
2094
2095         * dom/ScriptedAnimationController.cpp:
2096         (WebCore::ScriptedAnimationController::ScriptedAnimationController):
2097         (WebCore::ScriptedAnimationController::setThrottled):
2098         (WebCore::ScriptedAnimationController::scheduleAnimation):
2099         * dom/ScriptedAnimationController.h:
2100         (ScriptedAnimationController):
2101             - Fixes for review comments.
2102
2103 2013-05-15  Anders Carlsson  <andersca@apple.com>
2104
2105         Move HTTPRequest class to WebKit2
2106         https://bugs.webkit.org/show_bug.cgi?id=116192
2107
2108         Reviewed by Darin Adler.
2109
2110         HTTPRequest is only used by the "remote inspector" feature in WebKit2,
2111         so there's no need to have it in WebCore.
2112
2113         * CMakeLists.txt:
2114         * GNUmakefile.list.am:
2115         * Target.pri:
2116         * WebCore.vcproj/WebCore.vcproj:
2117         * WebCore.vcxproj/WebCore.vcxproj:
2118         * WebCore.vcxproj/WebCore.vcxproj.filters:
2119         * WebCore.xcodeproj/project.pbxproj:
2120
2121 2013-05-15  Oliver Hunt  <oliver@apple.com>
2122
2123         RefCountedArray needs to use vector initialisers for its backing store
2124         https://bugs.webkit.org/show_bug.cgi?id=116194
2125
2126         Reviewed by Gavin Barraclough.
2127
2128         Update to use new functions for operating on the exception stack.
2129
2130         * bindings/js/ScriptCallStackFactory.cpp:
2131         (WebCore::createScriptCallStackFromException):
2132
2133 2013-05-15  Gavin Barraclough  <barraclough@apple.com>
2134
2135         ScriptedAnimationController::setThrottled should extend MinimumAnimationInterval
2136         https://bugs.webkit.org/show_bug.cgi?id=116193
2137
2138         Reviewed by Simon Fraser.
2139
2140         * dom/ScriptedAnimationController.cpp:
2141         (WebCore::ScriptedAnimationController::ScriptedAnimationController):
2142             - initialize m_throttled
2143         (WebCore::ScriptedAnimationController::setThrottled):
2144             - sets m_throttled, reschedule when this changes.
2145         (WebCore::ScriptedAnimationController::scheduleAnimation):
2146             - if throtled don't use a display link, and extend the timeout.
2147         * dom/ScriptedAnimationController.h:
2148         (ScriptedAnimationController):
2149             - Added m_throttled
2150
2151 2013-05-08  Gavin Barraclough  <barraclough@apple.com>
2152
2153         Process suppression should throttle scripted animations
2154         https://bugs.webkit.org/show_bug.cgi?id=115812
2155
2156         Reviewed by Simon Fraser.
2157
2158         <rdar://problem/13799726>
2159
2160         * WebCore.exp.in:
2161             - Expose Page::setThrottled
2162         * dom/Document.cpp:
2163         (WebCore::Document::scriptedAnimationControllerSetThrottled):
2164         (WebCore):
2165         * dom/Document.h:
2166         (Document):
2167             - Forwards to ScriptedAnimationController::setThrottled
2168         * dom/ScriptedAnimationController.cpp:
2169         (WebCore::ScriptedAnimationController::setThrottled):
2170         (WebCore):
2171         * dom/ScriptedAnimationController.h:
2172             - Force use of a timer.
2173         (ScriptedAnimationController):
2174         * page/Page.cpp:
2175         (WebCore::Page::setThrottled):
2176         (WebCore):
2177         * page/Page.h:
2178         (Page):
2179             - When under throttling force the ScriptedAnimationController to use a timer.
2180
2181 2013-05-15  Igor Oliveira  <igor.o@sisa.samsung.com>
2182
2183         Implement run-in remove child cases.
2184         https://bugs.webkit.org/show_bug.cgi?id=86520
2185
2186         Move runin to original position when sibling element is destroyed.
2187
2188         Reviewed by David Hyatt.
2189
2190         Tests: fast/runin/runin-remove-child-simple.html
2191                fast/runin/runin-sibling-inline.html
2192
2193         * rendering/RenderBlock.cpp:
2194         (WebCore::RenderBlock::willBeDestroyed):
2195         (WebCore::RenderBlock::moveRunInUnderSiblingBlockIfNeeded):
2196             If moveRunInUnderSiblingBlockIfNeeded is called when the sibling run-in block
2197             is being destroyed, it means that the run-in is moving to original position and
2198             we do not need to do nothing.
2199
2200 2013-05-15  Anders Carlsson  <andersca@apple.com>
2201
2202         Remove WebSocketHandshakeResponse class
2203         https://bugs.webkit.org/show_bug.cgi?id=116190
2204
2205         Reviewed by Andreas Kling.
2206
2207         Just use ResourceResponse instead of WebSocketHandshakeResponse.
2208
2209         * CMakeLists.txt:
2210         * GNUmakefile.list.am:
2211         * Modules/websockets/WebSocketHandshake.cpp:
2212         (WebCore::WebSocketHandshake::readServerHandshake):
2213         (WebCore::WebSocketHandshake::serverWebSocketProtocol):
2214         (WebCore::WebSocketHandshake::serverSetCookie):
2215         (WebCore::WebSocketHandshake::serverSetCookie2):
2216         (WebCore::WebSocketHandshake::serverUpgrade):
2217         (WebCore::WebSocketHandshake::serverConnection):
2218         (WebCore::WebSocketHandshake::serverWebSocketAccept):
2219         (WebCore::WebSocketHandshake::serverHandshakeResponse):
2220         (WebCore::WebSocketHandshake::readHTTPHeaders):
2221         * Modules/websockets/WebSocketHandshake.h:
2222         * Modules/websockets/WebSocketHandshakeResponse.cpp: Removed.
2223         * Modules/websockets/WebSocketHandshakeResponse.h: Removed.
2224         * Target.pri:
2225         * WebCore.vcproj/WebCore.vcproj:
2226         * WebCore.vcxproj/WebCore.vcxproj:
2227         * WebCore.vcxproj/WebCore.vcxproj.filters:
2228         * WebCore.xcodeproj/project.pbxproj:
2229         * inspector/InspectorInstrumentation.cpp:
2230         (WebCore):
2231         (WebCore::InspectorInstrumentation::didReceiveWebSocketHandshakeResponseImpl):
2232         * inspector/InspectorInstrumentation.h:
2233         (InspectorInstrumentation):
2234         (WebCore::InspectorInstrumentation::didReceiveWebSocketHandshakeResponse):
2235         * inspector/InspectorResourceAgent.cpp:
2236         (WebCore::InspectorResourceAgent::didReceiveWebSocketHandshakeResponse):
2237         * inspector/InspectorResourceAgent.h:
2238         (WebCore):
2239         (InspectorResourceAgent):
2240
2241 2013-05-15  Eric Carlson  <eric.carlson@apple.com>
2242
2243         [Mac] media engine may deliver NULL in-band "cue"
2244         https://bugs.webkit.org/show_bug.cgi?id=116180
2245
2246         Reviewed by Jer Noble.
2247
2248         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
2249         (WebCore::InbandTextTrackPrivateAVF::processCue): NULL check before logging cue count.
2250
2251 2013-05-15  Darin Adler  <darin@apple.com>
2252
2253         List platforms that still use the legacy clipboard instead of just saying "not Mac"
2254         https://bugs.webkit.org/show_bug.cgi?id=116177
2255
2256         Reviewed by Andreas Kling.
2257
2258         * dom/Clipboard.h: Replaced the "!MAC || IOS" with a list of platforms still on the
2259         legacy model.
2260
2261 2013-05-15  Yongjun Zhang  <yongjun_zhang@apple.com>
2262
2263         We should clear mainResource in DocumentLoader::cancelMainResourceLoad.
2264         https://bugs.webkit.org/show_bug.cgi?id=116119
2265
2266         Reviewed by Oliver Hunt.
2267
2268         MainResourceLoader::clearResource() was left out in r146239 when moving MainResourceLoader::cancel()
2269         to DocumentLoader::cancelMainResourceLoad(), we need to add it back to make sure m_mainResource is
2270         cleared when we cancel the loader.
2271
2272         No new tests needed.
2273
2274         * loader/DocumentLoader.cpp:
2275         (WebCore::DocumentLoader::~DocumentLoader):
2276         (WebCore::DocumentLoader::continueAfterNavigationPolicy):
2277         (WebCore::DocumentLoader::cancelMainResourceLoad):
2278         (WebCore::DocumentLoader::clearMainResource):
2279         (WebCore):
2280         * loader/DocumentLoader.h: add helper method clearMainResource()
2281         (DocumentLoader):
2282
2283 2013-05-15  Joe Mason  <jmason@blackberry.com>
2284
2285         [BlackBerry] When HTTP auth fails, only purge credentials that match the failed credentials
2286         https://bugs.webkit.org/show_bug.cgi?id=116164
2287
2288         Reviewed by Rob Buis.
2289
2290         Internal PR: 338490
2291         Internally Reviewed By: Lyon Chen
2292
2293         When there are multiple HTTP requests in flight with the same bad credentials (common with
2294         proxy auth if the user mistyped their password), the first 407 that's received will cause
2295         the credentials to be purged and the password dialog to open for new credentials. This means
2296         that all 407's received after this should only purge the credentials if they have not
2297         already been updated from the dialog; otherwise they will be wiping out credentials that
2298         haven't failed yet.
2299
2300         * platform/network/blackberry/NetworkJob.cpp:
2301         (WebCore::NetworkJob::sendRequestWithCredentials):
2302         (WebCore::NetworkJob::purgeCredentials):
2303
2304 2013-05-15  Chris Fleizach  <cfleizach@apple.com>
2305
2306         AX: Use caching when requesting children object on iOS
2307         https://bugs.webkit.org/show_bug.cgi?id=116112
2308
2309         Reviewed by David Kilzer.
2310
2311         Building up the children list in the AX hierarchy can be time consuming. On iOS, this
2312         is now much more noticeable (I believe due to the way tables calculate their AX ignored flag).
2313
2314         We can speed everything up if we just cache the isIgnored() attribute while building up children.
2315
2316         * accessibility/AXObjectCache.cpp:
2317         (WebCore::AXAttributeCacheEnabler::AXAttributeCacheEnabler):
2318         (WebCore):
2319         (WebCore::AXAttributeCacheEnabler::~AXAttributeCacheEnabler):
2320         * accessibility/AXObjectCache.h:
2321         (AXAttributeCacheEnabler):
2322         (WebCore):
2323         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2324         (-[WebAccessibilityObjectWrapper accessibilityHitTest:]):
2325         (-[WebAccessibilityObjectWrapper accessibilityElementCount]):
2326         (-[WebAccessibilityObjectWrapper accessibilityElementAtIndex:]):
2327         (-[WebAccessibilityObjectWrapper indexOfAccessibilityElement:]):
2328         (-[WebAccessibilityObjectWrapper accessibilityContainer]):
2329
2330 2013-05-15  Anders Carlsson  <andersca@apple.com>
2331
2332         Remove WebSocketHandshakeRequest class
2333         https://bugs.webkit.org/show_bug.cgi?id=116178
2334
2335         Reviewed by Andreas Kling.
2336
2337         Turns out WebSocketHandshakeRequest is just used by the web inspector, and there's no reason 
2338         why we can't just use a ResourceRequest instead.
2339
2340         * CMakeLists.txt:
2341         * GNUmakefile.list.am:
2342         * Modules/websockets/WebSocketChannel.cpp:
2343         (WebCore::WebSocketChannel::didOpenSocketStream):
2344         * Modules/websockets/WebSocketHandshake.cpp:
2345         (WebCore::WebSocketHandshake::clientHandshakeRequest):
2346         * Modules/websockets/WebSocketHandshake.h:
2347         (WebCore):
2348         * Modules/websockets/WebSocketHandshakeRequest.cpp: Removed.
2349         * Modules/websockets/WebSocketHandshakeRequest.h: Removed.
2350         * Target.pri:
2351         * WebCore.vcproj/WebCore.vcproj:
2352         * WebCore.vcxproj/WebCore.vcxproj:
2353         * WebCore.vcxproj/WebCore.vcxproj.filters:
2354         * WebCore.xcodeproj/project.pbxproj:
2355         * inspector/InspectorInstrumentation.cpp:
2356         (WebCore):
2357         (WebCore::InspectorInstrumentation::willSendWebSocketHandshakeRequestImpl):
2358         * inspector/InspectorInstrumentation.h:
2359         (InspectorInstrumentation):
2360         (WebCore::InspectorInstrumentation::willSendWebSocketHandshakeRequest):
2361         * inspector/InspectorResourceAgent.cpp:
2362         (WebCore::InspectorResourceAgent::willSendWebSocketHandshakeRequest):
2363         * inspector/InspectorResourceAgent.h:
2364         (WebCore):
2365         (InspectorResourceAgent):
2366         * platform/network/HTTPRequest.cpp:
2367         (WebCore):
2368
2369 2013-05-15  Darin Adler  <darin@apple.com>
2370
2371         Try to fix iOS build.
2372
2373         * platform/Pasteboard.h: Fix #if so that we don't try to compile pasteboard name code
2374         on iOS.
2375
2376 2013-05-13  Anders Carlsson  <andersca@apple.com>
2377
2378         Frame::editor() should return a reference
2379         https://bugs.webkit.org/show_bug.cgi?id=116037
2380
2381         Reviewed by Darin Adler.
2382
2383         A frame's editor can never be null. Change Frame::editor() to return a reference to reflect this.
2384         Also, make Frame::m_editor a const member variable so nobody will accidentally set it to null.
2385
2386         * accessibility/AccessibilityObject.cpp:
2387         (WebCore::AccessibilityObject::hasMisspelling):
2388         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2389         (AXAttributeStringSetSpelling):
2390         * dom/ContainerNode.cpp:
2391         (WebCore::ContainerNode::cloneChildNodes):
2392         * dom/Document.cpp:
2393         (WebCore::acceptsEditingFocus):
2394         (WebCore::Document::setFocusedNode):
2395         (WebCore::command):
2396         * editing/AlternativeTextController.cpp:
2397         (WebCore::AlternativeTextController::timerFired):
2398         (WebCore::AlternativeTextController::applyDictationAlternative):
2399         * editing/CompositeEditCommand.cpp:
2400         (WebCore::EditCommandComposition::unapply):
2401         (WebCore::EditCommandComposition::reapply):
2402         (WebCore::CompositeEditCommand::apply):
2403         (WebCore::CompositeEditCommand::moveParagraphs):
2404         * editing/DeleteButton.cpp:
2405         (WebCore::DeleteButton::defaultEventHandler):
2406         * editing/DeleteButtonController.cpp:
2407         (WebCore::DeleteButtonController::show):
2408         * editing/DeleteButtonController.h:
2409         (WebCore::DeleteButtonControllerDisableScope::DeleteButtonControllerDisableScope):
2410         (WebCore::DeleteButtonControllerDisableScope::~DeleteButtonControllerDisableScope):
2411         * editing/DeleteSelectionCommand.cpp:
2412         (WebCore::DeleteSelectionCommand::mergeParagraphs):
2413         (WebCore::DeleteSelectionCommand::doApply):
2414         * editing/EditCommand.cpp:
2415         (WebCore::EditCommand::EditCommand):
2416         * editing/EditingStyle.cpp:
2417         (WebCore::StyleChange::StyleChange):
2418         * editing/Editor.cpp:
2419         (WebCore::Editor::markMisspellingsAfterTypingToWord):
2420         * editing/EditorCommand.cpp:
2421         (WebCore::applyCommandToFrame):
2422         (WebCore::executeToggleStyle):
2423         (WebCore::executeApplyParagraphStyle):
2424         (WebCore::expandSelectionToGranularity):
2425         (WebCore::stateStyle):
2426         (WebCore::valueStyle):
2427         (WebCore::executeCopy):
2428         (WebCore::executeCut):
2429         (WebCore::executeDefaultParagraphSeparator):
2430         (WebCore::executeDelete):
2431         (WebCore::executeDeleteBackward):
2432         (WebCore::executeDeleteBackwardByDecomposingPreviousCharacter):
2433         (WebCore::executeDeleteForward):
2434         (WebCore::executeDeleteToBeginningOfLine):
2435         (WebCore::executeDeleteToBeginningOfParagraph):
2436         (WebCore::executeDeleteToEndOfLine):
2437         (WebCore::executeDeleteToEndOfParagraph):
2438         (WebCore::executeDeleteToMark):
2439         (WebCore::executeDeleteWordBackward):
2440         (WebCore::executeDeleteWordForward):
2441         (WebCore::executeFindString):
2442         (WebCore::executeForwardDelete):
2443         (WebCore::executeIgnoreSpelling):
2444         (WebCore::executeInsertNewline):
2445         (WebCore::executeMakeTextWritingDirectionLeftToRight):
2446         (WebCore::executeMakeTextWritingDirectionNatural):
2447         (WebCore::executeMakeTextWritingDirectionRightToLeft):
2448         (WebCore::executeToggleOverwrite):
2449         (WebCore::executePaste):
2450         (WebCore::executePasteGlobalSelection):
2451         (WebCore::executePasteAndMatchStyle):
2452         (WebCore::executePasteAsPlainText):
2453         (WebCore::executeRedo):
2454         (WebCore::executeRemoveFormat):
2455         (WebCore::executeSelectToMark):
2456         (WebCore::executeSetMark):
2457         (WebCore::executeStyleWithCSS):
2458         (WebCore::executeUseCSS):
2459         (WebCore::executeSwapWithMark):
2460         (WebCore::executeTakeFindStringFromSelection):
2461         (WebCore::executeTranspose):
2462         (WebCore::executeUndo):
2463         (WebCore::executeYank):
2464         (WebCore::executeYankAndSelect):
2465         (WebCore::supportedCopyCut):
2466         (WebCore::supportedPaste):
2467         (WebCore::enabledVisibleSelection):
2468         (WebCore::enabledVisibleSelectionAndMark):
2469         (WebCore::enableCaretInEditableText):
2470         (WebCore::enabledCopy):
2471         (WebCore::enabledCut):
2472         (WebCore::enabledInEditableText):
2473         (WebCore::enabledDelete):
2474         (WebCore::enabledPaste):
2475         (WebCore::enabledRedo):
2476         (WebCore::enabledTakeFindStringFromSelection):
2477         (WebCore::enabledUndo):
2478         (WebCore::stateOrderedList):
2479         (WebCore::stateStyleWithCSS):
2480         (WebCore::stateUnorderedList):
2481         (WebCore::valueDefaultParagraphSeparator):
2482         * editing/FrameSelection.cpp:
2483         (WebCore::shouldAlwaysUseDirectionalSelection):
2484         (WebCore::FrameSelection::setSelection):
2485         (WebCore::FrameSelection::nextWordPositionForPlatform):
2486         (WebCore::FrameSelection::modifyMovingRight):
2487         (WebCore::FrameSelection::modifyMovingLeft):
2488         (WebCore::FrameSelection::modify):
2489         (WebCore::shouldStopBlinkingDueToTypingCommand):
2490         (WebCore::FrameSelection::shouldDeleteSelection):
2491         (WebCore::FrameSelection::shouldChangeSelection):
2492         * editing/InsertTextCommand.cpp:
2493         (WebCore::InsertTextCommand::doApply):
2494         * editing/SpellChecker.cpp:
2495         (WebCore::SpellChecker::didCheck):
2496         * editing/SpellingCorrectionCommand.cpp:
2497         * editing/TypingCommand.cpp:
2498         (WebCore::TypingCommand::insertText):
2499         (WebCore::TypingCommand::lastTypingCommandIfStillOpenForTyping):
2500         (WebCore::TypingCommand::markMisspellingsAfterTyping):
2501         (WebCore::TypingCommand::typingAddedToOpenCommand):
2502         (WebCore::TypingCommand::deleteKeyPressed):
2503         (WebCore::TypingCommand::forwardDeleteKeyPressed):
2504         * editing/htmlediting.cpp:
2505         (WebCore::createDefaultParagraphElement):
2506         * editing/mac/EditorMac.mm:
2507         (WebCore::Editor::pasteWithPasteboard):
2508         * editing/markup.cpp:
2509         (WebCore::createMarkup):
2510         * html/HTMLInputElement.cpp:
2511         (WebCore::HTMLInputElement::endEditing):
2512         * html/HTMLTextAreaElement.cpp:
2513         (WebCore::HTMLTextAreaElement::subtreeHasChanged):
2514         * html/TextFieldInputType.cpp:
2515         (WebCore::TextFieldInputType::handleKeydownEvent):
2516         (WebCore::TextFieldInputType::didSetValueByUserEdit):
2517         * loader/FrameLoader.cpp:
2518         (WebCore::FrameLoader::closeURL):
2519         (WebCore::FrameLoader::didOpenURL):
2520         (WebCore::FrameLoader::clear):
2521         * page/ContextMenuController.cpp:
2522         (WebCore::insertUnicodeCharacter):
2523         (WebCore::ContextMenuController::contextMenuItemSelected):
2524         (WebCore::ContextMenuController::populate):
2525         (WebCore::ContextMenuController::checkOrEnableIfNeeded):
2526         * page/DOMWindow.cpp:
2527         (WebCore::DOMWindow::find):
2528         * page/DragController.cpp:
2529         (WebCore::DragController::dispatchTextInputEventFor):
2530         (WebCore::DragController::concludeEditDrag):
2531         (WebCore::DragController::startDrag):
2532         * page/EventHandler.cpp:
2533         (WebCore::EventHandler::selectClosestWordFromMouseEvent):
2534         (WebCore::EventHandler::handleMousePressEventSingleClick):
2535         (WebCore::EventHandler::handlePasteGlobalSelection):
2536         (WebCore::EventHandler::sendContextMenuEvent):
2537         (WebCore::EventHandler::sendContextMenuEventForKey):
2538         (WebCore::EventHandler::keyEvent):
2539         (WebCore::EventHandler::defaultKeyboardEventHandler):
2540         (WebCore::EventHandler::defaultTextInputEventHandler):
2541         (WebCore::EventHandler::defaultBackspaceEventHandler):
2542         * page/FocusController.cpp:
2543         (WebCore::relinquishesEditingFocus):
2544         * page/Frame.cpp:
2545         (WebCore::Frame::rangeForPoint):
2546         * page/Frame.h:
2547         (Frame):
2548         (WebCore::Frame::editor):
2549         * page/Page.cpp:
2550         (WebCore::Page::findString):
2551         (WebCore::Page::findStringMatchingRanges):
2552         (WebCore::Page::rangeOfString):
2553         (WebCore::Page::markAllMatchesForText):
2554         (WebCore::Page::setDeviceScaleFactor):
2555         * platform/mac/ClipboardMac.mm:
2556         (WebCore::ClipboardMac::writeRange):
2557         * platform/mac/DragDataMac.mm:
2558         (WebCore::DragData::asURL):
2559         * platform/mac/PasteboardMac.mm:
2560         (WebCore::Pasteboard::getStringSelection):
2561         (WebCore::Pasteboard::getDataSelection):
2562         (WebCore::Pasteboard::writeSelectionForTypes):
2563         (WebCore::writeURLForTypes):
2564         (WebCore::Pasteboard::plainText):
2565         (WebCore::documentFragmentWithRTF):
2566         (WebCore::Pasteboard::documentFragment):
2567         * rendering/HitTestResult.cpp:
2568         (WebCore::HitTestResult::dictationAlternatives):
2569         * rendering/InlineTextBox.cpp:
2570         (WebCore::InlineTextBox::paint):
2571         (WebCore::InlineTextBox::paintTextMatchMarker):
2572         * rendering/RenderBlock.cpp:
2573         (WebCore::RenderBlock::positionForPointWithInlineChildren):
2574         * testing/Internals.cpp:
2575         (WebCore::spellchecker):
2576         (WebCore::Internals::resetToConsistentState):
2577         (WebCore::Internals::hasSpellingMarker):
2578         (WebCore::Internals::hasAutocorrectedMarker):
2579         (WebCore::Internals::setContinuousSpellCheckingEnabled):
2580         (WebCore::Internals::setAutomaticQuoteSubstitutionEnabled):
2581         (WebCore::Internals::setAutomaticLinkDetectionEnabled):
2582         (WebCore::Internals::setAutomaticDashSubstitutionEnabled):
2583         (WebCore::Internals::setAutomaticTextReplacementEnabled):
2584         (WebCore::Internals::setAutomaticSpellingCorrectionEnabled):
2585         (WebCore::Internals::isOverwriteModeEnabled):
2586         (WebCore::Internals::toggleOverwriteModeEnabled):
2587         (WebCore::Internals::hasGrammarMarker):
2588
2589 2013-05-15  Darin Adler  <darin@apple.com>
2590
2591         [Mac] Make Clipboard class no longer polymorphic by removing the last virtual functions
2592         https://bugs.webkit.org/show_bug.cgi?id=116166
2593
2594         Reviewed by Anders Carlsson.
2595
2596         * WebCore.exp.in: Add ~Clipboard since it's no longer a virtual function, but to the
2597         non-iOS section, since iOS is still using the legacy version of Clipboard.
2598
2599         * dom/Clipboard.h: Mark items non-virtual, too. It's not implemented on Mac yet.
2600
2601 2013-05-15  Dongseong Hwang  <dongseong.hwang@intel.com>
2602
2603         Remove an overloaded strokeRect in <canvas>
2604         https://bugs.webkit.org/show_bug.cgi?id=116017
2605
2606         Reviewed by Benjamin Poulain.
2607
2608         The canvas spec [1] does not define strokeRect with 5 arguments, so this issue
2609         remains only strokeRect with 4 arguments.
2610
2611         [1] http://www.w3.org/TR/2dcontext2/
2612
2613         Covered by existing tests: canvas/philip/tests/2d.missingargs.html
2614
2615         * html/canvas/CanvasRenderingContext2D.cpp:
2616         (WebCore::CanvasRenderingContext2D::strokeRect):
2617         * html/canvas/CanvasRenderingContext2D.h:
2618         (CanvasRenderingContext2D):
2619         * html/canvas/CanvasRenderingContext2D.idl:
2620
2621 2013-05-15  Bruno de Oliveira Abinader  <bruno.abinader@basyskom.com>
2622
2623         [css3-text] text-decoration-line now accepts "blink" as valid value
2624         https://bugs.webkit.org/show_bug.cgi?id=116104
2625
2626         Reviewed by Andreas Kling.
2627
2628         As of November 13th 2012, the W3C specification has been updated to
2629         accept "blink" as a valid property value in text-decoration-line. Though
2630         accepting the value as valid, it is ignored as CSS Level 1
2631         text-decoration property currently does.
2632
2633         Updated related layout tests to reflect changes in specification.
2634
2635         * css/CSSParser.cpp:
2636         (WebCore::CSSParser::parseValue):
2637         (WebCore::CSSParser::parseTextDecoration):
2638
2639 2013-05-14  Simon Fraser  <simon.fraser@apple.com>
2640
2641         Revert http://trac.webkit.org/changeset/150047
2642         
2643         It introduced unwanted behavioral differences between
2644         Retina and non-Retina Mac hardware.
2645
2646         * platform/graphics/ca/GraphicsLayerCA.cpp:
2647         (WebCore::GraphicsLayerCA::requiresTiledLayer):
2648         (WebCore::GraphicsLayerCA::computePixelAlignment):
2649
2650 2013-05-15  Darin Adler  <darin@apple.com>
2651
2652         [Mac] Remove the ClipboardMac class and header file
2653         https://bugs.webkit.org/show_bug.cgi?id=116165
2654
2655         Reviewed by Anders Carlsson.
2656
2657         * WebCore.xcodeproj/project.pbxproj: Remove ClipboardMac.h.
2658         * editing/mac/EditorMac.mm: Import Clipboard.h rather than ClipboardMac.h.
2659         * page/mac/EventHandlerMac.mm: Ditto.
2660         * platform/mac/ClipboardMac.h: Removed.
2661
2662         * platform/mac/ClipboardMac.mm: Import Clipboard.h rather than ClipboardMac.h.
2663         Deleted ClipboardMac constructor.
2664
2665 2013-05-15  Darin Adler  <darin@apple.com>
2666
2667         [Mac] Change Clipboard::create functions so they don't use ClipboardMac::create any more
2668         https://bugs.webkit.org/show_bug.cgi?id=116163
2669
2670         Reviewed by Anders Carlsson.
2671
2672         * dom/Clipboard.h: Made the file drag boolean default to false, better for most callers.
2673
2674         * platform/mac/ClipboardMac.mm: Remove #if ENABLE(DRAG_SUPPORT); that's always on for Mac
2675         and it's not helpful to have the conditionals in here. It's helpful in cross-platform
2676         source files.
2677         (WebCore::Clipboard::create): Create a Pasteboard and then create a Clipboard with new.
2678         Later could refactor to have the Pasteboard creation be platform-specific, and make these
2679         functions platform-independent.
2680         (WebCore::Clipboard::createForDragAndDrop): Ditto.
2681         (WebCore::Clipboard::createForCopyAndPaste): Ditto.
2682
2683 2013-05-15  Darin Adler  <darin@apple.com>
2684
2685         [Mac] Remove call to ClipboardMac::create from Editor::newGeneralClipboard
2686         https://bugs.webkit.org/show_bug.cgi?id=116162
2687
2688         Reviewed by Andreas Kling.
2689
2690         * dom/Clipboard.h: Add createForCopyAndPaste function.
2691
2692         * editing/mac/EditorMac.mm:
2693         (WebCore::Editor::newGeneralClipboard): Call createForCopyAndPaste.
2694
2695         * platform/mac/ClipboardMac.mm:
2696         (WebCore::Clipboard::createForCopyAndPaste): Added. Moved code here from
2697         Editor::newGeneralClipboard.
2698
2699 2013-05-15  Darin Adler  <darin@apple.com>
2700
2701         [Mac] Remove call to ClipboardMac::create from EventHandler::createDraggingClipboard
2702         https://bugs.webkit.org/show_bug.cgi?id=116161
2703
2704         Reviewed by Andreas Kling.
2705
2706         * dom/Clipboard.h: Added createForDragAndDrop function.
2707
2708         * page/mac/EventHandlerMac.mm:
2709         (WebCore::EventHandler::createDraggingClipboard): Changed to use new Clipboard function
2710         instead of ClipboardMac::create.
2711
2712         * platform/mac/ClipboardMac.mm:
2713         (WebCore::Clipboard::createForDragAndDrop): Added. For now it does exactly what the
2714         EventHandler::createDraggingClipboard function did, soon to be refactored better.
2715
2716 2013-05-15  Darin Adler  <darin@apple.com>
2717
2718         [Mac] Thin out the ClipboardMac class and header file to prepare for deleting them
2719         https://bugs.webkit.org/show_bug.cgi?id=116159
2720
2721         Reviewed by Andreas Kling.
2722
2723         * dom/Clipboard.h:
2724         (WebCore::Clipboard::pasteboard): Added. For clients that have a DOM clipboard
2725         object and need to get to the Pasteboard platform abstraction.
2726
2727         * editing/Editor.cpp:
2728         (WebCore::Editor::dispatchCPPEvent): Call writePasteboard instead of writeClipboard.
2729         Our long term plan is to delete writeClipboard.
2730
2731         * platform/Pasteboard.h: Added writePasteboard function.
2732         (WebCore::Pasteboard::name): Made this const.
2733
2734         * platform/mac/ClipboardMac.h: Deleted unneeded includes and forward declarations.
2735         Deleted all the data members and the virtual destructor.
2736
2737         * platform/mac/ClipboardMac.mm: Deleted the many includes that are no longer needed.
2738         Deleted the destructor, since it's now automatically generated. Deleted the comment
2739         on an #endif since it's only a few source lines away from the #if.
2740         (WebCore::ClipboardMac::ClipboardMac): Deleted the code to set the data members,
2741         since they are no longer used.
2742
2743         * platform/mac/PasteboardMac.mm: Changed include to Clipboard.h instead of ClipboardMac.h.
2744         (WebCore::Pasteboard::writePasteboard): Replaced writeClipboard with this.
2745
2746 2013-05-15  Seokju Kwon  <seokju.kwon@gmail.com>
2747
2748         Web Inspector: Get rid of addNativeSnapshotChunk and HeapSnapshotChunk from Memory domain
2749         https://bugs.webkit.org/show_bug.cgi?id=116144
2750
2751         Reviewed by Timothy Hatcher.
2752
2753         No new tests, no behavior change.
2754
2755         * inspector/Inspector.json:
2756
2757 2013-05-15  Jocelyn Turcotte  <jocelyn.turcotte@digia.com>
2758
2759         [Qt] Fix a crash under ~PingLoader when the QNAM on the page has been destroyed.
2760         https://bugs.webkit.org/show_bug.cgi?id=116035
2761
2762         Reviewed by Allan Sandfeld Jensen.
2763
2764         The previous fix only moved the crash location from WebKit down to QNetworkReplyHttpImpl
2765         which expects its QNetworkAccessManager to still be alive.
2766
2767         Fix it by watching the QNetworkReply's destroyed() signal and avoid the dangling pointer
2768         instead. The QNetworkReply doesn't need to be aborted in this case anyway.
2769
2770         * platform/network/qt/QNetworkReplyHandler.cpp:
2771         (WebCore::QNetworkReplyWrapper::QNetworkReplyWrapper):
2772         (WebCore::QNetworkReplyWrapper::release):
2773         (WebCore::QNetworkReplyWrapper::stopForwarding):
2774           Rename resetConnections to stopForwarding since not all connections are related
2775           to data forwarding to the client anymore.
2776         (WebCore::QNetworkReplyWrapper::receiveMetaData):
2777         (WebCore::QNetworkReplyWrapper::replyDestroyed):
2778         (WebCore::QNetworkReplyWrapper::didReceiveFinished):
2779         * platform/network/qt/QNetworkReplyHandler.h:
2780         (QNetworkReplyWrapper):
2781
2782 2013-05-15  Darin Adler  <darin@apple.com>
2783
2784         [Mac] Make Clipboard::declareAndWriteDragImage non-virtual
2785         https://bugs.webkit.org/show_bug.cgi?id=116156
2786
2787         Reviewed by Anders Carlsson.
2788
2789         * dom/Clipboard.h: Make declareAndWriteDragImage non-virtual for non-legacy.
2790
2791         * platform/Pasteboard.h:
2792         (WebCore::Pasteboard::name): Added. Can be used in Mac platform code to do
2793         pasteboard operations directly instead of through the Pasteboard class
2794         functions. Not sure if we'll need it long term or not.
2795
2796         * platform/mac/ClipboardMac.h: Removed declareAndWriteDragImage function.
2797
2798         * platform/mac/ClipboardMac.mm:
2799         (WebCore::Clipboard::declareAndWriteDragImage): Made this function a Clipboard
2800         member instead of ClipboardMac.
2801
2802 2013-05-15  Peter Gal  <galpeter@inf.u-szeged.hu>
2803
2804         [curl] Remove version #if guards
2805         https://bugs.webkit.org/show_bug.cgi?id=116152
2806
2807         Reviewed by Brent Fulgham.
2808
2809         No tests required.
2810
2811         * platform/network/curl/ResourceHandleCurl.cpp:
2812         (WebCore::ResourceHandle::platformSetDefersLoading): Removed version guard.
2813         * platform/network/curl/ResourceHandleManager.cpp:
2814         (WebCore::writeCallback): Ditto.
2815         (WebCore::headerCallback): Ditto.
2816         (WebCore::readCallback): Ditto.
2817         (WebCore::ResourceHandleManager::dispatchSynchronousJob): Ditto.
2818         (WebCore::ResourceHandleManager::initializeHandle): Ditto.
2819
2820 2013-05-15  David Kilzer  <ddkilzer@apple.com>
2821
2822         BUILD FIX (r150089): Make WebCoreTestShim build for iOS
2823
2824         * Configurations/WebCoreTestShim.xcconfig: Exclude
2825         WebCoreTestShimLibrary.cpp when building for iOS.
2826
2827 2013-05-15  Radu Stavila  <stavila@adobe.com>
2828
2829         [CSSRegions] Implement offsetParent for elements inside named flow
2830         https://bugs.webkit.org/show_bug.cgi?id=113276
2831
2832         In the offsetParent algorithm, the nearest ancestor search skips from the topmost named flow elements directly to the body element.
2833         http://dev.w3.org/csswg/css-regions/#cssomview-offset-attributes
2834
2835         As a result of this change, the DumpRenderTree tool would crash in 
2836         WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent when running the selecting-text-through-different-region-flows.html
2837         test. The RenderObjects inside a flow are attached to the RenderFlowThread. However, the RenderFlowThread is attached to the 
2838         RenderView directly, meaning that we are going to bypass the <body>'s RenderObject while iterating the parents.
2839
2840         Reviewed by Darin Adler.
2841
2842         Tests: fast/regions/offsetParent-body-in-flow-thread.html
2843                fast/regions/offsetParent-in-flow-thread.html
2844
2845         * rendering/RenderBoxModelObject.cpp:
2846         (WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent):
2847         * rendering/RenderObject.cpp:
2848         (WebCore::RenderObject::offsetParent):
2849
2850 2013-05-15  Darin Adler  <darin@apple.com>
2851
2852         [Mac] Make Clipboard::createDragImage non-virtual
2853         https://bugs.webkit.org/show_bug.cgi?id=116136
2854
2855         Reviewed by Benjamin Poulain.
2856
2857         * dom/Clipboard.h: Made createDragImage non-virtual for non-legacy.
2858
2859         * platform/mac/ClipboardMac.h: Removed frame argument from create function
2860         and constructor. Removed createDragImage and dragNSImage. Removed m_frame
2861         data member.
2862
2863         * platform/mac/ClipboardMac.mm:
2864         (WebCore::ClipboardMac::ClipboardMac): Removed frame argument and code
2865         to initialize m_frame.
2866         (WebCore::Clipboard::createDragImage): Merged the createDragImage and
2867         dragNSImage functions, since they were the same thing. Changed code to get
2868         the frame from the drag image element. Made the createDragImage function
2869         a Clipboard member instead of ClipboardMac.
2870
2871 2013-05-15  Patrick Gansterer  <paroga@webkit.org>
2872
2873         [WINCE] Fix calls to GlyphPage::setGlyphDataForIndex()
2874         https://bugs.webkit.org/show_bug.cgi?id=116137
2875
2876         Reviewed by Andreas Kling.
2877
2878         Use zero for the glyp when the fontData pointer is null.
2879         This aligns GlyphPageTreeNodeWinCE with the other implementations
2880         and makes all ASSERT() pass in setGlyphDataForIndex().
2881
2882         * platform/graphics/wince/GlyphPageTreeNodeWinCE.cpp:
2883         (WebCore::GlyphPage::fill):
2884
2885 2013-05-15  Benjamin Poulain  <bpoulain@apple.com>
2886
2887         Do not bloat HTMLTokenizer with a giant inline InputStreamPreprocessor::peek
2888         https://bugs.webkit.org/show_bug.cgi?id=116066
2889
2890         Reviewed by Ryosuke Niwa.
2891
2892         Merge https://chromium.googlesource.com/chromium/blink/+/45e0337b2f2db535ab08365f6e763a5015e4d990.
2893
2894         On x86_64, this removes 40kb from the binary. On my machine it is completely neutral on performance.
2895
2896         * html/parser/InputStreamPreprocessor.h:
2897         (WebCore::InputStreamPreprocessor::peek):
2898         (InputStreamPreprocessor):
2899         (WebCore::InputStreamPreprocessor::advance):
2900         (WebCore::InputStreamPreprocessor::skipNextNewLine):
2901         (WebCore::InputStreamPreprocessor::reset):
2902         (WebCore::InputStreamPreprocessor::processNextInputCharacter):
2903
2904 2013-05-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2905
2906         Remove WTF_USE_PLATFORM_STRATEGIES
2907         https://bugs.webkit.org/show_bug.cgi?id=114431
2908
2909         Reviewed by Darin Adler.
2910
2911         * Modules/webdatabase/DatabaseManager.cpp:
2912         (WebCore::DatabaseManager::DatabaseManager):
2913         * dom/ContainerNode.cpp:
2914         (WebCore::ContainerNode::suspendPostAttachCallbacks):
2915         (WebCore::ContainerNode::resumePostAttachCallbacks):
2916         * dom/VisitedLinkState.cpp:
2917         (WebCore::VisitedLinkState::determineLinkStateSlowCase):
2918         * loader/CookieJar.cpp:
2919         (WebCore::cookies):
2920         (WebCore::setCookies):
2921         (WebCore::cookiesEnabled):
2922         (WebCore::cookieRequestHeaderFieldValue):
2923         (WebCore::getRawCookies):
2924         (WebCore::deleteCookie):
2925         * loader/FrameLoader.cpp:
2926         (WebCore::FrameLoader::loadResourceSynchronously):
2927         * loader/HistoryController.cpp:
2928         (WebCore::addVisitedLink):
2929         * loader/LoaderStrategy.cpp:
2930         * loader/LoaderStrategy.h:
2931         * loader/ResourceLoadScheduler.cpp:
2932         (WebCore::resourceLoadScheduler):
2933         * loader/ResourceLoader.cpp:
2934         (WebCore::ResourceLoader::releaseResources):
2935         (WebCore::ResourceLoader::willSendRequest):
2936         * loader/cache/CachedResource.cpp:
2937         (WebCore::CachedResource::load):
2938         * loader/cache/CachedResourceLoader.cpp:
2939         (WebCore::CachedResourceLoader::performPostLoadActions):
2940         * platform/CookiesStrategy.h:
2941         * platform/DatabaseStrategy.cpp:
2942         * platform/DatabaseStrategy.h:
2943         * platform/PasteboardStrategy.h:
2944         * platform/PlatformStrategies.cpp:
2945         * platform/PlatformStrategies.h:
2946         * platform/VisitedLinkStrategy.h:
2947         * platform/mac/PasteboardMac.mm:
2948         * platform/network/BlobRegistry.cpp:
2949         (WebCore::blobRegistry):
2950         * plugins/PluginData.cpp:
2951         (WebCore::PluginData::initPlugins):
2952         * plugins/PluginStrategy.h:
2953         * storage/StorageNamespace.cpp:
2954         (WebCore::StorageNamespace::localStorageNamespace):
2955         (WebCore::StorageNamespace::transientLocalStorageNamespace):
2956         (WebCore::StorageNamespace::sessionStorageNamespace):
2957         * storage/StorageStrategy.cpp:
2958         * storage/StorageStrategy.h:
2959         * workers/SharedWorkerStrategy.h:
2960
2961 2013-05-15  Dávid Szabolcs  <David.Szabolcs@stud.u-szeged.hu>
2962
2963         [curl] Add support for HttpOnly cookies
2964         https://bugs.webkit.org/show_bug.cgi?id=116102
2965
2966         Reviewed by Brent Fulgham.
2967
2968         * platform/network/curl/CookieJarCurl.cpp:
2969         (WebCore::addMatchingCurlCookie):
2970         (WebCore::cookiesForSession):
2971         (WebCore::cookiesForDOM):
2972         (WebCore):
2973         (WebCore::cookieRequestHeaderFieldValue):
2974
2975 2013-05-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2976
2977         REGRESSION(r147548): Broken comboboxes
2978         https://bugs.webkit.org/show_bug.cgi?id=115475
2979
2980         Reviewed by Gustavo Noronha Silva.
2981
2982         The problem is that r147548 made the popup to be closed when a
2983         blur event is received. Right before showing the popup the input
2984         element is focused, so that after the the popup is shown the focus
2985         event is emitted and the event handler is called again hiding the
2986         popup.
2987
2988         * html/HTMLSelectElement.cpp:
2989         (WebCore::HTMLSelectElement::menuListDefaultEventHandler): Check
2990         element has lost the focus before closing the popup menu.
2991
2992 2013-05-14  Darin Adler  <darin@apple.com>
2993
2994         [Mac] Move setDragImage from ClipboardMac to PasteboardMac
2995         https://bugs.webkit.org/show_bug.cgi?id=116036
2996
2997         Reviewed by Anders Carlsson.
2998
2999         * dom/Clipboard.cpp:
3000         (WebCore::Clipboard::~Clipboard): Stop loading the drag image when
3001         the clipboard object is deallocated. It would be better if there was
3002         a more-well-defined time to stop the load.
3003         (WebCore::Clipboard::setDragImage): Added. Sets up a drag image
3004         based on a CachedImage. This tells the image loader to load the image
3005         and updates the drag image when the image arrives. Copied from the
3006         code in ClipboardMac, but refactored to use a separate loader object.
3007         (WebCore::Clipboard::setDragImageElement): Added. Sets up a drag image
3008         based on an element.
3009         (WebCore::Clipboard::updateDragImage): Added. Common code to update
3010         drag image when a new one is set or when a drag image load completes.
3011         (WebCore::DragImageLoader::create): Added.
3012         (WebCore::DragImageLoader::DragImageLoader): Ditto.
3013         (WebCore::DragImageLoader::startLoading): Ditto.
3014         (WebCore::DragImageLoader::stopLoading): Ditto.
3015         (WebCore::DragImageLoader::imageChanged): Ditto.
3016
3017         * dom/Clipboard.h: Made setDragImage and setDragImageElement non-virtual
3018         for non-legacy. Added updateDragImage and m_dragImageLoader.
3019
3020         * platform/Pasteboard.h: Added setDragImage function.
3021
3022         * platform/mac/ClipboardMac.h: Removed CachedImageClient as a base class
3023         for ClipboardMac. Removed setDragImage and setDragImageElement.
3024
3025         * platform/mac/ClipboardMac.mm: Removed setDragImage and setDragImageElement.
3026         (WebCore::ClipboardMac::~ClipboardMac): Removed code to remove self as
3027         client loading the drag image. This is now in the Clipboard base class.
3028
3029         * platform/mac/PasteboardMac.mm:
3030         (WebCore::Pasteboard::setDragImage): Added. Contains code moved here
3031         from ClipboardMac.
3032
3033 2013-05-14  Ryosuke Niwa  <rniwa@webkit.org>
3034
3035         Use ElementTraversal in SelectorDataList::execute
3036         https://bugs.webkit.org/show_bug.cgi?id=116131
3037
3038         Reviewed by Darin Adler.
3039
3040         Use ElementTraversal::firstWithin and ElementTraversal::next to simplify the code.
3041
3042         * dom/SelectorQuery.cpp:
3043         (WebCore::SelectorDataList::execute):
3044
3045 2013-05-14  Tim Horton  <timothy_horton@apple.com>
3046
3047         [wk2] Not updating tiled backing coverage when main frame scrollability changes
3048         https://bugs.webkit.org/show_bug.cgi?id=116123
3049         <rdar://problem/13836559>
3050
3051         Reviewed by Simon Fraser.
3052
3053         Export FrameView::adjustTiledBackingCoverage.
3054
3055         * WebCore.exp.in:
3056
3057 2013-05-14  Alexey Proskuryakov  <ap@apple.com>
3058
3059         [Mac] Add a testing shim for secure event input functions
3060         https://bugs.webkit.org/show_bug.cgi?id=116122
3061
3062         Reviewed by Mark Rowe.
3063
3064         Added a new target with a dynamic library that interposes secure event input functions.
3065         We need this to avoid interfering with user session state.
3066
3067         * Configurations/WebCoreTestShim.xcconfig: Added.
3068         * WebCore.xcodeproj/project.pbxproj:
3069         * platform/mac/DynamicLinkerInterposing.h: Moved from Source/WebKit2/Shared/mac/DyldInterpose.h.
3070         * testing/WebCoreTestShimLibrary.cpp: Added.
3071         (shimEnableSecureEventInput):
3072         (shimDisableSecureEventInput):
3073         (shimIsSecureEventInputEnabled):
3074
3075 2013-05-14  Benjamin Poulain  <bpoulain@apple.com>
3076
3077         Get rid of Gradient::getColor()
3078         https://bugs.webkit.org/show_bug.cgi?id=116089
3079
3080         Reviewed by Andreas Kling.
3081
3082         This code is now useless, remove it.
3083
3084         * html/canvas/CanvasGradient.h:
3085         (CanvasGradient):
3086         * platform/graphics/Gradient.cpp:
3087         (WebCore::Gradient::Gradient):
3088         (WebCore::Gradient::hash):
3089         * platform/graphics/Gradient.h:
3090         (Gradient):
3091
3092 2013-05-14  David Hyatt  <hyatt@apple.com>
3093
3094         REGRESSION: united.com has overlapping elements and is broken by flex box changes.
3095         https://bugs.webkit.org/show_bug.cgi?id=115329
3096         <rdar://problem/13690610>
3097         
3098         The new flexbox spec says that flex-basis omitted in the flex shorthand defaults to
3099         0 when flex-grow/shrink are set. This has undesirable behavior when objects don't
3100         end up flexing at all, and it's something the spec is going to eventually address.
3101         
3102         For now, though, to fix the regression, I'm making a targeted "hack" to deliberately
3103         violate the spec, but to do so as minimally as possible. This hack detects if there
3104         is infinite available space on a line, and if so, it treats a flex-basis of 0 like
3105         auto.
3106         
3107         This means that when height is constrained and set by a container, flexing will do
3108         the right thing. Basically any time you end up actually flexing, the spec behavior
3109         should happen. If you're just laying out at intrinsic sizes, though, and no flexing
3110         is going to occur, we ignore a flex-basis of 0 and just use the child's normal size.
3111         
3112         Note that widths don't have to be patched because the preferred logical widths
3113         algorithm is broken right now and not checking flex-basis. If it did, we'd have seen
3114         the same bug in the width direction.
3115         
3116         This width issue is covered by https://bugs.webkit.org/show_bug.cgi?id=116117
3117         
3118         Reviewed by Simon Fraser.
3119
3120         Added fast/flexbox/auto-height-with-flex.html
3121
3122         * rendering/RenderFlexibleBox.cpp:
3123         (WebCore::RenderFlexibleBox::mainAxisContentExtent):
3124         Make sure we return LayoutUnit::max when you have infinite free space and not
3125         max - borderPadding.
3126
3127         (WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild):
3128         Only clear override size if it was set. Only mark for relayout if we did
3129         an override size clear (i.e., if we were actually flexed). Add a new parameter,
3130         hasInfiniteLineLength, that - if set - causes us to special case flex-basis:0
3131         and treat it like flex-basis:auto.
3132
3133         (WebCore::RenderFlexibleBox::layoutFlexItems):
3134         Define hasInfiniteLineLength and pass it to all the functions that need it.
3135
3136         (WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes):
3137         Remove the code that marks for layout and does a layout so early. This code
3138         is moving (and changing) to preferredMainAxisContentExtentForChild.
3139
3140         (WebCore::RenderFlexibleBox::computeNextFlexLine):
3141         Computes whether or not we have infinite line length now.
3142
3143         (WebCore::RenderFlexibleBox::freezeViolations):
3144         (WebCore::RenderFlexibleBox::resolveFlexibleLengths):
3145         Propagate hasInfiniteLineLength through to preferredMainAxisContentExtentForChild.
3146
3147         * rendering/RenderFlexibleBox.h:
3148         (RenderFlexibleBox):
3149         Add hasInfiniteLineLength parameter to a bunch of functions.
3150
3151 2013-05-14  Andreas Kling  <akling@apple.com>
3152
3153         Assertion failure in GlyphPage::setGlyphDataForIndex: (!glyph || fontData == m_fontDataForAllGlyphs)
3154         <http://webkit.org/b/116113>
3155         <rdar://problem/13833790>
3156
3157         Reviewed by Dan Bernstein.
3158
3159         If we're filling a full GlyphPage with a SimpleFontData that is actually a composite font reference,
3160         we need to make sure we have per-glyph font data pointers, since it may end up using them.
3161
3162         Added GlyphPage::mayUseMixedFontDataWhenFilling() which can be implemented by the platform to let
3163         GlyphPageTreeNode know that it should allocate a full-sized GlyphPage for mixed font data pointers
3164         in case the font is a composite font reference, or if there are CJK ideographs in the text.
3165
3166         This code can be made smarter, but that's outside the scope of this change.
3167         Fixes heavy asserting on bots running unreleased software.
3168
3169         * platform/graphics/GlyphPage.h:
3170         (GlyphPage):
3171         (WebCore::GlyphPage::mayUseMixedFontDataWhenFilling):
3172         * platform/graphics/GlyphPageTreeNode.cpp:
3173         (WebCore::GlyphPageTreeNode::initializePage):
3174         * platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
3175         (WebCore::shouldUseCoreText):
3176         (WebCore::GlyphPage::mayUseMixedFontDataWhenFilling):
3177
3178 2013-05-14  Bem Jones-Bey  <bjonesbe@adobe.com>
3179
3180         Heap-use-after-free in WebCore::RenderBox::exclusionShapeOutsideInfo
3181         https://bugs.webkit.org/show_bug.cgi?id=115566
3182
3183         Reviewed by David Hyatt.
3184
3185         When a portion of the render tree is being detached, anonymous blocks
3186         will be combined as their children are deleted. In this process, the
3187         anonymous block later in the tree is merged into the one preceeding it.
3188         It can happen that the later block contains floats that the previous
3189         block did not contain, and thus are not in the floating objects list for
3190         the new block. This can result in the new block containing floats that
3191         are not in it's floating objects list, but are in the floating objects
3192         lists of siblings and parents. This can cause problems when the float
3193         itself is deleted, since the deletion code assumes that if a float is not
3194         in it's containing block's floating objects list, it isn't in any
3195         floating objects list, causing dangling pointers in the floating objects
3196         lists of the siblings and parents. In order to preserve this condition
3197         (removing it has serious performance implications), we need to copy the
3198         floating objects from the old block to the new block.  The float's
3199         metrics will likely all be wrong, but since the new block is already
3200         marked for layout, this will get fixed before anything gets displayed.
3201
3202         Test: fast/block/float/float-append-child-crash.html
3203
3204         * rendering/RenderBlock.cpp:
3205         (WebCore::RenderBlock::moveAllChildrenIncludingFloatsTo): Copy
3206             floating objects list in addition to children.
3207         (WebCore::RenderBlock::FloatingObject::clone): Added.
3208         (WebCore::RenderBlock::removeChild): Use new method to copy children.
3209         * rendering/RenderBlock.h:
3210         (RenderBlock): Add method.
3211
3212 2013-05-14  Commit Queue  <commit-queue@webkit.org>
3213
3214         Unreviewed, rolling out r150023.
3215         http://trac.webkit.org/changeset/150023
3216         https://bugs.webkit.org/show_bug.cgi?id=116120
3217
3218         Causes table layout issues (Bug 116118) and crashes on
3219         buildbot waterfall pages. (Requested by ddkilzer on #webkit).
3220
3221         * rendering/RenderTableSection.cpp:
3222         (WebCore::RenderTableSection::calcRowLogicalHeight):
3223         * rendering/RenderTableSection.h:
3224         (RenderTableSection):
3225
3226 2013-05-14  Antoine Quint  <graouts@apple.com>
3227
3228         Snapshotted plug-ins shadow tree should reset style inheritance
3229         https://bugs.webkit.org/show_bug.cgi?id=116098
3230
3231         Reset the styles such that only injected user-agent stylesheets affect
3232         the rendering of snapshotted plug-ins' shadow content.
3233
3234         Reviewed by Darin Adler.
3235
3236         * html/HTMLPlugInImageElement.cpp:
3237         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
3238
3239 2013-05-14  Mihnea Ovidenie  <mihnea@adobe.com>
3240
3241         [CSSRegions] Improve hit testing for empty regions
3242         https://bugs.webkit.org/show_bug.cgi?id=115534
3243
3244         Reviewed by David Hyatt.
3245
3246         As a better follow up after WebKit bug https://bugs.webkit.org/show_bug.cgi?id=107752,
3247         we can improve the code by not doing hit testing on the render flow thread object when
3248         we are trying to hit test the render flow thread background. In this case, we should just bail out.
3249         No new tests, covered by existing regions tests.
3250
3251         * rendering/RenderFlowThread.cpp:
3252         (WebCore::RenderFlowThread::nodeAtPoint):
3253         (WebCore):
3254         (WebCore::RenderFlowThread::hitTestFlowThreadPortionInRegion):
3255         * rendering/RenderFlowThread.h:
3256
3257 2013-05-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3258
3259         [BlackBerry] Handle network errors when starting a new job
3260         https://bugs.webkit.org/show_bug.cgi?id=116101
3261
3262         Reviewed by Rob Buis.
3263
3264         Make startJob() return a network status that can be used by the
3265         caller to create a network error.
3266
3267         * platform/network/blackberry/NetworkJob.cpp:
3268         (WebCore::NetworkJob::initialize): createNetworkStream() should
3269         always return a valid pointer so use an ASSERT instead of an early
3270         return to make sure we have a valid stream.
3271         (WebCore::NetworkJob::startNewJobWithRequest): Only return true if
3272         the network job was started successfully.
3273         * platform/network/blackberry/NetworkJob.h:
3274         (NetworkJob): Make initialize method void instead of bool since it
3275         can't fail.
3276         * platform/network/blackberry/NetworkManager.cpp:
3277         (WebCore::NetworkManager::startJob): Return a network error or
3278         StatusSuccess.
3279         * platform/network/blackberry/NetworkManager.h:
3280         (NetworkManager):
3281         * platform/network/blackberry/ResourceHandleBlackBerry.cpp:
3282         (WebCore::ResourceHandle::start): Return true if job was started
3283         successfully.
3284         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
3285         Check return value of startJob and fill the ResourceError with the
3286         network status returned to finish the load.
3287
3288 2013-05-14  Antoine Quint  <graouts@apple.com>
3289
3290         [Mac] captions menu is not positioned correctly in full-screen
3291         https://bugs.webkit.org/show_bug.cgi?id=116103
3292
3293         Update the positioning properties of the captions menu in full-screen
3294         following the fix for https://webkit.org/b/115968.
3295
3296         Reviewed by Darin Adler.
3297
3298         * css/fullscreenQuickTime.css:
3299         (video:-webkit-full-screen::-webkit-media-controls-closed-captions-container):
3300         Add 50px to the bottom position since we're now positioned relative to the
3301         media element, and use a calc() command to be right-aligned to the captions
3302         icon in the media controller. The max-width and max-height properties follow
3303         the same technique used for the non-full-screen mode.
3304
3305 2013-05-14  Zan Dobersek  <zdobersek@igalia.com>
3306
3307         [GTK] Move generated ColorData.cpp, WebKitFontFamilyNames.(cpp|h) build targets into libPlatform
3308         https://bugs.webkit.org/show_bug.cgi?id=115921
3309
3310         Reviewed by Gustavo Noronha Silva.
3311
3312         No new tests - no new functionality.
3313
3314         * GNUmakefile.am: Add platform_cppflags to the list of CPPFLAGS for libWebCoreSVG, libWebCore,
3315         libWebCorePlatform, libWebCoreGtk. Remove generation rules for ColorData.cpp and WebKitFontFamilyNames.(cpp|h).
3316         * GNUmakefile.list.am: Include the ColorData.cpp and WebKitFontFamilyNames.(cpp|h) build targers under
3317         platform_built_sources.
3318         * bindings/gobject/GNUmakefile.am: Add platform_cppflags to the list of libWebCoreDOM CPPFLAGS.
3319
3320 2013-05-14  Zan Dobersek  <zdobersek@igalia.com>
3321
3322         [GTK] libPlatform, libPlatformGtk must depend on the related GNUmakefiles
3323         https://bugs.webkit.org/show_bug.cgi?id=115937
3324
3325         Reviewed by Martin Robinson.
3326
3327         No new tests - no new functionality.
3328
3329         * GNUmakefile.am: Fix typos in two libraries' names - Webcore -> WebCore.
3330
3331 2013-05-13  Ryosuke Niwa  <rniwa@webkit.org>
3332
3333         Removing Attr can delete a wrong Attribute in ElementData
3334         https://bugs.webkit.org/show_bug.cgi?id=116077
3335
3336         Reviewed by Benjamin Poulain.
3337         
3338         Merge https://chromium.googlesource.com/chromium/blink/+/e861452a292e185501e48940305947aa6a4e23c2
3339         after simplifying and renaming functions to be more WebKit style.
3340
3341         The XML parser can produce elements with attributes whose names have
3342         distinct prefixes, but the same expanded name. When one of these
3343         attributes is put up for adoption, it may be its similarly named
3344         sibling that is removed from its owner element. As a result the
3345         original owner hangs onto the adopted attribute, despite the fact that
3346         it is now in a different document. Sometimes it's just hard to let go.
3347
3348         Test: fast/dom/adopt-attribute-crash.svg
3349
3350         * dom/Element.cpp:
3351         (WebCore::Element::setAttributeNode):
3352         (WebCore::Element::removeAttributeNode):
3353         (WebCore::ElementData::getAttributeItemIndex):
3354         * dom/Element.h:
3355         (ElementData):
3356         (Element):
3357
3358 2013-05-14  Antti Koivisto  <antti@apple.com>
3359
3360         Remove ::-webkit-distributed()
3361         https://bugs.webkit.org/show_bug.cgi?id=116106
3362
3363         Reviewed by Andreas Kling.
3364
3365         This experimental Shadow DOM selector code is unused and has no owner.
3366
3367         * css/CSSGrammar.y.in:
3368         * css/CSSParser.cpp:
3369         (WebCore::CSSParser::rewriteSpecifiersWithNamespaceIfNeeded):
3370         (WebCore::CSSParser::rewriteSpecifiersWithElementName):
3371         * css/CSSParser.h:
3372         * css/CSSParserValues.cpp:
3373         (WebCore::CSSParserSelector::CSSParserSelector):
3374         * css/CSSParserValues.h:
3375         (CSSParserSelector):
3376         * css/CSSSelector.cpp:
3377         (WebCore::CSSSelector::pseudoId):
3378         (WebCore::nameToPseudoTypeMap):
3379         (WebCore::CSSSelector::selectorText):
3380         * css/CSSSelector.h:
3381         * css/CSSSelectorList.cpp:
3382         * css/CSSSelectorList.h:
3383         (CSSSelectorList):
3384         * css/DocumentRuleSets.cpp:
3385         (WebCore::DocumentRuleSets::resetAuthorStyle):
3386         * css/DocumentRuleSets.h:
3387         (DocumentRuleSets):
3388         * css/ElementRuleCollector.cpp:
3389         (WebCore::ElementRuleCollector::matchAuthorRules):
3390         * css/ElementRuleCollector.h:
3391         (ElementRuleCollector):
3392         * css/RuleSet.cpp:
3393         (WebCore::RuleSet::addChildRules):
3394         * css/SelectorChecker.cpp:
3395         (WebCore::SelectorChecker::match):
3396         * css/SelectorFilter.cpp:
3397         (WebCore::SelectorFilter::collectIdentifierHashes):
3398         * html/shadow/InsertionPoint.cpp:
3399         * html/shadow/InsertionPoint.h:
3400
3401 2013-05-14  Daker Fernandes Pinheiro  <daker.pinheiro@openbossa.org>
3402
3403         Remove RenderTheme::supportsCalendarPicker
3404         https://bugs.webkit.org/show_bug.cgi?id=116068
3405
3406         Reviewed by Benjamin Poulain.
3407
3408         No new tests needed because it doesn't affect behaviour.
3409
3410         This method was never overrided by any platform
3411         and always leaded to the same behaviour.
3412         The code which depended on it was also removed.
3413
3414         * html/BaseMultipleFieldsDateAndTimeInputType.cpp:
3415         (WebCore::BaseMultipleFieldsDateAndTimeInputType::createShadowSubtree):
3416         (WebCore::BaseMultipleFieldsDateAndTimeInputType::updatePickerIndicatorVisibility):
3417         * html/BaseMultipleFieldsDateAndTimeInputType.h:
3418         (BaseMultipleFieldsDateAndTimeInputType):
3419         * page/ChromeClient.h:
3420         (ChromeClient):
3421         * rendering/RenderTheme.h:
3422
3423 2013-04-30  Balazs Kelemen  <b.kelemen@sisa.samsung.com>
3424
3425         [GStreamer] cannot seek after video finished
3426         https://bugs.webkit.org/show_bug.cgi?id=114044
3427
3428         Reviewed by Philippe Normand.
3429
3430         Test: media/video-seek-after-end.html
3431
3432         Reland without wrong assertion. If seek is called after didEnd the pipeline
3433         state will not be in GST_STATE_NULL yet but it is not a problem because we handle that.
3434
3435         Rework the seeking logic to be able to seek after reseting the pipeline.
3436         In addition to solve the actual problem this patch supposed to make seeking
3437         more robust and correct.
3438         The previous implementation tried to hide the complexity of asynchronous operations
3439         on the pipeline. It did not handle the GST_MESSAGE_ASYNC_DONE message from the bus
3440         but instead reported the seek as finished when it saw an asynchronous pending state
3441         (GST_STATE_CHANGE_ASYNC) which could happen way before the seek is really done.
3442         Now we pay attention to the GST_MESSAGE_ASYNC_DONE message to track the status of seeks.
3443         Seeks are not the only operations executed asynchronously, changing the pipeling state is
3444         similar. It means a seek can overlap with onother ongoing asynchronous operation.
3445         This change address this by introducing an invariant for seeks, which is that we only request
3446         a seek if there are no other ongoing asynchronous operations and the pipeline state is either
3447         paused or playing (which is recommended anyway according to GStreamer's documentation).
3448         This way we can be sure that the time when we get the next GST_MESSAGE_ASYNC_DONE message the
3449         seek has been completed.
3450
3451         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3452         (WebCore::toGstClockTime): Factored time conversation into a helper.
3453         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
3454
3455         (WebCore::MediaPlayerPrivateGStreamer::playbackPosition): The position might not be available
3456         if the pipeline still has a pending state. As a workaround, if we are right after a seek we can
3457         use the seek time. Avoiding this situation would be possible by not allowing any asynchronous
3458         operation to overlap. I believe it would add a lot more complexity so I decided to rather introduce
3459         this workaround. Otherwise those overlapping operations are handled fine by GStreamer.
3460
3461         (WebCore::MediaPlayerPrivateGStreamer::prepareToPlay): Do not reset internal state variables.
3462         This function called when there is an intent to restart playback but it does not actually restart it.
3463         (WebCore::MediaPlayerPrivateGStreamer::currentTime): Just removed a staling newline.
3464         (WebCore::MediaPlayerPrivateGStreamer::seek): Take a look to the pipeline state and act upon that.
3465         If there is an ongoing asynchronous operation make the seek pending, otherwise do it now.
3466         Now we handle overlapping seeks as well because I saw that it can happen in some tests.
3467         Added an early return for live streams as it doesn't makes sense to try seeking in them.
3468
3469         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Handle GST_MESSAGE_ASYNC_DONE and some refactoring.
3470         (WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone):
3471         (WebCore::MediaPlayerPrivateGStreamer::updateStates): Only handle seeks in the pending case, the rest is
3472         now handled in asyncStateChangeDone.
3473         (WebCore::MediaPlayerPrivateGStreamer::cacheDuration): Do not reset the m_mediaDurationKnown if the pipeline
3474         has an asynchronous pending state because it would fail. It does actually happen when we get a duration message
3475         after restarting the pipeline and it would result in restarting playback from the start. It seems to be a bug
3476         in GStreamer that it sends the duration message too early. Also sanitized this function by merging redundant branches.
3477         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3478         (MediaPlayerPrivateGStreamer):
3479
3480 2013-05-14  Zalan Bujtas  <zalan@apple.com>
3481
3482         Ellipsis text is placed to wrong position, when the truncated text is fully cut off in RTL direction.
3483         https://bugs.webkit.org/show_bug.cgi?id=115858
3484
3485         Reviewed by Darin Adler.
3486
3487         Take text direction into account to calculate ellipsis position in case of
3488         full truncation.
3489
3490         Test: fast/css/text-overflow-ellipsis-full-truncate-rtl.html
3491
3492         * rendering/InlineTextBox.cpp:
3493         (WebCore::InlineTextBox::placeEllipsisBox):
3494
3495 2013-05-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3496
3497         [BlackBerry] Implement platform strategies
3498         https://bugs.webkit.org/show_bug.cgi?id=112162
3499
3500         Reviewed by Rob Buis.
3501
3502         This is just a refactoring, covered by existing tests.
3503
3504         * CMakeLists.txt: Move PlatformStrategies.cpp from platform
3505         specific makefiles to the global one now that all platforms using
3506         cmake implement platform strategies.
3507         * PlatformBlackBerry.cmake:
3508         * PlatformEfl.cmake:
3509         * PlatformWinCE.cmake:
3510         * loader/CookieJar.cpp: Remove the preprocessor error that is not
3511         needed anymore.
3512         * loader/blackberry/CookieJarBlackBerry.cpp: Removed.
3513         * platform/network/blackberry/CookieJarBlackBerry.cpp: Added.
3514         (WebCore):
3515         (WebCore::setCookiesFromDOM):
3516         (WebCore::cookiesForDOM):
3517         (WebCore::cookieRequestHeaderFieldValue):
3518         (WebCore::cookiesEnabled):
3519         (WebCore::getRawCookies):
3520         (WebCore::deleteCookie):
3521         (WebCore::getHostnamesWithCookies):
3522         (WebCore::deleteCookiesForHostname):
3523         (WebCore::deleteAllCookies):
3524         * plugins/blackberry/PluginDataBlackBerry.cpp: Removed.
3525
3526 2013-05-14  Jocelyn Turcotte  <jocelyn.turcotte@digia.com>
3527
3528         [Qt] Fix a crash under ~PingLoader when the QNAM on the page has been destroyed.
3529         https://bugs.webkit.org/show_bug.cgi?id=116035
3530
3531         Reviewed by Simon Hausmann.
3532
3533         Reproduced with arora which does destroy the QNetworkAccessManager in some situations.
3534         The problem is that PingLoader can still be pending meanwhile, holding a ResourceHandle
3535         with a dangling pointer to a QNetworkReply destroyed with the QNetworkAccessManager.
3536
3537         * platform/network/qt/QNetworkReplyHandler.cpp:
3538         (WebCore::QNetworkReplyWrapper::QNetworkReplyWrapper):
3539           Set the parent to 0 like we did before the introduction of QNetworkReplyWrapper.
3540         (WebCore::QNetworkReplyWrapper::release):
3541
3542 2013-05-13  Eric Carlson  <eric.carlson@apple.com>
3543
3544         [Mac] update in-band caption attributes
3545         https://bugs.webkit.org/show_bug.cgi?id=116057
3546
3547         Reviewed by Dean Jackson.
3548
3549         * html/track/InbandTextTrack.cpp:
3550         (WebCore::InbandTextTrack::updateCueFromCueData): Copy highlight color.
3551
3552         * html/track/TextTrackCueGeneric.cpp:
3553         (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties): "highlight" color sets the cue
3554             background, "background" color sets the cue container background.
3555         * html/track/TextTrackCueGeneric.h:
3556
3557         * platform/graphics/InbandTextTrackPrivateClient.h:
3558
3559         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
3560         (WebCore::InbandTextTrackPrivateAVF::processCueAttributes): Process "highlight" color.
3561
3562 2013-05-13  David Kilzer  <ddkilzer@apple.com>
3563
3564         BUILD FIX (r150049): Fix RetainPtr<> type in PasteboardIOS.mm
3565
3566         * platform/ios/PasteboardIOS.mm:
3567         (WebCore::Pasteboard::writeImage): Use RetainPtr<CFStringRef>
3568         instead of RetainPtr<NSString>.
3569
3570 2013-05-13  Benjamin Poulain  <bpoulain@apple.com>
3571
3572         Remove platform/graphic's Generator
3573         https://bugs.webkit.org/show_bug.cgi?id=116084
3574
3575         Reviewed by Darin Adler.
3576
3577         The Generator no longer abstract anything useful, its only
3578         implementation is Gradient.
3579
3580         * GNUmakefile.list.am:
3581         * WebCore.exp.in:
3582         * WebCore.vcproj/WebCore.vcproj:
3583         * WebCore.vcxproj/WebCore.vcxproj:
3584         * WebCore.vcxproj/WebCore.vcxproj.filters:
3585         * WebCore.xcodeproj/project.pbxproj:
3586         * platform/graphics/GeneratedImage.h:
3587         * platform/graphics/Generator.h: Removed.
3588         * platform/graphics/GeneratorGeneratedImage.cpp:
3589         (WebCore::GeneratorGeneratedImage::draw):
3590         (WebCore::GeneratorGeneratedImage::drawPattern):
3591         * platform/graphics/GeneratorGeneratedImage.h:
3592         (WebCore::GeneratorGeneratedImage::create):
3593         (WebCore::GeneratorGeneratedImage::GeneratorGeneratedImage):
3594         (GeneratorGeneratedImage):
3595         * platform/graphics/Gradient.h:
3596         (WebCore):
3597         (Gradient):
3598         * platform/graphics/GraphicsContext.cpp:
3599         (WebCore::GraphicsContext::fillRect):
3600         * platform/graphics/GraphicsContext.h:
3601         (WebCore):
3602         (GraphicsContext):
3603
3604 2013-05-13  David Kilzer  <ddkilzer@apple.com>
3605
3606         Upstream iOS Clipboard and Pasteboard changes
3607         <http://webkit.org/b/116062>
3608
3609         Reviewed by Darin Adler.
3610
3611         * WebCore.xcodeproj/project.pbxproj:
3612         * dom/Clipboard.h:
3613         * platform/Pasteboard.h:
3614         * platform/ios/ClipboardIOS.h: Added.
3615         * platform/ios/ClipboardIOS.mm: Added.
3616         * platform/ios/PasteboardIOS.mm: Added.
3617
3618 2013-05-13  Huang Dongsung  <luxtella@company100.net>
3619
3620         [Mac] Use pageScaleFactor * deviceScaleFactor in requiresTiledLayer() and computePixelAlignment() of GraphicsLayerCA.
3621         https://bugs.webkit.org/show_bug.cgi?id=107359
3622
3623         Reviewed by Darin Adler.
3624
3625         Currently GraphicsLayerCA uses pageScaleFactor in requiresTiledLayer() and
3626         computePixelAlignment(), but we must use pageScaleFactor * deviceScaleFactor in
3627         them.
3628         It is because:
3629         1. requiresTiledLayer() uses the scale to compute an actual layer size in the device
3630         pixel unit.
3631         2. computePixelAlignment() uses the scale to compute an aligned layer position
3632         in the device pixel unit.
3633
3634         No new tests. We can not test about requiresTiledLayer() because it depends on
3635         gpu. computePixelAlignment() is correct now because fortunately Mac uses
3636         only 2 (for retina display) as a deviceScaleFactor.
3637
3638         * platform/graphics/ca/GraphicsLayerCA.cpp:
3639         (WebCore::GraphicsLayerCA::requiresTiledLayer):
3640         (WebCore::GraphicsLayerCA::computePixelAlignment):
3641
3642 2013-05-13  Christophe Dumez  <ch.dumez@sisa.samsung.com>
3643
3644         Rename BarInfo to BarProp and remove [NoInterfaceObject]
3645         https://bugs.webkit.org/show_bug.cgi?id=116027
3646
3647         Reviewed by Andreas Kling.
3648
3649         Rename BarInfo to BarProp and remove [NoInterfaceObject] extended attribute from
3650         the IDL interface to match the specification:
3651         http://www.w3.org/html/wg/drafts/html/master/browsers.html#barprop
3652
3653         The new behavior also matches Firefox and Blink.
3654
3655         No new tests, covered by LayoutTests/fast/js/global-constructors-attributes.html.
3656
3657         * CMakeLists.txt:
3658         * DerivedSources.cpp:
3659         * DerivedSources.make:
3660         * DerivedSources.pri:
3661         * GNUmakefile.list.am:
3662         * Target.pri:
3663         * WebCore.order:
3664         * WebCore.vcproj/WebCore.vcproj:
3665         * WebCore.vcxproj/WebCore.vcxproj:
3666         * WebCore.vcxproj/WebCore.vcxproj.filters:
3667         * WebCore.xcodeproj/project.pbxproj:
3668         * bindings/gobject/GNUmakefile.am:
3669         * page/BarProp.cpp: Renamed from Source/WebCore/page/BarInfo.cpp.
3670         * page/BarProp.h: Renamed from Source/WebCore/page/BarInfo.h.
3671         * page/BarProp.idl: Renamed from Source/WebCore/page/BarInfo.idl.
3672         * page/DOMWindow.cpp:
3673         * page/DOMWindow.h:
3674         * page/DOMWindow.idl:
3675
3676 2013-05-13  Anders Carlsson  <andersca@apple.com>
3677
3678         Remove ChromeClient::willPopupMenu
3679         https://bugs.webkit.org/show_bug.cgi?id=116063
3680
3681         Reviewed by Andreas Kling.
3682
3683         Remove ChromeClient::willPopupMenu.
3684
3685         * page/ChromeClient.h:
3686
3687 2013-05-13  Beth Dakin  <bdakin@apple.com>
3688
3689         Headers and footers should be pinned to the left edge of the window when scrolling 
3690         horizontally
3691         https://bugs.webkit.org/show_bug.cgi?id=116061
3692         -and corresponding-
3693         <rdar://problem/13599215>
3694
3695         Reviewed by Simon Fraser.
3696
3697         The scrolling thread will need to know about the header and footer layers in order 
3698         the implement this custom scrolling behavior. 
3699
3700         These getters will fetch the header or footer layer from the FrameView as 
3701         appropriate.
3702         * page/scrolling/ScrollingCoordinator.cpp:
3703         (WebCore::ScrollingCoordinator::headerLayerForFrameView):
3704         (WebCore::ScrollingCoordinator::footerLayerForFrameView):
3705         * page/scrolling/ScrollingCoordinator.h:
3706
3707         When we’re scrolling on the main thread, adjust the position of the header and 
3708         footer layers here.
3709         (WebCore::ScrollingCoordinator::updateMainFrameScrollPosition):
3710
3711         ScrollingStateScrollingNode now stores GraphicsLayers and PlatformLayers for the 
3712         header and footer, just like it already does for the counterScrollingLayer.
3713         * page/scrolling/ScrollingStateScrollingNode.cpp:
3714         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
3715         * page/scrolling/ScrollingStateScrollingNode.h:
3716         (ScrollingStateScrollingNode):
3717         (WebCore::ScrollingStateScrollingNode::headerLayer):
3718         (WebCore::ScrollingStateScrollingNode::footerLayer):
3719
3720         Setters for the new layers.
3721         * page/scrolling/mac/ScrollingCoordinatorMac.h:
3722         (ScrollingCoordinatorMac):
3723         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
3724         (WebCore::ScrollingCoordinatorMac::frameViewRootLayerDidChange):
3725         (WebCore::ScrollingCoordinatorMac::setHeaderLayerForNode):
3726         (WebCore::ScrollingCoordinatorMac::setFooterLayerForNode):
3727
3728         These setters and getters mirror the existing one for counterScrollingLayer.
3729         * page/scrolling/mac/ScrollingStateScrollingNodeMac.mm:
3730         (WebCore::ScrollingStateScrollingNode::headerPlatformLayer):
3731         (WebCore::ScrollingStateScrollingNode::setHeaderLayer):
3732         (WebCore::ScrollingStateScrollingNode::footerPlatformLayer):
3733         (WebCore::ScrollingStateScrollingNode::setFooterLayer):
3734
3735         And the ScrollingTree will store CALayers for the header and footer.
3736         * page/scrolling/mac/ScrollingTreeScrollingNodeMac.h:
3737         (ScrollingTreeScrollingNodeMac):
3738         * page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
3739         (WebCore::ScrollingTreeScrollingNodeMac::updateBeforeChildren):
3740
3741         This is where the magic happens when we are scrolling on the scrolling thread. 
3742         Adjust the horizontal position the behave like a fixed object, but keep the 
3743         vertical position what it was when layer was created.
3744         (WebCore::ScrollingTreeScrollingNodeMac::setScrollLayerPosition):
3745
3746         RenderLayerCompositor must now provide getters for the header and footer.
3747         * rendering/RenderLayerCompositor.h:
3748         * rendering/RenderLayerCompositor.cpp:
3749         (WebCore::RenderLayerCompositor::headerLayer):
3750         (WebCore::RenderLayerCompositor::footerLayer):
3751
3752         Set the anchor point for when we adjust the position later on. Also call 
3753         frameViewRootLayerDidChange() to get the new layers picked up and sent to the 
3754         scrolling tree.
3755         (WebCore::RenderLayerCompositor::updateLayerForHeader):
3756         (WebCore::RenderLayerCompositor::updateLayerForFooter):
3757
3758 2013-05-12  Timothy Hatcher  <timothy@apple.com>
3759
3760         Add support for updating the Web Inspector toolbar height.
3761
3762         https://bugs.webkit.org/show_bug.cgi?id=115996
3763
3764         Reviewed by Joseph Pecoraro and Benjamin Poulain.
3765
3766         * inspector/InspectorFrontendClient.h:
3767         (InspectorFrontendClient):
3768         * inspector/InspectorFrontendHost.cpp:
3769         (WebCore::InspectorFrontendHost::setToolbarHeight):
3770         * inspector/InspectorFrontendHost.h:
3771         (InspectorFrontendHost):
3772         * inspector/InspectorFrontendHost.idl:
3773         * testing/Internals.cpp:
3774
3775 2013-05-13  Dean Jackson  <dino@apple.com>
3776
3777         toDataURL can return an empty image in some cases
3778         https://bugs.webkit.org/show_bug.cgi?id=115981
3779         <rdar://problem/13760256>
3780
3781         Reviewed by Darin Adler.
3782
3783         In some accelerated rendering cases, calling toDataURL on
3784         an off-screen canvas produced an empty image. The solution
3785         was to force a CGContextFlush before extracting the data
3786         for image generation.
3787
3788         While here, I collected the flushing code from other methods
3789         into a single place. Also we were getting into a situation where
3790         we called flush two times in a row.
3791
3792         Test: fast/canvas/toDataURL-not-empty.html
3793
3794         * platform/graphics/ImageBuffer.h:
3795         (ImageBuffer): Define two new methods flushContext and flushContextIfNecessary.
3796         * platform/graphics/cg/ImageBufferCG.cpp:
3797         (WebCore::ImageBuffer::context): Call flushContextIfNecessary.
3798         (WebCore::ImageBuffer::flushContextIfNecessary): Moved the 10.7 code in here.
3799         (WebCore::ImageBuffer::flushContext): Calls CGContextFlush.
3800         (WebCore::ImageBuffer::getUnmultipliedImageData): Call new helper.
3801         (WebCore::ImageBuffer::getPremultipliedImageData): Call new helper.
3802         (WebCore::ImageBuffer::toDataURL): Flush the CG context.
3803
3804 2013-05-13  David Hyatt  <hyatt@apple.com>
3805
3806         Regressions in flexbox layout caused by the flexing optimizations.
3807         https://bugs.webkit.org/show_bug.cgi?id=116058
3808         <rdar://problem/13863647>
3809         
3810         Reviewed by Beth Dakin.
3811
3812         Roll out the flex-related changes from r149597 so that the layout
3813         algorithm goes back to the way it was. Leave the repainting optimizations
3814         in place though.
3815
3816         * rendering/RenderDeprecatedFlexibleBox.cpp:
3817         (WebCore::gatherFlexChildrenInfo):
3818         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
3819         (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
3820
3821 2013-05-13  Philippe Normand  <pnormand@igalia.com>
3822
3823         Unreviewed, rolling out r150014.
3824         http://trac.webkit.org/changeset/150014
3825         https://bugs.webkit.org/show_bug.cgi?id=86410
3826
3827         Broke video playback on WK2 and some webgl tests
3828
3829         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3830         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
3831         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
3832         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
3833         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3834         (MediaPlayerPrivateGStreamerBase):
3835
3836 2013-05-13  Christophe Dumez  <ch.dumez@sisa.samsung.com>
3837
3838         Unreviewed, rolling out r150022.
3839         http://trac.webkit.org/changeset/150022
3840         https://bugs.webkit.org/show_bug.cgi?id=114044
3841
3842         Causes assertions in media tests
3843
3844         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3845         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
3846         (WebCore::MediaPlayerPrivateGStreamer::playbackPosition):
3847         (WebCore::MediaPlayerPrivateGStreamer::prepareToPlay):
3848         (WebCore::MediaPlayerPrivateGStreamer::currentTime):
3849         (WebCore::MediaPlayerPrivateGStreamer::seek):
3850         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
3851         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3852         (MediaPlayerPrivateGStreamer):
3853
3854 2013-05-13  Bem Jones-Bey  <bjonesbe@adobe.com>
3855
3856         Floats should not overhang from flex items
3857         https://bugs.webkit.org/show_bug.cgi?id=115925
3858
3859         Reviewed by David Hyatt.
3860
3861         Allowing floats to overhand from flex items is not only against the
3862         spec, it causes bad bugs. Fix this by having flex items properly avoid
3863         floats.
3864
3865         Test: fast/block/float/float-not-removed-crash2.html
3866
3867         * rendering/RenderBox.cpp:
3868         (WebCore::RenderBox::avoidsFloats): Add flex items to avoid floats.
3869         * rendering/RenderBox.h:
3870         (WebCore::RenderBox::isFlexItemIncludingDeprecated): Determine if the current box is a
3871             flex item or deprecated flex item.
3872
3873 2013-05-13  Zoltan Horvath  <zoltan@webkit.org>
3874
3875         [CSS Regions][CSS Exclusions] Shape-inside on regions should respect region borders and paddings
3876         https://bugs.webkit.org/show_bug.cgi?id=115456
3877
3878         Reviewed by David Hyatt.
3879
3880         I refactored the computation logic of shape-inside on regions by removing access to RenderFlowThread from ExclusionShapeInfo's logicalTopOffset
3881         function, this means all the logic is now existing in RenderBlockLineLayout.cpp. By modifying the logicalTopOffset it turned out that the borders
3882         and padding hadn't worked correctly, since borders and paddings were counted twice in the shape-inside's computation. This patch adds the necessary
3883         modifications to let it respect the borders and padding in the correct way. I created 2 new helper functions to prevent increasing the code size of
3884         the layoutRunsAndFloatsInRange function.
3885
3886         I introduced 7 new tests to test for testing the correct behavior.
3887
3888         Tests: fast/regions/shape-inside/shape-inside-on-first-region-block-content.html
3889                fast/regions/shape-inside/shape-inside-on-first-region-inline-content.html
3890                fast/regions/shape-inside/shape-inside-on-second-region-block-content.html
3891                fast/regions/shape-inside/shape-inside-on-second-region-inline-content.html
3892                fast/regions/shape-inside/shape-inside-on-regions-inline-content.html
3893                fast/regions/shape-inside/shape-inside-with-region-borders.html
3894                fast/regions/shape-inside/shape-inside-with-region-padding.html
3895
3896         * rendering/ExclusionShapeInfo.cpp:
3897         (WebCore): Remove FlowThread logic from logicalTopOffset move definition to header.
3898         * rendering/ExclusionShapeInfo.h:
3899         (WebCore::ExclusionShapeInfo::logicalTopOffset): Moved from cpp.
3900         (WebCore::ExclusionShapeInfo::logicalLeftOffset): Add condition for RenderRegions. 
3901         * rendering/RenderBlock.h:
3902         (RenderBlock): Add definition to the new helper members.
3903         * rendering/RenderBlockLineLayout.cpp:
3904         (WebCore::RenderBlock::layoutExclusionShapeInsideInfo): Modified the flow thread case to return the appropriate region.
3905         (WebCore::RenderBlock::updateLineBoundariesForExclusions): Added new helper function. Modify the shape-inside on regions
3906         line boundaries and position computation logic.
3907         (WebCore::RenderBlock::adjustLogicalLineTopAndLogicalHeightIfNeeded): Added new helper function which handles the flow thread case also.
3908         (WebCore::RenderBlock::layoutRunsAndFloatsInRange): Modified the code to use the helper functions.
3909
3910 2013-05-13  Bear Travis  <betravis@adobe.com>
3911
3912         [css exclusions] Enable CSS Exclusions by default when CSS_EXCLUSIONS is set
3913         https://bugs.webkit.org/show_bug.cgi?id=115919
3914
3915         Reviewed by Dean Jackson.
3916
3917         Change the RuntimeEnabledFeatures::isCSSExclusionsEnabled boolean to default
3918         to true. CSS Exclusions can still be enabled / disabled in platforms by
3919         setting the CSS_EXCLUSIONS compile flag in one of the FeatureDefine files.
3920
3921         Test: fast/exclusions/css-exclusions-enabled.html
3922
3923         * bindings/generic/RuntimeEnabledFeatures.cpp:
3924         (WebCore):
3925
3926 2013-05-13  Suchit Agrawal  <a.suchit@samsung.com>
3927
3928         Cell heights are disproportional when a row-spanning cell contains a block element that determines the height of the rows
3929         https://bugs.webkit.org/show_bug.cgi?id=52185
3930
3931         Reviewed by David Hyatt.
3932
3933         Cells heights are not proper when rowspan cell have its own height and rowspan height
3934         is more than the height of the rows present in rowspan.
3935
3936         After calculating logical height of the rows in the table, we are recalculating the height
3937         of the rows present in rowspan. Based on the ratio of row's logical height, we are
3938         distributing rowspan cell height in rows.
3939
3940         Test: fast/table/table-rowspan-height-distribution-in-rows.html
3941
3942         * rendering/RenderTableSection.cpp:
3943         (WebCore):
3944
3945         Update the logical height of the rows based on rowspan cell height.
3946         (WebCore::RenderTableSection::distributeRowSpanHeightToRows):
3947
3948         It calculates logical height of the rows in the table.
3949         (WebCore::RenderTableSection::calcRowLogicalHeight):
3950
3951         Added new private API to distribute rowSpan cell height in rows.
3952         * rendering/RenderTableSection.h:
3953         (RenderTableSection):
3954
3955 2013-04-30  Balazs Kelemen  <b.kelemen@sisa.samsung.com>
3956
3957         [GStreamer] cannot seek after video finished
3958         https://bugs.webkit.org/show_bug.cgi?id=114044
3959
3960         Reviewed by Philippe Normand.
3961
3962         Test: media/video-seek-after-end.html
3963
3964         Rework the seeking logic to be able to seek after reseting the pipeline.
3965         In addition to solve the actual problem this patch supposed to make seeking
3966         more robust and correct.
3967         The previous implementation tried to hide the complexity of asynchronous operations
3968         on the pipeline. It did not handle the GST_MESSAGE_ASYNC_DONE message from the bus
3969         but instead reported the seek as finished when it saw an asynchronous pending state
3970         (GST_STATE_CHANGE_ASYNC) which could happen way before the seek is really done.
3971         Now we pay attention to the GST_MESSAGE_ASYNC_DONE message to track the status of seeks.
3972         Seeks are not the only operations executed asynchronously, changing the pipeling state is
3973         similar. It means a seek can overlap with onother ongoing asynchronous operation.
3974         This change address this by introducing an invariant for seeks, which is that we only request
3975         a seek if there are no other ongoing asynchronous operations and the pipeline state is either
3976         paused or playing (which is recommended anyway according to GStreamer's documentation).
3977         This way we can be sure that the time when we get the next GST_MESSAGE_ASYNC_DONE message the
3978         seek has been completed.
3979
3980         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3981         (WebCore::toGstClockTime): Factored time conversation into a helper.
3982         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
3983
3984         (WebCore::MediaPlayerPrivateGStreamer::playbackPosition): The position might not be available
3985         if the pipeline still has a pending state. As a workaround, if we are right after a seek we can
3986         use the seek time. Avoiding this situation would be possible by not allowing any asynchronous
3987         operation to overlap. I believe it would add a lot more complexity so I decided to rather introduce
3988         this workaround. Otherwise those overlapping operations are handled fine by GStreamer.
3989
3990         (WebCore::MediaPlayerPrivateGStreamer::prepareToPlay): Do not reset internal state variables.
3991         This function called when there is an intent to restart playback but it does not actually restart it.
3992         (WebCore::MediaPlayerPrivateGStreamer::currentTime): Just removed a staling newline.
3993         (WebCore::MediaPlayerPrivateGStreamer::seek): Take a look to the pipeline state and act upon that.
3994         If there is an ongoing asynchronous operation make the seek pending, otherwise do it now.
3995         Now we handle overlapping seeks as well because I saw that it can happen in some tests.
3996         Added an early return for live streams as it doesn't makes sense to try seeking in them.
3997
3998         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Handle GST_MESSAGE_ASYNC_DONE and some refactoring.
3999         (WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone):
4000         (WebCore::MediaPlayerPrivateGStreamer::updateStates): Only handle seeks in the pending case, the rest is
4001         now handled in asyncStateChangeDone.
4002         (WebCore::MediaPlayerPrivateGStreamer::cacheDuration): Do not reset the m_mediaDurationKnown if the pipeline
4003         has an asynchronous pending state because it would fail. It does actually happen when we get a duration message
4004         after restarting the pipeline and it would result in restarting playback from the start. It seems to be a bug
4005         in GStreamer that it sends the duration message too early. Also sanitized this function by merging redundant branches.
4006         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
4007         (MediaPlayerPrivateGStreamer):
4008
4009 2013-05-12  Darin Adler  <darin@apple.com>
4010
4011         [Mac] Move writeRange/PlainText/URL from ClipboardMac to PasteboardMac
4012         https://bugs.webkit.org/show_bug.cgi?id=116009
4013
4014         Reviewed by Andreas Kling.
4015
4016         * dom/Clipboard.cpp:
4017         (WebCore::Clipboard::writeRange): Added. Moved from ClipboardMac,
4018         but added some FIXMEs.
4019         (WebCore::Clipboard::writePlainText): Ditto.
4020         (WebCore::Clipboard::writeURL): Ditto.
4021
4022         * dom/Clipboard.h: Made writeURL, writeRange, and writePlainText
4023         non-virtual in non-legacy clipboard implementations.
4024
4025         * platform/mac/ClipboardMac.h: Removed writeRange, writeURL, and
4026         writePlainText.
4027         * platform/mac/ClipboardMac.mm: Ditto.
4028
4029 2013-05-13  Noam Rosenthal  <noam@webkit.org>
4030
4031         [CoordGfx] requestAnimationFrame performance issues
4032         https://bugs.webkit.org/show_bug.cgi?id=112345
4033
4034         Reviewed by Jocelyn Turcotte.
4035
4036         Removed current requestAnimationFrame logic from CoordinatedGraphics. The new logic
4037         is entirely in WebKit2 CoordinatedLayerTreeHost.
4038
4039         Covered by existing tests in fast/animations.
4040
4041         * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:
4042         (WebCore::CoordinatedGraphicsScene::CoordinatedGraphicsScene):
4043         (WebCore::CoordinatedGraphicsScene::paintToCurrentGLContext):
4044         * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h:
4045         (CoordinatedGraphicsScene):
4046
4047 2013-05-13  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
4048
4049         [texmap][GStreamer] Composited Video support
4050         https://bugs.webkit.org/show_bug.cgi?id=86410
4051