Windows build fix after r154658.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2013-08-26  Ryosuke Niwa  <rniwa@webkit.org>
2
3         Windows build fix after r154658.
4
5         * page/AutoscrollController.cpp:
6         (WebCore::getMainFrame):
7
8 2013-08-26  Andreas Kling  <akling@apple.com>
9
10         Page::mainFrame() should return a reference.
11         <http://webkit.org/b/119677>
12
13         Reviewed by Antti Koivisto.
14
15         Page always creates the main Frame by itself now, so it will never be null during the Page's lifetime.
16
17         Let Page::mainFrame() return Frame& and remove a sea of null checks.
18
19 2013-08-26  Sam Weinig  <sam@webkit.org>
20
21         Remove two unnecessary .get()s.
22
23         Reviewed by Anders Carlsson.
24
25         * editing/Editor.h:
26         (WebCore::Editor::killRing):
27         (WebCore::Editor::spellChecker):
28
29 2013-08-26  Joseph Pecoraro  <pecoraro@apple.com>
30
31         Web Inspector: We should regenerate InspectorBackendCommands.js for Legacy Inspector.json versions
32         https://bugs.webkit.org/show_bug.cgi?id=120242
33
34         Reviewed by Timothy Hatcher.
35
36         - Update the Inspector.json CodeGenerator to include an output_js_dir.
37         - Cleanup multiple trailing newlines in some of the generated files.
38         - Provide a way to not verify runtime casts, needed for Legacy inputs.
39
40         * CMakeLists.txt:
41         * DerivedSources.make:
42         * DerivedSources.pri:
43         * GNUmakefile.am:
44         * inspector/CodeGeneratorInspector.py:
45         (resolve_all_types):
46         (SmartOutput.close):
47
48 2013-08-26  Sam Weinig  <sam@webkit.org>
49
50         AlternativeTextController should hold onto Frame as a reference
51         https://bugs.webkit.org/show_bug.cgi?id=120327
52
53         Reviewed by Andreas Kling.
54
55         While in the area I also:
56           - Reference-ified Editor::killRing().
57           - Const-ified Editor::m_killRing, Editor::m_spellChecker, and Editor::m_alternativeTextController.
58
59         * editing/AlternativeTextController.cpp:
60         (WebCore::AlternativeTextController::AlternativeTextController):
61         (WebCore::AlternativeTextController::stopPendingCorrection):
62         (WebCore::AlternativeTextController::isSpellingMarkerAllowed):
63         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
64         (WebCore::AlternativeTextController::applyAutocorrectionBeforeTypingIfAppropriate):
65         (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection):
66         (WebCore::AlternativeTextController::timerFired):
67         (WebCore::AlternativeTextController::handleAlternativeTextUIResult):
68         (WebCore::AlternativeTextController::rootViewRectForRange):
69         (WebCore::AlternativeTextController::respondToChangedSelection):
70         (WebCore::AlternativeTextController::respondToAppliedEditing):
71         (WebCore::AlternativeTextController::respondToUnappliedEditing):
72         (WebCore::AlternativeTextController::alternativeTextClient):
73         (WebCore::AlternativeTextController::editorClient):
74         (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand):
75         (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult):
76         (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord):
77         (WebCore::AlternativeTextController::insertDictatedText):
78         (WebCore::AlternativeTextController::applyDictationAlternative):
79         * editing/AlternativeTextController.h:
80         (WebCore::AlternativeTextController::UNLESS_ENABLED):
81         * editing/Editor.cpp:
82         (WebCore::Editor::Editor):
83         (WebCore::Editor::addToKillRing):
84         * editing/Editor.h:
85         (WebCore::Editor::killRing):
86         * editing/EditorCommand.cpp:
87         (WebCore::executeYank):
88         (WebCore::executeYankAndSelect):
89
90 2013-08-23  Andy Estes  <aestes@apple.com>
91
92         Fix issues found by the Clang Static Analyzer
93         https://bugs.webkit.org/show_bug.cgi?id=120230
94
95         Reviewed by Darin Adler.
96
97         * WebCore.xcodeproj/project.pbxproj: Removed FoundationExtras.h.
98         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: Removed CFAutoreleaseHelper().
99         (AXTextMarkerRange): Used HardAutorelease() instead of
100         CFAutoreleaseHelper().
101         (AXTextMarkerRangeStart): Ditto.
102         (AXTextMarkerRangeEnd): Ditto.
103         (textMarkerForVisiblePosition): Ditto.
104         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
105         (-[WebCoreAVFMovieObserver initWithCallback:]): Called [super init]
106         first so that we don't later use ivars from the wrong self.
107         (-[WebCoreAVFLoaderDelegate initWithCallback:]): Ditto.
108         * platform/mac/FoundationExtras.h: Removed.
109         * platform/mac/KURLMac.mm:
110         (WebCore::KURL::operator NSURL *): Used WTF's HardAutorelease().
111         * platform/mac/WebCoreNSURLExtras.mm:
112         (WebCore::mapHostNameWithRange): Used HardAutorelease() instead of
113         WebCoreCFAutorelease().
114         (WebCore::URLWithData): Ditto.
115         (WebCore::userVisibleString): Ditto.
116         (WebCore::URLByRemovingComponentAndSubsequentCharacter): Used Vector<>
117         with an inline capacity rather than heap-allocating a buffer.
118         * platform/mac/WebCoreObjCExtras.h: Used HardAutorelease() instead of
119         WebCoreCFAutorelease().
120         * platform/text/mac/StringImplMac.mm:
121         (WTF::StringImpl::operator NSString *): Used WTF's HardAutorelease().
122
123 2013-08-26  Pratik Solanki  <psolanki@apple.com>
124
125         Page::console() should return a reference
126         https://bugs.webkit.org/show_bug.cgi?id=120320
127
128         Reviewed by Darin Adler.
129
130         Page::m_console is never NULL so console() can just return a reference.
131
132         * css/CSSParser.cpp:
133         (WebCore::CSSParser::logError):
134         * dom/Document.cpp:
135         (WebCore::Document::addConsoleMessage):
136         (WebCore::Document::addMessage):
137         * page/DOMWindow.cpp:
138         (WebCore::DOMWindow::pageConsole):
139         * page/Page.h:
140         (WebCore::Page::console):
141         * xml/XSLStyleSheetLibxslt.cpp:
142         (WebCore::XSLStyleSheet::parseString):
143         * xml/XSLTProcessorLibxslt.cpp:
144         (WebCore::docLoaderFunc):
145
146 2013-08-26  Rob Buis  <rwlbuis@webkit.org>
147
148         Lonely stop crashes
149         https://bugs.webkit.org/show_bug.cgi?id=87964
150
151         Reviewed by Darin Adler.
152
153         Provide a nodeAtFloatPoint implementation for RenderSVGGradientStop to avoid hitting the assert in RenderObject::nodeAtFloatPoint.
154
155         Test: svg/custom/stop-crash-hittest.svg
156
157         * rendering/svg/RenderSVGGradientStop.h:
158
159 2013-08-26  Sam Weinig  <sam@webkit.org>
160
161         Editor::spellChecker() should return a reference
162         https://bugs.webkit.org/show_bug.cgi?id=120325
163
164         Reviewed by Anders Carlsson.
165
166         * editing/Editor.cpp:
167         (WebCore::Editor::Editor):
168         * editing/Editor.h:
169         (WebCore::Editor::spellChecker):
170         * editing/SpellChecker.cpp:
171         (WebCore::SpellChecker::SpellChecker):
172         (WebCore::SpellChecker::client):
173         (WebCore::SpellChecker::isAsynchronousEnabled):
174         (WebCore::SpellChecker::didCheck):
175         (WebCore::SpellChecker::didCheckSucceed):
176         * editing/SpellChecker.h:
177         * page/EditorClient.h:
178         * testing/Internals.cpp:
179         (WebCore::Internals::lastSpellCheckRequestSequence):
180         (WebCore::Internals::lastSpellCheckProcessedSequence):
181
182 2013-08-26  Bem Jones-Bey  <bjonesbe@adobe.com>
183
184         Optimize FloatIntervalSearchAdapter::collectIfNeeded
185         https://bugs.webkit.org/show_bug.cgi?id=120237
186
187         Reviewed by David Hyatt.
188
189         This is a port of 3 Blink patches:
190         https://codereview.chromium.org/22463002 (By shatch@chromium.org)
191         https://chromiumcodereview.appspot.com/22909005 (By me)
192         https://chromiumcodereview.appspot.com/23084002 (By me)
193
194         shatch optimized FloatIntervalSearchAdapter by having it store the
195         outermost float instead of making a bunch of calls to
196         logical(Left/Right/Bottom)ForFloat, and then only making that call
197         once when heightRemaining needs to be computed.
198
199         I noticed that now we were storing both the last float encountered and
200         the outermost float, and that the behavior for shape-outside wasn't
201         significantly changed by using the outermost float instead of the last
202         float encountered (and in most cases, using the outermost float gives
203         more reasonable behavior). Since this isn't covered in the spec yet, I
204         changed shape-outside to use the outermost float, making it so that we
205         only need to store one float pointer when walking the placed floats
206         tree, and keeping the performance win.
207
208         Also while changing updateOffsetIfNeeded, removed const, since that is
209         a lie. Nothing about that method is const.
210
211         Test: fast/shapes/shape-outside-floats/shape-outside-floats-outermost.html
212
213         * rendering/RenderBlock.cpp:
214         (WebCore::::updateOffsetIfNeeded):
215         (WebCore::::collectIfNeeded):
216         (WebCore::::getHeightRemaining):
217         (WebCore::RenderBlock::logicalLeftFloatOffsetForLine):
218         (WebCore::RenderBlock::logicalRightFloatOffsetForLine):
219         * rendering/RenderBlock.h:
220         (WebCore::RenderBlock::FloatIntervalSearchAdapter::FloatIntervalSearchAdapter):
221         (WebCore::RenderBlock::FloatIntervalSearchAdapter::outermostFloat):
222
223 2013-08-26  Alexey Proskuryakov  <ap@apple.com>
224
225         [Mac] can-read-in-dragstart-event.html and can-read-in-copy-and-cut-events.html fail
226         https://bugs.webkit.org/show_bug.cgi?id=113094
227
228         Reviewed by Darin Adler.
229
230         Mac platform implementation has checks for pasteboard change count, but it
231         didn't use to update the count when writing to pasteboad from JavaScript.
232
233         * platform/PasteboardStrategy.h: Changed changeCount function to return a long
234         instead of an int, as the underlying Mac type is NSInteger. Changed all methods
235         that modify the pasteboard to return a new change count.
236
237         * platform/PlatformPasteboard.h: Changed all methods that modify the pasteboard
238         to return a new change count.
239
240         * platform/mac/PasteboardMac.mm:
241         (WebCore::Pasteboard::clear): Update m_changeCount.
242         (WebCore::Pasteboard::writeSelectionForTypes): Ditto.
243         (WebCore::Pasteboard::writePlainText): Ditto.
244         (WebCore::writeURLForTypes): Ditto.
245         (WebCore::Pasteboard::writeURL): Ditto.
246         (WebCore::writeFileWrapperAsRTFDAttachment): Ditto.
247         (WebCore::Pasteboard::writeImage): Ditto.
248         (WebCore::Pasteboard::writePasteboard): Ditto.
249         (WebCore::addHTMLClipboardTypesForCocoaType): Ditto.
250         (WebCore::Pasteboard::writeString): Ditto.
251
252         * platform/mac/PlatformPasteboardMac.mm:
253         (WebCore::PlatformPasteboard::changeCount): Changed returned type to long to avoid
254         data loss.
255         (WebCore::PlatformPasteboard::copy): Return new change count.
256         (WebCore::PlatformPasteboard::addTypes): Ditto.
257         (WebCore::PlatformPasteboard::setTypes): Ditto.
258         (WebCore::PlatformPasteboard::setBufferForType): Ditto.
259         (WebCore::PlatformPasteboard::setPathnamesForType): Ditto.
260         (WebCore::PlatformPasteboard::setStringForType): Ditto. Replaced -[NSURL writeToPasteboard:]
261         with an equivalent implemnentation that tells use whether writing was successful.
262         There is difference with invalid URL string handling - we used to silently ignore
263         such requets, but set pasteboard content to empty URL now.
264
265 2013-08-24  Sam Weinig  <sam@webkit.org>
266
267         Add support for Promises
268         https://bugs.webkit.org/show_bug.cgi?id=120260
269
270         Reviewed by Darin Adler.
271
272         Add an initial implementation of Promises - http://dom.spec.whatwg.org/#promises.
273         - Despite Promises being defined in the DOM, the implementation is being put in JSC
274           in preparation for the Promises eventually being defined in ECMAScript.
275
276         Tests: fast/js/Promise-already-fulfilled.html
277                fast/js/Promise-already-rejected.html
278                fast/js/Promise-already-resolved.html
279                fast/js/Promise-catch-in-workers.html
280                fast/js/Promise-catch.html
281                fast/js/Promise-chain.html
282                fast/js/Promise-exception.html
283                fast/js/Promise-fulfill-in-workers.html
284                fast/js/Promise-fulfill.html
285                fast/js/Promise-init-in-workers.html
286                fast/js/Promise-init.html
287                fast/js/Promise-reject-in-workers.html
288                fast/js/Promise-reject.html
289                fast/js/Promise-resolve-chain.html
290                fast/js/Promise-resolve-in-workers.html
291                fast/js/Promise-resolve-with-then-exception.html
292                fast/js/Promise-resolve-with-then-fulfill.html
293                fast/js/Promise-resolve-with-then-reject.html
294                fast/js/Promise-resolve.html
295                fast/js/Promise-simple-fulfill-inside-callback.html
296                fast/js/Promise-simple-fulfill.html
297                fast/js/Promise-simple-in-workers.html
298                fast/js/Promise-simple.html
299                fast/js/Promise-static-fulfill.html
300                fast/js/Promise-static-reject.html
301                fast/js/Promise-static-resolve.html
302                fast/js/Promise-then-in-workers.html
303                fast/js/Promise-then-without-callbacks-in-workers.html
304                fast/js/Promise-then-without-callbacks.html
305                fast/js/Promise-then.html
306                fast/js/Promise-types.html
307                fast/js/Promise.html
308
309         * GNUmakefile.list.am:
310         * Target.pri:
311         * UseJSC.cmake:
312         * WebCore.vcxproj/WebCore.vcxproj:
313         * WebCore.vcxproj/WebCore.vcxproj.filters:
314         * WebCore.xcodeproj/project.pbxproj:
315         * bindings/js/JSBindingsAllInOne.cpp:
316         Add new files.
317
318         * bindings/js/JSDOMGlobalObjectTask.cpp: Added.
319         (WebCore::JSGlobalObjectCallback::create):
320         (WebCore::JSGlobalObjectCallback::~JSGlobalObjectCallback):
321         (WebCore::JSGlobalObjectCallback::call):
322         (WebCore::JSGlobalObjectCallback::JSGlobalObjectCallback):
323         (WebCore::JSGlobalObjectTask::JSGlobalObjectTask):
324         (WebCore::JSGlobalObjectTask::~JSGlobalObjectTask):
325         (WebCore::JSGlobalObjectTask::performTask):
326         * bindings/js/JSDOMGlobalObjectTask.h: Added.
327         (WebCore::JSGlobalObjectTask::create):
328         Add a new task type to be used with the GlobalObjectMethodTable's new QueueTaskToEventLoop callback.
329
330         * bindings/js/JSDOMWindowBase.cpp:
331         (WebCore::JSDOMWindowBase::queueTaskToEventLoop):
332         * bindings/js/JSDOMWindowBase.h:
333         Implement the GlobalObjectMethodTable callback, QueueTaskToEventLoop. 
334
335         * bindings/js/JSMainThreadExecState.h:
336         All using JSMainThreadExecState as a simple RAII object.
337
338         * bindings/js/JSWorkerGlobalScopeBase.cpp:
339         (WebCore::JSWorkerGlobalScopeBase::JSWorkerGlobalScopeBase):
340         (WebCore::JSWorkerGlobalScopeBase::allowsAccessFrom):
341         (WebCore::JSWorkerGlobalScopeBase::supportsProfiling):
342         (WebCore::JSWorkerGlobalScopeBase::supportsRichSourceInfo):
343         (WebCore::JSWorkerGlobalScopeBase::shouldInterruptScript):
344         (WebCore::JSWorkerGlobalScopeBase::javaScriptExperimentsEnabled):
345         (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):
346         * bindings/js/JSWorkerGlobalScopeBase.h:
347         Add a GlobalObjectMethodTable and implement QueueTaskToEventLoop. Forward the other callbacks
348         to JSGlobalObject so they retain their existing behavior.
349
350 2013-08-26  Rob Buis  <rwlbuis@webkit.org>
351
352         Computed style of fill/stroke properties incorrect on references
353         https://bugs.webkit.org/show_bug.cgi?id=114761
354
355         Reviewed by Darin Adler.
356
357         The computed style of the fill and stroke properties did not include
358         the url() function. Added the url() string to output.
359
360         Updated existing tests to cover the issue.
361
362         * css/CSSPrimitiveValue.cpp: Cleanup.
363         (WebCore::CSSPrimitiveValue::customCssText):
364         * svg/SVGPaint.cpp: Added "url("
365         (WebCore::SVGPaint::customCssText):
366
367 2013-08-26  Zan Dobersek  <zdobersek@igalia.com>
368
369         Prettify generated build guards in HTMLElementFactory.cpp
370         https://bugs.webkit.org/show_bug.cgi?id=120310
371
372         Reviewed by Darin Adler.
373
374         Build guards should wrap the constructor definitions without empty lines between
375         the guards and the constructor code. Similarly, build guards for addTag calls
376         shouldn't put an empty line after the build guard closure.
377
378         * dom/make_names.pl:
379         (printConstructorInterior):
380         (printConstructors):
381         (printFunctionInits):
382
383 2013-08-26  Robert Hogan  <robert@webkit.org>
384
385         Avoid painting every non-edge collapsed border twice over
386         https://bugs.webkit.org/show_bug.cgi?id=119759
387
388         Reviewed by David Hyatt.
389
390         Every collapsed border that isn't on the edge of a table gets painted at least twice, once by each 
391         adjacent cell. The joins are painted four times. This is unnecessary and results in tables with semi-transparent
392         borders getting rendered incorrectly - each border adjoing two cells is painted twice and ends up darker than it should be. 
393
394         Fixing the overpainting at joins is another day's work. This patch ensures each collapsed border inside a table is only
395         painted once. It does this by only allowing cells at the top and left edge of the table to paint their top and left collapsed borders.
396         All the others can only paint their right and bottom collapsed border. This works because the borders are painted from bottom right to top left.
397
398         Tests: fast/table/border-collapsing/collapsed-borders-adjoining-sections-vertical-rl.html
399                fast/table/border-collapsing/collapsed-borders-adjoining-sections.html
400
401         * rendering/RenderTableCell.cpp:
402         (WebCore::RenderTableCell::paintCollapsedBorders):
403
404 2013-08-26  Andreas Kling  <akling@apple.com>
405
406         Unreviewed build fix.
407
408         * page/Page.cpp:
409         (WebCore::Page::setNeedsRecalcStyleInAllFrames):
410
411 2013-08-26  Brent Fulgham  <bfulgham@apple.com>
412
413         Unreviewed buid fix.
414
415         * page/Page.cpp: 
416         (WebCore::Page::setNeedsRecalcStyleInAllFrames): Remove extra '{' character.
417
418 2013-08-26  Pratik Solanki  <psolanki@apple.com>
419
420         PageGroup::groupSettings() should return a reference
421         https://bugs.webkit.org/show_bug.cgi?id=120319
422
423         Reviewed by Andreas Kling.
424
425         PageGroup::m_groupSettings is never NULL so we can just return a reference from groupSettings().
426
427         * Modules/indexeddb/IDBFactory.cpp:
428         * page/PageGroup.h:
429         (WebCore::PageGroup::groupSettings):
430         * storage/StorageNamespaceImpl.cpp:
431         (WebCore::StorageNamespaceImpl::localStorageNamespace):
432         * workers/DefaultSharedWorkerRepository.cpp:
433         (WebCore::SharedWorkerProxy::groupSettings):
434         * workers/WorkerMessagingProxy.cpp:
435         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
436
437 2013-08-26  Andreas Kling  <akling@apple.com>
438
439         WebCore: Let Page create the main Frame.
440         <https://webkit.org/b/119964>
441
442         Reviewed by Anders Carlsson.
443
444         Previously, Frame::create() would call Page::setMainFrame() when constructing the
445         main Frame for a Page. Up until that point, Page had a null mainFrame().
446
447         To guarantee that Page::mainFrame() is never null, we re-order things so that
448         Page is responsible for creating its own main Frame. We do this at the earliest
449         possible point; in the Page constructor initializer list.
450
451         Constructing a Frame requires a FrameLoaderClient*, so I've added such a field to
452         the PageClients struct.
453
454         When creating a WebKit-layer frame, we now wrap the already-instantiated
455         Page::mainFrame() instead of creating a new Frame.
456
457         * loader/EmptyClients.cpp:
458         (WebCore::fillWithEmptyClients):
459
460             Add an EmptyFrameLoaderClient to the PageClients constructed here.
461
462         * inspector/InspectorOverlay.cpp:
463         (WebCore::InspectorOverlay::overlayPage):
464         * svg/graphics/SVGImage.cpp:
465         (WebCore::SVGImage::dataChanged):
466
467             Updated to wrap Page::mainFrame() in a FrameView instead of creating their
468             own Frame manually.
469
470         * page/Frame.cpp:
471         (WebCore::Frame::create):
472         * page/Page.h:
473
474             Remove Page::setMainFrame() and the only call site.
475
476         * page/Page.cpp:
477         (WebCore::Page::Page):
478
479             Construct Page::m_mainFrame in the initializer list.
480
481         (WebCore::Page::PageClients::PageClients):
482
483             Add "FrameLoaderClient* loaderClientForMainFrame" to PageClients.
484
485         (WebCore::Page::setNeedsRecalcStyleInAllFrames):
486
487             Null-check the Frame::document() before calling through on it. This would
488             otherwise crash when changing font-related Settings before calling init() on
489             the Frame (like InspectorOverlay does.)
490
491 2013-08-26  Brent Fulgham  <bfulgham@apple.com>
492
493         [Windows] Unreviewed build fix.
494
495         * rendering/RenderMediaControls.cpp: Remove references to QuickTime controls
496         that are no longer part of WKSI.
497         (wkHitTestMediaUIPart): 
498         (wkMeasureMediaUIPart):
499         (wkDrawMediaUIPart):
500         (wkDrawMediaSliderTrack):
501
502 2013-08-26  Gurpreet Kaur  <gur.trio@gmail.com>
503
504         <https://webkit.org/b/106133> document.body.scrollTop & document.documentElement.scrollTop differ cross-browser
505
506         Reviewed by Darin Adler.
507
508         Webkit always uses document.body.scrollTop whether quirks or
509         standard mode. Similiar behaviour is for document.body.scrollLeft.
510         As per the specification webkit should return document.body.scrollTop
511         for quirks mode and document.documentElement.scrollTop for standard mode.
512         Same for document.body.scrollLeft and document.documentElement.scrollLeft.
513
514         Tests: fast/dom/Element/scrollLeft-Quirks.html
515                fast/dom/Element/scrollLeft.html
516                fast/dom/Element/scrollTop-Quirks.html
517                fast/dom/Element/scrollTop.html
518
519         * dom/Element.cpp:
520         (WebCore::Element::scrollLeft):
521         (WebCore::Element::scrollTop): 
522         If the element does not have any associated CSS layout box or the element
523         is the root element and the Document is in quirks mode return zero.
524         Else If the element is the root element return the value of scrollY
525         for scrollTop and scrollX for scrollLeft.
526         * html/HTMLBodyElement.cpp:
527         (WebCore::HTMLBodyElement::scrollLeft):
528         (WebCore::HTMLBodyElement::scrollTop):
529         If the element is the HTML body element, the Document is in quirks mode,
530         return the value of scrollY for scrollTop and scrollX for scrollLeft.
531
532 2013-08-26  Antti Koivisto  <antti@apple.com>
533
534         REGRESSION (r154581): Some plugin tests failing in debug bots
535         https://bugs.webkit.org/show_bug.cgi?id=120315
536
537         Reviewed by Darin Adler.
538         
539         We are hitting the new no-event-dispatch-while-iterating assertion.
540
541         Detaching deletes a plugin which modifies DOM while it dies.
542
543         * dom/Document.cpp:
544         (WebCore::Document::createRenderTree):
545         (WebCore::Document::detach):
546         
547             Don't iterate at all. Document never has more than one Element child anyway.
548
549 2013-08-26  David Kilzer  <ddkilzer@apple.com>
550
551         BUILD FIX (r154580): RenderObject::document() returns a reference
552
553         See: <https://webkit.org/b/120272>
554
555         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
556         (-[WebAccessibilityObjectWrapper _accessibilityParentForSubview:]):
557         (AXAttributeStringSetHeadingLevel):
558
559 2013-08-26  Brent Fulgham  <bfulgham@apple.com>
560
561         [Windows] Build fix after r154578.  Return Vector<String>() instead
562         of ListHashSet<String>().
563
564         * platform/win/PasteboardWin.cpp:
565         (WebCore::Pasteboard::types):
566
567 2013-08-26  Brent Fulgham  <bfulgham@apple.com>
568
569         [Windows] Build fix after r154580.
570
571         * rendering/RenderThemeWin.cpp: Mirror changes made for other ports now that
572         Frame is known to always be valid when in a render tree. This allows us to
573         get rid of some unneeded null checks.
574         (WebCore::RenderThemeWin::getThemeData):
575         (WebCore::RenderThemeWin::paintMenuList):
576
577 2013-08-26  Brent Fulgham  <bfulgham@apple.com>
578
579         [Windows] Build fix after r154554.
580
581         * page/AutoscrollController.cpp: Correct various places where pointers are now
582         references.
583         (WebCore::AutoscrollController::stopAutoscrollTimer):
584         (WebCore::AutoscrollController::startPanScrolling):
585         (WebCore::AutoscrollController::autoscrollTimerFired):
586
587 2013-08-26  Andreas Kling  <akling@apple.com>
588
589         Move DocumentTiming inside ENABLE(WEB_TIMING) guards.
590         <https://webkit.org/b/120281>
591
592         Reviewed by Anders Carlsson.
593
594         Looks like this struct is only used by other ENABLE(WEB_TIMING) code, so don't bother
595         filling it in if we're not building like that.
596
597         * dom/Document.cpp:
598         (WebCore::Document::setReadyState):
599         (WebCore::Document::finishedParsing):
600         * dom/Document.h:
601         * dom/DocumentTiming.h:
602
603 2013-08-26  Carlos Garcia Campos  <cgarcia@igalia.com>
604
605         [GTK] Fix compile warning in WebKitDOMCustom
606         https://bugs.webkit.org/show_bug.cgi?id=120286
607
608         Reviewed by Philippe Normand.
609
610         * bindings/gobject/WebKitDOMCustom.cpp:
611         (webkit_dom_html_element_get_item_type): Add return 0.
612
613 2013-08-25  Ryosuke Niwa  <rniwa@webkit.org>
614
615         JSHTMLFormElement::canGetItemsForName needlessly allocates a Vector
616         https://bugs.webkit.org/show_bug.cgi?id=120277
617
618         Reviewed by Sam Weinig.
619
620         Added HTMLFormElement::hasNamedElement and used it in JSHTMLFormElement::canGetItemsForName.
621
622         This required fixing a bug in HTMLFormElement::getNamedElements that the first call to getNamedElements
623         after replacing an element A with another element B of the same name caused it to erroneously append A
624         to namedItems via the aliases mapping. Because getNamedElements used to be always called in pairs, this
625         wrong behavior was never visible to the Web. Fixed the bug by not adding the old element to namedItem
626         when namedItem's size is 1.
627
628         Also renamed m_elementAliases to m_pastNamesMap along with related member functions.
629
630         No new tests are added since there should be no Web exposed behavioral change.
631
632         * bindings/js/JSHTMLFormElementCustom.cpp:
633         (WebCore::JSHTMLFormElement::canGetItemsForName):
634         * html/HTMLFormElement.cpp:
635         (WebCore::HTMLFormElement::elementFromPastNamesMap):
636         (WebCore::HTMLFormElement::addElementToPastNamesMap):
637         (WebCore::HTMLFormElement::hasNamedElement):
638         (WebCore::HTMLFormElement::getNamedElements):
639         * html/HTMLFormElement.h:
640
641 2013-08-25  Andreas Kling  <akling@apple.com>
642
643         RenderLayerBacking::renderer() should return a reference.
644         <https://webkit.org/b/120280>
645
646         Reviewed by Anders Carlsson.
647
648         It's just a forwarding call to RenderLayer::renderer() which already returns a reference.
649
650 2013-08-25  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
651
652         Add toSVGMissingGlyphElement(), and use it.
653         https://bugs.webkit.org/show_bug.cgi?id=120197
654
655         Reviewed by Andreas Kling.
656
657         As a step to clean-up static_cast<SVGXXX>, toSVGMissingGlyphElement() is added to clean-up
658         static_cast<SVGMissingGlyphElement*>.
659
660         * svg/SVGFontElement.cpp:
661         (WebCore::SVGFontElement::firstMissingGlyphElement):
662         (WebCore::SVGFontElement::ensureGlyphCache):
663         * svg/SVGMissingGlyphElement.h:
664         (WebCore::toSVGMissingGlyphElement):
665
666 2013-08-25  Andreas Kling  <akling@apple.com>
667
668         RenderLayer::renderer() should return a reference.
669         <https://webkit.org/b/120276>
670
671         Reviewed by Anders Carlsson.
672
673         RenderLayer is always created with a renderer, so make renderer() (and m_renderer) references.
674         Nuked an assortment of useless null checks.
675
676 2013-08-25  Antti Koivisto  <antti@apple.com>
677
678         Element child and descendant iterators
679         https://bugs.webkit.org/show_bug.cgi?id=120248
680
681         Reviewed by Sam Weinig and Andreas Kling.
682
683         Add iterators for Element children and descendants.
684         
685         To iterate over element children:
686         
687         #include "ChildIterator.h"
688         
689         for (auto it = elementChildren(this).begin(), end = elementChildren(this).end(); it != end; ++it) {
690             Element& element = *it;
691             ...
692
693         for (auto it = childrenOfType<HTMLAreaElement>(this).begin(), end = childrenOfType<HTMLAreaElement>(this).end(); it != end; ++it) {
694             HTMLAreaElement& area = *it;
695             ...
696
697         To iteratate over element descendants in pre-order:
698         
699         #include "DescendantIterator.h"
700         
701         for (auto it = elementDescendants(this).begin(), end = elementDescendants(this).end(); it != end; ++it) {
702             Element& element = *it;
703             ...
704
705         for (auto it = descendantsOfType<HTMLAreaElement>(this).begin(), end = descendantsOfType<HTMLAreaElement>(this).end(); it != end; ++it) {
706             HTMLAreaElement& area = *it;
707             ...
708             
709         The iterators assert against DOM mutations and event dispatch while iterating in debug builds.
710             
711         They are compatible with C++11 range-based for loops. In the future we can use
712         
713         for (auto& element : elementChildren(this))
714             ...
715
716         etc.
717         
718         The patch all uses the new iterators in a few places.
719
720         * WebCore.xcodeproj/project.pbxproj:
721         * accessibility/AccessibilityNodeObject.cpp:
722         (WebCore::AccessibilityNodeObject::canvasHasFallbackContent):
723         (WebCore::siblingWithAriaRole):
724         * accessibility/AccessibilityRenderObject.cpp:
725         * accessibility/AccessibilityTable.cpp:
726         (WebCore::AccessibilityTable::isDataTable):
727         * dom/ChildIterator.h: Added.
728         (WebCore::ChildIterator::operator*):
729         (WebCore::ChildIterator::operator->):
730         (WebCore::::ChildIterator):
731         (WebCore::::operator):
732         (WebCore::=):
733         (WebCore::::ChildIteratorAdapter):
734         (WebCore::::begin):
735         (WebCore::::end):
736         (WebCore::elementChildren):
737         (WebCore::childrenOfType):
738         * dom/DescendantIterator.h: Added.
739         (WebCore::DescendantIterator::operator*):
740         (WebCore::DescendantIterator::operator->):
741         (WebCore::::DescendantIterator):
742         (WebCore::::operator):
743         (WebCore::=):
744         (WebCore::::DescendantIteratorAdapter):
745         (WebCore::::begin):
746         (WebCore::::end):
747         (WebCore::elementDescendants):
748         (WebCore::descendantsOfType):
749         * dom/Document.cpp:
750         (WebCore::Document::buildAccessKeyMap):
751         (WebCore::Document::childrenChanged):
752         (WebCore::Document::attach):
753         (WebCore::Document::detach):
754         * editing/ApplyStyleCommand.cpp:
755         (WebCore::ApplyStyleCommand::cleanupUnstyledAppleStyleSpans):
756         * editing/markup.cpp:
757         (WebCore::completeURLs):
758         * html/HTMLMapElement.cpp:
759         (WebCore::HTMLMapElement::mapMouseEvent):
760         * html/HTMLMediaElement.cpp:
761         (WebCore::HTMLMediaElement::selectMediaResource):
762         (WebCore::HTMLMediaElement::textTrackModeChanged):
763
764 2013-08-25  Andreas Kling  <akling@apple.com>
765
766         RenderObject::document() should return a reference.
767         <https://webkit.org/b/120272>
768
769         Reviewed by Antti Koivisto.
770
771         There's always a Document. We were allocated in someone's arena, after all.
772         Various null checks and assertions neutralized.
773
774 2013-08-25  David Kilzer  <ddkilzer@apple.com>
775
776         BUILD FIX (r154578): Return Vector<String>() from Pasteboard::types() for iOS
777
778         * platform/ios/PasteboardIOS.mm:
779         (WebCore::Pasteboard::types): Return Vector<String>() instead of
780         ListHashSet<String>() after r154578.
781
782 2013-08-25  Darin Adler  <darin@apple.com>
783
784         Make JavaScript binding for Clipboard::types more normal
785         https://bugs.webkit.org/show_bug.cgi?id=120271
786
787         Reviewed by Anders Carlsson.
788
789         * bindings/js/JSClipboardCustom.cpp:
790         (WebCore::JSClipboard::types): Make a simple custom binding. Only needed because
791         there is a special value, null, this can return.
792
793         * dom/Clipboard.cpp:
794         (WebCore::Clipboard::types): Return Vector<String> instead of ListHashSet<String>.
795         * dom/Clipboard.h: Ditto.
796         * platform/Pasteboard.h: Ditto.
797         * platform/blackberry/PasteboardBlackBerry.cpp:
798         (WebCore::Pasteboard::types): Ditto.
799         * platform/efl/PasteboardEfl.cpp:
800         (WebCore::Pasteboard::types): Ditto.
801         * platform/gtk/PasteboardGtk.cpp:
802         (WebCore::Pasteboard::types): Ditto.
803         * platform/ios/PasteboardIOS.mm:
804         (WebCore::Pasteboard::types): Ditto.
805         * platform/mac/PasteboardMac.mm:
806         (WebCore::Pasteboard::types): Ditto.
807         * platform/qt/PasteboardQt.cpp:
808         (WebCore::Pasteboard::types): Ditto.
809         * platform/win/PasteboardWin.cpp:
810         (WebCore::Pasteboard::types): Ditto.
811
812 2013-08-25  David Kilzer  <ddkilzer@apple.com>
813
814         Unreviewed rollout of r154571. Broke internal iOS build.
815
816         Reopened: No need for clearTimers function in Frame
817         https://bugs.webkit.org/show_bug.cgi?id=120265
818
819         * history/CachedFrame.cpp:
820         (WebCore::CachedFrame::CachedFrame):
821         (WebCore::CachedFrame::destroy):
822         * page/Frame.cpp:
823         (WebCore::Frame::clearTimers):
824         * page/Frame.h:
825
826 2013-08-25  Darin Adler  <darin@apple.com>
827
828         No need for hasData in Clipboard
829         https://bugs.webkit.org/show_bug.cgi?id=120269
830
831         Reviewed by Andreas Kling.
832
833         This simple forwarder does not belong in the Clipboard class.
834         The drag code that uses it already works directly with Pasteboard.
835
836         * dom/Clipboard.cpp: Removed hasData.
837         * dom/Clipboard.h: Ditto.
838
839         * page/DragController.cpp:
840         (WebCore::DragController::startDrag): Call through the pasteboard.
841
842 2013-08-25  Darin Adler  <darin@apple.com>
843
844         No need for documentTypeString function in Frame
845         https://bugs.webkit.org/show_bug.cgi?id=120262
846
847         Reviewed by Andreas Kling.
848
849         * WebCore.exp.in: Removed export of Frame::documentTypeString.
850
851         * editing/markup.cpp:
852         (WebCore::documentTypeString): Added. Replaces the old Frame member function.
853         Makes more sense to have this here since it is both called by and calls code
854         in this file; somehow this function was left behind.
855         (WebCore::createFullMarkup): Changed to call the new function.
856         * editing/markup.h: Added documentTypeString function. Has to be exported
857         because LegacyWebArchive uses it; might be worth fixing that later.
858         * loader/archive/cf/LegacyWebArchive.cpp:
859         (WebCore::LegacyWebArchive::create): Changed to call the new function.
860         (WebCore::LegacyWebArchive::createFromSelection): Ditto.
861
862         * page/Frame.cpp: Removed Frame::documentTypeString.
863         * page/Frame.h: Ditto.
864
865 2013-08-25  Darin Adler  <darin@apple.com>
866
867         Clipboard is in DOM directory, but ClipboardMac is in platform directory
868         https://bugs.webkit.org/show_bug.cgi?id=120267
869
870         Reviewed by Andreas Kling.
871
872         This file is almost gone; has just one function in it. Move it for now, and later
873         we can delete it entirely.
874
875         * WebCore.xcodeproj/project.pbxproj: Updated for new file location.
876         * dom/ClipboardMac.mm: Moved from Source/WebCore/platform/mac/ClipboardMac.mm.
877
878 2013-08-25  Darin Adler  <darin@apple.com>
879
880         No need for notifyChromeClientWheelEventHandlerCountChanged in Frame
881         https://bugs.webkit.org/show_bug.cgi?id=120264
882
883         Reviewed by Andreas Kling.
884
885         * dom/Document.cpp:
886         (WebCore::Document::createRenderTree): Renamed attach to this.
887         This made it practical to remove a comment that says the same thing and
888         also helps make the purpose of the function considerably more clear,
889         although the relationship to the attached and detach functions is now
890         less clear; should fix that soon.
891         (WebCore::pageWheelEventHandlerCountChanged): Added. Contains the code
892         from Frame::notifyChromeClientWheelEventHandlerCountChanged, minus some
893         assertions that were only needed because the function was passed a frame
894         rather than a page.
895         (WebCore::Document::didBecomeCurrentDocumentInFrame): Added. Contains
896         most of the code from Frame::setDocument. Looking at before and after,
897         we can see that most of the work is within the document class and matches
898         up with other code already in this class. Added FIXMEs about many problems
899         spotted in the code.
900         (WebCore::Document::topDocument): Added FIXME and tweaked formatting.
901         (WebCore::wheelEventHandlerCountChanged): Moved the call to the
902         pageWheelEventHandlerCountChanged in here from the two call sites.
903         Also added a FIXME.
904         (WebCore::Document::didAddWheelEventHandler): Removed the call to
905         notifyChromeClientWheelEventHandlerCountChanged, since that's now handled
906         inside wheelEventHandlerCountChanged.
907         (WebCore::Document::didRemoveWheelEventHandler): Ditto.
908
909         * dom/Document.h: Renamed attach to createRenderTree, made it private,
910         and added a new didBecomeCurrentDocumentInFrame function.
911
912         * loader/PlaceholderDocument.cpp:
913         (WebCore::PlaceholderDocument::createRenderTree): Renamed from attach.
914         * loader/PlaceholderDocument.h: Did the rename and made the function a
915         private override.
916
917         * page/Frame.cpp:
918         (WebCore::Frame::setDocument): Moved most of this function out of here
919         into the new Document::didBecomeCurrentDocumentInFrame function.
920         Also deleted notifyChromeClientWheelEventHandlerCountChanged.
921
922         * page/Frame.h: Deleted notifyChromeClientWheelEventHandlerCountChanged.
923
924 2013-08-25  Darin Adler  <darin@apple.com>
925
926         No need for dispatchVisibilityStateChangeEvent function
927         https://bugs.webkit.org/show_bug.cgi?id=120261
928
929         Reviewed by Andreas Kling.
930
931         * dom/Document.cpp: Removed dispatchVisibilityStateChangeEvent.
932         * dom/Document.h: Ditto.
933         * page/Frame.cpp: Ditto.
934         * page/Frame.h: Ditto.
935
936         * page/Page.cpp:
937         (WebCore::Page::setVisibilityState): Put all the logic for dispatching the
938         visibility state change event. Nothing here requires any special information
939         about the internals of Frame or Document.
940
941 2013-08-25  Darin Adler  <darin@apple.com>
942
943         No need for clearTimers function in Frame
944         https://bugs.webkit.org/show_bug.cgi?id=120265
945
946         Reviewed by Andreas Kling.
947
948         * history/CachedFrame.cpp:
949         (WebCore::clearTimers): Added. Moved here from Frame.
950         (WebCore::CachedFrame::CachedFrame): Call above function.
951         (WebCore::CachedFrame::destroy): Ditto.
952
953         * page/Frame.cpp: Removed the two clearTimers functions.
954         * page/Frame.h: Ditto.
955
956 2013-08-24  Ryuan Choi  <ryuan.choi@samsung.com>
957
958         Unreviewed build fix after r154560
959
960         * page/FrameTree.cpp:
961         (WebCore::FrameTree::scopedChild): 
962         Use tree(). instead of tree()->.
963
964 2013-08-24  Benjamin Poulain  <benjamin@webkit.org>
965
966         <https://webkit.org/b/120102> Inline SelectorQuery's execution traits
967
968         Reviewed by Sam Weinig.
969
970         For some reason, clang does not always inline the trait. The operations are so simple
971         that it shows up in profile.
972         Force the inlining to match the original speed.
973
974         * dom/SelectorQuery.cpp:
975         (WebCore::AllElementExtractorSelectorQueryTrait::appendOutputForElement):
976         (WebCore::SingleElementExtractorSelectorQueryTrait::appendOutputForElement):
977
978 2013-08-24  Benjamin Poulain  <benjamin@webkit.org>
979
980         Remove a useless #include from StyledElement
981         https://bugs.webkit.org/show_bug.cgi?id=120245
982
983         Reviewed by Andreas Kling.
984
985         * dom/StyledElement.cpp:
986
987 2013-08-24  Darin Adler  <darin@apple.com>
988
989         Move Frame::inScope into FrameTree
990         https://bugs.webkit.org/show_bug.cgi?id=120257
991
992         Reviewed by Sam Weinig.
993
994         * page/Frame.cpp: Removed inScope.
995         * page/Frame.h: Ditto.
996
997         * page/FrameTree.cpp:
998         (WebCore::inScope): Moved it here.
999         (WebCore::FrameTree::scopedChild): Changed to call new function.
1000         (WebCore::FrameTree::scopedChildCount): Ditto.
1001
1002 2013-08-24  David Kilzer  <ddkilzer@apple.com>
1003
1004         BUILD FIX: Include HTMLPlugInImageElement.h for ENABLE(PLUGIN_PROXY_FOR_VIDEO)
1005
1006         Fixes the following build failure for iOS:
1007
1008             In file included from Source/WebCore/accessibility/AccessibilityAllInOne.cpp:28:
1009             In file included from Source/WebCore/accessibility/AXObjectCache.cpp:42:
1010             In file included from Source/WebCore/accessibility/AccessibilityMediaControls.h:36:
1011             In file included from Source/WebCore/html/shadow/MediaControlElements.h:34:
1012             In file included from Source/WebCore/html/shadow/MediaControlElementTypes.h:37:
1013             Source/WebCore/html/HTMLMediaElement.h:324:23: error: unknown type name 'PluginCreationOption'
1014                 void updateWidget(PluginCreationOption);
1015                                   ^
1016
1017         * html/HTMLMediaElement.h:
1018
1019 2013-08-24  Darin Adler  <darin@apple.com>
1020
1021         Frame::tree should return a reference instead of a pointer
1022         https://bugs.webkit.org/show_bug.cgi?id=120259
1023
1024         Reviewed by Andreas Kling.
1025
1026         * page/Frame.h:
1027         (WebCore::Frame::tree): Return a reference instead of a pointer.
1028
1029         * bindings/js/JSDOMWindowCustom.cpp:
1030         (WebCore::childFrameGetter):
1031         (WebCore::indexGetter):
1032         (WebCore::JSDOMWindow::getOwnPropertySlot):
1033         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
1034         (WebCore::JSDOMWindow::setLocation):
1035         * bindings/js/PageScriptDebugServer.cpp:
1036         (WebCore::PageScriptDebugServer::setJavaScriptPaused):
1037         * dom/Document.cpp:
1038         (WebCore::canAccessAncestor):
1039         (WebCore::Document::adoptNode):
1040         (WebCore::Document::canNavigate):
1041         (WebCore::Document::findUnsafeParentScrollPropagationBoundary):
1042         (WebCore::Document::notifySeamlessChildDocumentsOfStylesheetUpdate):
1043         (WebCore::Document::openSearchDescriptionURL):
1044         (WebCore::Document::setDesignMode):
1045         (WebCore::Document::parentDocument):
1046         (WebCore::Document::initSecurityContext):
1047         (WebCore::Document::initContentSecurityPolicy):
1048         (WebCore::Document::requestFullScreenForElement):
1049         (WebCore::Document::webkitExitFullscreen):
1050         (WebCore::Document::didRemoveTouchEventHandler):
1051         * dom/TreeScope.cpp:
1052         (WebCore::focusedFrameOwnerElement):
1053         * editing/FrameSelection.cpp:
1054         (WebCore::FrameSelection::selectFrameElementInParentIfFullySelected):
1055         * history/CachedFrame.cpp:
1056         (WebCore::CachedFrameBase::CachedFrameBase):
1057         (WebCore::CachedFrameBase::restore):
1058         (WebCore::CachedFrame::CachedFrame):
1059         * history/CachedPage.cpp:
1060         (WebCore::CachedPage::restore):
1061         * history/PageCache.cpp:
1062         (WebCore::logCanCacheFrameDecision):
1063         (WebCore::PageCache::canCachePageContainingThisFrame):
1064         * html/HTMLDocument.cpp:
1065         (WebCore::HTMLDocument::hasFocus):
1066         * html/HTMLPlugInImageElement.cpp:
1067         (WebCore::HTMLPlugInImageElement::restartSimilarPlugIns):
1068         * inspector/InspectorApplicationCacheAgent.cpp:
1069         (WebCore::InspectorApplicationCacheAgent::getFramesWithManifests):
1070         * inspector/InspectorCanvasAgent.cpp:
1071         (WebCore::InspectorCanvasAgent::findFramesWithUninstrumentedCanvases):
1072         (WebCore::InspectorCanvasAgent::frameNavigated):
1073         * inspector/InspectorDOMAgent.cpp:
1074         (WebCore::InspectorDOMAgent::documents):
1075         * inspector/InspectorFileSystemAgent.cpp:
1076         (WebCore::InspectorFileSystemAgent::assertScriptExecutionContextForOrigin):
1077         * inspector/InspectorPageAgent.cpp:
1078         (WebCore::InspectorPageAgent::getCookies):
1079         (WebCore::InspectorPageAgent::deleteCookie):
1080         (WebCore::InspectorPageAgent::searchInResources):
1081         (WebCore::InspectorPageAgent::findFrameWithSecurityOrigin):
1082         (WebCore::InspectorPageAgent::buildObjectForFrame):
1083         (WebCore::InspectorPageAgent::buildObjectForFrameTree):
1084         * inspector/PageRuntimeAgent.cpp:
1085         (WebCore::PageRuntimeAgent::reportExecutionContextCreation):
1086         * loader/DocumentLoader.cpp:
1087         (WebCore::DocumentLoader::willSendRequest):
1088         (WebCore::DocumentLoader::mainResource):
1089         * loader/DocumentWriter.cpp:
1090         (WebCore::DocumentWriter::createDecoderIfNeeded):
1091         * loader/FrameLoader.cpp:
1092         (WebCore::FrameLoader::submitForm):
1093         (WebCore::FrameLoader::allChildrenAreComplete):
1094         (WebCore::FrameLoader::allAncestorsAreComplete):
1095         (WebCore::FrameLoader::loadURLIntoChildFrame):
1096         (WebCore::FrameLoader::outgoingReferrer):
1097         (WebCore::FrameLoader::updateFirstPartyForCookies):
1098         (WebCore::FrameLoader::setFirstPartyForCookies):
1099         (WebCore::FrameLoader::completed):
1100         (WebCore::FrameLoader::started):
1101         (WebCore::FrameLoader::loadURL):
1102         (WebCore::FrameLoader::loadWithDocumentLoader):
1103         (WebCore::FrameLoader::stopAllLoaders):
1104         (WebCore::FrameLoader::commitProvisionalLoad):
1105         (WebCore::FrameLoader::closeOldDataSources):
1106         (WebCore::FrameLoader::prepareForCachedPageRestore):
1107         (WebCore::FrameLoader::subframeIsLoading):
1108         (WebCore::FrameLoader::subresourceCachePolicy):
1109         (WebCore::FrameLoader::detachChildren):
1110         (WebCore::FrameLoader::closeAndRemoveChild):
1111         (WebCore::FrameLoader::checkLoadComplete):
1112         (WebCore::FrameLoader::numPendingOrLoadingRequests):
1113         (WebCore::FrameLoader::detachFromParent):
1114         (WebCore::FrameLoader::shouldClose):
1115         (WebCore::FrameLoader::handleBeforeUnloadEvent):
1116         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
1117         (WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):
1118         (WebCore::FrameLoader::findFrameForNavigation):
1119         (WebCore::FrameLoader::effectiveSandboxFlags):
1120         (WebCore::createWindow):
1121         * loader/HistoryController.cpp:
1122         (WebCore::HistoryController::saveDocumentState):
1123         (WebCore::HistoryController::saveDocumentAndScrollState):
1124         (WebCore::HistoryController::restoreDocumentState):
1125         (WebCore::HistoryController::goToItem):
1126         (WebCore::HistoryController::updateForRedirectWithLockedBackForwardList):
1127         (WebCore::HistoryController::recursiveUpdateForCommit):
1128         (WebCore::HistoryController::recursiveUpdateForSameDocumentNavigation):
1129         (WebCore::HistoryController::initializeItem):
1130         (WebCore::HistoryController::createItemTree):
1131         (WebCore::HistoryController::recursiveSetProvisionalItem):
1132         (WebCore::HistoryController::recursiveGoToItem):
1133         (WebCore::HistoryController::currentFramesMatchItem):
1134         * loader/NavigationScheduler.cpp:
1135         (WebCore::NavigationScheduler::mustLockBackForwardList):
1136         (WebCore::NavigationScheduler::scheduleFormSubmission):
1137         * loader/ProgressTracker.cpp:
1138         (WebCore::ProgressTracker::progressStarted):
1139         (WebCore::ProgressTracker::progressCompleted):
1140         (WebCore::ProgressTracker::isMainLoadProgressing):
1141         * loader/appcache/ApplicationCacheGroup.cpp:
1142         (WebCore::ApplicationCacheGroup::selectCache):
1143         (WebCore::ApplicationCacheGroup::selectCacheWithoutManifestURL):
1144         * loader/archive/cf/LegacyWebArchive.cpp:
1145         (WebCore::LegacyWebArchive::create):
1146         * loader/cache/CachedResourceLoader.cpp:
1147         (WebCore::CachedResourceLoader::checkInsecureContent):
1148         * loader/icon/IconController.cpp:
1149         (WebCore::IconController::urlsForTypes):
1150         (WebCore::IconController::startLoader):
1151         * page/Chrome.cpp:
1152         (WebCore::canRunModalIfDuringPageDismissal):
1153         (WebCore::Chrome::windowScreenDidChange):
1154         * page/DOMWindow.cpp:
1155         (WebCore::DOMWindow::length):
1156         (WebCore::DOMWindow::name):
1157         (WebCore::DOMWindow::setName):
1158         (WebCore::DOMWindow::parent):
1159         (WebCore::DOMWindow::top):
1160         (WebCore::DOMWindow::open):
1161         * page/EventHandler.cpp:
1162         (WebCore::EventHandler::scrollRecursively):
1163         (WebCore::EventHandler::logicalScrollRecursively):
1164         (WebCore::EventHandler::handleMouseMoveEvent):
1165         * page/FocusController.cpp:
1166         (WebCore::FocusController::setContainingWindowIsVisible):
1167         * page/Frame.cpp:
1168         (WebCore::parentPageZoomFactor):
1169         (WebCore::parentTextZoomFactor):
1170         (WebCore::Frame::setPrinting):
1171         (WebCore::Frame::shouldUsePrintingLayout):
1172         (WebCore::Frame::dispatchVisibilityStateChangeEvent):
1173         (WebCore::Frame::willDetachPage):
1174         (WebCore::Frame::setPageAndTextZoomFactors):
1175         (WebCore::Frame::deviceOrPageScaleFactorChanged):
1176         (WebCore::Frame::notifyChromeClientWheelEventHandlerCountChanged):
1177         (WebCore::Frame::isURLAllowed):
1178         * page/FrameTree.cpp:
1179         (WebCore::FrameTree::~FrameTree):
1180         (WebCore::FrameTree::setName):
1181         (WebCore::FrameTree::transferChild):
1182         (WebCore::FrameTree::appendChild):
1183         (WebCore::FrameTree::actuallyAppendChild):
1184         (WebCore::FrameTree::removeChild):
1185         (WebCore::FrameTree::uniqueChildName):
1186         (WebCore::FrameTree::scopedChild):
1187         (WebCore::FrameTree::scopedChildCount):
1188         (WebCore::FrameTree::childCount):
1189         (WebCore::FrameTree::child):
1190         (WebCore::FrameTree::find):
1191         (WebCore::FrameTree::isDescendantOf):
1192         (WebCore::FrameTree::traverseNext):
1193         (WebCore::FrameTree::traversePreviousWithWrap):
1194         (WebCore::FrameTree::deepLastChild):
1195         (WebCore::FrameTree::top):
1196         (printFrames):
1197         (showFrameTree):
1198         * page/FrameView.cpp:
1199         (WebCore::FrameView::setFrameRect):
1200         (WebCore::FrameView::hasCompositedContentIncludingDescendants):
1201         (WebCore::FrameView::hasCompositingAncestor):
1202         (WebCore::FrameView::flushCompositingStateIncludingSubframes):
1203         (WebCore::FrameView::updateCanBlitOnScrollRecursively):
1204         (WebCore::FrameView::setIsOverlapped):
1205         (WebCore::FrameView::shouldUseLoadTimeDeferredRepaintDelay):
1206         (WebCore::FrameView::updateLayerFlushThrottlingInAllFrames):
1207         (WebCore::FrameView::serviceScriptedAnimations):
1208         (WebCore::FrameView::updateBackgroundRecursively):
1209         (WebCore::FrameView::parentFrameView):
1210         (WebCore::FrameView::paintContentsForSnapshot):
1211         (WebCore::FrameView::setTracksRepaints):
1212         (WebCore::FrameView::notifyWidgetsInAllFrames):
1213         * page/Location.cpp:
1214         (WebCore::Location::ancestorOrigins):
1215         * page/Page.cpp:
1216         (WebCore::networkStateChanged):
1217         (WebCore::Page::~Page):
1218         (WebCore::Page::renderTreeSize):
1219         (WebCore::Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment):
1220         (WebCore::Page::setNeedsRecalcStyleInAllFrames):
1221         (WebCore::Page::refreshPlugins):
1222         (WebCore::Page::takeAnyMediaCanStartListener):
1223         (WebCore::incrementFrame):
1224         (WebCore::Page::setDefersLoading):
1225         (WebCore::Page::setMediaVolume):
1226         (WebCore::Page::setDeviceScaleFactor):
1227         (WebCore::Page::setShouldSuppressScrollbarAnimations):
1228         (WebCore::Page::didMoveOnscreen):
1229         (WebCore::Page::willMoveOffscreen):
1230         (WebCore::Page::setIsInWindow):
1231         (WebCore::Page::suspendScriptedAnimations):
1232         (WebCore::Page::resumeScriptedAnimations):
1233         (WebCore::Page::userStyleSheetLocationChanged):
1234         (WebCore::Page::allVisitedStateChanged):
1235         (WebCore::Page::visitedStateChanged):
1236         (WebCore::Page::setDebugger):
1237         (WebCore::Page::setMemoryCacheClientCallsEnabled):
1238         (WebCore::Page::setMinimumTimerInterval):
1239         (WebCore::Page::setTimerAlignmentInterval):
1240         (WebCore::Page::dnsPrefetchingStateChanged):
1241         (WebCore::Page::collectPluginViews):
1242         (WebCore::Page::storageBlockingStateChanged):
1243         (WebCore::Page::privateBrowsingStateChanged):
1244         (WebCore::Page::checkSubframeCountConsistency):
1245         (WebCore::Page::suspendActiveDOMObjectsAndAnimations):
1246         (WebCore::Page::resumeActiveDOMObjectsAndAnimations):
1247         (WebCore::Page::captionPreferencesChanged):
1248         * page/PageGroup.cpp:
1249         (WebCore::PageGroup::invalidateInjectedStyleSheetCacheInAllFrames):
1250         * page/PageGroupLoadDeferrer.cpp:
1251         (WebCore::PageGroupLoadDeferrer::PageGroupLoadDeferrer):
1252         (WebCore::PageGroupLoadDeferrer::~PageGroupLoadDeferrer):
1253         * page/PageSerializer.cpp:
1254         (WebCore::PageSerializer::serializeFrame):
1255         * page/PageThrottler.cpp:
1256         (WebCore::PageThrottler::throttlePage):
1257         (WebCore::PageThrottler::unthrottlePage):
1258         * page/Settings.cpp:
1259         (WebCore::setImageLoadingSettings):
1260         (WebCore::Settings::setTextAutosizingFontScaleFactor):
1261         * page/SpatialNavigation.cpp:
1262         (WebCore::rectToAbsoluteCoordinates):
1263         * page/animation/AnimationController.cpp:
1264         (WebCore::AnimationControllerPrivate::suspendAnimations):
1265         (WebCore::AnimationControllerPrivate::resumeAnimations):
1266         * page/mac/PageMac.cpp:
1267         (WebCore::Page::addSchedulePair):
1268         (WebCore::Page::removeSchedulePair):
1269         * page/scrolling/ScrollingCoordinator.cpp:
1270         (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
1271         (WebCore::ScrollingCoordinator::computeCurrentWheelEventHandlerCount):
1272         * plugins/PluginView.cpp:
1273         (WebCore::PluginView::performRequest):
1274         (WebCore::PluginView::load):
1275         * rendering/HitTestResult.cpp:
1276         (WebCore::HitTestResult::targetFrame):
1277         * rendering/RenderLayerCompositor.cpp:
1278         (WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers):
1279         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1280         (WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange):
1281         * rendering/TextAutosizer.cpp:
1282         (WebCore::TextAutosizer::processSubtree):
1283         * storage/StorageEventDispatcher.cpp:
1284         (WebCore::StorageEventDispatcher::dispatchSessionStorageEvents):
1285         (WebCore::StorageEventDispatcher::dispatchLocalStorageEvents):
1286         * svg/SVGSVGElement.cpp:
1287         (WebCore::SVGSVGElement::currentScale):
1288         (WebCore::SVGSVGElement::setCurrentScale):
1289         * testing/Internals.cpp:
1290         (WebCore::Internals::formControlStateOfPreviousHistoryItem):
1291         (WebCore::Internals::setFormControlStateOfPreviousHistoryItem):
1292         (WebCore::Internals::numberOfScrollableAreas):
1293         * xml/parser/XMLDocumentParserLibxml2.cpp:
1294         (WebCore::hasNoStyleInformation):
1295         Use tree(). instead of tree()->.
1296
1297 2013-08-24  Andreas Kling  <akling@apple.com>
1298
1299         Merge Document::viewportSize() logic into RenderView::viewportSize().
1300         <https://webkit.org/b/120254>
1301
1302         Reviewed by Darin Adler.
1303
1304         RenderView can just ask FrameView (the viewport) about its size directly, no need for
1305         a weirdly-placed method on Document.
1306
1307         * dom/Document.cpp:
1308         * rendering/RenderView.cpp:
1309         (WebCore::RenderView::viewportSize):
1310         * rendering/RenderView.h:
1311
1312 2013-08-24  Andreas Kling  <akling@apple.com>
1313
1314         RenderObject::frame() should return a reference.
1315         <https://webkit.org/b/120251>
1316
1317         Reviewed by Darin Adler.
1318
1319         There is now always a Frame, and we can get to it by walking this path:
1320
1321             RenderObject -> Document -> RenderView -> FrameView -> Frame
1322
1323         Removed the customary horde of null checks.
1324
1325 2013-08-24  Andreas Kling  <akling@apple.com>
1326
1327         RenderLayer::compositor() should return a reference.
1328         <https://webkit.org/b/120250>
1329
1330         Reviewed by Anders Carlsson.
1331
1332         It was already converting from a reference to a pointer.
1333
1334 2013-08-24  Yoav Weiss  <yoav@yoav.ws>
1335
1336         Eliminate a useless comparison in srcset's candidate selection algorithm
1337         https://bugs.webkit.org/show_bug.cgi?id=120235
1338
1339         There is no point in comparing the last item in the candidates vector to the DPR, since it will be returned anyway. Therefore, the
1340         iteration on the candidates vector now skips the last candidate.
1341
1342         Reviewed by Andreas Kling.
1343
1344         * html/parser/HTMLParserIdioms.cpp:
1345         (WebCore::bestFitSourceForImageAttributes):
1346
1347 2013-08-24  Andreas Kling  <akling@apple.com>
1348
1349         RenderObject::view() should return a reference.
1350         <https://webkit.org/b/120247>
1351
1352         Reviewed by Antti Koivisto.
1353
1354         Now that the lifetime and accessibility characteristics of RenderView are well-defined,
1355         we can make RenderObject::view() return a reference, exposing a plethora of unnecessary
1356         null checks.
1357
1358 2013-08-24  Joseph Pecoraro  <pecoraro@apple.com>
1359
1360         Web Inspector: Cleanup Inspector Agents a bit
1361         https://bugs.webkit.org/show_bug.cgi?id=120218
1362
1363         Reviewed by Andreas Kling.
1364
1365         Merge https://chromium.googlesource.com/chromium/blink/+/8693dcb8ba42a5c225f516c664fb0f453c8ba6f0.
1366
1367         * inspector/InspectorCSSAgent.cpp:
1368         (WebCore::InspectorCSSAgent::elementForId):
1369         * inspector/InspectorStyleSheet.cpp:
1370         (ParsedStyleSheet::ParsedStyleSheet):
1371         (WebCore::InspectorStyle::setPropertyText):
1372         (WebCore::InspectorStyle::populateAllProperties):
1373         (WebCore::InspectorStyleSheet::inlineStyleSheetText):
1374
1375 2013-08-24  Andreas Kling  <akling@apple.com>
1376
1377         Let Document keep its RenderView during render tree detach.
1378         <https://webkit.org/b/120233>
1379
1380         Reviewed by Antti Koivisto.
1381
1382         Instead of having "Document::renderer() == NULL" signify that the render tree is being
1383         torn down, give Document an explicit flag for this instead.
1384
1385         This way, we can keep Document's RenderView in place during tree detach.
1386
1387         * dom/Document.cpp:
1388         (WebCore::Document::Document):
1389         (WebCore::Document::detach):
1390         * dom/Document.h:
1391         (WebCore::Document::renderTreeBeingDestroyed):
1392         * rendering/RenderObject.h:
1393         (WebCore::RenderObject::documentBeingDestroyed):
1394
1395 2013-08-24  Antti Koivisto  <antti@apple.com>
1396
1397         Tighten before/after pseudo element accessors
1398         https://bugs.webkit.org/show_bug.cgi?id=120204
1399
1400         Reviewed by Andreas Kling.
1401
1402         We have generic looking Element::pseudoElement(PseudoID) which only returns before/after pseudo elements.
1403         
1404         Switch to Element::before/afterPseudoElement(), similarly for setters.
1405
1406         * WebCore.exp.in:
1407         * css/CSSComputedStyleDeclaration.cpp:
1408         (WebCore::ComputedStyleExtractor::styledNode):
1409         * dom/Element.cpp:
1410         (WebCore::Element::~Element):
1411         (WebCore::beforeOrAfterPseudeoElement):
1412         (WebCore::Element::computedStyle):
1413         (WebCore::Element::updatePseudoElement):
1414         (WebCore::Element::createPseudoElementIfNeeded):
1415         (WebCore::Element::updateBeforePseudoElement):
1416         (WebCore::Element::updateAfterPseudoElement):
1417         (WebCore::Element::beforePseudoElement):
1418         (WebCore::Element::afterPseudoElement):
1419         (WebCore::Element::setBeforePseudoElement):
1420         (WebCore::Element::setAfterPseudoElement):
1421         (WebCore::disconnectPseudoElement):
1422         (WebCore::Element::clearBeforePseudoElement):
1423         (WebCore::Element::clearAfterPseudoElement):
1424         (WebCore::Element::clearStyleDerivedDataBeforeDetachingRenderer):
1425         * dom/Element.h:
1426         * dom/ElementRareData.h:
1427         (WebCore::ElementRareData::beforePseudoElement):
1428         (WebCore::ElementRareData::afterPseudoElement):
1429         (WebCore::ElementRareData::hasPseudoElements):
1430         (WebCore::ElementRareData::~ElementRareData):
1431         (WebCore::ElementRareData::clearBeforePseudoElement):
1432         (WebCore::ElementRareData::clearAfterPseudoElement):
1433         (WebCore::ElementRareData::setBeforePseudoElement):
1434         (WebCore::ElementRareData::setAfterPseudoElement):
1435         
1436             Move detach logic to Element. ElementRareData should not implement semantics.
1437
1438         * dom/Node.cpp:
1439         (WebCore::Node::pseudoAwarePreviousSibling):
1440         (WebCore::Node::pseudoAwareNextSibling):
1441         (WebCore::Node::pseudoAwareFirstChild):
1442         (WebCore::Node::pseudoAwareLastChild):
1443         * dom/NodeRenderingTraversal.cpp:
1444         (WebCore::NodeRenderingTraversal::nextSiblingSlow):
1445         (WebCore::NodeRenderingTraversal::previousSiblingSlow):
1446         * rendering/RenderTreeAsText.cpp:
1447         (WebCore::writeCounterValuesFromChildren):
1448         (WebCore::counterValueForElement):
1449         * style/StyleResolveTree.cpp:
1450         (WebCore::Style::attachRenderTree):
1451         (WebCore::Style::resolveTree):
1452         * testing/Internals.cpp:
1453         (WebCore::Internals::pauseAnimationAtTimeOnPseudoElement):
1454         (WebCore::Internals::pauseTransitionAtTimeOnPseudoElement):
1455
1456 2013-08-23  Simon Fraser  <simon.fraser@apple.com>
1457
1458         Improve scrolling behavior in iTunes
1459         https://bugs.webkit.org/show_bug.cgi?id=120241
1460         <rdar://problem/14825344>
1461
1462         Reviewed by Sam Weinig.
1463
1464         When vertically scrolling a page with horizontally scrollable overflow areas,
1465         vertical scroll gestures would be interrupted when wheel events with non-zero
1466         X deltas were intercepted by the overflow areas.
1467         
1468         Fix by storing a small history of wheel events deltas and using
1469         it to determine of the scroll gesture is primarily vertical or horizontal.
1470         When this is detected, avoid dispatching scroll events on the on the
1471         non-dominant axis.
1472         
1473         Currently this behavior is conditionalized to only apply in iTunes.
1474
1475         * page/EventHandler.cpp:
1476         (WebCore::EventHandler::EventHandler):
1477         (WebCore::EventHandler::recordWheelEventDelta):
1478         (WebCore::deltaIsPredominantlyVertical):
1479         (WebCore::EventHandler::dominantScrollGestureDirection):
1480         (WebCore::EventHandler::handleWheelEvent):
1481         (WebCore::EventHandler::defaultWheelEventHandler):
1482         * page/EventHandler.h:
1483         * platform/RuntimeApplicationChecks.cpp:
1484         (WebCore::applicationIsITunes):
1485         * platform/RuntimeApplicationChecks.h:
1486
1487 2013-08-23  Pratik Solanki  <psolanki@apple.com>
1488
1489         MediaQuery::expressions() should return a reference
1490         <https://webkit.org/b/120215>
1491
1492         Reviewed by Anders Carlsson.
1493
1494         m_expressions is never NULL so we can just return a reference.
1495
1496         * css/MediaList.cpp:
1497         (WebCore::reportMediaQueryWarningIfNeeded):
1498         * css/MediaQuery.cpp:
1499         (WebCore::MediaQuery::MediaQuery):
1500         * css/MediaQuery.h:
1501         (WebCore::MediaQuery::expressions):
1502         * css/MediaQueryEvaluator.cpp:
1503         (WebCore::MediaQueryEvaluator::eval):
1504
1505 2013-08-23  Ryosuke Niwa  <rniwa@webkit.org>
1506
1507         Build fix after r154515.
1508
1509         * dom/ElementTraversal.h:
1510         (WebCore::Traversal<ElementType>::firstChild):
1511         (WebCore::Traversal<ElementType>::lastChild):
1512
1513 2013-08-23  Andreas Kling  <akling@apple.com>
1514
1515         Simplify some Settings access where we have a Frame in reach.
1516         <http://webkit.org/b/120239>
1517
1518         Reviewed by Anders Carlsson.
1519
1520         In three cases where we can grab at a Frame, we can reach all the way to some Settings
1521         without having to use pointers.
1522
1523         * loader/FrameLoader.cpp:
1524         (WebCore::FrameLoader::didBeginDocument):
1525         * rendering/RenderLayerCompositor.cpp:
1526         (WebCore::RenderLayerCompositor::addToOverlapMap):
1527         (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
1528
1529 2013-08-23  Jer Noble  <jer.noble@apple.com>
1530
1531         REGRESSION (r150516): Media controls are messed up on right-to-left webpages
1532         https://bugs.webkit.org/show_bug.cgi?id=120234
1533
1534         Reviewed by Dan Bernstein.
1535
1536         Test: media/video-rtl.html
1537
1538         Make the media control panel explicitly direction:ltr. The captions menu and captions
1539         display are unaffected, so rtl content will continue to appear rtl there.
1540
1541         * css/mediaControls.css:
1542         (audio::-webkit-media-controls-panel, video::-webkit-media-controls-panel):
1543
1544 2013-08-23  Beth Dakin  <bdakin@apple.com>
1545
1546         REGRESSION (r132545): Some PDFs generated by WebKit are blank when viewed in 
1547         Adobe Reader
1548         https://bugs.webkit.org/show_bug.cgi?id=120240
1549         -and corresponding-
1550         <rdar://problem/14634453>
1551
1552         Reviewed by Anders Carlsson.
1553
1554         This patch makes it so that we don’t use the infinite rect for the PDF context, 
1555         and it adds WebCoreSystemInterface API to find out if the current content is the 
1556         PDF context. 
1557
1558         * WebCore.exp.in:
1559         * platform/graphics/cg/GraphicsContextCG.cpp:
1560         (WebCore::GraphicsContext::clipOut):
1561         * platform/mac/WebCoreSystemInterface.h:
1562         * platform/mac/WebCoreSystemInterface.mm:
1563
1564 2013-08-23  Eric Carlson  <eric.carlson@apple.com>
1565
1566         [Mac] some track language tags are not recognized
1567         https://bugs.webkit.org/show_bug.cgi?id=119643
1568
1569         Reviewed by Jere Noble.
1570
1571         No new tests, existing tests updated.
1572
1573         * html/HTMLMediaElement.cpp:
1574         (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_captionDisplayMode from settings
1575             if possible.
1576         (WebCore::HTMLMediaElement::configureTextTrackGroup): Don't enable a default track when preferences
1577             say captions should be disabled. Don't disable an already visible track if we don't find
1578             a match unless preferences say captions should be disabled. m_forcedOrAutomaticSubtitleTrackLanguage ->
1579             m_subtitleTrackLanguage.
1580         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): If the language of the primary
1581             audio track changes, only kick off a text track recalc if caption preference are set to "automatic".
1582         * html/HTMLMediaElement.h:
1583
1584         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1585         (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation): Initialize m_characteristicsChanged
1586             and m_delayCharacteristicsChangedNotification.
1587         (WebCore::MediaPlayerPrivateAVFoundation::setHasVideo): Call characteristicsChanged.
1588         (WebCore::MediaPlayerPrivateAVFoundation::setHasAudio): Ditto.
1589         (WebCore::MediaPlayerPrivateAVFoundation::setHasClosedCaptions): Ditto.
1590         (WebCore::MediaPlayerPrivateAVFoundation::characteristicsChanged): New, allows us to coalesce 
1591             calls to the media player when we know several characteristics may change.
1592         (WebCore::MediaPlayerPrivateAVFoundation::setDelayCharacteristicsChangedNotification): Enable or
1593             disable notification delay.
1594         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1595
1596         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1597         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): Always call languageOfPrimaryAudioTrack(),
1598             a track may have changed so we may have a new language.
1599         (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack): Call [AVAssetTrack languageCode]
1600             if [AVAssetTrack extendedLanguageTag] returns NULL in case the media file has an old
1601             QuickTime language code.
1602
1603 2013-08-23  Andreas Kling  <akling@apple.com>
1604
1605         RenderView::compositor() should return a reference.
1606         <https://webkit.org/b/120217>
1607
1608         Reviewed by Beth Dakin.
1609
1610         The RenderLayerCompositor is lazily constructed by compositor() and never returns null.
1611
1612 2013-08-23  Yoav Weiss  <yoav@yoav.ws>
1613
1614         Fix srcset's image candidate algorithm when DPR exceeds all candidates
1615         https://bugs.webkit.org/show_bug.cgi?id=120168
1616
1617         When the DPR exceeded the 'x' qualifier of all image candidates, none was chosen.
1618
1619         From the srcset spec: "If there are any entries in candidates that have an associated pixel density that is less than a
1620         user-agent-defined value giving the nominal pixel density of the display, then remove them, unless that would remove all the
1621         entries, in which case remove only the entries whose associated pixel density is less than the greatest such pixel density."
1622
1623         Fixed by returning the last one in the list of candidates sorted by their qualifier, in case none of them is equal or greater than
1624         DPR.
1625         
1626         Reviewed by Andreas Kling.
1627
1628         Test: fast/hidpi/image-srcset-fraction.html
1629
1630         * html/parser/HTMLParserIdioms.cpp:
1631         (WebCore::bestFitSourceForImageAttributes):
1632
1633 2013-08-23  Chris Fleizach  <cfleizach@apple.com>
1634
1635         <https://webkit.org/b/113895> Webkit exposes aria-expanded="undefined" as aria-expanded="false" (AXExpanded = NO)
1636
1637         Reviewed by Darin Adler.
1638
1639         Don't support the ARIA expanded attribute unless the value is one of the defined ARIA values (true/false).
1640
1641         Test: platform/mac/accessibility/aria-expanded-not-exposed-when-undefined.html
1642
1643         * accessibility/AccessibilityObject.cpp:
1644         (WebCore::AccessibilityObject::supportsARIAExpanded):
1645
1646 2013-08-17  Darin Adler  <darin@apple.com>
1647
1648         <https://webkit.org/b/119945> Some cleanup for PasteboardIOS
1649
1650         Reviewed by Andreas Kling.
1651
1652         * platform/ios/PasteboardIOS.mm:
1653         (WebCore::Pasteboard::setFrame): Moved this function up near the
1654         create functions and constructors.
1655         (WebCore::documentFragmentWithRTF): Tweaked formatting.
1656         (WebCore::Pasteboard::documentFragmentForPasteboardItemAtIndex):
1657         Ditto.
1658         (WebCore::utiTypeFromCocoaType): Changed to use early return and removed
1659         an unneeded local variable.
1660         (WebCore::cocoaTypeFromHTMLClipboardType): Renamed the quaint qType and
1661         pbType local variables, and tweaked formatting.
1662         (WebCore::Pasteboard::clear): Tweaked comment.
1663         (WebCore::Pasteboard::readString): Tweaked formatting.
1664         (WebCore::addHTMLClipboardTypesForCocoaType): Tweaked formatting.
1665         (WebCore::Pasteboard::writeString): Streamlined logic and tweaked formatting
1666         (WebCore::Pasteboard::types): Renamed pbType to just type.
1667
1668 2013-08-23  Bem Jones-Bey  <bjonesbe@adobe.com>
1669
1670         Attempt to make it more clear what FloatIntervalSearchAdaptor::collectIfNeeded is doing
1671         https://bugs.webkit.org/show_bug.cgi?id=119816
1672
1673         Reviewed by David Hyatt.
1674
1675         This is a port from Blink of
1676         https://src.chromium.org/viewvc/blink?revision=155885&view=revision
1677         Original Patch by Eric Seidel
1678
1679         Original comments:
1680
1681         "It seemed to me that template specifications would be clearer than an
1682         if.  They also allow for compile-time error checking were a 3rd type
1683         of float to come into existance in CSS4. :p
1684
1685         For any unfamiliar with this method, this the object used for
1686         performing a search on a RedBlackTree in WTF.
1687
1688         We create one of these adaptors, specifying that we want to search for
1689         values in a specific (logical) Y interval, and this adaptor is called
1690         back for any values in the RBTree cooresponding to that interval
1691         range.
1692
1693         The job of this adaptor is to collect the various values we care
1694         about, including the left or right-most offset of the floats in that
1695         Y-range as well as what the last (document order) float seen in that
1696         range.
1697
1698         It also collects the remaining available height for the block but I'm
1699         less clear on how that parameter is used."
1700
1701         Note that in addition to the original change, I have made the
1702         updateOffsetIfNeeded and rangesIntersect methods inline, as this was
1703         shown to be a performance win in
1704         https://src.chromium.org/viewvc/blink?revision=156064&view=revision
1705         and it seemed a rather trivial change to be subject to a separate
1706         patch when porting.
1707
1708         No new tests, no behavior change.
1709
1710         * rendering/RenderBlock.cpp:
1711         (WebCore::::updateOffsetIfNeeded):
1712         (WebCore::::collectIfNeeded):
1713         * rendering/RenderBlock.h:
1714
1715 2013-08-23  David Kilzer  <ddkilzer@apple.com>
1716
1717         WebCore fails to link due to changes in Objective-C++ ABI in trunk clang
1718         <http://webkit.org/b/120183>
1719         <rdar://problem/14764114>
1720
1721         Reviewed by Eric Carlson.
1722
1723         The trunk version of clang made an ABI change for Objective-C++
1724         parameters that caused WebCore to fail to link.  The short-term
1725         fix is to change the parameter type from id<protocol> to just id
1726         and add an ASSERT that the parameter still conforms to the
1727         protocol.
1728
1729         * platform/DragData.h:
1730         (DragDataRef): Change typedef from id<NSDragInfo> to id.
1731         * platform/mac/DragDataMac.mm:
1732         (WebCore::DragData::DragData): Add ASSERT that checks that the
1733         DragDataRef object implements the NSDragInfo protocol.
1734
1735 2013-08-23  Andreas Kling  <akling@apple.com>
1736
1737         RenderLayerCompositor::m_renderView should be a reference.
1738         <https://webkit.org/b/120210>
1739
1740         Reviewed by Antti Koivisto.
1741
1742         The RenderLayerCompositor is always created by a RenderView passing itself to the constructor.
1743         By making m_renderView a reference, we flush out some unnecessary null checks.
1744         We also gain a pointer-free path to Settings through m_renderView.frameView().frame().settings()
1745         so we don't have to make those blocks conditional anymore, reducing ambiguity.
1746
1747         * rendering/RenderLayerCompositor.cpp:
1748         * rendering/RenderLayerCompositor.h:
1749         * rendering/RenderView.cpp:
1750         (WebCore::RenderView::compositor):
1751
1752 2013-08-23  Andreas Kling  <akling@apple.com>
1753
1754         RenderView::frameView() should return a reference.
1755         <https://webkit.org/b/120208>
1756
1757         Reviewed by Antti Koivisto.
1758
1759         A RenderView should always have a corresponding FrameView, so make frameView()
1760         return a reference. Also remove a myriad of now-impossible null checks.
1761
1762 2013-08-23  Allan Sandfeld Jensen  <allan.jensen@digia.com>
1763
1764         REGRESSION(r153939) Fix typo in Qt build-files
1765
1766         Reviewed by Antti Koivisto.
1767
1768         Fix simple typo in Target.pri introduced in r153939.
1769
1770         * Target.pri:
1771
1772 2013-08-23  Antti Koivisto  <antti@apple.com>
1773
1774         <https://webkit.org/b/120166> Add Traversal<ElementType> template
1775
1776         Reviewed by Andreas Kling.
1777
1778         It is common to traverse through a subtree looking for elements of specific type and then casting to the type. This pattern can be generalized.
1779         
1780         This patch adds a new Traversal<typename ElementType> template. It works like ElementTraversal except that the traversal is limited to the specified type.
1781         The patch also uses the template in a bunch of applicable places.
1782
1783         * WebCore.exp.in:
1784         * accessibility/AccessibilityRenderObject.cpp:
1785         (WebCore::AccessibilityRenderObject::addImageMapChildren):
1786         * dom/Document.cpp:
1787         (WebCore::Document::removeTitle):
1788         (WebCore::Document::updateBaseURL):
1789         (WebCore::Document::processBaseElement):
1790         * dom/Element.h:
1791         * dom/ElementTraversal.h:
1792         (WebCore::::firstChildTemplate):
1793         (WebCore::::firstWithinTemplate):
1794         (WebCore::::lastChildTemplate):
1795         (WebCore::::lastWithinTemplate):
1796         (WebCore::::nextTemplate):
1797         (WebCore::::previousTemplate):
1798         (WebCore::::nextSiblingTemplate):
1799         (WebCore::::previousSiblingTemplate):
1800         (WebCore::::nextSkippingChildrenTemplate):
1801         (WebCore::::firstChild):
1802         (WebCore::::lastChild):
1803         (WebCore::::firstWithin):
1804         (WebCore::::lastWithin):
1805         (WebCore::::next):
1806         (WebCore::::previous):
1807         (WebCore::::nextSibling):
1808         (WebCore::::previousSibling):
1809         (WebCore::::nextSkippingChildren):
1810         (WebCore::ElementTraversal::previousIncludingPseudo):
1811         (WebCore::ElementTraversal::nextIncludingPseudo):
1812         (WebCore::ElementTraversal::nextIncludingPseudoSkippingChildren):
1813         (WebCore::ElementTraversal::pseudoAwarePreviousSibling):
1814         * dom/Node.cpp:
1815         (WebCore::Node::numberOfScopedHTMLStyleChildren):
1816         * dom/NodeIterator.cpp:
1817         (WebCore::NodeIterator::NodeIterator):
1818         * dom/NodeIterator.h:
1819         * dom/Traversal.cpp:
1820         (WebCore::NodeIteratorBase::NodeIteratorBase):
1821         (WebCore::NodeIteratorBase::acceptNode):
1822         * dom/Traversal.h:
1823         
1824             Renamed existing class called Traversal to less generic NodeIteratorBase.
1825
1826         * dom/TreeScope.cpp:
1827         (WebCore::TreeScope::labelElementForId):
1828         (WebCore::TreeScope::findAnchor):
1829         * dom/TreeWalker.cpp:
1830         (WebCore::TreeWalker::TreeWalker):
1831         * dom/TreeWalker.h:
1832         * editing/FrameSelection.cpp:
1833         (WebCore::scanForForm):
1834         * editing/markup.cpp:
1835         (WebCore::createContextualFragment):
1836         * html/HTMLAnchorElement.h:
1837         (WebCore::isHTMLAnchorElement):
1838         (WebCore::HTMLAnchorElement):
1839         * html/HTMLAreaElement.h:
1840         (WebCore::isHTMLAreaElement):
1841         (WebCore::HTMLAreaElement):
1842         * html/HTMLBaseElement.h:
1843         (WebCore::isHTMLBaseElement):
1844         (WebCore::HTMLBaseElement):
1845         * html/HTMLElement.h:
1846         (WebCore::HTMLElement):
1847         * html/HTMLFieldSetElement.cpp:
1848         (WebCore::HTMLFieldSetElement::invalidateDisabledStateUnder):
1849         (WebCore::HTMLFieldSetElement::childrenChanged):
1850         (WebCore::HTMLFieldSetElement::legend):
1851         * html/HTMLFormControlElement.h:
1852         (WebCore::toHTMLFormControlElement):
1853         (WebCore::HTMLFormControlElement):
1854         * html/HTMLLabelElement.cpp:
1855         (WebCore::nodeAsSupportedLabelableElement):
1856         (WebCore::HTMLLabelElement::control):
1857         * html/HTMLLabelElement.h:
1858         (WebCore::isHTMLLabelElement):
1859         (WebCore::HTMLLabelElement):
1860         * html/HTMLLegendElement.h:
1861         (WebCore::isHTMLLegendElement):
1862         (WebCore::HTMLLegendElement):
1863         * html/HTMLMapElement.cpp:
1864         (WebCore::HTMLMapElement::mapMouseEvent):
1865         * html/HTMLMediaElement.cpp:
1866         (WebCore::HTMLMediaElement::finishParsingChildren):
1867         * html/HTMLStyleElement.h:
1868         (WebCore::isHTMLStyleElement):
1869         (WebCore::HTMLStyleElement):
1870         * html/HTMLTitleElement.h:
1871         (WebCore::HTMLTitleElement):
1872         * html/HTMLTrackElement.h:
1873         (WebCore::isHTMLTrackElement):
1874         (WebCore::HTMLTrackElement):
1875         * html/LabelableElement.h:
1876         (WebCore::isLabelableElement):
1877         (WebCore::LabelableElement):
1878         * rendering/FilterEffectRenderer.cpp:
1879         (WebCore::FilterEffectRenderer::buildReferenceFilter):
1880         * svg/SVGElement.h:
1881         (WebCore::SVGElement):
1882         * svg/SVGForeignObjectElement.h:
1883         (WebCore::isSVGForeignObjectElement):
1884         (WebCore::SVGForeignObjectElement):
1885         * svg/SVGSVGElement.cpp:
1886         (WebCore::SVGSVGElement::collectIntersectionOrEnclosureList):
1887         (WebCore::SVGSVGElement::getElementById):
1888         * svg/SVGStyledElement.cpp:
1889         (WebCore::SVGStyledElement::title):
1890         * svg/SVGTitleElement.h:
1891         (WebCore::SVGTitleElement):
1892         * svg/animation/SMILTimeContainer.cpp:
1893         (WebCore::SMILTimeContainer::updateDocumentOrderIndexes):
1894         * svg/animation/SVGSMILElement.cpp:
1895         (WebCore::SVGSMILElement::isSMILElement):
1896         * svg/animation/SVGSMILElement.h:
1897         (WebCore::SVGSMILElement):
1898         * svg/graphics/SVGImage.cpp:
1899         (WebCore::SVGImage::hasSingleSecurityOrigin):
1900
1901 2013-08-23  Arpita Bahuguna  <a.bah@samsung.com>
1902
1903         <br> does not get deleted when inlined after some non-textual content.
1904         https://bugs.webkit.org/show_bug.cgi?id=120006
1905
1906         Reviewed by Ryosuke Niwa.
1907
1908         deleteSelectionCommand does not handle the case when a <br> element is
1909         inlined after some non-textual content (input controls, image etc.).
1910
1911         When doing a back-delete at the start of a line following such a <br>
1912         the two contiguous lines should merge and the <br> should get deleted.
1913         Currently, even though the <br> is deleted, another placeholder <br>
1914         is incorrectly inserted at the same point, thus effectively there is no
1915         change.
1916
1917         We are incorrectly computing the inline <br> to be at the start of an
1918         empty line even though the line is not empty.
1919
1920         Test: editing/deleting/delete-inline-br.html
1921
1922         * editing/DeleteSelectionCommand.cpp:
1923         (WebCore::DeleteSelectionCommand::handleSpecialCaseBRDelete):
1924         Adding a check to verify that the inline <br> is not on an empty line
1925         if the end node is not a <br> element itself and it's previous sibling
1926         is the start <br> element.
1927
1928         Basically we check whether there is another node (end node) following
1929         the <br>, that the node is not a <br> itself, and that the end node's
1930         previous node is the start <br>.
1931
1932 2013-08-23  Renata Hodovan  <reni@webkit.org>
1933
1934         Missing null-check in HTMLFormElement::rendererIsNeeded()
1935         https://bugs.webkit.org/show_bug.cgi?id=120159
1936
1937         Reviewed by Ryosuke Niwa.
1938
1939         Null-check parentRenderer in HTMLFormElement::rendererIsNeeded()
1940         and early return.
1941
1942         Test: fast/forms/missing-parentrenderer-crash.html
1943
1944         * html/HTMLFormElement.cpp:
1945         (WebCore::HTMLFormElement::rendererIsNeeded):
1946
1947 2013-08-23  Zalan Bujtas  <zalan@apple.com>
1948
1949         MathML: ASSERTION FAILED: !isPreferredLogicalHeightDirty() in RenderMathMLBlock::preferredLogicalHeight() const
1950         https://bugs.webkit.org/show_bug.cgi?id=120157
1951
1952         Reviewed by Antti Koivisto.
1953
1954         RenderListMarker needs to be inserted to the render tree before
1955         we start computing the preferred logical widths for the associated
1956         RenderListItem.
1957
1958         Test: mathml/mn-as-list-item-assert.html
1959
1960         * rendering/RenderListItem.cpp:
1961         (WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
1962         (WebCore::RenderListItem::layout):
1963         (WebCore::RenderListItem::computePreferredLogicalWidths):
1964         * rendering/RenderListItem.h:
1965
1966 2013-08-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1967
1968         Introduce toSVGLinearGradientElement(), and use it
1969         https://bugs.webkit.org/show_bug.cgi?id=120154
1970
1971         Reviewed by Andreas Kling.
1972
1973         As a step to clean-up static_cast<SVGXXX>, toSVGLinearGradientElement() is added to clean-up
1974         static_cast<SVGLinearGradientElement*>.
1975
1976         * rendering/svg/RenderSVGResourceLinearGradient.cpp:
1977         (WebCore::RenderSVGResourceLinearGradient::collectGradientAttributes):
1978         * rendering/svg/SVGRenderTreeAsText.cpp:
1979         (WebCore::writeSVGResourceContainer):
1980         * svg/SVGLinearGradientElement.cpp:
1981         (WebCore::SVGLinearGradientElement::collectGradientAttributes):
1982         * svg/SVGLinearGradientElement.h:
1983         (WebCore::toSVGLinearGradientElement):
1984
1985 2013-08-22  Simon Fraser  <simon.fraser@apple.com>
1986
1987         compositing/geometry/bounds-ignores-hidden-dynamic.html has incorrect initial rendering
1988         https://bugs.webkit.org/show_bug.cgi?id=119825
1989
1990         Reviewed by Tim Horton.
1991         
1992         r137526 and some earlier commits attempted to avoid unconditionally
1993         repainting layers when their size changes, because this was causing
1994         TiledBacking layers to repaint when the document size changed.
1995         
1996         However, the approach required that we have good information about
1997         whether size changes require a repaint, which in some cases is hard
1998         to determine, especially when RenderLayer changes affect our
1999         decisions about which layers are composited.
2000         
2001         Fix by pushing the decision about whether to repaint on size change
2002         into GraphicsLayer. The default is to repaint on size change,
2003         but GraphicsLayer provides a function that can be overridden to
2004         modify this behavior; GraphicsLayerCA does so to avoid repaints
2005         when layers with TiledBackings get resized.
2006
2007         Test: compositing/repaint/repaint-on-layer-grouping-change.html
2008
2009         * WebCore.exp.in: WebKit2 needs GraphicsLayer::setSize, which is no longer inline.
2010         * platform/graphics/GraphicsLayer.cpp:
2011         (WebCore::GraphicsLayer::setOffsetFromRenderer):
2012         (WebCore::GraphicsLayer::setSize):
2013         * platform/graphics/GraphicsLayer.h:
2014         (WebCore::GraphicsLayer::shouldRepaintOnSizeChange):
2015         * platform/graphics/ca/GraphicsLayerCA.cpp:
2016         (WebCore::GraphicsLayerCA::shouldRepaintOnSizeChange):
2017         * platform/graphics/ca/GraphicsLayerCA.h:
2018         * rendering/RenderLayerBacking.h: No longer need m_boundsConstrainedByClipping
2019         * rendering/RenderLayerBacking.cpp:
2020         (WebCore::RenderLayerBacking::RenderLayerBacking):
2021         (WebCore::RenderLayerBacking::updateCompositedBounds):
2022         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): setSize takes
2023         care of repainting for us now, so we can remove all the conditional code.
2024
2025 2013-08-22  Simon Fraser  <simon.fraser@apple.com>
2026
2027         Repaint counters are sometimes not in the corner of the compositing layer
2028         https://bugs.webkit.org/show_bug.cgi?id=120176
2029
2030         Reviewed by Beth Dakin.
2031
2032         Sometimes the repaint counters are not in the corner of the compositing layer;
2033         they are either inset, or partially or entirely outside the layer.
2034         
2035         Fix by making sure that we restore the CGContext before drawing
2036         the counter, since the WebCore code may have translated the CTM.
2037         
2038         The counter-painting code saves and restores the context itself,
2039         so this is safe.
2040
2041         * platform/graphics/mac/WebLayer.mm:
2042         (drawLayerContents):
2043
2044 2013-08-22  Tim Horton  <timothy_horton@apple.com>
2045
2046         Unavailable plug-in indicator text is one pixel too low
2047         https://bugs.webkit.org/show_bug.cgi?id=120177
2048         <rdar://problem/14811951>
2049
2050         Reviewed by Kevin Decker.
2051
2052         Move the unavailable plug-in indicator text up one pixel.
2053
2054         * rendering/RenderEmbeddedObject.cpp:
2055         (WebCore::RenderEmbeddedObject::paintReplaced):
2056
2057 2013-08-22  Christophe Dumez  <ch.dumez@sisa.samsung.com>
2058
2059         [SVG2] Merge SVGStyledElement and SVGElement
2060         https://bugs.webkit.org/show_bug.cgi?id=107386
2061
2062         Reviewed by Andreas Kling.
2063
2064         Merge SVGStyledElement into SVGElement to simplify the SVG inheritance
2065         model and match the SVG2 specification:
2066         https://svgwg.org/svg2-draft/single-page.html#types-InterfaceSVGElement
2067
2068         Test: svg/dom/svg2-inheritance.html
2069
2070         * CMakeLists.txt:
2071         * DerivedSources.cpp:
2072         * DerivedSources.make:
2073         * DerivedSources.pri:
2074         * GNUmakefile.list.am:
2075         * Target.pri:
2076         * WebCore.order:
2077         * WebCore.vcxproj/WebCore.vcxproj:
2078         * WebCore.vcxproj/WebCore.vcxproj.filters:
2079         * WebCore.xcodeproj/project.pbxproj:
2080         * accessibility/AccessibilityNodeObject.cpp:
2081         (WebCore::AccessibilityNodeObject::alternativeText):
2082         (WebCore::AccessibilityNodeObject::accessibilityDescription):
2083         * css/SVGCSSStyleSelector.cpp:
2084         * rendering/style/SVGRenderStyle.cpp:
2085         * rendering/svg/RenderSVGContainer.cpp:
2086         (WebCore::RenderSVGContainer::RenderSVGContainer):
2087         * rendering/svg/RenderSVGContainer.h:
2088         * rendering/svg/RenderSVGHiddenContainer.cpp:
2089         (WebCore::RenderSVGHiddenContainer::RenderSVGHiddenContainer):
2090         * rendering/svg/RenderSVGHiddenContainer.h:
2091         * rendering/svg/RenderSVGModelObject.cpp:
2092         (WebCore::RenderSVGModelObject::RenderSVGModelObject):
2093         (WebCore::getElementCTM):
2094         * rendering/svg/RenderSVGModelObject.h:
2095         * rendering/svg/RenderSVGResourceClipper.cpp:
2096         (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
2097         (WebCore::RenderSVGResourceClipper::calculateClipContentRepaintRect):
2098         (WebCore::RenderSVGResourceClipper::hitTestClipContent):
2099         * rendering/svg/RenderSVGResourceContainer.cpp:
2100         (WebCore::RenderSVGResourceContainer::RenderSVGResourceContainer):
2101         * rendering/svg/RenderSVGResourceContainer.h:
2102         * rendering/svg/RenderSVGResourceFilter.cpp:
2103         * rendering/svg/RenderSVGResourceFilterPrimitive.h:
2104         * rendering/svg/RenderSVGResourceMarker.cpp:
2105         * rendering/svg/RenderSVGResourceMarker.h:
2106         * rendering/svg/RenderSVGResourceMasker.cpp:
2107         (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
2108         (WebCore::RenderSVGResourceMasker::calculateMaskContentRepaintRect):
2109         * rendering/svg/RenderSVGResourcePattern.cpp:
2110         (WebCore::RenderSVGResourcePattern::createTileImage):
2111         * rendering/svg/RenderSVGRoot.cpp:
2112         (WebCore::RenderSVGRoot::RenderSVGRoot):
2113         * rendering/svg/RenderSVGRoot.h:
2114         * rendering/svg/RenderSVGViewportContainer.cpp:
2115         (WebCore::RenderSVGViewportContainer::RenderSVGViewportContainer):
2116         * rendering/svg/RenderSVGViewportContainer.h:
2117         * rendering/svg/SVGRenderSupport.cpp:
2118         (WebCore::SVGRenderSupport::layoutChildren):
2119         * rendering/svg/SVGRenderTreeAsText.cpp:
2120         * rendering/svg/SVGResources.cpp:
2121         (WebCore::registerPendingResource):
2122         * rendering/svg/SVGResourcesCache.cpp:
2123         * svg/SVGAElement.cpp:
2124         (WebCore::SVGAElement::title):
2125         * svg/SVGAllInOne.cpp:
2126         * svg/SVGAltGlyphDefElement.h:
2127         * svg/SVGAltGlyphItemElement.h:
2128         * svg/SVGAnimateElement.cpp:
2129         * svg/SVGAnimatedType.cpp:
2130         (WebCore::SVGAnimatedType::valueAsString):
2131         (WebCore::SVGAnimatedType::setValueAsString):
2132         * svg/SVGAnimationElement.cpp:
2133         (WebCore::SVGAnimationElement::isTargetAttributeCSSProperty):
2134         (WebCore::SVGAnimationElement::computeCSSPropertyValue):
2135         (WebCore::SVGAnimationElement::adjustForInheritance):
2136         (WebCore::inheritsFromProperty):
2137         * svg/SVGComponentTransferFunctionElement.h:
2138         * svg/SVGCursorElement.h:
2139         * svg/SVGDescElement.cpp:
2140         (WebCore::SVGDescElement::SVGDescElement):
2141         * svg/SVGDescElement.h:
2142         * svg/SVGDescElement.idl:
2143         * svg/SVGElement.cpp:
2144         (WebCore::mapAttributeToCSSProperty):
2145         (WebCore::cssPropertyToTypeMap):
2146         (WebCore::SVGElement::SVGElement):
2147         (WebCore::SVGElement::~SVGElement):
2148         (WebCore::SVGElement::removedFrom):
2149         (WebCore::SVGElement::parseAttribute):
2150         (WebCore::SVGElement::animatedPropertyTypeForAttribute):
2151         (WebCore::collectInstancesForSVGElement):
2152         (WebCore::SVGElement::isAnimatableAttribute):
2153         (WebCore::SVGElement::title):
2154         (WebCore::SVGElement::rendererIsNeeded):
2155         (WebCore::SVGElement::cssPropertyIdForSVGAttributeName):
2156         (WebCore::SVGElement::isAnimatableCSSProperty):
2157         (WebCore::SVGElement::isPresentationAttribute):
2158         (WebCore::SVGElement::collectStyleForPresentationAttribute):
2159         (WebCore::SVGElement::isKnownAttribute):
2160         (WebCore::SVGElement::svgAttributeChanged):
2161         (WebCore::SVGElement::insertedInto):
2162         (WebCore::SVGElement::buildPendingResourcesIfNeeded):
2163         (WebCore::SVGElement::childrenChanged):
2164         (WebCore::SVGElement::getPresentationAttribute):
2165         (WebCore::SVGElement::instanceUpdatesBlocked):
2166         (WebCore::SVGElement::setInstanceUpdatesBlocked):
2167         (WebCore::SVGElement::localCoordinateSpaceTransform):
2168         (WebCore::SVGElement::updateRelativeLengthsInformation):
2169         (WebCore::SVGElement::isMouseFocusable):
2170         (WebCore::SVGElement::isKeyboardFocusable):
2171         * svg/SVGElement.h:
2172         (WebCore::SVGElement::supportsMarkers):
2173         (WebCore::SVGElement::hasRelativeLengths):
2174         (WebCore::SVGElement::needsPendingResourceHandling):
2175         (WebCore::SVGElement::selfHasRelativeLengths):
2176         (WebCore::SVGElement::updateRelativeLengthsInformation):
2177         * svg/SVGElement.idl:
2178         * svg/SVGElementInstance.cpp:
2179         (WebCore::SVGElementInstance::invalidateAllInstancesOfElement):
2180         (WebCore::SVGElementInstance::InstanceUpdateBlocker::InstanceUpdateBlocker):
2181         * svg/SVGElementInstance.h:
2182         * svg/SVGFEBlendElement.idl:
2183         * svg/SVGFEColorMatrixElement.idl:
2184         * svg/SVGFEComponentTransferElement.idl:
2185         * svg/SVGFECompositeElement.idl:
2186         * svg/SVGFEConvolveMatrixElement.idl:
2187         * svg/SVGFEDiffuseLightingElement.idl:
2188         * svg/SVGFEDisplacementMapElement.idl:
2189         * svg/SVGFEDropShadowElement.idl:
2190         * svg/SVGFEFloodElement.idl:
2191         * svg/SVGFEGaussianBlurElement.idl:
2192         * svg/SVGFEImageElement.idl:
2193         * svg/SVGFELightElement.h:
2194         * svg/SVGFEMergeElement.idl:
2195         * svg/SVGFEMergeNodeElement.h:
2196         * svg/SVGFEMorphologyElement.idl:
2197         * svg/SVGFEOffsetElement.idl:
2198         * svg/SVGFESpecularLightingElement.idl:
2199         * svg/SVGFETileElement.idl:
2200         * svg/SVGFETurbulenceElement.idl:
2201         * svg/SVGFilterElement.cpp:
2202         (WebCore::SVGFilterElement::SVGFilterElement):
2203         (WebCore::SVGFilterElement::parseAttribute):
2204         (WebCore::SVGFilterElement::svgAttributeChanged):
2205         (WebCore::SVGFilterElement::childrenChanged):
2206         * svg/SVGFilterElement.h:
2207         * svg/SVGFilterElement.idl:
2208         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
2209         (WebCore::SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes):
2210         (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute):
2211         (WebCore::SVGFilterPrimitiveStandardAttributes::svgAttributeChanged):
2212         (WebCore::SVGFilterPrimitiveStandardAttributes::childrenChanged):
2213         (WebCore::SVGFilterPrimitiveStandardAttributes::rendererIsNeeded):
2214         * svg/SVGFilterPrimitiveStandardAttributes.h:
2215         * svg/SVGFontElement.cpp:
2216         (WebCore::SVGFontElement::SVGFontElement):
2217         * svg/SVGFontElement.h:
2218         * svg/SVGFontFaceElement.cpp:
2219         * svg/SVGFontFaceElement.h:
2220         * svg/SVGFontFaceFormatElement.h:
2221         * svg/SVGFontFaceNameElement.h:
2222         * svg/SVGFontFaceSrcElement.h:
2223         * svg/SVGFontFaceUriElement.h:
2224         * svg/SVGGElement.cpp:
2225         (WebCore::SVGGElement::rendererIsNeeded):
2226         * svg/SVGGlyphElement.cpp:
2227         (WebCore::SVGGlyphElement::SVGGlyphElement):
2228         (WebCore::SVGGlyphElement::parseAttribute):
2229         (WebCore::SVGGlyphElement::insertedInto):
2230         (WebCore::SVGGlyphElement::removedFrom):
2231         * svg/SVGGlyphElement.h:
2232         * svg/SVGGlyphRefElement.cpp:
2233         (WebCore::SVGGlyphRefElement::SVGGlyphRefElement):
2234         (WebCore::SVGGlyphRefElement::parseAttribute):
2235         * svg/SVGGlyphRefElement.h:
2236         * svg/SVGGlyphRefElement.idl:
2237         * svg/SVGGradientElement.cpp:
2238         (WebCore::SVGGradientElement::SVGGradientElement):
2239         (WebCore::SVGGradientElement::parseAttribute):
2240         (WebCore::SVGGradientElement::svgAttributeChanged):
2241         (WebCore::SVGGradientElement::childrenChanged):
2242         * svg/SVGGradientElement.h:
2243         * svg/SVGGradientElement.idl:
2244         * svg/SVGGraphicsElement.cpp:
2245         (WebCore::SVGGraphicsElement::SVGGraphicsElement):
2246         (WebCore::SVGGraphicsElement::parseAttribute):
2247         (WebCore::SVGGraphicsElement::svgAttributeChanged):
2248         * svg/SVGGraphicsElement.h:
2249         * svg/SVGGraphicsElement.idl:
2250         * svg/SVGLocatable.cpp:
2251         (WebCore::SVGLocatable::computeCTM):
2252         * svg/SVGMPathElement.h:
2253         * svg/SVGMarkerElement.cpp:
2254         (WebCore::SVGMarkerElement::SVGMarkerElement):
2255         (WebCore::SVGMarkerElement::parseAttribute):
2256         (WebCore::SVGMarkerElement::svgAttributeChanged):
2257         (WebCore::SVGMarkerElement::childrenChanged):
2258         * svg/SVGMarkerElement.h:
2259         * svg/SVGMarkerElement.idl:
2260         * svg/SVGMaskElement.cpp:
2261         (WebCore::SVGMaskElement::SVGMaskElement):
2262         (WebCore::SVGMaskElement::parseAttribute):
2263         (WebCore::SVGMaskElement::svgAttributeChanged):
2264         (WebCore::SVGMaskElement::childrenChanged):
2265         * svg/SVGMaskElement.h:
2266         * svg/SVGMaskElement.idl:
2267         * svg/SVGMetadataElement.h:
2268         * svg/SVGMissingGlyphElement.cpp:
2269         (WebCore::SVGMissingGlyphElement::SVGMissingGlyphElement):
2270         * svg/SVGMissingGlyphElement.h:
2271         * svg/SVGMissingGlyphElement.idl:
2272         * svg/SVGPatternElement.cpp:
2273         (WebCore::SVGPatternElement::SVGPatternElement):
2274         (WebCore::SVGPatternElement::parseAttribute):
2275         (WebCore::SVGPatternElement::svgAttributeChanged):
2276         (WebCore::SVGPatternElement::childrenChanged):
2277         * svg/SVGPatternElement.h:
2278         * svg/SVGPatternElement.idl:
2279         * svg/SVGScriptElement.h:
2280         * svg/SVGStopElement.cpp:
2281         (WebCore::SVGStopElement::SVGStopElement):
2282         (WebCore::SVGStopElement::parseAttribute):
2283         (WebCore::SVGStopElement::svgAttributeChanged):
2284         * svg/SVGStopElement.h:
2285         * svg/SVGStopElement.idl:
2286         * svg/SVGStyleElement.h:
2287         * svg/SVGStyledElement.cpp: Removed.
2288         * svg/SVGStyledElement.h: Removed.
2289         * svg/SVGStyledElement.idl: Removed.
2290         * svg/SVGSymbolElement.cpp:
2291         (WebCore::SVGSymbolElement::SVGSymbolElement):
2292         (WebCore::SVGSymbolElement::parseAttribute):
2293         (WebCore::SVGSymbolElement::svgAttributeChanged):
2294         * svg/SVGSymbolElement.h:
2295         * svg/SVGSymbolElement.idl:
2296         * svg/SVGTRefElement.cpp:
2297         (WebCore::SVGTRefElement::insertedInto):
2298         (WebCore::SVGTRefElement::removedFrom):
2299         * svg/SVGTitleElement.cpp:
2300         (WebCore::SVGTitleElement::SVGTitleElement):
2301         (WebCore::SVGTitleElement::insertedInto):
2302         * svg/SVGTitleElement.h:
2303         * svg/SVGTitleElement.idl:
2304         * svg/SVGTransformable.cpp:
2305         * svg/SVGUseElement.cpp:
2306         (WebCore::SVGUseElement::selfHasRelativeLengths):
2307         * svg/SVGViewElement.cpp:
2308         (WebCore::SVGViewElement::SVGViewElement):
2309         (WebCore::SVGViewElement::parseAttribute):
2310         * svg/SVGViewElement.h:
2311         * svg/animation/SVGSMILElement.h:
2312         * svg/graphics/filters/SVGFEImage.cpp:
2313         (WebCore::FEImage::platformApplySoftware):
2314
2315 2013-08-22  Andreas Kling  <akling@apple.com>
2316
2317         FrameLoader::history() should return a reference.
2318         <https://webkit.org/b/120163>
2319
2320         Reviewed by Anders Carlsson.
2321
2322         Rehued by Anders Carlsson.
2323
2324         FrameLoader::m_history is never null, so make history() return a reference.
2325         Also made HistoryController::m_frame a reference, since HistoryController's
2326         lifetime is tied to FrameLoader, which is tied to the Frame.
2327
2328 2013-08-21  Simon Fraser  <simon.fraser@apple.com>
2329
2330         Reloading this video test shows garbage briefly
2331         https://bugs.webkit.org/show_bug.cgi?id=119377
2332
2333         Reviewed by Anders Carlson.
2334
2335         RenderVideo should not claim that it's foreground is opaque
2336         unless it has a video frame to display.
2337
2338         * rendering/RenderVideo.cpp:
2339         (WebCore::RenderVideo::foregroundIsKnownToBeOpaqueInRect):
2340
2341 2013-08-22  Andreas Kling  <akling@apple.com>
2342
2343         Remove accidental cruft from r154449.
2344
2345         * rendering/RenderWidget.cpp:
2346         (WebCore::RenderWidget::destroy):
2347
2348 2013-08-22  Andreas Kling  <akling@apple.com>
2349
2350         FrameLoader: frame() and client() should return references.
2351         <https://webkit.org/b/120158>
2352
2353         Reviewed by Anders Carlsson.
2354
2355         These two are never null so change them to return references.
2356
2357 2013-08-22  Andrei Bucur  <abucur@adobe.com>
2358
2359         RenderNamedFlowThread should not create NodeRenderingContext objects
2360         https://bugs.webkit.org/show_bug.cgi?id=119923
2361
2362         Reviewed by Antti Koivisto.
2363
2364         Port of https://chromium.googlesource.com/chromium/blink/+/949d7d7e7b8685454742a55cf0ca912bb9a7b177.
2365         Original patch by Elliott Sprehn.
2366
2367         RenderNamedFlowThread should not create NodeRenderingContext objects
2368
2369         RenderNamedFlowThread is using NodeRenderingContext to get the original
2370         parent renderer, but should just be using NodeRenderingTraversal::parent
2371         instead (which is what NodeRenderingContext does internally anyway).
2372
2373         Tests: No change in functionality. No new tests.
2374
2375         * rendering/RenderNamedFlowThread.cpp:
2376         (WebCore::RenderNamedFlowThread::isChildAllowed):
2377
2378 2013-08-22  Christophe Dumez  <ch.dumez@sisa.samsung.com>
2379
2380         Introduce a SVGUnknownElement class for unknown SVG elements
2381         https://bugs.webkit.org/show_bug.cgi?id=120155
2382
2383         Reviewed by Andreas Kling.
2384
2385         Introduce a SVGUnknownElement class and have it override rendererIsNeeded() to return false.
2386         We now use SVGUnknownElement type (instead of SVGElement) for unknown SVG elements:
2387         - Unknown Elements in SVG namespace
2388         - Registered custom tag elements in SVG namespace:
2389           http://www.w3.org/TR/2013/WD-custom-elements-20130514/#registering-custom-elements
2390
2391         As a consequence, SVGElement::rendererIsNeeded() is not longer required to return false and
2392         it will be able to behave as SVGStyledElement::rendererIsNeeded() once we merge
2393         SVGStyledElement into SVGElement.
2394
2395         This is a pre-requirement to merging SVGStyledElement into SVGElement.
2396
2397         No new tests, no behavior change.
2398
2399         * GNUmakefile.list.am:
2400         * Target.pri:
2401         * WebCore.vcxproj/WebCore.vcxproj:
2402         * WebCore.vcxproj/WebCore.vcxproj.filters:
2403         * dom/CustomElementConstructor.cpp:
2404         (WebCore::CustomElementConstructor::createElementInternal):
2405         * dom/make_names.pl:
2406         (defaultParametersHash):
2407         (printJSElementIncludes):
2408         (printWrapperFunctions):
2409         (printWrapperFactoryCppFile):
2410         * svg/SVGElement.cpp:
2411         * svg/SVGElement.h:
2412         * svg/SVGUnknownElement.h: Added.
2413         (WebCore::SVGUnknownElement::create):
2414         (WebCore::SVGUnknownElement::SVGUnknownElement):
2415         * svg/svgtags.in:
2416
2417 2013-08-22  Rob Buis  <rwlbuis@webkit.org>
2418
2419         REGRESSION: Assertion failure !collection->hasExactlyOneItem() in WebCore::namedItemGetter
2420         https://bugs.webkit.org/show_bug.cgi?id=118056
2421
2422         Reviewed by Ryosuke Niwa.
2423
2424         The assert is hit in Debug mode because the DocumentOrderedMap in HTMLDocument::m_windowNamedItem
2425         includes matched SVG elements, but the WindowNameCollection used to collect the elements does not.
2426         This means the HTMLCollection stripped of SVG elements could end up hitting the empty or single item
2427         assertion, which the testcase verifies.
2428         To fix this change WindowNameCollection to include both SVG and HTML elements so it matches DocumentOrderedMap.
2429
2430         Tests: svg/custom/document-all-includes-svg.html
2431                svg/custom/window-named-item-lookup.html
2432
2433         * html/HTMLCollection.cpp:
2434         (WebCore::isMatchingElement):
2435         (WebCore::HTMLCollection::updateNameCache):
2436
2437 2013-08-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2438
2439         Introduce toSVGRadialGradientElement(), and use it
2440         https://bugs.webkit.org/show_bug.cgi?id=120153
2441
2442         Reviewed by Andreas Kling.
2443
2444         As a step to clean-up static_cast<SVGXXX>, toSVGRadialGradientElement() is added to clean-up
2445         static_cast<SVGRadialGradientElement*>.
2446
2447         * rendering/svg/RenderSVGResourceRadialGradient.cpp:
2448         (WebCore::RenderSVGResourceRadialGradient::collectGradientAttributes):
2449         * rendering/svg/SVGRenderTreeAsText.cpp:
2450         (WebCore::writeSVGResourceContainer):
2451         * svg/SVGRadialGradientElement.cpp:
2452         (WebCore::SVGRadialGradientElement::collectGradientAttributes):
2453         * svg/SVGRadialGradientElement.h:
2454         (WebCore::toSVGRadialGradientElement):
2455
2456 2013-08-22  Renata Hodovan  <reni@webkit.org>
2457
2458         ASSERTION FAILED: extractedStyle in WebCore::ApplyStyleCommand::removeInlineStyleFromElement
2459         https://bugs.webkit.org/show_bug.cgi?id=119672
2460
2461         Reviewed by Darin Adler.
2462
2463         The last extractedStyle parameter of removeInlineStyleFromElement() is not mandatory and it's set
2464         to default 0. This way we have to check its existence before the usage.
2465
2466         Test: editing/execCommand/extracted_style_assert.html
2467
2468         * editing/ApplyStyleCommand.cpp:
2469         (WebCore::ApplyStyleCommand::removeInlineStyleFromElement):
2470
2471 2013-08-21  Commit Queue  <commit-queue@webkit.org>
2472
2473         Unreviewed, rolling out r154416.
2474         http://trac.webkit.org/changeset/154416
2475         https://bugs.webkit.org/show_bug.cgi?id=120147
2476
2477         Broke Windows builds (Requested by rniwa on #webkit).
2478
2479         * WebCore.vcxproj/WebCoreGenerated.make:
2480         * WebCore.vcxproj/WebCoreGeneratedWinCairo.make:
2481         * WebCore.vcxproj/WebCoreGeneratedWinCairoCommon.props:
2482         * WebCore.vcxproj/build-generated-files.sh:
2483         * WebCore.vcxproj/copyForwardingHeaders.cmd:
2484         * WebCore.vcxproj/copyWebCoreResourceFiles.cmd:
2485
2486 2013-08-21  Ryuan Choi  <ryuan.choi@samsung.com>
2487
2488         [EFL] Unreviewed build fix after r154430.
2489
2490         * rendering/style/StyleRareNonInheritedData.cpp:
2491         (WebCore::StyleRareNonInheritedData::hasFilters): Added CSS_FILTERS guard.
2492
2493 2013-08-21  Simon Fraser  <simon.fraser@apple.com>
2494
2495         Setting -webkit-filter: in :active selector causes failure to redraw
2496         https://bugs.webkit.org/show_bug.cgi?id=120135
2497
2498         Reviewed by Jer Noble.
2499         
2500         When removing a filter on an inline child of a compositing layer,
2501         the inline loses its RenderLayer and compositing layer, but we fail to
2502         repaint the compositing layer that the inline is now painting into.
2503         
2504         This worked correctly for opacity, because opacity toggles cause
2505         layouts (which then paint the correct layer), so do the same for filters.
2506
2507         Test: css3/filters/remove-filter-repaint.html
2508
2509         * rendering/style/RenderStyle.cpp:
2510         (WebCore::RenderStyle::changeRequiresLayout): Return true if we toggled
2511         between having filters and not. Drive-by cleanup, making use of new convenience
2512         function for hasOpacity().
2513         * rendering/style/StyleRareNonInheritedData.cpp:
2514         (WebCore::StyleRareNonInheritedData::hasFilters): Returns true if we have any
2515         filters.
2516         * rendering/style/StyleRareNonInheritedData.h:
2517         (WebCore::StyleRareNonInheritedData::hasOpacity): Convenience function that
2518         returns true if opacity is < 1.
2519
2520 2013-08-21  Gavin Barraclough  <barraclough@apple.com>
2521
2522         https://bugs.webkit.org/show_bug.cgi?id=120139
2523         PropertyDescriptor argument to define methods should be const
2524
2525         Rubber stamped by Sam Weinig.
2526
2527         This should never be modified, and this way we can use rvalues.
2528
2529         * bindings/js/JSDOMWindowCustom.cpp:
2530         (WebCore::JSDOMWindow::defineOwnProperty):
2531         * bindings/js/JSLocationCustom.cpp:
2532         (WebCore::JSLocation::defineOwnProperty):
2533         (WebCore::JSLocationPrototype::defineOwnProperty):
2534         * bindings/scripts/CodeGeneratorJS.pm:
2535         (GenerateHeader):
2536             - make PropertyDescriptor const
2537
2538 2013-08-21  Jacky Jiang  <zhajiang@blackberry.com>
2539
2540         <https://webkit.org/b/120123> [BlackBerry] Incorrect origin of indexOfTile in LayerTiler can cause unnecessary texture jobs and waste memory
2541
2542         Reviewed by Yong Li.
2543         Internally reviewed by Arvid Nilsson.
2544
2545         JIRA 481356
2546         The origin of indexOfTile(origin) is incorrect in these two places. For
2547         example, if the maxXMaxYCorner of the rect is (768, 768), there can be
2548         three other redundant indexOfTile (0, 1), (1, 0), (1, 1) which can cause
2549         unnecessary texture jobs and waste memory.
2550         The origin should be the top left of the bottom right pixel of a rect.
2551
2552         * platform/graphics/blackberry/LayerTiler.cpp:
2553         (WebCore::LayerTiler::updateTextureContentsIfNeeded):
2554         (WebCore::LayerTiler::processTextureJob):
2555
2556 2013-08-21  Simon Fraser  <simon.fraser@apple.com>
2557
2558         <https://webkit.org/b/116901> ASSERTION FAILED: !m_visibleDescendantStatusDirty on twitter
2559
2560         Reviewed by Beth Dakin.
2561         
2562         In order to make decisions about compositing, the m_hasVisibleDescendant bit on RenderLayers
2563         needs to be up-to-date when RenderLayerCompositor::computeCompositingRequirements is recursing
2564         over the RenderLayer tree.
2565         
2566         However, was possible for computeCompositingRequirements() to hit a layer whose m_visibleDescendantStatusDirty
2567         bit was set; we only clear this bit from collectLayers() (when updating z-order lists), and from styleChanged()
2568         which requires that style changed on the layer itself.
2569         
2570         Fix by always calling updateDescendantDependentFlags() from computeCompositingRequirements().
2571
2572         Wasn't able to easily get a reduced testcase.
2573
2574         * rendering/RenderLayerCompositor.cpp:
2575         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2576
2577 2013-08-21  Alex Christensen  <achristensen@apple.com>
2578
2579         <https://webkit.org/b/120137> Separating Win32 and Win64 builds.
2580
2581         Reviewed by Brent Fulgham.
2582
2583         * WebCore.vcxproj/WebCoreGenerated.make:
2584         * WebCore.vcxproj/WebCoreGeneratedWinCairo.make:
2585         Pass PlatformArchitecture as a command line parameter to bash scripts
2586         and use PlatformArchitecture to determine which directory to delete
2587         while cleaning (obj32 or obj64).
2588         * WebCore.vcxproj/WebCoreGeneratedWinCairoCommon.props:
2589         Export PlatformArchitecture to be used by make and cmd scripts.
2590         * WebCore.vcxproj/build-generated-files.sh:
2591         Use PlatformArchitecture from command line to determine which object directory to use (obj32 or obj64).
2592         * WebCore.vcxproj/copyForwardingHeaders.cmd:
2593         * WebCore.vcxproj/copyWebCoreResourceFiles.cmd:
2594         Use PlatformArchitecture to determine which directory to copy to (obj32 or obj64).
2595
2596 2013-08-21  Tim Horton  <timothy_horton@apple.com>
2597
2598         revalidateTiles and ensureTilesForRect can share a lot of code
2599         https://bugs.webkit.org/show_bug.cgi?id=119282
2600
2601         Missed the review comments, whoops.
2602
2603         * platform/graphics/ca/mac/TileController.h:
2604         * platform/graphics/ca/mac/TileController.mm:
2605         (WebCore::TileController::prepopulateRect):
2606         (WebCore::TileController::revalidateTiles):
2607         (WebCore::TileController::ensureTilesForRect):
2608
2609 2013-08-21  Andreas Kling  <akling@apple.com>
2610
2611         <https://webkit.org/b/120115> SVG elements always have custom style resolve callbacks.
2612
2613         Reviewed by Antti Koivisto.
2614
2615         Simplify SVGElement construction by making them opt in to custom style resolve callbacks
2616         by default, and removing the ability to pass a custom ConstructionType to some subclass
2617         constructors.
2618
2619         * dom/Node.h:
2620
2621             Add HasCustomStyleResolveCallbacksFlag to the CreateSVGElement mask.
2622
2623         * svg/SVGElement.cpp:
2624         (WebCore::SVGElement::SVGElement):
2625         * svg/SVGElement.h:
2626         * svg/SVGGElement.cpp:
2627         (WebCore::SVGGElement::SVGGElement):
2628         * svg/SVGGElement.h:
2629         * svg/SVGGraphicsElement.cpp:
2630         (WebCore::SVGGraphicsElement::SVGGraphicsElement):
2631         * svg/SVGGraphicsElement.h:
2632         * svg/SVGImageElement.cpp:
2633         (WebCore::SVGImageElement::SVGImageElement):
2634         * svg/SVGStyledElement.cpp:
2635         (WebCore::SVGStyledElement::SVGStyledElement):
2636         * svg/SVGStyledElement.h:
2637
2638             Remove calls to setHasCustomStyleResolveCallbacks() in SVGElement and subclasses.
2639             Also remove unnecessary ConstructionType argument from subclasses since nobody
2640             overrides it and everyone just uses CreateSVGElement.
2641
2642 2013-08-21  Tim Horton  <timothy_horton@apple.com>
2643
2644         revalidateTiles and ensureTilesForRect can share a lot of code
2645         https://bugs.webkit.org/show_bug.cgi?id=119282
2646
2647         Reviewed by Simon Fraser.
2648
2649         No new tests, just a refactoring.
2650
2651         The bodies of ensureTilesForRect and revalidateTiles are nearly equivalent.
2652
2653         * platform/graphics/ca/mac/TileController.h:
2654         Add an enum, NewTileType, to note whether the tiles created by ensureTilesForRect will
2655         be primary coverage tiles or secondary out-of-view tiles.
2656
2657         * platform/graphics/ca/mac/TileController.mm:
2658         (WebCore::TileController::prepopulateRect):
2659         Move the code to see if we already have the requisite tiles in the
2660         primary coverage rect, as well as our call to updateTileCoverageMap,
2661         out into prepopulateRect, to generalize ensureTilesForRect.
2662
2663         (WebCore::TileController::revalidateTiles):
2664         Make use of ensureTilesForRect. The platformCALayerDidCreateTiles call will happen there, now.
2665
2666         (WebCore::TileController::ensureTilesForRect):
2667         Make ensureTilesForRect return the rect that it created tiles for, and only put
2668         tiles in a cohort if we're creating secondary tiles.
2669
2670 2013-08-21  Tim Horton  <timothy_horton@apple.com>
2671
2672         isReplacementObscured is wrong when the indicator is clipped by an iframe
2673         https://bugs.webkit.org/show_bug.cgi?id=120031
2674         <rdar://problem/14606819>
2675
2676         Reviewed by Simon Fraser.
2677
2678         Hit-test for plugin obscurity in the root document. To do this, we also need
2679         to convert the indicator rectangle into root view coordinates before
2680         hit testing its edges.
2681
2682         This resolves the case where an iframe which clips its content was reporting
2683         the indicator as not obscured, despite the fact that it was obscured from the
2684         point of view of the user.
2685
2686         Updated test plugins/unavailable-plugin-indicator-obscurity.html
2687
2688         * rendering/RenderEmbeddedObject.cpp:
2689         (WebCore::RenderEmbeddedObject::isReplacementObscured):
2690
2691 2013-08-21  Andreas Kling  <akling@apple.com>
2692
2693         <https://webkit.org/b/120132> Frame::navigationScheduler() should return a reference.
2694
2695         Reviewed by Anders Carlzon.
2696
2697         Frame::m_navigationScheduler is an inline member, not a pointer.
2698
2699 2013-08-21  Tim Horton  <timothy_horton@apple.com>
2700
2701         REGRESSION(r154399): broke Mac ML debug WK1 tests > 50 crashes (Requested by thorton on #webkit).
2702         https://bugs.webkit.org/show_bug.cgi?id=120129
2703
2704         Rolling out http://trac.webkit.org/changeset/154399.
2705
2706         * rendering/RenderBlock.cpp:
2707         * rendering/RenderBlock.h:
2708         * rendering/RenderBlockLineLayout.cpp:
2709         (WebCore::RenderBlock::LineBreaker::skipLeadingWhitespace):
2710         * rendering/RenderBox.h:
2711
2712 2013-08-21  Andreas Kling  <akling@apple.com>
2713
2714         <https://webkit.org/b/120118> Frame::animation() should return a reference.
2715
2716         Reviewed by Anders Carlsson.
2717
2718         Frame::m_animationController is never null.
2719         Also changed RenderObject::animation() to return a reference since it's just a wrapper
2720         around RenderObject::frame()->animation() with no null checking of frame().
2721
2722 2013-08-21  Simon Fraser  <simon.fraser@apple.com>
2723
2724         Allow opacity to apply to custom scrollbars
2725         https://bugs.webkit.org/show_bug.cgi?id=120104
2726
2727         Reviewed by David Hyatt.
2728         
2729         Opacity was ignored custom scrollbar pseudoelements because custom scrollbar
2730         renderers never create layers, and opacity is normally handled by the RenderLayer code.
2731         
2732         Fix by having RenderScrollbarTheme and RenderScrollbarPart do the transparency
2733         layers necessary for opacity. RenderScrollbarPart handles opacity for individual
2734         parts.
2735         
2736         Because ScrollbarThemeComposite::paint() renders the parts on after another (with
2737         no nesting), opacity handling for the entire scrollbar needs special-casing.
2738         This is done by willPaintScrollbar()/didPaintScrollbar() on the theme.
2739         RenderScrollbarTheme consults the opacity the scrollbar (which we get from
2740         the ScrollbarBGPart renderer) to decide whether to set up a transparency layer.
2741
2742         Test: scrollbars/scrollbar-parts-opacity.html
2743
2744         * platform/ScrollbarThemeComposite.cpp:
2745         (WebCore::ScrollbarThemeComposite::paint):
2746         * platform/ScrollbarThemeComposite.h:
2747         (WebCore::ScrollbarThemeComposite::willPaintScrollbar):
2748         (WebCore::ScrollbarThemeComposite::didPaintScrollbar):
2749         * rendering/RenderScrollbar.cpp:
2750         (WebCore::RenderScrollbar::opacity):
2751         * rendering/RenderScrollbar.h:
2752         * rendering/RenderScrollbarPart.cpp:
2753         (WebCore::RenderScrollbarPart::paintIntoRect):
2754         * rendering/RenderScrollbarTheme.cpp:
2755         (WebCore::RenderScrollbarTheme::willPaintScrollbar):
2756         (WebCore::RenderScrollbarTheme::didPaintScrollbar):
2757         * rendering/RenderScrollbarTheme.h:
2758
2759 2013-08-21  Robert Hogan  <robert@webkit.org>
2760
2761         REGRESSION(r127163): Respect clearance set on ancestors when placing floats
2762         https://bugs.webkit.org/show_bug.cgi?id=119979
2763
2764         Reviewed by David Hyatt.
2765
2766         If a float has a self-collapsing ancestor with clearance then it needs to respect
2767         that clearance when placing itself on the line.
2768
2769         Test: fast/block/margin-collapse/self-collapsing-block-with-float-descendant.html
2770
2771         * rendering/RenderBlock.cpp:
2772         (WebCore::RenderBlock::marginOffsetForSelfCollapsingBlock):
2773         * rendering/RenderBlock.h:
2774         * rendering/RenderBlockLineLayout.cpp:
2775         (WebCore::RenderBlock::LineBreaker::skipLeadingWhitespace):
2776         * rendering/RenderBox.h:
2777         (WebCore::RenderBox::previousInFlowSiblingBox):
2778
2779 2013-08-21  Brent Fulgham  <bfulgham@apple.com>
2780
2781         <https://webkit.org/b/120113> [Windows] Enable CSS_IMAGE_SET
2782
2783         Reviewed by Anders Carlsson.
2784
2785         We can now activate:
2786         fast/css/image-set-parsing.html
2787         fast/css/image-set-parsing-invalid.html
2788
2789         * WebCore.vcxproj/WebCore.vcxproj: Add missing image set implementation files.
2790         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
2791         * css/CSSAllInOne.cpp: Add missing CSSImageSetValue.cpp
2792         * rendering/style/StyleAllInOne.cpp: Add missing StyeCachedImageSet.cpp
2793
2794 2013-08-21  Robert Hogan  <robert@webkit.org>
2795
2796         In RenderTableCell::paintCollapsedBorders() check surrounding cells using physical rather than logical direction
2797         https://bugs.webkit.org/show_bug.cgi?id=120074
2798
2799         Reviewed by David Hyatt.
2800
2801         No new tests, covered by existing tests.
2802
2803         The functions cellAbove(), cellBelow() etc. check the logical rather than the physical direction but they're being
2804         used to decide the painting of the physical borders of the cell. As we paint all four sides of every cell, and
2805         the borders of adjoining cells twice over, this has no impact on painting currently but making the check consistent
2806         in its treatment of physical and logical direction will help with webkit.org/b/119759 and make the code less confusing
2807         to the next guy.
2808
2809         * rendering/RenderTableCell.cpp:
2810         (WebCore::RenderTableCell::cellAtLeft):
2811         (WebCore::RenderTableCell::cellAtRight):
2812         (WebCore::RenderTableCell::cellAtTop):
2813         (WebCore::RenderTableCell::cellAtBottom):
2814         (WebCore::RenderTableCell::paintCollapsedBorders):
2815         * rendering/RenderTableCell.h:
2816
2817 2013-08-21  Róbert Sipka  <sipka@inf.u-szeged.hu>
2818
2819         <https://webkit.org/b/120109> [curl] only include WebCoreBundleWin on Windows
2820
2821         Reviewed by Brent Fulgham.
2822
2823         The WebCoreBundleWin is a windows specific file, it is only needed on Windows.
2824
2825         * platform/network/curl/ResourceHandleManager.cpp:
2826
2827 2013-08-21  Jae Hyun Park  <jae.park@company100.net>
2828
2829         [Qt] Remove unused code path in PluginView
2830         https://bugs.webkit.org/show_bug.cgi?id=113173
2831
2832         Reviewed by Anders Carlsson.
2833
2834         m_platformLayer in PluginView has been removed in r121710, but there are
2835         still some leftover code path related to m_platformLayer. This patch
2836         removes unused code path.
2837
2838         No new tests, removing unused code paths.
2839
2840         * plugins/PluginView.h:
2841         (PluginView):
2842         * plugins/qt/PluginViewQt.cpp:
2843         (WebCore::PluginView::updatePluginWidget):
2844         (WebCore::PluginView::paint):
2845
2846 2013-08-21  Allan Sandfeld Jensen  <allan.jensen@digia.com>
2847
2848         Font’s fast code path doesn’t handle partial runs correctly when kerning or ligatures are enabled 
2849         https://bugs.webkit.org/show_bug.cgi?id=100050
2850
2851         Reviewed by Antti Koivisto.
2852
2853         Always let WidthIterator iterate over an entire TextRun to avoid problems
2854         with pixel rounding or shaping on partial runs.
2855
2856         This fix is necessary for Qt because the complex font-path can not disable
2857         shaping, leading to the complex path painting slighly different from the
2858         fast path, which messes up selection painting.
2859
2860         No change in functionality, no new tests.
2861
2862         * platform/graphics/Font.cpp:
2863         (WebCore::Font::drawText):
2864         (WebCore::Font::drawEmphasisMarks):
2865         (WebCore::Font::selectionRectForText):
2866         (WebCore::Font::offsetForPosition):
2867         * platform/graphics/FontFastPath.cpp:
2868         (WebCore::Font::getGlyphsAndAdvancesForSimpleText):
2869         (WebCore::Font::selectionRectForSimpleText):
2870         (WebCore::Font::offsetForPositionForSimpleText):
2871         * platform/graphics/GlyphBuffer.h:
2872         (WebCore::GlyphBuffer::add):
2873         (GlyphBuffer):
2874         * platform/graphics/WidthIterator.cpp:
2875         (WebCore::WidthIterator::advanceInternal):
2876         * platform/graphics/WidthIterator.h:
2877         (WidthIterator): Removed now unused advanceOneCharacter method.
2878
2879 2013-08-20  Antonio Gomes  <a1.gomes@sisa.samsung.com>
2880
2881         Harden RenderBox::canBeScrolledAndHasScrollableArea logic
2882         https://bugs.webkit.org/show_bug.cgi?id=104373
2883
2884         Reviewed by Simon Fraser.
2885
2886         Previously if a say div has a overflown content on 'y' but is
2887         styled as "overflow-x: auto; overflow-y: hidden", RenderBox::canBeProgramaticallyScrolled
2888         would still return true. It interfers, among other things, with the way
2889         autoscroll works.
2890
2891         Patch fixes it by adding two helper methods to RenderBox class in order to verify a box'
2892         scrollability in a given axis (x or y); They are used when checking if a given box is in
2893         fact programatically scrollable.
2894
2895         Test: fast/events/autoscroll-overflow-hidden-longhands.html
2896
2897         WebKit autoscroll behavior now matches Firefox and Opera12 (pre-blink)
2898         in that sense.
2899
2900         * rendering/RenderBox.cpp:
2901         (WebCore::RenderBox::canBeProgramaticallyScrolled):
2902         * rendering/RenderBox.h:
2903         (WebCore::RenderBox::hasScrollableOverflowX):
2904         (WebCore::RenderBox::hasScrollableOverflowY):
2905
2906 2013-08-19  Antonio Gomes  <a1.gomes@sisa.samsung.com>
2907
2908         Text dragging can scroll overflow:hidden boxes
2909         https://bugs.webkit.org/show_bug.cgi?id=119760
2910
2911         Reviewed by Darin Adler.
2912
2913         Consider the case of the following HTML:
2914         <div style="overflow:hidden; width: 100px; height: 100px" >
2915           <input id="input" type="text" size=10 value="any text here!"/>
2916           <button style="position:relative; top: 100px; left: 100px"/>
2917         </div>
2918
2919         If ones starts a text selection by dragging the mouse from within the input
2920         field, and continues to drag beyong the outer div boundary, the latter will
2921         be scrolled no matter its overflow:hidden style.
2922         That happens because when the autoscroll has started, it gets propagated up
2923         to the current layer's parent layer, instead of the to current layer's enclosing
2924         scrollable layer.
2925
2926         Patch fixes the issue by hardening the way scrolling is
2927         propagated upwards when autoscroll is being performed.
2928
2929         RenderLayer::enclosingScrollableLayer method also got rewritten
2930         in terms of RenderLayer tree traversing, instead of RenderObject tree.
2931         The rewrite adds support for cross frame upwards traversal.
2932
2933         Test: fast/events/autoscroll-upwards-propagation.html
2934
2935         * rendering/RenderLayer.cpp:
2936         (WebCore::parentLayerCrossFrame):
2937         (WebCore::RenderLayer::enclosingScrollableLayer):
2938         (WebCore::RenderLayer::scrollRectToVisible):
2939
2940 2013-08-20  Jer Noble  <jer.noble@apple.com>
2941
2942         <https://webkit.org/b/120101> [Mac] Suspended HTMLMediaElements can still hold power assertion after playback stops.
2943
2944         Reviewed by Eric Carlson.
2945
2946         Call updateDisplaySleep() when we clear our MediaPlayer, as doing so may kill any in-flight
2947         rateChanged() notifications.
2948
2949         * html/HTMLMediaElement.cpp:
2950         (WebCore::HTMLMediaElement::clearMediaPlayer):
2951         (WebCore::HTMLMediaElement::stop):
2952
2953 2013-08-20  David Barr <davidbarr@chromium.org>, Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2954
2955         <https://webkit.org/b/92330> [CSS] Pass an image orientation data to drawImage()
2956
2957         Reviewed by Beth Dakin.
2958
2959         In support of ongoing css3-images image-orientation implementation. This patch passes
2960         an imageOrientationDescription object to drawImage() function as a argument. The drawImage()
2961         can know information of image orientation by the argument.
2962
2963         Spec: http://www.w3.org/TR/2012/CR-css3-images-20120417/#the-image-orientation
2964
2965         * html/HTMLCanvasElement.cpp:
2966         (WebCore::HTMLCanvasElement::paint):
2967         * html/canvas/CanvasRenderingContext2D.cpp:
2968         (WebCore::CanvasRenderingContext2D::drawImage):
2969         (WebCore::drawImageToContext):
2970         * platform/graphics/ImageOrientation.h: Add setter functions.
2971         (WebCore::ImageOrientationDescription::setRespectImageOrientation):
2972         (WebCore::ImageOrientationDescription::setImageOrientationEnum):
2973         * platform/graphics/texmap/TextureMapperImageBuffer.cpp:
2974         (WebCore::BitmapTextureImageBuffer::updateContents):
2975         * rendering/RenderBoxModelObject.cpp:
2976         (WebCore::RenderBoxModelObject::paintNinePieceImage):
2977         * rendering/RenderImage.cpp:
2978         (WebCore::RenderImage::paintReplaced):
2979         (WebCore::RenderImage::paintIntoRect):
2980         * rendering/RenderSnapshottedPlugIn.cpp:
2981         (WebCore::RenderSnapshottedPlugIn::paintSnapshot):
2982
2983 2013-08-20  Gavin Barraclough  <barraclough@apple.com>
2984
2985         https://bugs.webkit.org/show_bug.cgi?id=120093
2986         Remove getOwnPropertyDescriptor trap
2987
2988         Reviewed by Geoff Garen.
2989
2990         All implementations of this method are now called via the method table, and equivalent in behaviour.
2991         Remove all duplicate implementations (and the method table trap), and add a single member function implementation on JSObject.
2992
2993         * WebCore.exp.in:
2994         * bindings/js/JSDOMWindowCustom.cpp:
2995         * bindings/scripts/CodeGeneratorJS.pm:
2996         (GenerateHeader):
2997         (GenerateImplementation):
2998         (GenerateConstructorDeclaration):
2999         (GenerateConstructorHelperMethods):
3000         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3001         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
3002         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3003         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
3004         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3005         * bindings/scripts/test/JS/JSTestEventConstructor.h:
3006         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3007         * bindings/scripts/test/JS/JSTestEventTarget.h:
3008         * bindings/scripts/test/JS/JSTestException.cpp:
3009         * bindings/scripts/test/JS/JSTestException.h:
3010         * bindings/scripts/test/JS/JSTestInterface.cpp:
3011         * bindings/scripts/test/JS/JSTestInterface.h:
3012         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3013         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
3014         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3015         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
3016         * bindings/scripts/test/JS/JSTestNode.cpp:
3017         * bindings/scripts/test/JS/JSTestNode.h:
3018         * bindings/scripts/test/JS/JSTestObj.cpp:
3019         * bindings/scripts/test/JS/JSTestObj.h:
3020         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3021         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
3022         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3023         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
3024         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3025         * bindings/scripts/test/JS/JSTestTypedefs.h:
3026         * bridge/jsc/BridgeJSC.h:
3027         (JSC::Bindings::Instance::getOwnPropertySlot):
3028         * bridge/objc/objc_runtime.h:
3029         * bridge/objc/objc_runtime.mm:
3030         * bridge/runtime_array.cpp:
3031         * bridge/runtime_array.h:
3032         * bridge/runtime_method.cpp:
3033         * bridge/runtime_method.h:
3034         * bridge/runtime_object.cpp:
3035         * bridge/runtime_object.h:
3036             - remove getOwnPropertyDescriptor
3037
3038 2013-08-20  Antti Koivisto  <antti@apple.com>
3039
3040         <https://webkit.org/b/120071> Replace NodeRenderingContext with Node* as childShouldCreateRenderer() argument
3041
3042         Reviewed by Darin Adler.
3043
3044         This simplifies the code. NodeRenderingContext was basically only used for getting the Node.
3045
3046         * dom/ContainerNode.h:
3047         (WebCore::ContainerNode::childShouldCreateRenderer):
3048         * dom/Element.cpp:
3049         (WebCore::Element::childShouldCreateRenderer):
3050         * dom/Element.h:
3051         * dom/NodeRenderingContext.cpp:
3052         (WebCore::NodeRenderingContext::shouldCreateRenderer):
3053         * dom/NodeRenderingContext.h:
3054         
3055             Move isOnEncapsulationBoundary() to InsertionPoint.h and call it hasShadowRootOrActiveInsertionPointParent().
3056             Move isOnUpperEncapsulationBoundary() to ShadowRoot.h and call it hasShadowRootParent().
3057
3058         * dom/ShadowRoot.h:
3059         (WebCore::hasShadowRootParent):
3060         * html/HTMLDetailsElement.cpp:
3061         (WebCore::HTMLDetailsElement::childShouldCreateRenderer):
3062         * html/HTMLDetailsElement.h:
3063         * html/HTMLFormControlElement.cpp:
3064         (WebCore::HTMLFormControlElement::validationMessageShadowTreeContains):
3065         * html/HTMLFormControlElement.h:
3066         * html/HTMLMediaElement.cpp:
3067         (WebCore::HTMLMediaElement::childShouldCreateRenderer):
3068         * html/HTMLMediaElement.h:
3069         * html/HTMLMeterElement.cpp:
3070         (WebCore::HTMLMeterElement::childShouldCreateRenderer):
3071         * html/HTMLMeterElement.h:
3072         * html/HTMLOptGroupElement.h:
3073         (WebCore::isHTMLOptGroupElement):
3074         * html/HTMLOptionElement.h:
3075         (WebCore::isHTMLOptionElement):
3076         * html/HTMLProgressElement.cpp:
3077         (WebCore::HTMLProgressElement::childShouldCreateRenderer):
3078         * html/HTMLProgressElement.h:
3079         * html/HTMLSelectElement.cpp:
3080         (WebCore::HTMLSelectElement::childShouldCreateRenderer):
3081         * html/HTMLSelectElement.h:
3082         * html/HTMLSummaryElement.cpp:
3083         (WebCore::HTMLSummaryElement::childShouldCreateRenderer):
3084         * html/HTMLSummaryElement.h:
3085         * html/HTMLTextFormControlElement.cpp:
3086         (WebCore::HTMLTextFormControlElement::childShouldCreateRenderer):
3087         (WebCore::enclosingTextFormControl):
3088         * html/HTMLTextFormControlElement.h:
3089         * html/ValidationMessage.cpp:
3090         (WebCore::ValidationMessage::shadowTreeContains):
3091         * html/ValidationMessage.h:
3092         * html/shadow/InsertionPoint.cpp:
3093         (WebCore::InsertionPoint::rendererIsNeeded):
3094         * html/shadow/InsertionPoint.h:
3095         (WebCore::isActiveInsertionPoint):
3096         
3097             Remove isShadowBoundary() as it was equivalent to isActive(). 
3098             Remove isLowerEncapsulationBoundary() as it was equivalent to isActiveInsertionPoint().
3099
3100         (WebCore::hasShadowRootOrActiveInsertionPointParent):
3101         
3102             Moved and renamed from NodeRenderingContext::isOnEncapsulationBoundary().
3103
3104         * svg/SVGAElement.cpp:
3105         (WebCore::SVGAElement::childShouldCreateRenderer):
3106         * svg/SVGAElement.h:
3107         * svg/SVGAltGlyphElement.cpp:
3108         (WebCore::SVGAltGlyphElement::childShouldCreateRenderer):
3109         * svg/SVGAltGlyphElement.h:
3110         * svg/SVGDocument.cpp:
3111         (WebCore::SVGDocument::childShouldCreateRenderer):
3112         * svg/SVGDocument.h:
3113         * svg/SVGElement.cpp:
3114         (WebCore::SVGElement::childShouldCreateRenderer):
3115         * svg/SVGElement.h:
3116         * svg/SVGFilterElement.cpp:
3117         (WebCore::SVGFilterElement::childShouldCreateRenderer):
3118         * svg/SVGFilterElement.h:
3119         * svg/SVGFilterPrimitiveStandardAttributes.h:
3120         * svg/SVGForeignObjectElement.cpp:
3121         (WebCore::SVGForeignObjectElement::childShouldCreateRenderer):
3122         * svg/SVGForeignObjectElement.h:
3123         * svg/SVGSVGElement.h:
3124         (WebCore::toSVGSVGElement):
3125         * svg/SVGSwitchElement.cpp:
3126         (WebCore::SVGSwitchElement::childShouldCreateRenderer):
3127         * svg/SVGSwitchElement.h:
3128         * svg/SVGTRefElement.cpp:
3129         (WebCore::SVGTRefElement::childShouldCreateRenderer):
3130         * svg/SVGTRefElement.h:
3131         * svg/SVGTSpanElement.cpp:
3132         (WebCore::SVGTSpanElement::childShouldCreateRenderer):
3133         * svg/SVGTSpanElement.h:
3134         * svg/SVGTextElement.cpp:
3135         (WebCore::SVGTextElement::childShouldCreateRenderer):
3136         * svg/SVGTextElement.h:
3137         * svg/SVGTextPathElement.cpp:
3138         (WebCore::SVGTextPathElement::childShouldCreateRenderer):
3139         * svg/SVGTextPathElement.h:
3140
3141 2013-08-20  Benjamin Poulain  <benjamin@webkit.org>
3142
3143         <https://webkit.org/b/120050> Don't bother using a Vector for the ouput of querySelector, just return the first element found
3144
3145         Reviewed by Ryosuke Niwa.
3146
3147         Simplify the case of querySelector. Instead of using the same output type as querySelectorAll,
3148         simply use a trait to define what to do in the loop.
3149
3150         * dom/SelectorQuery.cpp:
3151         (WebCore::AllElementExtractorSelectorQueryTrait::appendOutputForElement):
3152         (WebCore::SelectorDataList::queryAll):
3153         (WebCore::SingleElementExtractorSelectorQueryTrait::appendOutputForElement):
3154         (WebCore::SelectorDataList::queryFirst):
3155         (WebCore::SelectorDataList::executeFastPathForIdSelector):
3156         (WebCore::elementsForLocalName):
3157         (WebCore::anyElement):
3158         (WebCore::SelectorDataList::executeSingleTagNameSelectorData):
3159         (WebCore::SelectorDataList::executeSingleClassNameSelectorData):
3160         (WebCore::SelectorDataList::executeSingleSelectorData):
3161         (WebCore::SelectorDataList::executeSingleMultiSelectorData):
3162         (WebCore::SelectorDataList::execute):
3163         * dom/SelectorQuery.h:
3164
3165 2013-08-20  Antti Koivisto  <antti@apple.com>
3166
3167         Rollout the previous patch for landing with the correct ChangeLog.
3168
3169 013-08-20  Jacky Jiang  <zhajiang@blackberry.com>
3170
3171         <https://webkit.org/b/120082> [BlackBerry] Remove unused previousTextureRect in LayerTiler
3172
3173         Reviewed by Rob Buis.
3174         Internally reviewed by Mike Lattanzio and Jakob Petsovits.
3175
3176         * platform/graphics/blackberry/LayerTiler.cpp:
3177         (WebCore::LayerTiler::updateTextureContentsIfNeeded):
3178
3179 2013-08-20  Antti Koivisto  <antti@apple.com>
3180
3181         <https://webkit.org/b/120078> Replace NodeRenderingContext with RenderStyle& as shouldCreateRenderer() argument
3182
3183         Reviewed by Darin Adler.
3184
3185         This simplifies the code. NodeRenderingContext was only used for getting the RenderStyle.
3186
3187         * dom/Element.cpp:
3188         (WebCore::Element::rendererIsNeeded):
3189         * dom/Element.h:
3190         * dom/NodeRenderingContext.cpp:
3191         (WebCore::NodeRenderingContext::elementInsideRegionNeedsRenderer):
3192         (WebCore::NodeRenderingContext::createRendererForElementIfNeeded):
3193         * dom/PseudoElement.cpp:
3194         (WebCore::PseudoElement::rendererIsNeeded):
3195         * dom/PseudoElement.h:
3196         * html/HTMLAppletElement.cpp:
3197         (WebCore::HTMLAppletElement::rendererIsNeeded):
3198         * html/HTMLAppletElement.h:
3199         * html/HTMLElement.cpp:
3200         (WebCore::HTMLElement::rendererIsNeeded):
3201         * html/HTMLElement.h:
3202         * html/HTMLEmbedElement.cpp:
3203         (WebCore::HTMLEmbedElement::rendererIsNeeded):
3204         * html/HTMLEmbedElement.h:
3205         * html/HTMLFormElement.cpp:
3206         (WebCore::HTMLFormElement::rendererIsNeeded):
3207         * html/HTMLFormElement.h:
3208         * html/HTMLFrameElement.cpp:
3209         (WebCore::HTMLFrameElement::rendererIsNeeded):
3210         * html/HTMLFrameElement.h:
3211         * html/HTMLFrameSetElement.cpp:
3212         (WebCore::HTMLFrameSetElement::rendererIsNeeded):
3213         * html/HTMLFrameSetElement.h:
3214         * html/HTMLIFrameElement.cpp:
3215         (WebCore::HTMLIFrameElement::rendererIsNeeded):
3216         * html/HTMLIFrameElement.h:
3217         * html/HTMLInputElement.cpp:
3218         (WebCore::HTMLInputElement::rendererIsNeeded):
3219         * html/HTMLInputElement.h:
3220         * html/HTMLMediaElement.cpp:
3221         (WebCore::HTMLMediaElement::rendererIsNeeded):
3222         * html/HTMLMediaElement.h:
3223         * html/HTMLObjectElement.cpp:
3224         (WebCore::HTMLObjectElement::rendererIsNeeded):
3225         * html/HTMLObjectElement.h:
3226         * html/HTMLOptGroupElement.h:
3227         * html/HTMLOptionElement.h:
3228         * html/HTMLVideoElement.cpp:
3229         (WebCore::HTMLVideoElement::rendererIsNeeded):
3230         * html/HTMLVideoElement.h:
3231         * html/shadow/DetailsMarkerControl.cpp:
3232         (WebCore::DetailsMarkerControl::rendererIsNeeded):
3233         * html/shadow/DetailsMarkerControl.h:
3234         * html/shadow/InsertionPoint.cpp:
3235         (WebCore::InsertionPoint::rendererIsNeeded):
3236         * html/shadow/InsertionPoint.h:
3237         * html/shadow/MeterShadowElement.cpp:
3238         (WebCore::MeterShadowElement::rendererIsNeeded):
3239         (WebCore::MeterInnerElement::rendererIsNeeded):
3240         * html/shadow/MeterShadowElement.h:
3241         * html/shadow/ProgressShadowElement.cpp:
3242         (WebCore::ProgressShadowElement::rendererIsNeeded):
3243         (WebCore::ProgressInnerElement::rendererIsNeeded):
3244         * html/shadow/ProgressShadowElement.h:
3245         * svg/SVGDescElement.h:
3246         * svg/SVGElement.h:
3247         (WebCore::SVGElement::rendererIsNeeded):
3248         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
3249         (WebCore::SVGFilterPrimitiveStandardAttributes::rendererIsNeeded):
3250         * svg/SVGFilterPrimitiveStandardAttributes.h:
3251         * svg/SVGFontElement.h:
3252         * svg/SVGForeignObjectElement.cpp:
3253         (WebCore::SVGForeignObjectElement::rendererIsNeeded):
3254         * svg/SVGForeignObjectElement.h:
3255         * svg/SVGGElement.cpp:
3256         (WebCore::SVGGElement::rendererIsNeeded):
3257         * svg/SVGGElement.h:
3258         * svg/SVGGlyphElement.h:
3259         * svg/SVGGlyphRefElement.h:
3260         * svg/SVGHKernElement.h:
3261         * svg/SVGMarkerElement.h:
3262         * svg/SVGMissingGlyphElement.h:
3263         * svg/SVGSVGElement.cpp:
3264         (WebCore::SVGSVGElement::rendererIsNeeded):
3265         * svg/SVGSVGElement.h:
3266         * svg/SVGStopElement.cpp:
3267         (WebCore::SVGStopElement::rendererIsNeeded):
3268         * svg/SVGStopElement.h:
3269         * svg/SVGStyledElement.cpp:
3270         (WebCore::SVGStyledElement::rendererIsNeeded):
3271         * svg/SVGStyledElement.h:
3272         * svg/SVGTRefElement.cpp:
3273         (WebCore::SVGTRefElement::rendererIsNeeded):
3274         * svg/SVGTRefElement.h:
3275         * svg/SVGTSpanElement.cpp:
3276         (WebCore::SVGTSpanElement::rendererIsNeeded):
3277         * svg/SVGTSpanElement.h:
3278         * svg/SVGTextPathElement.cpp:
3279         (WebCore::SVGTextPathElement::rendererIsNeeded):
3280         * svg/SVGTextPathElement.h:
3281         * svg/SVGTitleElement.h:
3282         * svg/SVGVKernElement.h:
3283         * svg/SVGViewElement.h:
3284
3285 2013-08-20  Daniel Bates  <dabates@apple.com>
3286
3287         <https://webkit.org/b/120088> Define Clipboard::hasData() only when building with drag support
3288
3289         Reviewed by Darin Adler.
3290
3291         Clipboard::hasData() is specific to drag-and-drop support. We should only define it when
3292         such support is enabled.
3293
3294         * dom/Clipboard.cpp: Move hasData() to DRAG_SUPPORT section of the file.
3295         * dom/Clipboard.h: Ditto.
3296
3297 2013-08-20  Antti Koivisto  <antti@apple.com>
3298
3299         <https://webkit.org/b/120078> Replace NodeRenderingContext with RenderStyle& as shouldCreateRenderer() argument
3300
3301         Reviewed by Darin Adler.
3302
3303         This simplifies the code. NodeRenderingContext was only used for getting the RenderStyle.
3304
3305         * dom/Element.cpp:
3306         (WebCore::Element::rendererIsNeeded):
3307         * dom/Element.h:
3308         * dom/NodeRenderingContext.cpp:
3309         (WebCore::NodeRenderingContext::elementInsideRegionNeedsRenderer):
3310         (WebCore::NodeRenderingContext::createRendererForElementIfNeeded):
3311         * dom/PseudoElement.cpp:
3312         (WebCore::PseudoElement::rendererIsNeeded):
3313         * dom/PseudoElement.h:
3314         * html/HTMLAppletElement.cpp:
3315         (WebCore::HTMLAppletElement::rendererIsNeeded):
3316         * html/HTMLAppletElement.h:
3317         * html/HTMLElement.cpp:
3318         (WebCore::HTMLElement::rendererIsNeeded):
3319         * html/HTMLElement.h:
3320         * html/HTMLEmbedElement.cpp:
3321         (WebCore::HTMLEmbedElement::rendererIsNeeded):
3322         * html/HTMLEmbedElement.h:
3323         * html/HTMLFormElement.cpp:
3324         (WebCore::HTMLFormElement::rendererIsNeeded):
3325         * html/HTMLFormElement.h:
3326         * html/HTMLFrameElement.cpp:
3327         (WebCore::HTMLFrameElement::rendererIsNeeded):
3328         * html/HTMLFrameElement.h:
3329         * html/HTMLFrameSetElement.cpp:
3330         (WebCore::HTMLFrameSetElement::rendererIsNeeded):
3331         * html/HTMLFrameSetElement.h:
3332         * html/HTMLIFrameElement.cpp:
3333         (WebCore::HTMLIFrameElement::rendererIsNeeded):
3334         * html/HTMLIFrameElement.h:
3335         * html/HTMLInputElement.cpp:
3336         (WebCore::HTMLInputElement::rendererIsNeeded):
3337         * html/HTMLInputElement.h:
3338         * html/HTMLMediaElement.cpp:
3339         (WebCore::HTMLMediaElement::rendererIsNeeded):
3340         * html/HTMLMediaElement.h:
3341         * html/HTMLObjectElement.cpp:
3342         (WebCore::HTMLObjectElement::rendererIsNeeded):
3343         * html/HTMLObjectElement.h:
3344         * html/HTMLOptGroupElement.h:
3345         * html/HTMLOptionElement.h:
3346         * html/HTMLVideoElement.cpp:
3347         (WebCore::HTMLVideoElement::rendererIsNeeded):
3348         * html/HTMLVideoElement.h:
3349         * html/shadow/DetailsMarkerControl.cpp:
3350         (WebCore::DetailsMarkerControl::rendererIsNeeded):
3351         * html/shadow/DetailsMarkerControl.h:
3352         * html/shadow/InsertionPoint.cpp:
3353         (WebCore::InsertionPoint::rendererIsNeeded):
3354         * html/shadow/InsertionPoint.h:
3355         * html/shadow/MeterShadowElement.cpp:
3356         (WebCore::MeterShadowElement::rendererIsNeeded):
3357         (WebCore::MeterInnerElement::rendererIsNeeded):
3358         * html/shadow/MeterShadowElement.h:
3359         * html/shadow/ProgressShadowElement.cpp:
3360         (WebCore::ProgressShadowElement::rendererIsNeeded):
3361         (WebCore::ProgressInnerElement::rendererIsNeeded):
3362         * html/shadow/ProgressShadowElement.h:
3363         * svg/SVGDescElement.h:
3364         * svg/SVGElement.h:
3365         (WebCore::SVGElement::rendererIsNeeded):
3366         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
3367         (WebCore::SVGFilterPrimitiveStandardAttributes::rendererIsNeeded):
3368         * svg/SVGFilterPrimitiveStandardAttributes.h:
3369         * svg/SVGFontElement.h:
3370         * svg/SVGForeignObjectElement.cpp:
3371         (WebCore::SVGForeignObjectElement::rendererIsNeeded):
3372         * svg/SVGForeignObjectElement.h:
3373         * svg/SVGGElement.cpp:
3374         (WebCore::SVGGElement::rendererIsNeeded):
3375         * svg/SVGGElement.h:
3376         * svg/SVGGlyphElement.h:
3377         * svg/SVGGlyphRefElement.h:
3378         * svg/SVGHKernElement.h:
3379         * svg/SVGMarkerElement.h:
3380         * svg/SVGMissingGlyphElement.h:
3381         * svg/SVGSVGElement.cpp:
3382         (WebCore::SVGSVGElement::rendererIsNeeded):
3383         * svg/SVGSVGElement.h:
3384         * svg/SVGStopElement.cpp:
3385         (WebCore::SVGStopElement::rendererIsNeeded):
3386         * svg/SVGStopElement.h:
3387         * svg/SVGStyledElement.cpp:
3388         (WebCore::SVGStyledElement::rendererIsNeeded):
3389         * svg/SVGStyledElement.h:
3390         * svg/SVGTRefElement.cpp:
3391         (WebCore::SVGTRefElement::rendererIsNeeded):
3392         * svg/SVGTRefElement.h:
3393         * svg/SVGTSpanElement.cpp:
3394         (WebCore::SVGTSpanElement::rendererIsNeeded):
3395         * svg/SVGTSpanElement.h:
3396         * svg/SVGTextPathElement.cpp:
3397         (WebCore::SVGTextPathElement::rendererIsNeeded):
3398         * svg/SVGTextPathElement.h:
3399         * svg/SVGTitleElement.h:
3400         * svg/SVGVKernElement.h:
3401         * svg/SVGViewElement.h:
3402
3403 2013-08-20  Tim Horton  <timothy_horton@apple.com>
3404
3405         <https://webkit.org/b/105988> [Mac] Some inspector tests intermittently assert in InspectorOverlay::paint
3406         <rdar://problem/12958038>
3407
3408         Reviewed by Joseph Pecoraro.
3409
3410         Update the inspector overlay's layout before painting, if it is stale.
3411
3412         No new tests; fixes an intermittent assertion failure in some existing tests.
3413
3414         * inspector/InspectorOverlay.cpp:
3415         (WebCore::InspectorOverlay::paint):
3416
3417 2013-08-20  Daniel Bates  <dabates@apple.com>
3418
3419         Build fix after <http://trac.webkit.org/changeset/154260> (https://webkit.org/b/119949);
3420         declare Clipboard::hasData() when building with and without drag support
3421
3422         * dom/Clipboard.h:
3423
3424 2013-08-20  Hans Muller  <hmuller@adobe.com>
3425
3426         <https://webkit.org/b/119849> [CSS Shapes] Complete RasterShape::firstIncludedIntervalLogicalTop()
3427
3428         Reviewed by Alexandru Chiculita.
3429
3430         Completed the implementation of RasterShape::firstIncludedIntervalLogicalTop(). The
3431         method now computes first logical top location where a line segment can be laid
3432         out within a RasterShape, i.e. a shape derived from an image valued URL resource.
3433
3434         A detailed description of the algorithm can be found in
3435         http://hansmuller-webkit.blogspot.com/2013/08/first-fit-location-for-image-shapes.html.
3436
3437         The new tests exposed a bug in the existing getIncludedIntervals() method. A shape
3438         with a vertical gap that spans the entire line now causes the method to short circuit
3439         and return an empty interval list.
3440
3441         Tests: fast/shapes/shape-inside/shape-inside-image-003.html
3442                fast/shapes/shape-inside/shape-inside-image-004.html
3443                fast/shapes/shape-inside/shape-inside-image-005.html
3444
3445         * rendering/shapes/RasterShape.cpp:
3446         (WebCore::RasterShapeIntervals::firstIncludedIntervalY):
3447         (WebCore::RasterShapeIntervals::getIncludedIntervals):
3448         (WebCore::RasterShape::firstIncludedIntervalLogicalTop):
3449         * rendering/shapes/RasterShape.h:
3450
3451 2013-08-20  Pratik Solanki  <psolanki@apple.com>
3452
3453         <https://webkit.org/b/120029> Document::markers() should return a reference
3454
3455         Reviewed by Andreas Kling.
3456
3457         Document::m_markers is never NULL so return a reference from Document::markers(). Also mark
3458         m_markers as const and initialize it in member initialization.
3459
3460         * dom/Document.cpp:
3461         (WebCore::Document::Document):
3462         * dom/Document.h:
3463         (WebCore::Document::markers):
3464         * editing/AlternativeTextController.cpp:
3465         (WebCore::AlternativeTextController::isSpellingMarkerAllowed):
3466         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
3467         (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection):
3468         (WebCore::AlternativeTextController::handleAlternativeTextUIResult):
3469         (WebCore::AlternativeTextController::respondToChangedSelection):
3470         (WebCore::AlternativeTextController::respondToAppliedEditing):
3471         (WebCore::AlternativeTextController::respondToUnappliedEditing):
3472         (WebCore::AlternativeTextController::markReversed):
3473         (WebCore::AlternativeTextController::markCorrection):
3474         (WebCore::AlternativeTextController::recordSpellcheckerResponseForModifiedCorrection):
3475         (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand):
3476         (WebCore::Alter