2009-03-26 Darin Adler <darin@apple.com>
[WebKit-https.git] / WebCore / ChangeLog
1 2009-03-26  Darin Adler  <darin@apple.com>
2
3         Reviewed by Geoff Garen.
4
5         Removed code that casts EventListener down to derived classes
6         without type checking. A crash could happen if you added event
7         listeners with Objective-C and then manipulated the class with
8         JavaScript.
9
10         * bindings/js/JSDOMApplicationCacheCustom.cpp:
11         (WebCore::JSDOMApplicationCache::mark): Removed all the casts
12         and used the markIfNotNull function and mark functions on
13         EventListener instead.
14         * bindings/js/JSMessagePortCustom.cpp:
15         (WebCore::JSMessagePort::mark): Ditto.
16         * bindings/js/JSWorkerContextCustom.cpp:
17         (WebCore::JSWorkerContext::mark): Ditto.
18         * bindings/js/JSWorkerCustom.cpp:
19         (WebCore::JSWorker::mark): Ditto.
20         * bindings/js/JSXMLHttpRequestCustom.cpp:
21         (WebCore::JSXMLHttpRequest::mark): Ditto.
22         * bindings/js/JSXMLHttpRequestUploadCustom.cpp:
23         (WebCore::JSXMLHttpRequestUpload::mark): Ditto.
24
25         * bindings/js/JSEventListener.cpp:
26         (WebCore::JSAbstractEventListener::handleEvent): Used function,
27         the new name for what used to be called listenerObj.
28         (WebCore::JSAbstractEventListener::virtualIsInline): Renamed since
29         this doesn't need to be virtual for callers who have a pointer to
30         this class, not the base class.
31         (WebCore::JSEventListener::function): Renamed from listenerObj.
32         (WebCore::JSProtectedEventListener::function): Ditto.
33
34         * bindings/js/JSEventListener.h: Removed unneeded forward class
35         declarations. Made all virtual functions private since there's no
36         need to call any of them on a particular derived class, only on
37         EventListener. Explicitly declare JSEventListener::mark as virtual
38         since it's now overriding a function in the EventListener base class.
39         Made JSProtectedEventListener::m_globalObject protected so the
40         JSLazyEventListener derived class can use it directly instead of using
41         a virtual function to get the pointer.
42
43         * bindings/js/JSLazyEventListener.cpp:
44         (WebCore::JSLazyEventListener::parseCode): Use m_globalObject instead
45         of globalObject since the latter is a virtual function and there's no
46         need to pay virtual function overhead.
47         (WebCore::JSLazyEventListener::function): Renamed from listenerObj.
48
49         * bindings/js/JSLazyEventListener.h: Moved forward declaration of the
50         Node class here from JSEventListener.h.
51
52         * bindings/scripts/CodeGeneratorJS.pm: Removed now-unneeded cast to
53         JSEventListener when getting the script object from a listener.
54
55         * dom/EventListener.h: Added virtual function and mark functions
56         so we can extract the JavaScript function object or mark a JavaScript
57         event listener in a type safe manner.
58
59 2009-03-26  Peter Kasting  <pkasting@google.com>
60
61         Reviewed by Adele Peterson.
62
63         https://bugs.webkit.org/show_bug.cgi?id=24859
64         Use CSS file instead of code to adjust search field styling.
65
66         * css/themeWin.css:
67         * rendering/RenderThemeWin.cpp:
68         * rendering/RenderThemeWin.h:
69
70 2009-03-26  Darin Adler  <darin@apple.com>
71
72         Reviewed by Geoff Garen.
73
74         Split JSLazyEventListener out into its own separate source file.
75         We'll be removing JSAbstractEventListener and JSProtectedEventListener soon,
76         so leave those in the same file with JSEventListener.
77
78         * GNUmakefile.am: Added JSLazyEventListener.
79         * WebCore.pro: Ditto.
80         * WebCore.scons: Ditto.
81         * WebCore.vcproj/WebCore.vcproj: Ditto.
82         * WebCore.xcodeproj/project.pbxproj: Ditto.
83         * WebCoreSources.bkl: Ditto.
84
85         * bindings/js/JSEventListener.cpp: Removed the JSLazyEventListener part.
86         Removed unneeded includes. Removed incorrect ASSERT_CLASS_FITS_IN_CELL, since
87         JSAbstractEventListener is not derived from JSCell.
88
89         * bindings/js/JSEventListener.h: Removed the JSLazyEventListener part
90         and the now-unneeded include of PlatformString.h.
91
92         * bindings/js/JSLazyEventListener.cpp: Copied from bindings/js/JSEventListener.cpp.
93         Kept only the JSLazyEventListener part.
94         (WebCore::eventParameterName): Made this have internal linkage by adding "static".
95         Also moved the default case out of the switch statement so we will get a warning
96         if we omit any cases in the future.
97
98         * bindings/js/JSLazyEventListener.h: Copied from bindings/js/JSEventListener.h.
99         Kept only the JSLazyEventListener part.
100
101         * bindings/js/ScriptController.cpp: Removed unneeded includes and sorted the
102         remanining ones. Include JSLazyEventListener.h instead of JSEventListener.h.
103
104 2009-03-26  Darin Adler  <darin@apple.com>
105
106         Reviewed by Geoff Garen.
107
108         Renamed JSUnprotectedEventListener to JSEventListener.
109         And related renames.
110
111         Soon Geoff will make all JavaScript event listeners use mark instead
112         of protect, so there's no need to emphasize "unprotected".
113
114         * bindings/js/JSDOMApplicationCacheCustom.cpp:
115         (WebCore::JSDOMApplicationCache::mark):
116         (WebCore::JSDOMApplicationCache::addEventListener):
117         (WebCore::JSDOMApplicationCache::removeEventListener):
118         * bindings/js/JSDOMGlobalObject.cpp:
119         (WebCore::JSDOMGlobalObject::~JSDOMGlobalObject):
120         (WebCore::JSDOMGlobalObject::findJSEventListener):
121         (WebCore::JSDOMGlobalObject::findOrCreateJSEventListener):
122         (WebCore::JSDOMGlobalObject::jsEventListeners):
123         (WebCore::JSDOMGlobalObject::jsInlineEventListeners):
124         * bindings/js/JSDOMGlobalObject.h:
125         * bindings/js/JSDOMWindowBase.h:
126         * bindings/js/JSEventListener.cpp:
127         (WebCore::JSEventListener::JSEventListener):
128         (WebCore::JSEventListener::~JSEventListener):
129         (WebCore::JSEventListener::listenerObj):
130         (WebCore::JSEventListener::globalObject):
131         (WebCore::JSEventListener::clearGlobalObject):
132         (WebCore::JSEventListener::mark):
133         * bindings/js/JSEventListener.h:
134         (WebCore::JSEventListener::create):
135         * bindings/js/JSMessagePortCustom.cpp:
136         (WebCore::JSMessagePort::mark):
137         (WebCore::JSMessagePort::addEventListener):
138         (WebCore::JSMessagePort::removeEventListener):
139         * bindings/js/JSWorkerContextCustom.cpp:
140         (WebCore::JSWorkerContext::mark):
141         (WebCore::JSWorkerContext::addEventListener):
142         (WebCore::JSWorkerContext::removeEventListener):
143         * bindings/js/JSWorkerCustom.cpp:
144         (WebCore::JSWorker::mark):
145         (WebCore::JSWorker::addEventListener):
146         (WebCore::JSWorker::removeEventListener):
147         * bindings/js/JSXMLHttpRequestCustom.cpp:
148         (WebCore::JSXMLHttpRequest::mark):
149         (WebCore::JSXMLHttpRequest::addEventListener):
150         (WebCore::JSXMLHttpRequest::removeEventListener):
151         * bindings/js/JSXMLHttpRequestUploadCustom.cpp:
152         (WebCore::JSXMLHttpRequestUpload::mark):
153         (WebCore::JSXMLHttpRequestUpload::addEventListener):
154         (WebCore::JSXMLHttpRequestUpload::removeEventListener):
155         * bindings/scripts/CodeGeneratorJS.pm:
156         All just renaming.
157
158 2009-03-26  Darin Adler  <darin@apple.com>
159
160         Reviewed by Geoff Garen.
161
162         Renamed JSEventListener to JSProtectedEventListener.
163         And related renames.
164
165         Soon Geoff will make all JavaScript event listeners use mark instead
166         of protect, and so this class will be be obsolete. We will rename
167         JSUnrpotectedEventListener to JSEventListener in the next check-in,
168         since that one will remain.
169
170         * bindings/js/JSDOMGlobalObject.cpp:
171         (WebCore::JSDOMGlobalObject::~JSDOMGlobalObject):
172         (WebCore::JSDOMGlobalObject::findJSProtectedEventListener):
173         (WebCore::JSDOMGlobalObject::findOrCreateJSProtectedEventListener):
174         (WebCore::JSDOMGlobalObject::jsProtectedEventListeners):
175         (WebCore::JSDOMGlobalObject::jsProtectedInlineEventListeners):
176         * bindings/js/JSDOMGlobalObject.h:
177         * bindings/js/JSDOMWindowBase.h:
178         * bindings/js/JSDOMWindowCustom.cpp:
179         (WebCore::JSDOMWindow::addEventListener):
180         (WebCore::JSDOMWindow::removeEventListener):
181         * bindings/js/JSEventListener.cpp:
182         (WebCore::JSProtectedEventListener::JSProtectedEventListener):
183         (WebCore::JSProtectedEventListener::~JSProtectedEventListener):
184         (WebCore::JSProtectedEventListener::listenerObj):
185         (WebCore::JSProtectedEventListener::globalObject):
186         (WebCore::JSProtectedEventListener::clearGlobalObject):
187         (WebCore::JSLazyEventListener::JSLazyEventListener):
188         (WebCore::JSLazyEventListener::parseCode):
189         * bindings/js/JSEventListener.h:
190         (WebCore::JSProtectedEventListener::create):
191         * bindings/js/JSNodeCustom.cpp:
192         (WebCore::JSNode::addEventListener):
193         (WebCore::JSNode::removeEventListener):
194         * bindings/js/JSSVGElementInstanceCustom.cpp:
195         (WebCore::JSSVGElementInstance::addEventListener):
196         (WebCore::JSSVGElementInstance::removeEventListener):
197         * bindings/scripts/CodeGeneratorJS.pm:
198         All just renaming.
199
200 2009-03-26  Dan Bernstein  <mitz@apple.com>
201
202         Reviewed by Anders Carlsson.
203
204         - fix <rdar://problem/6725042> BidiResolver::createBidiRunsForLine can
205           create runs extending beyond the end
206
207         No test because Safari does not use this version of
208         createBidiRunsForLine() with the end iterator not pointing to the end
209         of the text run.
210
211         * platform/text/BidiResolver.h:
212         (WebCore::BidiResolver::appendRun): Cap the end of the run at the end
213         of the line and set the reachedEndOfLine flag. This mirrors the logic
214         in the specialized version of appendRun() in bidi.cpp, which is why the
215         problem did not show up in HTML. Also avoid creating empty runs.
216
217 2009-03-26  Simon Fraser  <simon.fraser@apple.com>
218
219         Reviewed by Dave Hyatt
220         
221         https://bugs.webkit.org/show_bug.cgi?id=23914
222
223         Tests: compositing/overflow/ancestor-overflow.html
224                compositing/overflow/parent-overflow.html
225
226         * rendering/RenderLayer.cpp:
227         (WebCore::RenderLayer::calculateClipRects):
228         * rendering/RenderLayer.h:
229         (WebCore::ClipRects::infiniteRect):
230         New static method that returns a large rect that is used by the clipping
231         logic.
232         
233         * rendering/RenderLayerBacking.cpp:
234         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
235         Use parentClipRects(), rather than calculateRects(), to compute the overflow
236         rect that we'll use to create a masking layer for composited clipping.
237         
238         * rendering/RenderLayerCompositor.cpp:
239         (WebCore::RenderLayerCompositor::clippedByAncestor):
240         Use parentClipRects() to see whether there's a layer between us and our
241         compositing ancestor which applies clipping.
242         
243         (WebCore::RenderLayerCompositor::clipsCompositingDescendants):
244         A layer which imposes clipping to its children doesn't have to be a stacking
245         context; it might be a normal flow layer; in either case, we can rely on the
246         hasCompositingDescendant() bit.
247
248 2009-03-26  Steve Falkenburg  <sfalken@apple.com>
249
250         https://bugs.webkit.org/show_bug.cgi?id=24837
251         Escape key should dismiss select menu
252
253         Reviewed by Adam Roben.
254
255         * platform/win/PopupMenuWin.cpp:
256         (WebCore::PopupWndProc):
257
258 2009-03-26  Kevin Ollivier  <kevino@theolliviers.com>
259
260         Reviewed by Alexey Proskuryakov.
261
262         Make sure the script uses LF line endings even on Windows.
263         
264         https://bugs.webkit.org/show_bug.cgi?id=24805
265
266         * WebCore/make-generated-sources.sh: Change svn:eol-style to LF
267
268 2009-03-26  Eli Fidler  <eli.fidler@torchmobile.com>
269
270         Reviewed by George Staikos.
271
272         Remove warnings all over the place by making operator precedence
273         explicit in cases like x && y || z.  No functional change.
274
275         * css/CSSFontSelector.cpp:
276         (WebCore::CSSFontSelector::addFontFaceRule):
277         * css/CSSParser.cpp:
278         (WebCore::CSSParser::parseValue):
279         (WebCore::CSSParser::parseShadow):
280         * dom/Document.cpp:
281         (WebCore::Document::shouldScheduleLayout):
282         * dom/Node.cpp:
283         (WebCore::Node::isBlockFlowOrBlockTable):
284         * dom/Node.h:
285         (WebCore::Node::document):
286         * dom/Position.cpp:
287         (WebCore::Position::next):
288         (WebCore::Position::upstream):
289         (WebCore::Position::downstream):
290         (WebCore::Position::getInlineBoxAndOffset):
291         * dom/PositionIterator.cpp:
292         (WebCore::PositionIterator::atStart):
293         * dom/Range.cpp:
294         (WebCore::Range::intersectsNode):
295         * editing/Editor.cpp:
296         (WebCore::Editor::setBaseWritingDirection):
297         * editing/InsertParagraphSeparatorCommand.cpp:
298         (WebCore::InsertParagraphSeparatorCommand::doApply):
299         * editing/ReplaceSelectionCommand.cpp:
300         (WebCore::ReplaceSelectionCommand::doApply):
301         * editing/TextIterator.cpp:
302         (WebCore::TextIterator::advance):
303         (WebCore::SimplifiedBackwardsTextIterator::advance):
304         * editing/VisiblePosition.cpp:
305         (WebCore::VisiblePosition::leftVisuallyDistinctCandidate):
306         (WebCore::VisiblePosition::rightVisuallyDistinctCandidate):
307         (WebCore::VisiblePosition::canonicalPosition):
308         * editing/htmlediting.cpp:
309         (WebCore::isMailBlockquote):
310         (WebCore::lineBreakExistsAtPosition):
311         * html/HTMLSelectElement.cpp:
312         (WebCore::HTMLSelectElement::parseMappedAttribute):
313         * loader/FTPDirectoryDocument.cpp:
314         (WebCore::processFileDateString):
315         * loader/ImageLoader.cpp:
316         (WebCore::ImageLoader::updateFromElement):
317         * loader/TextResourceDecoder.cpp:
318         (WebCore::TextResourceDecoder::checkForHeadCharset):
319         * page/AccessibilityObject.cpp:
320         (WebCore::updateAXLineStartForVisiblePosition):
321         * page/EventHandler.cpp:
322         (WebCore::EventHandler::sendContextMenuEvent):
323         * page/animation/AnimationBase.cpp:
324         (WebCore::PropertyWrapperGetter::equals):
325         (WebCore::PropertyWrapperShadow::equals):
326         * platform/ContextMenu.cpp:
327         (WebCore::ContextMenu::populate):
328         * platform/ScrollView.cpp:
329         (WebCore::ScrollView::adjustScrollbarsAvoidingResizerCount):
330         * platform/text/Base64.cpp:
331         (WebCore::base64Encode):
332         * platform/text/BidiResolver.h:
333         (WebCore::::raiseExplicitEmbeddingLevel):
334         (WebCore::::createBidiRunsForLine):
335         * rendering/InlineTextBox.cpp:
336         (WebCore::InlineTextBox::placeEllipsisBox):
337         * rendering/RenderBlock.cpp:
338         (WebCore::RenderBlock::addChild):
339         (WebCore::RenderBlock::repaintOverhangingFloats):
340         (WebCore::RenderBlock::fillInlineSelectionGaps):
341         (WebCore::RenderBlock::positionForPoint):
342         (WebCore::RenderBlock::calcInlinePrefWidths):
343         (WebCore::RenderBlock::hasLineIfEmpty):
344         * rendering/RenderBox.cpp:
345         (WebCore::RenderBox::imageChanged):
346         (WebCore::RenderBox::localCaretRect):
347         (WebCore::RenderBox::positionForPoint):
348         (WebCore::RenderBox::shrinkToAvoidFloats):
349         * rendering/RenderObject.h:
350         (WebCore::objectIsRelayoutBoundary):
351         * rendering/RenderTableCell.cpp:
352         (WebCore::RenderTableCell::clippedOverflowRectForRepaint):
353         * rendering/RenderText.cpp:
354         (WebCore::RenderText::calcPrefWidths):
355         * rendering/bidi.cpp:
356         (WebCore::RenderBlock::determineStartPosition):
357         (WebCore::textWidth):
358         * rendering/style/RenderStyle.cpp:
359         (WebCore::RenderStyle::diff):
360         * rendering/style/StyleInheritedData.cpp:
361         (WebCore::cursorDataEquivalent):
362         * rendering/style/StyleRareInheritedData.cpp:
363         (WebCore::StyleRareInheritedData::shadowDataEquivalent):
364         * rendering/style/StyleRareNonInheritedData.cpp:
365         (WebCore::StyleRareNonInheritedData::shadowDataEquivalent):
366         (WebCore::StyleRareNonInheritedData::animationDataEquivalent):
367         (WebCore::StyleRareNonInheritedData::transitionDataEquivalent):
368
369 2009-03-26  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
370
371         Reviewed by Holger Freyther.
372
373         https://bugs.webkit.org/show_bug.cgi?id=24804
374         [GTK] 401 responses cause rogue content to be loaded
375
376         Our soup code handles 401 responses itself, so we should not feed
377         the headers and data of those responses to the loader.
378
379         * platform/network/soup/ResourceHandleSoup.cpp:
380         (WebCore::gotHeadersCallback):
381         (WebCore::gotChunkCallback):
382
383 2009-03-25  Geoffrey Garen  <ggaren@apple.com>
384
385         Reviewed by Oliver Hunt and Darin Adler.
386         
387         Fixed <rdar://problem/6603167> Crash in WebKit!JSC::JSGlobalObject::resetPrototype
388         during Stress test (#3 & #7 WER crashes for Safari 4 Beta)
389         
390         The problem was that allocation of the global object would, for just a
391         moment, leave the global object's prototype unprotected from GC. This
392         bug doesn't apply to non-global DOM objects because their prototypes are
393         cached and marked by the global object.
394
395         No test case because the crashing condition is hard to deterministically
396         produce in a normal build, and in a Windows Release build with
397         COLLECT_ON_EVERY_ALLOCATION set to 1, existing tests crash/hang.
398
399         * bindings/js/JSDOMWindowShell.cpp:
400         (WebCore::JSDOMWindowShell::setWindow):
401         * bindings/js/WorkerScriptController.cpp:
402         (WebCore::WorkerScriptController::initScript): Protect the global object's
403         prototype from GC during construction, since the global object does not
404         yet point to it, and therefore won't mark it.
405
406 2009-03-25  Dean Jackson  <dino@apple.com>
407
408         Reviewed by Simon Fraser
409
410         https://bugs.webkit.org/show_bug.cgi?id=23361
411
412         When using hardware compositing, some images can be directly
413         rendered by the hardware - no need to draw them into a separate
414         context, therefore saving memory.
415         Only images with certain style properties can be directly
416         composited - basically anything that is not a simple image requires
417         the usual rendering path (eg. if the image has borders).
418
419         Test: compositing/direct-image-compositing.html
420
421         * manual-tests/resources/simple_image.png: Added.
422         * manual-tests/simple-image-compositing.html: Added.
423         * platform/graphics/Image.h:
424         (WebCore::Image::startAnimation):
425             - move this to public
426         * rendering/RenderImage.cpp:
427         (WebCore::RenderImage::imageChanged):
428             - poke compositing layer if image has changed
429         (WebCore::RenderImage::notifyFinished):
430             - let the compositing layer know that it can render the image
431         * rendering/RenderImage.h:
432         * rendering/RenderLayer.cpp:
433         (WebCore::RenderLayer::rendererContentChanged):
434         * rendering/RenderLayer.h:
435         * rendering/RenderLayerBacking.cpp:
436         (WebCore::RenderLayerBacking::canUseInnerContentLayer):
437         (WebCore::RenderLayerBacking::detectDrawingOptimizations):
438         (WebCore::RenderLayerBacking::rendererContentChanged):
439         * rendering/RenderLayerBacking.h:
440             - code to hook up direct compositing of images where
441               possible
442
443 2009-03-25  David Levin  <levin@chromium.org>
444
445         Reviewed by Dimitri Glazkov.
446
447         Chromium build fix. Fix #include in V8NodeFilterCondition.cpp due to the
448         rename of V8NodeFilter to V8NodeFilterCondition.
449
450         * bindings/v8/V8NodeFilterCondition.cpp:
451
452 2009-03-25  Simon Fraser  <simon.fraser@apple.com>
453
454         Reviewed by Darin Adler
455         
456         https://bugs.webkit.org/show_bug.cgi?id=24817
457         
458         When the slider range is zero, avoid a divide by zero, which caused the
459         thumb to be positioned off in the weeds, which broke painting.
460
461         Test: media/video-empty-source.html
462
463         * rendering/RenderSlider.cpp:
464         (WebCore::SliderRange::proportionFromValue):
465         (WebCore::SliderRange::valueFromProportion):
466         (WebCore::sliderPosition):
467         (WebCore::RenderSlider::setValueForPosition):
468
469 2009-03-24  Eric Seidel  <eric@webkit.org>
470
471         Reviewed by Darin Adler.
472
473         Remove dead code and style cleanup
474         https://bugs.webkit.org/show_bug.cgi?id=24684
475
476         * html/CanvasStyle.cpp:
477         (WebCore::CanvasStyle::CanvasStyle):
478           Coverty was annoyed that we didn't initialize all of our members.  I agree, but I didn't
479           want to paste all 8 members each time, so I just cleaned up the existing constructors and left them.
480         * page/FocusController.cpp:
481         (WebCore::FocusController::setFocusedNode):
482           "node" was checked just above and is already known to be non-null
483         * rendering/RenderLayer.cpp:
484         (WebCore::RenderLayer::insertOnlyThisLayer):
485           We were already using parentLayer w/o a NULL check above, so just add an explicit ASSERT and use it w/o NULL check
486         (WebCore::RenderLayer::resize):
487           element is already ASSERTed above, no need to null check it here
488         * rendering/RenderTableSection.cpp:
489         (WebCore::RenderTableSection::addCell):
490           currentCell.cell was just assigned to the value "cell" which is known to be non-null, no need to null check again.
491
492 2009-03-24  Eric Seidel  <eric@webkit.org>
493
494         Reviewed by Darin Adler.
495
496         Move ASSERT(foo) to before where foo-> is used
497         https://bugs.webkit.org/show_bug.cgi?id=24684
498
499         * platform/chromium/PasteboardChromium.cpp:
500         (WebCore::Pasteboard::writeImage):
501           Move ASSERTs to the top of the function, code was using "node" before ASSERT(node), once I moved
502           ASSERT(node) to the top of the function it made sense to move the rest of them there too.
503         * rendering/SVGRenderSupport.cpp:
504         (WebCore::prepareToRenderSVGContent):
505           move ASSERT(object) to *before* we use "object" :)
506
507 2009-03-24  Eric Seidel  <eric@webkit.org>
508
509         Reviewed by Simon Fraser.
510
511         Make TextTokenizer ASSERT that the buffer was freed
512         https://bugs.webkit.org/show_bug.cgi?id=24684
513
514         * loader/TextDocument.cpp:
515         (WebCore::TextTokenizer::TextTokenizer):
516         (WebCore::TextTokenizer::~TextTokenizer):
517         (WebCore::TextTokenizer::finish):
518           Make it clear by adding a ~TextTokenizer that finish() will always be called and the memory never leaked.
519
520 2009-03-24  Eric Seidel  <eric@webkit.org>
521
522         Reviewed by Darin Adler.
523
524         Fix case where lBreak.obj->isBR() when lBreak.obj was NULL
525         https://bugs.webkit.org/show_bug.cgi?id=24684
526
527         I don't have a test case where we were taking the wrong path here
528         However, adding an ASSERT(lBreak.obj) before this usage caused
529         multiple bidi tests to fail, so lBreak.obj can be null here.
530
531         * rendering/bidi.cpp:
532         (WebCore::RenderBlock::findNextLineBreak):
533           lBreak.obj can be null, so we can't call ->isBR() on it unconditionally.
534
535 2009-03-24  Eric Seidel  <eric@webkit.org>
536
537         Reviewed by Simon Fraser.
538
539         Style cleanup and dead code removal in dom, editing
540         https://bugs.webkit.org/show_bug.cgi?id=24684
541
542         * dom/ContainerNode.cpp:
543         (WebCore::ContainerNode::getUpperLeftCorner):
544         (WebCore::ContainerNode::getLowerRightCorner):
545         (WebCore::ContainerNode::getRect):
546           Coverty was (rightly) confused as to what the hell "o" was being used for
547           and whether or not it would ever be NULL.  I added some ASSERTS so that people (and machines)
548           would be less confused about the logic in getUpperLeftCorner/getLowerRightCorner
549         * dom/Document.cpp:
550         (WebCore::Document::recalcStyle):
551           Remove dead code, this block already checked that change == Force
552         * editing/ApplyStyleCommand.cpp:
553         (WebCore::ApplyStyleCommand::removeInlineStyle):
554           Coverty correctly identified that traversePreviousNodePostOrder can return NULL, thus
555           prev will be null, and we don't really explicitly handle it (like we probably should)
556           It's OK though, because we end up creating a null position object, which may not have
557           been what we intended, but we certainly don't crash.
558         * editing/InsertParagraphSeparatorCommand.cpp:
559         (WebCore::InsertParagraphSeparatorCommand::doApply):
560           Remove dead code, insertionPosition.node() is already checked to be non-null above.
561         * editing/markup.cpp:
562         (WebCore::appendStartMarkup):
563           removed dead code, annotate is already known to be true at this point in the file
564           !annotate was checked above, and break; was called.
565
566 2009-03-24  Eric Seidel  <eric@webkit.org>
567
568         Reviewed by Simon Fraser.
569
570         CSS dead code removal and cleanup from Coverty errors
571         https://bugs.webkit.org/show_bug.cgi?id=24684
572
573         * css/CSSStyleSelector.cpp:
574         (WebCore::CSSStyleSelector::applyProperty):
575           Every other place in the code we check settings() for NULL, so I made these places
576           check too, even though we should never be resolving style against a document which has
577           no frame (which I believe is the only time settings() can be null)
578         * css/CSSStyleSheet.cpp:
579         (WebCore::CSSStyleSheet::styleSheetChanged):
580           Removing dead code, "root" can never be null here.
581         * css/SVGCSSStyleSelector.cpp:
582         (WebCore::colorFromSVGColorCSSValue):
583         (WebCore::CSSStyleSelector::applySVGProperty):
584           Extra returns in the old macros caused dead code.  Removing the old macros and use modern
585           ones instead. :)
586           Extra null checks to value were not needed.  Added an ASSERT at the top of the function
587           to make it clear that value will never be NULL.
588           Added colorFromSVGColorCSSValue to clean up the code a little.
589
590 2009-03-24  Eric Seidel  <eric@webkit.org>
591
592         Reviewed by Simon Fraser.
593
594         Font fallback cleanup and added ASSERT for GlyphPageTreeNode
595         https://bugs.webkit.org/show_bug.cgi?id=24684
596
597         * css/CSSFontSelector.cpp:
598         (WebCore::compareFontFaces):
599           Coverty was concerned that it was possible to index off the end of weightFallbackRuleSets
600           I can't read the code well enough to tell, so I tried to make the code clearer
601           and added an ASSERT.        
602         * platform/graphics/GlyphPageTreeNode.cpp:
603         (WebCore::GlyphPageTreeNode::initializePage):
604           Coverty believes we can crash here due to j being larger than GlyphPage::size.  I think to is already
605           known to be < GlyphPage::size due to the min() statement above, but not being sure I added an ASSERT.
606
607 2009-03-24  Eric Seidel  <eric@webkit.org>
608
609         Reviewed by Simon Fraser.
610
611         Coverty inspired fixes in Animations/Transforms
612         https://bugs.webkit.org/show_bug.cgi?id=24684
613
614         * page/animation/AnimationBase.h:
615           Fix animate() signatures to match so that the virtual methods actually override one another. :)
616         * page/animation/AnimationController.cpp:
617         (WebCore::AnimationControllerPrivate::removeFromStartTimeResponseWaitList):
618           Attempt to fix this method, prevAnimation was never set to anything but NULL,
619           as far as I can tell the author originally intended to update it at the end
620           of the loop, which is what I changed this code to do.
621         * page/animation/ImplicitAnimation.cpp:
622         (WebCore::ImplicitAnimation::animate):
623           Make method signature match AnimationBase::animate
624         * page/animation/ImplicitAnimation.h:
625         * page/animation/KeyframeAnimation.cpp:
626         (WebCore::KeyframeAnimation::animate):
627           Make method signature match AnimationBase::animate
628         * page/animation/KeyframeAnimation.h:
629         * platform/graphics/transforms/PerspectiveTransformOperation.cpp:
630         (WebCore::PerspectiveTransformOperation::blend):
631           if (blendToIdentity) already returned above.
632         * platform/graphics/transforms/RotateTransformOperation.cpp:
633         (WebCore::RotateTransformOperation::blend):
634           if (blendToIdentity) already returned above.
635
636 2009-03-25  Eli Fidler  <eli.fidler@torchmobile.com>
637
638         Reviewed by George Staikos.
639
640         Fix compiler warnings regarding assignments in if statements.
641
642         * html/HTMLFormElement.cpp:
643         (WebCore::HTMLFormElement::createFormData):
644         * plugins/PluginPackage.cpp:
645         (WebCore::PluginPackage::compare):
646
647 2009-03-25  Dan Bernstein  <mitz@apple.com>
648
649         Reviewed by Dave Hyatt.
650
651         - fix <rdar://problem/6472150> repro crash in
652           RenderBlock::rightmostPosition(bool, bool) const at mercotte.fr using
653           menus
654
655         Test: fast/inline/continuation-positioned-reparenting.html
656
657         * rendering/RenderInline.cpp:
658         (WebCore::RenderInline::splitFlow): When repurposing the existing
659         container as the "pre" block, clear its positioned objects list, because
660         positioned descendants may end up in a different block after the split.
661
662 2009-03-24  Simon Fraser  <simon.fraser@apple.com>
663
664         Reviewed by Dave Hyatt
665         
666         https://bugs.webkit.org/show_bug.cgi?id=24784
667         
668         Length values in transform operations need to take zoom into account.
669
670         Test: fast/transforms/transforms-with-zoom.html
671
672         * css/CSSStyleSelector.cpp:
673         (WebCore::CSSStyleSelector::createTransformOperations):
674
675 2009-03-25  David Hyatt  <hyatt@apple.com>
676
677         Reviewed by Simon Fraser.
678
679         https://bugs.webkit.org/show_bug.cgi?id=24809, background-clip/origin don't use the correct
680         values.  Add support for the new values (while preserving the old values for backwards
681         compatibility).
682
683         Changed some existing test cases to use the new values.
684
685         * css/CSSParser.cpp:
686         (WebCore::CSSParser::parseFillProperty):
687         * css/CSSPrimitiveValueMappings.h:
688         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
689         (WebCore::CSSPrimitiveValue::operator EFillBox):
690         * css/CSSValueKeywords.in:
691
692 2009-03-25  Brett Wilson  <brettw@dhcp-172-22-71-191.mtv.corp.google.com>
693
694         Reviewed by Dimitri Glazkov.
695
696         Fix complex text opacity on the Chromium Windows port.
697         https://bugs.webkit.org/show_bug.cgi?id=24757
698
699         Test: fast/text/complex-text-opacity.html
700
701         * platform/graphics/chromium/FontChromiumWin.cpp:
702         (WebCore::):
703         (WebCore::TransparencyAwareFontPainter::TransparencyAwareFontPainter::TransparencyAwareFontPainter):
704         (WebCore::TransparencyAwareFontPainter::TransparencyAwareFontPainter::init):
705         (WebCore::TransparencyAwareFontPainter::TransparencyAwareFontPainter::initializeForGDI):
706         (WebCore::TransparencyAwareFontPainter::TransparencyAwareFontPainter::~TransparencyAwareFontPainter):
707         (WebCore::TransparencyAwareFontPainter::TransparencyAwareGlyphPainter::TransparencyAwareGlyphPainter):
708         (WebCore::TransparencyAwareFontPainter::TransparencyAwareGlyphPainter::~TransparencyAwareGlyphPainter):
709         (WebCore::TransparencyAwareFontPainter::TransparencyAwareGlyphPainter::estimateTextBounds):
710         (WebCore::TransparencyAwareFontPainter::TransparencyAwareGlyphPainter::drawGlyphs):
711         (WebCore::TransparencyAwareFontPainter::TransparencyAwareUniscribePainter::hdc):
712         (WebCore::TransparencyAwareFontPainter::TransparencyAwareUniscribePainter::TransparencyAwareUniscribePainter):
713         (WebCore::TransparencyAwareFontPainter::TransparencyAwareUniscribePainter::~TransparencyAwareUniscribePainter):
714         (WebCore::TransparencyAwareFontPainter::TransparencyAwareUniscribePainter::estimateTextBounds):
715         (WebCore::Font::drawGlyphs):
716         (WebCore::Font::drawComplexText):
717
718 2009-03-25  David Hyatt  <hyatt@apple.com>
719
720         Reviewed by Eric Seidel
721
722         Fix for bug 23198, border images should not clip to border radii.  The border-image should just ignore
723         the border-radius, since the assumption is that any desired rounding will be built into the border-image
724         itself.
725
726         Note that I do not agree with this change, but I am matching the spec.
727
728         Added fast/borders/border-image-border-radius.html
729
730         * rendering/RenderBoxModelObject.cpp:
731         (WebCore::RenderBoxModelObject::paintNinePieceImage):
732
733 2009-03-25  Gustavo Noronha Silva  <gns@gnome.org>
734
735         Reviewed by Holger Freyther.
736
737         https://bugs.webkit.org/show_bug.cgi?id=24750
738         [GTK] requests download instead of displaying page
739
740         Fix the Content-Type headers we get from soup, so that we set a
741         proper media type on the ResourceResponse.
742
743         * platform/network/soup/ResourceHandleSoup.cpp:
744         (WebCore::fillResponseFromMessage):
745
746 2009-03-25  Gustavo Noronha Silva  <gns@gnome.org>
747
748         Reviewed by Holger Freyther.
749
750         https://bugs.webkit.org/show_bug.cgi?id=24600
751         [GTK] responses with status code >= 400 should not be given special treatment
752
753         Do not special case requests that have HTTP responses >=
754         400. Redirects are handled automatically by libsoup, but the rest
755         of the responses should be treated like any other.
756
757         * platform/network/soup/ResourceHandleSoup.cpp:
758         (WebCore::):
759         (WebCore::gotHeadersCallback):
760         (WebCore::gotChunkCallback):
761         (WebCore::finishedCallback):
762
763 2009-03-25  Darin Adler  <darin@apple.com>
764
765         Reviewed by John Sullivan.
766
767         Tidy up LegacyWebArchive a bit. And don't include favicons in web archives when
768         they are being used only for selections, not an entire document.
769
770         * WebCore.base.exp: Remove exported function that's not used in WebKit.
771
772         * loader/archive/cf/LegacyWebArchive.cpp:
773         (WebCore::LegacyWebArchive::createPropertyListRepresentation): Made a static member
774         function so it can share private things with other member functions. Added some FIXME
775         comments to a branch of code I think is dead. Changed boolean argument into a named
776         one. Renamed to match other similar functions.
777         (WebCore::LegacyWebArchive::createResourceResponseFromPropertyListData): Ditto.
778         (WebCore::LegacyWebArchive::createResource): Ditto.
779         (WebCore::LegacyWebArchive::create): Merged the create and init functions.
780         (WebCore::LegacyWebArchive::rawDataRepresentation): Added some assertions because
781         we should never fail to write (we can fail to read).
782         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Made a static
783         member function as above.
784         (WebCore::LegacyWebArchive::createFromSelection): Ditto.
785         (WebCore::LegacyWebArchive::create): Iterate the vector with indices rather than
786         iterators. Only include the favicon if the first node is the document since we don't
787         want to include the favicon when copying and pasting.
788
789         * loader/archive/cf/LegacyWebArchive.h: Made one of the create functions private.
790         Made the Mac-specific functions be static member functions. Made other helpers be
791         static member functions. Removed the nit function.
792
793         * loader/archive/cf/LegacyWebArchiveMac.mm:
794         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Updated
795         comment and made this a static member function.
796         (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto. Also made
797         it so we only type cast in one place.
798
799 2009-03-25  Darin Adler  <darin@apple.com>
800
801         Reviewed by David Hyatt.
802
803         Bug 24740: crash in RenderSlider::setPositionFromValue when calling pause() after setting <video> to display: none
804         https://bugs.webkit.org/show_bug.cgi?id=24740
805         rdar://problem/6679873
806
807         Bug 12104: Native Slider: When the thumb's height is specified as a percentage, it is not centered properly
808         https://bugs.webkit.org/show_bug.cgi?id=12104
809
810         Test: media/video-display-none-crash.html
811
812         The problem here was that RenderSlider was trying to position its thumb in a way that
813         requires it to call updateLayout inside rendering code. The right way to position a
814         child renderer is to do layout, so I had to write a layout function. And then fix a few
815         other small problems shown by the same test case.
816
817         * rendering/RenderSlider.cpp: Made defaultTrackLength have internal linkage.
818         Renamed HTMLSliderThumbElement to SliderThumbElement because we only use the HTML
819         prefix for public DOM classes, not elements used as implementation details.
820         Made SliderThumbElement function members private and got rid of unneeded default
821         argument value for shadowParent.
822         (WebCore::SliderRange::SliderRange): Added. Parses precision, max, and min attributes.
823         (WebCore::SliderRange::clampValue): Added. Does standard clamping based on the above.
824         (WebCore::SliderRange::valueFromElement): Added. Reads the value from the element in
825         a way that clamps to the range.
826         (WebCore::sliderPosition): Added. Computes the slider position: a double.
827         (WebCore::SliderThumbElement::SliderThumbElement): Removed unneeded explicit
828         initialization of m_initialClickPoint.
829         (WebCore::SliderThumbElement::defaultEventHandler): Call setValueForPosition instead
830         of calling setCurrentPosition and valueChanged.
831         (WebCore::RenderSlider::RenderSlider): Remove unneeded explicit initialization of m_thumb.
832         (WebCore::RenderSlider::styleDidChange): Remove unneeded second argument to createThumbStyle.
833         (WebCore::RenderSlider::createThumbStyle): Remove unneeded second argument. Get rid of code
834         setting the position to relative and setting the left and top. We now handle positioning
835         in a custom layout function.
836         (WebCore::RenderSlider::layout): Rewrote to handle positioning of the thumb as layout.
837         (WebCore::RenderSlider::updateFromElement): Added code to immediately update the value
838         in the element if it's out of range. This clamping used to be done as a side effect of
839         setPositionFromValue. Also, this has nothing to do with the renderer, so at some point
840         it could be moved into HTMLInputElement. Removed call to setPositionFromValue
841         and instead just rely on the call to setNeedsLayout. Fix the setNeedsLayout call to be
842         a normal setNeedsLayout(true), not a setNeedsLayout(true, false), because we do want
843         this to be propagated to the parent -- it's not called during layout.
844         (WebCore::RenderSlider::setValueForPosition): Refactor to use the new SliderRange
845         class. Also don't call setCurrentPosition; instead just call setNeedsLayout.
846         (WebCore::RenderSlider::currentPosition): Use the actual position of the renderer rather
847         than the style to find the position; that means this needs to be done after layout is done.
848         Also removed unneeded runtime checks and replaced them with assertions, after checking
849         all callers to see they already guarantee this.
850         (WebCore::RenderSlider::trackSize): Removed unneeded runtime checks and replaced them
851         with assertions, after checking all callers to see they already guarantee this.
852         (WebCore::RenderSlider::inDragMode): Added a null check for m_thumb so this won't
853         crash if called early on a brand new RenderSlider.
854
855         * rendering/RenderSlider.h: Made all functions private except for forwardEvent and inDragMode.
856         Renamed HTMLSliderThumbElement to SliderThumbElement because we only use the HTML
857         prefix for public DOM classes, not elements used as implementation details. Made the
858         mouseEventIsInThumb function non-virtual. Removed the return value and argument from
859         setPositionFromValue. Removed valueChanged and setCurrentPosition. Removed the oldStyle
860         argument to createThumbStyle (see above). Made SliderThumbElement a friend so it can use some
861         private member functions.
862
863 2009-03-25  Eli Fidler  <eli.fidler@torchmobile.com>
864
865         Reviewed by George Staikos.
866
867         Fix ambiguous else cases by adding braces to nested if()s with elses.
868
869         * loader/MainResourceLoader.cpp:
870         (WebCore::MainResourceLoader::continueAfterContentPolicy):
871         * page/EventHandler.cpp:
872         (WebCore::EventHandler::updateDragAndDrop):
873         * rendering/RenderListMarker.cpp:
874         (WebCore::toArmenianUnder10000):
875         * rendering/TextControlInnerElements.cpp:
876         (WebCore::TextControlInnerTextElement::defaultEventHandler):
877
878 2009-03-24  Eli Fidler  <eli.fidler@torchmobile.com>
879
880         Reviewed by George Staikos.
881
882         Move variable into proper platform block to quiet warning.
883
884         * html/CanvasRenderingContext2D.cpp:
885         (WebCore::CanvasRenderingContext2D::drawTextInternal):
886
887 2009-03-24  Eric Carlson  <eric.carlson@apple.com>
888
889         Reviewed by Antti Koivisto.
890
891         Fix for <rdar://problem/6719375> Deal with QTKit loadstate changes when playing streaming movies
892
893         *  WebCore/html/HTMLMediaElement.cpp:
894         (WebCore::HTMLMediaElement::setNetworkState): Deal with media engine reviving after having
895         network state of NETWORK_NO_SOURCE.
896
897         *  WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
898         (WebCore::MediaPlayerPrivate::updateStates): Reset m_readyState at each state change since
899         some types of movies currently cause QTKit's load state to bounce around. QTMovieLoadStatePlaythroughOK
900         corresponds to HaveFutureData, not HaveEnoughData.
901
902 2009-03-24  Adele Peterson  <adele@apple.com>
903
904         Reviewed by Darin Adler.
905
906         Fix for https://bugs.webkit.org/show_bug.cgi?id=24707
907         <rdar://problem/6593021> Deleting with a caret in a blank, quoted line decreases the quoting, but does not delete the line
908
909         * editing/TypingCommand.cpp: (WebCore::TypingCommand::deleteKeyPressed):
910         After breaking out of an empty mail blockquote, we still want continue with the deletion
911         so actual content will get deleted, and not just the quote style.
912
913 2009-03-24  Darin Adler  <darin@apple.com>
914
915         Reviewed by Brady Eidson.
916
917         <rdar://problem/6624662> REGRESSION (r39904): can't save certain web pages as web archive (ones without favicons!)
918
919         * loader/archive/cf/LegacyWebArchive.cpp:
920         (WebCore::LegacyWebArchive::create): Added a null check.
921
922 2009-03-24  Adam Langley  <agl@google.com>
923
924         Reviewed by Darin Fisher.
925
926         https://bugs.webkit.org/show_bug.cgi?id=24685
927
928         The Skia drawLine function takes subpixel values and attempts to draw
929         a line with subpixel precision. This is complex and slow for drawing
930         scrollbars which use only vertical and horizontal lines.
931
932         This changes the Chromium Linux scrollbar code to use drawIRect.
933
934         * platform/chromium/ScrollbarThemeChromiumLinux.cpp:
935         (WebCore::ScrollbarThemeChromium::invalidateOnMouseEnterExit):
936         (WebCore::drawVertLine):
937         (WebCore::drawHorizLine):
938         (WebCore::drawBox):
939         (WebCore::ScrollbarThemeChromium::paintTrackPiece):
940         (WebCore::ScrollbarThemeChromium::paintThumb):
941
942 2009-03-24  David Kilzer  <ddkilzer@apple.com>
943
944         Bug 23310: Setting an absolute path (/abs) on an <iframe> with no src doesn't resolve the URL properly
945
946         <https://bugs.webkit.org/show_bug.cgi?id=23310>
947
948         Reviewed by Darin Adler.
949
950         Test: fast/frames/iframe-no-src-set-location.html
951
952         * dom/Document.cpp:
953         (WebCore::Document::completeURL): If m_baseURL is empty or is
954         about:blank and we have a parent document, use the parent
955         document's URL for the base when completing a new URL.
956
957 2009-03-24  Simon Fraser  <simon.fraser@apple.com>
958
959         Reviewed by Dave Hyatt
960         
961         https://bugs.webkit.org/show_bug.cgi?id=24659
962         
963         When hit-testing 3d-transformed layers, it doesn't make sense to project the hitTestRect
964         into the coordinate space of the layer, and doing so can result in pathalogical quads
965         that break hit testing. In that case, simply use the same bounds as used for painting,
966         which are the composited bounds for this layer.
967
968         Test: transforms/3d/hit-testing/rotated-hit-test.html
969
970         * rendering/RenderLayer.cpp:
971         (WebCore::RenderLayer::hitTestLayer):
972
973 2009-03-24  Simon Fraser  <simon.fraser@apple.com>
974
975         Reviewed by Dave Hyatt
976
977         https://bugs.webkit.org/show_bug.cgi?id=24436
978         
979         When compositing is enabled, painting and hit testing end up using different
980         clipping roots, because, for painting, every composited layer is a clipping root,
981         but for hit testing only layers with transforms are. To fix this, we use
982         temporary clip rects for hit testing, if the page is in compositing mode.
983
984         * rendering/RenderLayer.cpp:
985         (WebCore::RenderLayer::paintLayer):
986         (WebCore::RenderLayer::hitTestLayer):
987         (WebCore::RenderLayer::parentClipRects):
988         (WebCore::RenderLayer::calculateRects):
989         * rendering/RenderLayer.h:
990
991 2009-03-24  Simon Fraser  <simon.fraser@apple.com>
992
993         Reviewed by Dan Bernstein
994         
995         https://bugs.webkit.org/show_bug.cgi?id=24782
996
997         Fix regression with CSS clip rects with non-length values, by reverting to
998         the original code, but passing the zoom multiplier through convertToLength().
999         
1000         Also make stylistic change in createTransformOperations(), renaming 'inStyle'
1001         to 'style.
1002         
1003         Tested by existing tests.
1004
1005         * css/CSSStyleSelector.cpp:
1006         (WebCore::convertToLength):
1007         (WebCore::CSSStyleSelector::applyProperty):
1008         (WebCore::CSSStyleSelector::createTransformOperations):
1009
1010 2009-03-24  David Hyatt  <hyatt@apple.com>
1011
1012         Reviewed by Simon Fraser
1013
1014         https://bugs.webkit.org/show_bug.cgi?id=21789, overflow:hidden elements should clip their foreground contents
1015         to a border-radius.
1016
1017         This patch makes non-self-painting overflow layers and control clips work with border-radius.  RenderLayers
1018         that should be clipped by overflow ancestors with border-radius are still broken.
1019
1020         Added fast/clip/overflow-border-radius-clip.html
1021
1022         * rendering/RenderBox.cpp:
1023         (WebCore::RenderBox::pushContentsClip):
1024
1025 2009-03-24  David Hyatt  <hyatt@apple.com>
1026
1027         Reviewed by Simon Fraser
1028
1029         https://bugs.webkit.org/show_bug.cgi?id=21789, overflow:hidden elements should clip their foreground contents.
1030         
1031         This first patch makes overflow:hidden properly clip the foreground contents of overflow:hidden replaced elements.  Common
1032         replaced elements now default to overflow:hidden in the UA stylesheet (this is what the spec specifically recommends be
1033         done).
1034     
1035         Added fast/replaced/border-radius-clip.html
1036
1037         * css/html4.css:
1038         * rendering/RenderReplaced.cpp:
1039         (WebCore::RenderReplaced::paint):
1040         * rendering/RenderWidget.cpp:
1041         (WebCore::RenderWidget::paint):
1042
1043 2009-03-24  Adele Peterson  <adele@apple.com>
1044
1045         RS by Mark Rowe.
1046
1047         Only build these Mail quirks checks in on the Mac.
1048
1049         * dom/Document.cpp: (WebCore::disableRangeMutation):
1050         * html/HTMLElement.cpp: (WebCore::HTMLElement::inEitherTagList):
1051
1052 2009-03-24  Brent Fulgham  <bfulgham@webkit.org>
1053
1054         Build fix, no review.
1055
1056         Remove ResourceLoaderCFNet.cpp from build list for Cairo Releas
1057         and Debug targets.
1058
1059         * WebCore.vcproj/WebCore.vcproj:
1060
1061 2009-03-24  Eric Carlson  <eric.carlson@apple.com>
1062
1063         Fix layout tests broken by r41907.
1064
1065         * html/HTMLMediaElement.cpp:
1066         (WebCore::HTMLMediaElement::setReadyState): Don't set "was playing" based on the new ready state
1067
1068 2009-03-24  Dmitry Titov  <dimich@chromium.org>
1069
1070         Reviewed by Dimitri Glazkov.
1071
1072         https://bugs.webkit.org/show_bug.cgi?id=24689
1073         Fix Chromium compilation errors.
1074
1075         * bindings/v8/WorkerContextExecutionProxy.cpp:
1076         (WebCore::WorkerContextExecutionProxy::FindOrCreateEventListener):
1077         (WebCore::WorkerContextExecutionProxy::RemoveEventListener):
1078
1079 2009-03-24  Yury Semikhatsky  <yurys@chromium.org>
1080
1081         Reviewed by Darin Adler.
1082
1083         https://bugs.webkit.org/show_bug.cgi?id=24759
1084         Add missing methods Element.prototype.removeMatchingStyleClasses and
1085         Node.prototype.enclosingNodeOrSelfWithNodeNameInArray to SourceFrame content
1086         iframe. These methods are called by Element.prototype.removeStyleClass and
1087         Node.prototype.enclosingNodeOrSelfWithNodeName.
1088
1089         * inspector/front-end/SourceFrame.js:
1090         (WebInspector.SourceFrame.prototype._loaded):
1091
1092 2009-03-24  Mark Mentovai  <mark@chromium.org>
1093
1094         Reviewed by Mark Rowe.
1095
1096         https://bugs.webkit.org/show_bug.cgi?id=24653
1097         WebKit should be buildable without prefix header injection.
1098         Adds missing #includes and forward declarations as needed.
1099
1100         * editing/SmartReplaceCF.cpp:
1101         * platform/graphics/mac/ColorMac.mm:
1102         * platform/graphics/mac/FontCacheMac.mm:
1103         * platform/graphics/mac/FontCustomPlatformData.h:
1104         * platform/graphics/mac/FontMac.mm:
1105         * platform/graphics/mac/FontMacATSUI.mm:
1106         * platform/graphics/mac/FontPlatformData.h:
1107         * platform/graphics/mac/FontPlatformDataMac.mm:
1108         * platform/graphics/mac/GraphicsContextMac.mm:
1109         * platform/graphics/mac/SimpleFontDataMac.mm:
1110         * platform/mac/FoundationExtras.h:
1111         * platform/mac/LocalCurrentGraphicsContext.h:
1112         * platform/mac/WebCoreSystemInterface.h:
1113         * platform/mac/WebCoreSystemInterface.mm:
1114         * platform/mac/WebCoreTextRenderer.h:
1115         * platform/mac/WebCoreTextRenderer.mm:
1116         * platform/mac/WebFontCache.h:
1117         * platform/mac/WebFontCache.mm:
1118         * platform/text/PlatformString.h:
1119         * platform/text/mac/ShapeArabic.c:
1120         * platform/text/mac/StringMac.mm:
1121         * rendering/RenderThemeChromiumMac.h:
1122
1123 2009-03-24  Dan Bernstein  <mitz@apple.com>
1124
1125         Reviewed by Darin Adler.
1126
1127         - fix <rdar://problem/6107874> by capping the nesting depth of
1128           "block-level" elements generated by the parser
1129
1130         Test: fast/parser/block-nesting-cap.html
1131
1132         * html/HTMLParser.cpp:
1133         (WebCore::HTMLParser::HTMLParser):
1134         (WebCore::HTMLParser::insertNode):
1135         (WebCore::HTMLParser::pushBlock):
1136         (WebCore::HTMLParser::popOneBlockCommon):
1137         (WebCore::HTMLParser::freeBlock):
1138         * html/HTMLParser.h:
1139
1140 2009-03-23  Greg Bolsinga  <bolsinga@apple.com>
1141
1142         Reviewed by David Kilzer.
1143
1144         https://bugs.webkit.org/show_bug.cgi?id=24771
1145         
1146         DOMTimeStamps are based upon 1970.
1147
1148         * platform/mac/GeolocationServiceMac.mm:
1149         (-[WebCoreCoreLocationObserver locationManager:didUpdateToLocation:fromLocation:]):
1150
1151 2009-03-23  Eric Seidel  <eric@webkit.org>
1152
1153         Build fix, no review.
1154
1155         * rendering/RenderObject.cpp:
1156         (WebCore::RenderObject::createVisiblePosition): change .container to .isNotNull()
1157
1158 2009-03-23  Eric Seidel  <eric@webkit.org>
1159
1160         Reviewed by Darin Adler.
1161
1162         Rename Position::container to m_anchorNode and make it private
1163         https://bugs.webkit.org/show_bug.cgi?id=24760
1164
1165         More code cleanup for Position.
1166
1167         Change all uses of m_container to node()
1168         Eventually most uses of node() should change to anchorNode() to designate
1169         that it's the node the Position is anchored to, but not necessarily the
1170         container of the position (it could be the before/after neighbor).
1171
1172         Remove any code which sets m_container, and change it to use a new
1173         Position::moveToPosition function which takes a node and offset.
1174         It never makes sense to change the node and leave the offset.
1175
1176         * dom/Position.h:
1177         (WebCore::Position::Position):
1178         (WebCore::Position::clear):
1179         (WebCore::Position::anchorNode):
1180         (WebCore::Position::node):
1181         (WebCore::Position::moveToPosition):
1182         (WebCore::Position::moveToOffset):
1183         (WebCore::Position::isNull):
1184         (WebCore::Position::isNotNull):
1185         (WebCore::operator==):
1186         * dom/Range.cpp:
1187         (WebCore::Range::create):
1188         (WebCore::Range::compareBoundaryPoints):
1189         * dom/RangeBoundaryPoint.h:
1190         (WebCore::RangeBoundaryPoint::container):
1191         (WebCore::RangeBoundaryPoint::set):
1192         (WebCore::RangeBoundaryPoint::setOffset):
1193         (WebCore::RangeBoundaryPoint::setToChild):
1194         (WebCore::RangeBoundaryPoint::setToStart):
1195         (WebCore::RangeBoundaryPoint::setToEnd):
1196
1197 2009-03-17  Eric Seidel  <eric@webkit.org>
1198
1199         Reviewed by David Hyatt.
1200
1201         document.write() should be able to make a document strict mode
1202         https://bugs.webkit.org/show_bug.cgi?id=24336
1203
1204         Remove an implicit write of "<html>" on the first document.write call
1205         this was added as part of a KDE import http://trac.webkit.org/changeset/798
1206         with no layout test or explanation.  I can't think of any reason why
1207         an implicit <html> write is necessary (or correct), so I'm removing it and
1208         adding a test for the correct behavior.  The parser will add any necessary
1209         HTMLHTMLElements during the write() anyway.
1210
1211         Our behavior is now tested by fast/dom/Document/document-write-doctype
1212         and matches IE, FF fails this new test.  Mozilla bug filed:
1213         https://bugzilla.mozilla.org/show_bug.cgi?id=483908
1214
1215         * dom/Document.cpp:
1216         (WebCore::Document::write):
1217
1218 2009-03-23  Sam Weinig  <sam@webkit.org>
1219
1220         Reviewed by Dan Bernstein.
1221
1222         Fix for <rdar://problem/6140966>
1223         Empty Caches does not clear the Cross-site XMLHttpRequest preflight cache
1224
1225         * WebCore.base.exp:
1226         * WebCore.xcodeproj/project.pbxproj:
1227         * loader/CrossOriginPreflightResultCache.cpp:
1228         (WebCore::CrossOriginPreflightResultCache::empty):
1229         * loader/CrossOriginPreflightResultCache.h:
1230
1231 2009-03-23  Darin Adler  <darin@apple.com>
1232
1233         Reviewed by Adele Peterson.
1234
1235         Bug 24726: hit testing doesn't work right when the click is on anonymous content
1236         https://bugs.webkit.org/show_bug.cgi?id=24726
1237         rdar://problem/6696992
1238
1239         Test: editing/selection/hit-test-anonymous.html
1240
1241         * rendering/RenderBR.cpp:
1242         (WebCore::RenderBR::positionForPoint): Call createVisiblePosition instead of
1243         creating a VisiblePosition directly. It will handle finding non-anonymous
1244         content nearby if node() is 0.
1245         * rendering/RenderBlock.cpp:
1246         (WebCore::positionForPointRespectingEditingBoundaries): Ditto.
1247         (WebCore::positionForPointWithInlineChildren): Ditto.
1248         (WebCore::RenderBlock::positionForPoint): Ditto.
1249         * rendering/RenderBox.cpp:
1250         (WebCore::RenderBox::positionForPoint): Ditto.
1251         * rendering/RenderObject.cpp:
1252         (WebCore::RenderObject::positionForPoint): Ditto.
1253         (WebCore::RenderObject::createVisiblePosition): Added.
1254         * rendering/RenderObject.h: Added createVisiblePosition.
1255         * rendering/RenderReplaced.cpp:
1256         (WebCore::RenderReplaced::positionForPoint): Call createVisiblePosition.
1257         * rendering/RenderSVGInlineText.cpp:
1258         (WebCore::RenderSVGInlineText::positionForPoint): Ditto.
1259         * rendering/RenderText.cpp:
1260         (WebCore::RenderText::positionForPoint): Ditto.
1261
1262 2009-03-23  Adele Peterson  <adele@apple.com>
1263
1264         Reviewed by Darin Adler & Dave Hyatt.
1265
1266         Fix for <rdar://problem/6621310> REGRESSION(35185): Apple Travel HTML emails missing some style after Safari 4 upgrade
1267
1268         Leopard Mail doesn't expect <style> to be in the body.  This change reverts back to the old behavior of
1269         moving <style> to <head> for that version of Mail.
1270
1271         * html/HTMLElement.cpp: (WebCore::HTMLElement::inEitherTagList):
1272
1273 2009-03-23  Adele Peterson  <adele@apple.com>
1274
1275         Reviewed by Mark Rowe & Dave Hyatt.
1276
1277         Merge some of the individual Mail quirks into two settings that we can check for future quirks.
1278
1279         * WebCore.base.exp:
1280         * dom/Document.cpp:
1281         (WebCore::disableRangeMutation):
1282         (WebCore::Document::nodeChildrenChanged):
1283         (WebCore::Document::nodeWillBeRemoved):
1284         (WebCore::Document::textInserted):
1285         (WebCore::Document::textRemoved):
1286         (WebCore::Document::textNodesMerged):
1287         (WebCore::Document::textNodeSplit):
1288         * page/Settings.cpp:
1289         (WebCore::Settings::Settings):
1290         (WebCore::Settings::setNeedsLeopardMailQuirks):
1291         (WebCore::Settings::setNeedsTigerMailQuirks):
1292         * page/Settings.h:
1293         (WebCore::Settings::needsLeopardMailQuirks):
1294         (WebCore::Settings::needsTigerMailQuirks):
1295
1296 2009-03-23  Ada Chan  <adachan@apple.com>
1297
1298         https://bugs.webkit.org/show_bug.cgi?id=24762
1299         Support text-indent in <option> elements on windows platform.
1300
1301         Reviewed by Adele Peterson.
1302
1303         * css/themeWin.css:
1304         * platform/PopupMenuStyle.h: We don't honor font specified on <option> elements right now.  Make this
1305         explicit via windows themed default stylesheet.
1306         (WebCore::PopupMenuStyle::PopupMenuStyle): Also store text-indent and text-direction.
1307         (WebCore::PopupMenuStyle::textIndent):
1308         (WebCore::PopupMenuStyle::textDirection):
1309         * platform/win/PopupMenuWin.cpp:
1310         (WebCore::PopupMenu::paint): Adjust the text's x-coordinate if text-indent is supported for options and 
1311         text-indent is specified with LTR direction.
1312         * rendering/RenderMenuList.cpp:
1313         (WebCore::RenderMenuList::updateOptionsWidth): Take text-indent into account if theme supports text-indent for options.
1314         (WebCore::RenderMenuList::itemStyle): Use new PopupMenuStyle constructor on windows.
1315         (WebCore::RenderMenuList::menuStyle): Ditto.
1316         * rendering/RenderTextControlSingleLine.cpp:
1317         (WebCore::RenderTextControlSingleLine::menuStyle): Ditto.
1318         * rendering/RenderTheme.h:
1319         (WebCore::RenderTheme::popupOptionSupportsTextIndent): Added.  Default is false since we are only supporting it in windows for now.
1320         * rendering/RenderThemeWin.h:
1321         (WebCore::RenderThemeWin::popupOptionSupportsTextIndent): Returns true for windows.
1322
1323 2009-03-23  Sam Weinig  <sam@webkit.org>
1324
1325         Reviewed by Anders Carlsson.
1326
1327         Fix for https://bugs.webkit.org/show_bug.cgi?id=24699
1328         REGRESSION: Java Applets broken
1329         <rdar://problem/6707494>
1330
1331         Fix loading Java applets without a codeBase. Only pass the base (up to the
1332         the last path component) of the baseURL to the plug-in.
1333
1334         * html/HTMLAppletElement.cpp:
1335         (WebCore::HTMLAppletElement::createRenderer):
1336         * platform/KURL.cpp:
1337         (WebCore::KURL::baseAsString):
1338         * platform/KURL.h:
1339
1340 2009-03-23  Darin Adler  <darin@apple.com>
1341
1342         Reviewed by Sam Weinig.
1343
1344         * platform/KURL.h: Removed now-incorrect comments.
1345         None of the parts include the separator characters any more, now that
1346         query doesn't include the "?", so the comments explaining which do and do
1347         not are no-longer helpful.
1348
1349 2009-03-23  David Levin  <levin@chromium.org>
1350
1351         Reviewed by Dimitri Glazkov.
1352
1353         https://bugs.webkit.org/show_bug.cgi?id=24764
1354
1355         Renamed files V8NodeFilter -> V8NodeFilterCondition to reflect
1356         class names.  Also fixed some headers that got mangled in search/replace
1357         operations.
1358
1359         No change in behavior, so no test.
1360
1361         * bindings/v8/V8NodeFilter.h: Removed.
1362         * bindings/v8/V8NodeFilterCondition.cpp: Renamed from WebCore/bindings/v8/V8NodeFilter.cpp.
1363         * bindings/v8/V8NodeFilterCondition.h: Added.
1364         * bindings/v8/custom/V8ClipboardCustom.cpp:
1365         * bindings/v8/custom/V8DocumentCustom.cpp:
1366         * bindings/v8/custom/V8ElementCustom.cpp:
1367         * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:
1368         * bindings/v8/custom/V8NavigatorCustom.cpp:
1369
1370 2009-03-23  Darin Fisher  <darin@chromium.org>
1371
1372         Reviewed by Antti Koivisto.
1373
1374         https://bugs.webkit.org/show_bug.cgi?id=24741
1375
1376         Adds a unique across-browser-sessions identifier to FormData, which may
1377         be used by ResourceHandle as a secondary cache key to enable cached
1378         form submissions.
1379
1380         At issue: two otherwise identical form submissions may result in
1381         completely independent responses, which may each be appropriate to
1382         store and reuse from cache.
1383
1384         * html/HTMLFormElement.cpp: Added call to FormData::setIdentifier so that
1385         we only enable cached form submissions for those generated by HTML.  This
1386         way we do not bother with POSTs generated by XMLHttpRequest.
1387         (WebCore::generateFormDataIdentifier):
1388         (WebCore::HTMLFormElement::createFormData):
1389         * platform/network/FormData.cpp: Initialize m_identifier to 0, which means
1390         the unspecified identifier.  So by default there is no identifier and
1391         nothing changes.
1392         (WebCore::FormData::FormData):
1393         * platform/network/FormData.h: Added m_identifier with setter and getter.
1394         (WebCore::FormData::setIdentifier):
1395         (WebCore::FormData::identifier):
1396
1397 2009-03-23  Simon Fraser  <simon.fraser@apple.com>
1398
1399         Reviewed by Antti Koivisto
1400         
1401         https://bugs.webkit.org/show_bug.cgi?id=24733
1402         
1403         Fix media controller with full-page zoom. Previously, the media controller
1404         shadow nodes never saw style changes on the RenderMedia, so did not respond
1405         to zooming at all. Now, we update the style on the shadow renderers
1406         whenever RenderMedia gets a style change. Also fix the video thumb in
1407         the theme to be scaled properly.
1408
1409         Test: media/video-controls-zoomed.html
1410
1411         * rendering/MediaControlElements.cpp:
1412         (WebCore::MediaControlShadowRootElement::updateStyle):
1413         (WebCore::MediaTextDisplayElement::MediaTextDisplayElement):
1414         (WebCore::MediaTextDisplayElement::updateStyle):
1415         (WebCore::MediaControlInputElement::MediaControlInputElement):
1416         (WebCore::MediaControlInputElement::updateStyle):
1417         * rendering/MediaControlElements.h:
1418         * rendering/RenderMedia.cpp:
1419         (WebCore::RenderMedia::styleDidChange):
1420         * rendering/RenderMedia.h:
1421         * rendering/RenderThemeMac.mm:
1422         (WebCore::RenderThemeMac::adjustSliderThumbSize):
1423
1424 2009-03-23  Mike Belshe  <mike@belshe.com>
1425
1426         Reviewed by Darin Adler.
1427
1428         https://bugs.webkit.org/show_bug.cgi?id=24739
1429
1430         Rework StringImpl::create methods to try to allocate a single buffer
1431         rather than allocating both the StringImpl class and a separate data
1432         buffer.
1433
1434         * platform/text/StringImpl.cpp:
1435         * platform/text/StringImpl.h:
1436
1437 2009-03-23  Darin Adler  <darin@apple.com>
1438
1439         Reviewed by Antti Koivisto.
1440
1441         Based on a patch by Nico Weber <nicolasweber@gmx.de>
1442
1443         Bug 24755: LayoutTests/http/tests/misc/url-in-utf16le.html regression
1444         https://bugs.webkit.org/show_bug.cgi?id=24755
1445
1446         * platform/text/TextEncoding.cpp:
1447         (WebCore::TextEncoding::isUTF7Encoding): Added. Checks if the current encoding
1448         is UTF7 without loading extended codecs.
1449         (WebCore::TextEncoding::encodingForFormSubmission): Use isUTF7Encoding() instead
1450         of comparing with UTF7Encoding(). Eliminate the explicit check of
1451         noExtendedTextEncodingNameUsed() because that's now handled by the functions
1452         that this function calls instead.
1453
1454         * platform/text/TextEncoding.h: Added isUTF7Encoding function.
1455         Also tweaked formatting a bit.
1456
1457 2009-03-20  Peter Kasting  <pkasting@google.com>
1458
1459         Reviewed by Darin Fisher.
1460
1461         https://bugs.webkit.org/show_bug.cgi?id=24720
1462         RenderThemeChromium should draw something for Slider parts instead of
1463         dropping them on the floor.
1464
1465         * platform/chromium/ChromiumBridge.h:
1466         * rendering/RenderThemeChromiumWin.cpp:
1467         (WebCore::RenderThemeChromiumWin::adjustSliderThumbSize):
1468         (WebCore::RenderThemeChromiumWin::paintSliderTrack):
1469         (WebCore::RenderThemeChromiumWin::determineSliderThumbState):
1470         (WebCore::RenderThemeChromiumWin::getThemeData):
1471         * rendering/RenderThemeChromiumWin.h:
1472         (WebCore::RenderThemeChromiumWin::paintSliderThumb):
1473
1474 2009-03-23  Glen Murphy  <glen@chromium.org>
1475
1476         Reviewed by Darin Fisher.
1477
1478         https://bugs.webkit.org/show_bug.cgi?id=24657
1479
1480         Fix Skia drawing of highly scaled bitmaps; the conversion to
1481         IntRect produced visible layout test failures in highly scaled 
1482         coordinate systems.
1483
1484         Test: svg/custom/image-small-width-height.svg
1485
1486         * WebCore\platform\graphics\skia\ImageSkia.cpp:
1487
1488 2009-03-23  David Kilzer  <ddkilzer@apple.com>
1489
1490         Provide JavaScript exception information after slow script timeout
1491
1492         Reviewed by Oliver Hunt.
1493
1494         * bindings/js/ScriptController.cpp:
1495         (WebCore::ScriptController::evaluate): Changed to report
1496         exceptions for the Interrupted completion type as well.
1497
1498 2009-03-23  Simon Fraser  <simon.fraser@apple.com>
1499
1500         Reviewed by Darin Adler
1501
1502         https://bugs.webkit.org/show_bug.cgi?id=24736
1503         
1504         Fix three mostly-unrelated problems with full-page zoom:
1505         
1506         * dom/Document.cpp:
1507         (WebCore::Document::elementFromPoint):
1508         Document::elementFromPoint() needs to take full-page zoom into account.
1509         
1510         * dom/MouseRelatedEvent.cpp:
1511         (WebCore::MouseRelatedEvent::receivedTarget):
1512         Take full-page zoom into account when computing offsetX/offsetY.
1513         
1514         * html/HTMLSelectElement.cpp:
1515         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
1516         Don't use offsetX/offsetY when hit testing list boxes; offsets were broken
1517         with full-page zoom, and using pageX/pageY is easier because we don't
1518         have to worry about the event target, and we already have a point in
1519         absolute coordinates.
1520
1521         Tests: fast/forms/listbox-hit-test-zoomed.html
1522                fast/forms/search-zoomed.html
1523                fast/forms/slider-zoomed.html
1524
1525 2009-03-23  Simon Fraser  <simon.fraser@apple.com>
1526
1527         Reviewed by Dan Bernstein
1528
1529         https://bugs.webkit.org/show_bug.cgi?id=24753
1530         
1531         The rect for CSS 'clip' needs to have zooming applied to it.
1532
1533         Test: fast/css/clip-zooming.html
1534
1535         * css/CSSStyleSelector.cpp:
1536         (WebCore::CSSStyleSelector::applyProperty):
1537
1538 2009-03-23  Eric Carlson  <eric.carlson@apple.com>
1539
1540         Reviewed by Adam Roben.
1541
1542         <rdar://problem/6704282>
1543         https://bugs.webkit.org/show_bug.cgi?id=24719
1544         QTMovieWinTimer logic inversion
1545
1546         Fix logic inversion in the Win32 timer used by QTMovieWin that caused it to always
1547         use SetTimer, even when the intervals was below USER_TIMER_MINIMUM. A side effect of
1548         this was that a movie timer would sometimes be blocked for significant amounts of time 
1549         because WM_TIMER messages are not processed when the thread's message queue has any
1550         higher priority messages, and WebCore/Win's timer uses PostMessage for low interval
1551         timers. Also change SetTimer call to use HWND and custom message instead of 
1552         timer function since the timer already has an HWND for processing PostMessage.
1553
1554         Not possible to make a test for this because it is so timing dependant.
1555
1556         * platform/graphics/win/QTMovieWinTimer.cpp:
1557         (TimerWindowWndProc):
1558         (setSharedTimerFireDelay):
1559
1560 2009-03-23  Eric Carlson  <eric.carlson@apple.com>
1561
1562         Reviewed by Adele Peterson.
1563
1564         https://bugs.webkit.org/show_bug.cgi?id=24588
1565         
1566         Update media element implementation to current HTML5 spec
1567
1568         New tests: 
1569                media/media-constants.html
1570                media/video-seek-no-src-exception.html
1571                media/video-source-add-src.html
1572                media/video-src-invalid-remove.html
1573                media/video-src-plus-source.html
1574                media/video-timeupdate-during-playback.html
1575
1576         * dom/EventNames.h: Remove obsolute events, add new ones.
1577         * html/HTMLMediaElement.cpp:
1578         (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize new member vars.
1579         (WebCore::HTMLMediaElement::attributeChanged): Trigger load() only when we don't
1580         have a source.
1581         (WebCore::HTMLMediaElement::removedFromDocument): Deal with state name changes.
1582         (WebCore::HTMLMediaElement::scheduleProgressEvent): New, create a progress event and 
1583         add it to the event queue to be dispatch when the timer fires.
1584         (WebCore::HTMLMediaElement::scheduleEvent): New, create a generic event and add
1585         it to the event queue to be dispatch when the timer fires.
1586         (WebCore::HTMLMediaElement::enqueueEvent): Add an event to the queue and ticke the 
1587         asynch event timer.
1588         (WebCore::HTMLMediaElement::asyncEventTimerFired): Dispatch all pending events.
1589         (WebCore::HTMLMediaElement::loadTimerFired): Either trigger the initial load or
1590         try to load the next <source> url.
1591         (WebCore::HTMLMediaElement::load): Minor style change.
1592         (WebCore::HTMLMediaElement::loadInternal): The first part of the spec load algorithm, cleanup
1593         the current load (if any) and set up state for a new load.
1594         (WebCore::HTMLMediaElement::selectMediaResource): Deal with no 'src' or <source>, post 'loadstart'
1595         event, and initiate load from 'src' if present.
1596         (WebCore::HTMLMediaElement::loadNextSourceChild): Initiate load from next <source> url, or trigger
1597         noneSupported() if no more to consider.
1598         (WebCore::HTMLMediaElement::loadResource): Instantiate a new MediaPlayer and ask it to load a url.
1599         (WebCore::HTMLMediaElement::startProgressEventTimer): Start the repeating progress event timer.
1600         (WebCore::HTMLMediaElement::noneSupported): Post error event and set up state when no valid 
1601         media url was found.
1602         (WebCore::HTMLMediaElement::mediaEngineError): Post error event and set up state when no valid 
1603         media engine failed with a decode error or a network error.
1604         (WebCore::HTMLMediaElement::mediaPlayerNetworkStateChanged):
1605         (WebCore::HTMLMediaElement::setNetworkState): Updated for new spec network states.
1606         (WebCore::HTMLMediaElement::mediaPlayerReadyStateChanged):
1607         (WebCore::HTMLMediaElement::setReadyState): Updated for new spec ready state.
1608         (WebCore::HTMLMediaElement::progressEventTimerFired): Bail if the network is not active.
1609         (WebCore::HTMLMediaElement::seek): Return INVALID_STATE_ERR exception if state is too low or
1610         if player hasn't been set up yet. This is necessary becase load() is async. Clear the flag
1611         we use to guard against sending 'ended' more than once.
1612         (WebCore::HTMLMediaElement::duration): Don't bother calling media engine before it has metadata.
1613         (WebCore::HTMLMediaElement::setDefaultPlaybackRate): Remove exception param, 0 is no longer an
1614         invalid rate. 
1615         (WebCore::HTMLMediaElement::setPlaybackRate): Remove exception param, 0 is no longer an
1616         invalid rate. Cache rate being set so we can use it later if media engine isn't ready now.
1617         (WebCore::HTMLMediaElement::play): Remove exception param, play() before load() now just
1618         starts loading asynchronously.
1619         (WebCore::HTMLMediaElement::playInternal): Remove exception param. Fire 'waiting' or 'playing'
1620         event depending on current state.
1621         (WebCore::HTMLMediaElement::pause): Remove exception param, pause() before load() now just
1622         starts loading asynchronously.
1623         (WebCore::HTMLMediaElement::pauseInternal): Remove exception param.
1624         (WebCore::HTMLMediaElement::setVolume): dispatchEventAsync -> scheduleEvent
1625         (WebCore::HTMLMediaElement::setMuted): dispatchEventAsync -> scheduleEvent
1626         (WebCore::HTMLMediaElement::togglePlayState): Remove exception param.
1627         (WebCore::HTMLMediaElement::beginScrubbing): pause() doesn't take an exception param.
1628         (WebCore::HTMLMediaElement::startPlaybackProgressTimer): New, starts timer that fires 4 times per
1629         second when the movie is playing to timeupdate so we can post 'timeupdate' events.
1630         (WebCore::HTMLMediaElement::playbackProgressTimerFired): Timer proc.
1631         (WebCore::HTMLMediaElement::scheduleTimeupdateEvent): Bottleneck around scheduling a 'timeupdate'
1632         event because we both fire them them when the spec says we should and when the media engine
1633         says that time has jumped, but we don't want to fire more than one at a given movie time. We also
1634         use this bottleneck to keep track of the last time one was posted so we won't fire too often
1635         during playback.
1636         (WebCore::HTMLMediaElement::canPlay): readyState now tracks whether or not we have metadata.
1637         (WebCore::HTMLMediaElement::havePotentialSourceChild): New, checks to see if there are a <source>
1638         element with a 'src' attribute that we have not tried to load yet.
1639         (WebCore::HTMLMediaElement::nextSourceChild): New, returns the url and content type of the next
1640         <source> element that we haven't tried to load.
1641         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): Schedule 'seeked' event when seeking completes.
1642         Set a flag when we post the 'ended' event, clear it when time changed and we aren't at the end since
1643         some media engines call this proc more than once when playback reaches the end and stops, but we
1644         don't want to post 'ended' more than once.
1645         (WebCore::HTMLMediaElement::mediaPlayerDurationChanged): New, added so media engine can inform
1646         when the movie duration changes and we can post 'durationchanged' event.
1647         (WebCore::HTMLMediaElement::mediaPlayerRateChanged): New, added so media engine can inform when
1648         the rate changed and we can updated our cached rate. This is useful because we only want to know
1649         post periodic 'timeupdate' events when the movie is actually playing, and because we want to know
1650         the actual playback rate when it differs from what we tried to set.
1651         (WebCore::HTMLMediaElement::mediaPlayerSizeChanged): New, added so media engine can inform when
1652         a movie's intrinsic size changes and we can inform the renderer.
1653         (WebCore::HTMLMediaElement::potentiallyPlaying): Renamed from activelyPlaying since the spec now
1654         uses "actively playing" for this concept. Update logic for new state names and un-comment calls
1655         to stoppedDueToErrors() and pausedForUserInteraction() since the spec says those condiditons
1656         are part of the answer.
1657         (WebCore::HTMLMediaElement::endedPlayback): Update logic for new state names. 
1658         (WebCore::HTMLMediaElement::stoppedDueToErrors): New, spec says this logic should be part of
1659         the determination of "potentially playing".
1660         (WebCore::HTMLMediaElement::pausedForUserInteraction): New, placeholder for when (if) user
1661         agent supports this spec concept.
1662         (WebCore::HTMLMediaElement::updatePlayState): Stop timer used to fire periodic 'timeupdate' 
1663         events when we pauses the movie. Set the media engine rate before calling play() in case it
1664         wasn't set up when the rate was changed.
1665         (WebCore::HTMLMediaElement::stopPeriodicTimers): New, stop the progress event and 'timeupate'
1666         event timers.
1667         (WebCore::HTMLMediaElement::userCancelledLoad): New, logic pulled out of documentWillBecomeInactive
1668         and updated for the current spec.
1669         (WebCore::HTMLMediaElement::documentWillBecomeInactive): Moved some logic to userCancelledLoad.
1670         (WebCore::HTMLMediaElement::documentDidBecomeActive): Update comments.
1671         (WebCore::HTMLMediaElement::initialURL): Update for refactoring of code that determines the 
1672         initial url.
1673         * html/HTMLMediaElement.h: Change ReadyState and NetworkState enums to match names in the spec,
1674         update for changes in .cpp.
1675         (WebCore::HTMLMediaElement::):
1676
1677         * html/HTMLMediaElement.idl: Update ready state and network state constants for spec changes.
1678         defaultPlaybackRate, playbackRate, play(), and pause() no longer raise exceptions.
1679
1680         * html/HTMLSourceElement.cpp:
1681         (WebCore::HTMLSourceElement::insertedIntoDocument): Update for network state name changes.
1682
1683         * html/HTMLVideoElement.cpp:
1684         (WebCore::HTMLVideoElement::updatePosterImage): Update for ready state name changes.
1685
1686         * html/MediaError.h:
1687         (WebCore::MediaError::): add MEDIA_ERR_NONE_SUPPORTED.
1688
1689         * html/MediaError.idl: add MEDIA_ERR_NONE_SUPPORTED.
1690
1691         * loader/MediaDocument.cpp:
1692         (WebCore::MediaDocument::defaultEventHandler): play() and pause() don't take an exception.
1693
1694         * platform/graphics/MediaPlayer.cpp:
1695         (WebCore::NullMediaPlayerPrivate::readyState): Update for newtork state name changes.
1696         (WebCore::MediaPlayer::sizeChanged): New, so engine can report intrinsic size changes.
1697         (WebCore::MediaPlayer::rateChanged): New, so engine can report rate changes.
1698         (WebCore::MediaPlayer::durationChanged): New, so engine can report duration changes.
1699         * platform/graphics/MediaPlayer.h: Update NetworkState and ReadyState enum names to match spec
1700         states.
1701         (WebCore::MediaPlayerClient::mediaPlayerDurationChanged): New.
1702         (WebCore::MediaPlayerClient::mediaPlayerRateChanged): New.
1703         (WebCore::MediaPlayerClient::mediaPlayerSizeChanged): New.
1704         (WebCore::MediaPlayer::):
1705
1706         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
1707         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate): Update for network/ready state name changes.
1708         (WebCore::MediaPlayerPrivate::load): Ditto.
1709         (WebCore::MediaPlayerPrivate::updateStates): Ditto.
1710         (WebCore::MediaPlayerPrivate::loadingFailed): Ditto.
1711
1712         * platform/graphics/mac/MediaPlayerPrivateQTKit.h: Update for network/ready state name changes.
1713         Remove endPointTimer, it is no longer necessary. Add m_enabledTrackCount and m_duration.
1714         (WebCore::MediaPlayerPrivate::metaDataAvailable):
1715         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1716         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate): No more m_endPointTimer or m_endTime. Initialize
1717         m_enabledTrackCount and m_duration. Update for network/ready state name changes.
1718         (WebCore::MediaPlayerPrivate::load): Update for network/ready state name changes.
1719         (WebCore::MediaPlayerPrivate::play): No more m_endPointTimer.
1720         (WebCore::MediaPlayerPrivate::pause): Ditto.
1721         (WebCore::MediaPlayerPrivate::currentTime): No more m_endTime.
1722         (WebCore::MediaPlayerPrivate::seek): Ditto.
1723         (WebCore::MediaPlayerPrivate::doSeek): Ditto, plus don't call setRate(0) when the rate is
1724         already zero.
1725         (WebCore::MediaPlayerPrivate::setEndTime): No more m_endTime.
1726         (WebCore::MediaPlayerPrivate::updateStates): Update for network/ready state name changes. Return
1727         different errors depending on what causes a failure. Watch for and report duration changes.
1728         (WebCore::MediaPlayerPrivate::rateChanged): Report rate changes.
1729         (WebCore::MediaPlayerPrivate::sizeChanged): Report size changes.
1730         (WebCore::MediaPlayerPrivate::didEnd): No more endpoint timer.
1731         (WebCore::MediaPlayerPrivate::setVisible): Update for network/ready state name changes.
1732         (WebCore::MediaPlayerPrivate::disableUnsupportedTracks): Don't return number of unsupported
1733         tracks, store in m_enabledTrackCount so we can use it to help determine causes of failure.
1734
1735         * platform/graphics/qt/MediaPlayerPrivatePhonon.cpp:
1736         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate): Update for network/ready state name changes.
1737         (WebCore::MediaPlayerPrivate::load): Ditto.
1738         (WebCore::MediaPlayerPrivate::duration): Ditto.
1739         (WebCore::MediaPlayerPrivate::updateStates): Ditto.
1740         (WebCore::MediaPlayerPrivate::naturalSize): Ditto.
1741
1742         * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp:
1743         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate): No more m_endPointTimer. Update for 
1744         network/ready state name changes.
1745         (WebCore::MediaPlayerPrivate::load): Update for network/ready state name changes. No more
1746         m_endPointTimer.
1747         (WebCore::MediaPlayerPrivate::play): No more m_endPointTimer.
1748         (WebCore::MediaPlayerPrivate::pause): Ditto. 
1749         (WebCore::MediaPlayerPrivate::setEndTime): Ditto.
1750         (WebCore::MediaPlayerPrivate::updateStates): Update for network/ready state name changes.
1751         (WebCore::MediaPlayerPrivate::didEnd): No more m_endPointTimer.
1752         * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.h:
1753
1754         * rendering/MediaControlElements.cpp:
1755         (WebCore::MediaControlPlayButtonElement::defaultEventHandler): Update for network/ready state 
1756         name changes.
1757         (WebCore::MediaControlSeekButtonElement::defaultEventHandler): Ditto.
1758
1759 2009-03-22  Kevin Ollivier  <kevino@theolliviers.com>
1760
1761         wxGTK build fix. Add missing header.
1762
1763         * platform/wx/wxcode/gtk/non-kerned-drawing.cpp:
1764
1765 2009-03-22  Simon Fraser  <simon.fraser@apple.com>
1766
1767         Reviewed by Dan Bernstein
1768         
1769         https://bugs.webkit.org/show_bug.cgi?id=24665
1770         
1771         Image-map code in RenderImage could result in RenderImage::nodeAtPoint()
1772         setting HitTestResult::innerNode(), but returning false, which violates
1773         hit testing rules. Use a temporary HitTestResult so that we only fill in
1774         result when we know we've hit.
1775
1776         * rendering/RenderImage.cpp:
1777         (WebCore::RenderImage::nodeAtPoint):
1778
1779 2009-03-22  Simon Fraser  <simon.fraser@apple.com>
1780
1781         Reviewed by Dan Bernstein
1782         
1783         https://bugs.webkit.org/show_bug.cgi?id=24743
1784         
1785         Fix hit testing regression from r41840. We need to pass the temporary
1786         HitTestResult when testing sublayers, then only copy to 'result' when
1787         the layer is known to have been hit.
1788
1789         Test: fast/layers/zindex-hit-test.html
1790
1791         * rendering/RenderLayer.cpp:
1792         (WebCore::RenderLayer::hitTestLayer):
1793
1794 2009-03-20  Simon Fraser  <simon.fraser@apple.com>
1795
1796         Reviewed by Darin Adler
1797
1798         https://bugs.webkit.org/show_bug.cgi?id=24733
1799         
1800         Fix hit testing on video controls after full page zoom by fixing wider issue
1801         with event->pageX(), pageY() with zooming. pageX and pageY are "fixed" to be
1802         invariant under zooming (for JavaScript), so we keep an actual page point around
1803         in MouseEvent::absoluteLocation() to avoid the need to factor in zooming everywhere.
1804
1805         * dom/MouseRelatedEvent.cpp:
1806         (WebCore::MouseRelatedEvent::initCoordinates):
1807         (WebCore::MouseRelatedEvent::computePageLocation):
1808         * dom/MouseRelatedEvent.h:
1809         (WebCore::MouseRelatedEvent::absoluteLocation):
1810         (WebCore::MouseRelatedEvent::setAbsoluteLocation):
1811         Member var, and getter and setter for absoluteLocation.
1812         New method, computePageLocation(), to compute the actual page point,
1813         and call it when creating and initting mouse-related events.
1814
1815         * dom/Node.cpp:
1816         (WebCore::Node::dispatchMouseEvent):
1817         (WebCore::Node::dispatchWheelEvent):
1818         Keep non-adjusted pageX and pageY around, and call setAbsoluteLocation()
1819         on the event to replace a potentially rounded point.
1820         
1821         * html/HTMLInputElement.cpp:
1822         (WebCore::HTMLInputElement::defaultEventHandler):
1823         Clean up slider handling code.
1824         
1825         * html/HTMLSelectElement.cpp:
1826         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
1827         Add FIXME comment for use of offsetX/offsetY.
1828         
1829         * page/ContextMenuController.cpp:
1830         (WebCore::ContextMenuController::handleContextMenuEvent):
1831         Use absoluteLocation() when hit testing for context menus.
1832         
1833         * rendering/RenderFrameSet.cpp:
1834         (WebCore::RenderFrameSet::userResize):
1835         Use absoluteLocation() when resizing frames.
1836         
1837         * rendering/RenderMedia.cpp:
1838         (WebCore::RenderMedia::forwardEvent):
1839         Use absoluteLocation() when hit testing media controls.
1840
1841         * rendering/RenderSlider.cpp:
1842         (WebCore::HTMLSliderThumbElement::defaultEventHandler):
1843         (WebCore::RenderSlider::mouseEventIsInThumb):
1844         Use absoluteLocation() when handling slider events.
1845
1846         (WebCore::RenderSlider::forwardEvent):
1847         Factor some code out of HTMLInputElement::defaultEventHandler().
1848         
1849         * rendering/RenderTextControlSingleLine.cpp:
1850         (WebCore::RenderTextControlSingleLine::forwardEvent):
1851         Use absoluteLocation() when hit testing search field buttons, which fixees
1852         bugs in the search field with zooming.
1853
1854 2009-03-21  David Levin  <levin@chromium.org>
1855
1856         Reviewed by Dimitri Glazkov.
1857
1858         https://bugs.webkit.org/show_bug.cgi?id=24727
1859         Add V8XMLHttpRequest*.
1860
1861         * bindings/v8/V8XMLHttpRequestUtilities.cpp: Added.
1862         * bindings/v8/V8XMLHttpRequestUtilities.h: Added.
1863         * bindings/v8/custom/V8XMLHttpRequestConstructor.cpp: Added.
1864         * bindings/v8/custom/V8XMLHttpRequestCustom.cpp: Added.
1865         * bindings/v8/custom/V8XMLHttpRequestUploadCustom.cpp: Added.
1866
1867 2009-03-21  David Levin  <levin@chromium.org>
1868
1869         Reviewed by Dimitri Glazkov.
1870
1871         https://bugs.webkit.org/show_bug.cgi?id=24725
1872         Add V8NodeFilter.
1873
1874         * bindings/v8/V8NodeFilter.cpp: Added.
1875         * bindings/v8/V8NodeFilter.h: Added.
1876
1877 2009-03-21  Dan Bernstein  <mitz@apple.com>
1878
1879         Rubber-stamped by Kevin Decker
1880
1881         - remove some redundant #include statements
1882
1883         * bindings/js/JSDOMWindowBase.cpp:
1884
1885 2009-03-20  Dan Bernstein  <mitz@apple.com>
1886
1887         Reviewed by Mark Rowe.
1888
1889         - fix <rdar://problem/6574185> REGRESSION (3.2.2-TOT): hang in text drawing code
1890
1891         * platform/graphics/win/FontCGWin.cpp:
1892         (WebCore::drawGDIGlyphs): Changed glyph stroking to fill and stroke each
1893         glyph as a separate path, instead of all glyphs as a single path. This
1894         matches what CGContextShowGlyphsWithAdvances() does, and has comparable
1895         performance.
1896
1897 2009-03-20  Dean Jackson  <dino@apple.com>
1898
1899         Reviewed by Simon Fraser
1900
1901         Build fix for ENABLE(3D_RENDERING)
1902
1903         * rendering/RenderObject.h:
1904         (WebCore::makeMatrixRenderable):
1905
1906 2009-03-20  Dave Moore  <davemoore@google.com>
1907
1908         Reviewed by Dimitri Glazkov.
1909
1910         https://bugs.webkit.org/show_bug.cgi?id=24705
1911
1912         A bug in the V8 bindings is preventing chromium from setting the href on the
1913         location object...any attempt throws a security error, not just for javascript
1914         protocol
1915
1916         * page/Location.idl:
1917
1918 2009-03-20  Craig Schlenter  <craig.schlenter@gmail.com>
1919
1920         Reviewed by Dimitri Glazkov.
1921
1922         https://bugs.webkit.org/show_bug.cgi?id=24608
1923
1924         Include stdio.h needed for printf on gcc 4.4.0
1925
1926         * platform/KURLGoogle.cpp:
1927
1928 2009-03-20  Mike Belshe <mike@belshe.com>
1929
1930         Reviewed by Darin Fisher.
1931
1932         https://bugs.webkit.org/show_bug.cgi?id=24577
1933
1934         Don't let comments at the end of an event handler
1935         break the event handler.
1936
1937         No change in behavior, so no test.
1938
1939         * bindings/v8/V8LazyEventListener.cpp:
1940         (WebCore::V8LazyEventListener::getWrappedListenerFunction):
1941
1942 2009-03-20  Norbert Leser  <norbert.leser@nokia.com>
1943
1944         Reviewed by Darin Adler.
1945
1946         https://bugs.webkit.org/show_bug.cgi?id=24535
1947
1948         Fixes missing line terminator character (;) after macro call.
1949         It is common practice to add the trailing ";" where macros are substituted
1950         and not where they are defined with #define.
1951         This change is consistent with other macro declarations across webkit,
1952         and it also solves compilation failure with symbian compilers. 
1953  
1954         No change in behavior, so no test.
1955
1956         * bindings/js/JSDOMWindowShell.cpp:
1957         * bindings/js/JSEventListener.cpp:
1958         * bindings/js/JSImageConstructor.cpp:
1959         * bindings/js/JSInspectedObjectWrapper.cpp:
1960         * bindings/js/JSInspectorCallbackWrapper.cpp:
1961         * bindings/js/JSNamedNodesCollection.cpp:
1962         * bindings/js/JSNodeFilterCondition.cpp:
1963         * bindings/js/JSOptionConstructor.cpp:
1964         * bindings/js/JSQuarantinedObjectWrapper.cpp:
1965         * bindings/js/JSRGBColor.cpp:
1966         * bindings/js/JSWorkerContextBase.cpp:
1967         * bindings/js/JSXMLHttpRequestConstructor.cpp:
1968         * bindings/js/JSXSLTProcessorConstructor.cpp:
1969         * bindings/scripts/CodeGeneratorJS.pm:
1970
1971 2009-03-20  Mike Belshe  <mike@belshe.com>
1972
1973         Reviewed by Dimitri Glazkov and Dave Hyatt.
1974
1975         https://bugs.webkit.org/show_bug.cgi?id=24324
1976
1977         Make the minimum timer configurable for different platforms.
1978
1979         * page/DOMTimer.cpp:
1980         (WebCore::DOMTimer::DOMTimer):
1981         (WebCore::DOMTimer::fired):
1982         * page/DOMTimer.h:
1983         (WebCore::DOMTimer::minTimerInterval):
1984         (WebCore::DOMTimer::setMinTimerInterval):
1985
1986 2009-03-20  Dean McNamee  <deanm@chromium.org>
1987
1988         Reviewed by Darin Adler.
1989
1990         https://bugs.webkit.org/show_bug.cgi?id=22834
1991
1992         Make sure to consistently match new/delete and fastMalloc/fastFree.
1993
1994         * css/CSSSelectorList.cpp:
1995         (WebCore::CSSSelectorList::adoptSelectorVector):
1996         (WebCore::CSSSelectorList::deleteSelectors):
1997
1998 2009-03-20  Dan Bernstein  <mitz@apple.com>
1999
2000         Reviewed by Dave Hyatt.
2001
2002         - fix https://bugs.webkit.org/show_bug.cgi?id=23739
2003           <rdar://problem/6556371> REGRESSION (r36513): iframe isn't sized properly upon load
2004
2005         * rendering/RenderBlock.cpp:
2006         (WebCore::RenderBlock::percentHeightDescendants): Added this accessor.
2007         * rendering/RenderBlock.h:
2008         * rendering/RenderTableSection.cpp:
2009         (WebCore::RenderTableSection::layoutRows): Extended the check for
2010         children that flex to include other descendants with percent height
2011         which is relative to the cell.
2012
2013 2009-03-20  Dmitry Titov  <dimich@chromium.org>
2014
2015         Reviewed by Alexey Proskuryakov.
2016
2017         https://bugs.webkit.org/show_bug.cgi?id=24706
2018         Remove ScriptExecutionContext::encoding() since Workers do not need it.
2019         WorkerContext::encoding() is simply removed, while Document::encoding()
2020         made non-virtual and private. Workers use UTF-8 now except when instructed
2021         otherwise by http header. Also updated test.
2022
2023         * dom/Document.h: Made encoding() non-virtual and private.
2024         * dom/ScriptExecutionContext.h: removed encoding().
2025
2026         * workers/Worker.cpp:
2027         (WebCore::Worker::Worker):
2028         (WebCore::Worker::notifyFinished):
2029         * workers/WorkerContext.cpp: removed encoding() implementation.
2030         (WebCore::WorkerContext::WorkerContext):
2031         (WebCore::WorkerContext::completeURL):
2032         * workers/WorkerContext.h: removed encoding()
2033         (WebCore::WorkerContext::create):
2034         * workers/WorkerContextProxy.h:
2035         * workers/WorkerImportScriptsClient.cpp:
2036         (WebCore::WorkerImportScriptsClient::didReceiveData):
2037         * workers/WorkerMessagingProxy.cpp:
2038         (WebCore::WorkerMessagingProxy::startWorkerContext):
2039         * workers/WorkerMessagingProxy.h:
2040         * workers/WorkerThread.cpp:
2041         (WebCore::WorkerThreadStartupData::create):
2042         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
2043         (WebCore::WorkerThread::create):
2044         (WebCore::WorkerThread::WorkerThread):
2045         (WebCore::WorkerThread::workerThread):
2046         * workers/WorkerThread.h:
2047         In all these, removed storing encoding and 'inheriting' it from the parent.
2048         Instead, they are all using UTF-8 now.
2049
2050 2009-03-20  Timothy Hatcher  <timothy@apple.com>
2051
2052         Change how threading exceptions are checked so they are reported
2053         by what round they were added. That way WebKit can decided the
2054         behavior per-round based on linked-on-or-after checks.
2055
2056         <rdar://problem/6626741&6648478&6635474&6674079>
2057
2058         Reviewed by Darin Adler.
2059
2060         * WebCore.base.exp: Export the new symbols.
2061         * bindings/objc/DOMAbstractView.mm: Use the new WebCoreThreadViolationCheckRoundOne macro.
2062         * bindings/scripts/CodeGeneratorObjC.pm: Ditto.
2063         * platform/ThreadCheck.h:
2064         * platform/mac/ThreadCheck.mm:
2065         (WebCore::readThreadViolationBehaviorFromUserDefaults): Refactor how the default is read.
2066         (WebCore::setDefaultThreadViolationBehavior): Take a round argument.
2067         (WebCore::reportThreadViolation): Ditto.
2068         (WebCoreReportThreadViolation): Ditto.
2069
2070 2009-03-20  Geoffrey Garen  <ggaren@apple.com>
2071
2072         Reviewed by Sam Weinig.
2073
2074         Fixed up an out-of-date comment.
2075
2076         * bindings/js/JSDOMWindowCustom.h:
2077         (WebCore::JSDOMWindow::customPut):
2078
2079 2009-03-20  Beth Dakin  <bdakin@apple.com>
2080
2081         Reviewed by Dave Hyatt.
2082
2083         Fix for https://bugs.webkit.org/show_bug.cgi?id=20909 REGRESSION 
2084         (r35318): A press release at pfizer.com does not display correctly
2085         - and corresponding -
2086         <rdar://problem/6680073>
2087
2088         * rendering/RenderObject.cpp:
2089         (WebCore::RenderObject::invalidateContainerPrefWidths):
2090         * rendering/RenderObject.h:
2091         (WebCore::RenderObject::markContainingBlocksForLayout):
2092
2093 2009-03-20  Eric Seidel  <eric@webkit.org>
2094
2095         Reviewed by Justin Garcia.
2096
2097         maxDeepOffset is confusing and should be removed
2098         https://bugs.webkit.org/show_bug.cgi?id=24586
2099
2100         Abstract some hard-to-read (but shared) logic into a new renderedAsNonInlineTableOrHR function.
2101         Add first/lastDeepEditingPositionForNode Position creation functions
2102         and deploy them to places we used to call maxDeepOffset.
2103
2104         Rename Position::atStart and atEnd to atStartOfTree atEndOfTree
2105         Add a new Position::atFirst/atLastEditingPositionForNode() and use these
2106         to replace a few more callers for maxDeepOffset()
2107         
2108         Rename maxDeepOffset to lastEditingOffsetForNode (so that we mere mortals have some clue what it does)
2109
2110         "Editing positions" are confusing because they have one
2111         of two behaviors, depending on if the container node is ignored
2112         by editing (if editingIgnoresContent(node) returns true) or not.
2113         Positions referring to nodes ignored by editing are
2114         neighbor-relative (they are before or after the node) where as
2115         positions reffering to other nodes are container-relative
2116         (they are between two child nodes of the container, identified
2117         by the offset() member).  I will be fixing this confusion in
2118         future patches.  These renames hopefully make the current behavior clearer.
2119
2120         * dom/Position.cpp:
2121         (WebCore::Position::previous):
2122         (WebCore::Position::next):
2123         (WebCore::Position::atFirstEditingPositionForNode):
2124         (WebCore::Position::atLastEditingPositionForNode):
2125         (WebCore::Position::atStartOfTree):
2126         (WebCore::Position::atEndOfTree):
2127         (WebCore::Position::previousCharacterPosition):
2128         (WebCore::Position::nextCharacterPosition):
2129         (WebCore::Position::upstream):
2130         (WebCore::Position::isCandidate):
2131         (WebCore::firstDeepEditingPositionForNode):
2132         (WebCore::lastDeepEditingPositionForNode):
2133         * dom/Position.h:
2134         * dom/PositionIterator.cpp:
2135         (WebCore::PositionIterator::operator Position):
2136         (WebCore::PositionIterator::increment):
2137         (WebCore::PositionIterator::decrement):
2138         (WebCore::PositionIterator::atEnd):
2139         (WebCore::PositionIterator::atEndOfNode):
2140         * editing/CompositeEditCommand.cpp:
2141         (WebCore::CompositeEditCommand::positionAvoidingSpecialElementBoundary):
2142         * editing/DeleteSelectionCommand.cpp:
2143         (WebCore::isTableCellEmpty):
2144         (WebCore::DeleteSelectionCommand::removeNode):
2145         (WebCore::DeleteSelectionCommand::handleGeneralDelete):
2146         * editing/Editor.cpp:
2147         (WebCore::Editor::advanceToNextMisspelling):
2148         * editing/InsertLineBreakCommand.cpp:
2149         (WebCore::InsertLineBreakCommand::doApply):
2150         * editing/InsertListCommand.cpp:
2151         (WebCore::InsertListCommand::doApply):
2152         * editing/ReplaceSelectionCommand.cpp:
2153         (WebCore::ReplaceSelectionCommand::positionAtEndOfInsertedContent):
2154         * editing/TypingCommand.cpp:
2155         (WebCore::TypingCommand::forwardDeleteKeyPressed):
2156         * editing/VisiblePosition.cpp:
2157         (WebCore::VisiblePosition::previous):
2158         (WebCore::VisiblePosition::leftVisuallyDistinctCandidate):
2159         (WebCore::VisiblePosition::left):
2160         (WebCore::VisiblePosition::rightVisuallyDistinctCandidate):
2161         (WebCore::VisiblePosition::right):
2162         * editing/VisibleSelection.cpp:
2163         (WebCore::VisibleSelection::selectionFromContentsOfNode):
2164         (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries):
2165         * editing/htmlediting.cpp:
2166         (WebCore::nextVisuallyDistinctCandidate):
2167         (WebCore::previousVisuallyDistinctCandidate):
2168         (WebCore::firstEditablePositionAfterPositionInRoot):
2169         (WebCore::lastEditablePositionBeforePositionInRoot):
2170         (WebCore::lastOffsetForEditing):
2171         (WebCore::isFirstPositionAfterTable):
2172         (WebCore::isLastPositionBeforeTable):
2173         (WebCore::positionBeforeNode):
2174         (WebCore::positionAfterNode):
2175         (WebCore::enclosingEmptyListItem):
2176         (WebCore::caretMaxOffset):
2177         * editing/htmlediting.h:
2178         * editing/visible_units.cpp:
2179         (WebCore::renderedAsNonInlineTableOrHR):
2180         (WebCore::startOfParagraph):
2181         (WebCore::endOfParagraph):
2182         (WebCore::startOfEditableContent):
2183         (WebCore::endOfEditableContent):
2184         * page/AccessibilityObject.cpp:
2185         (WebCore::endOfStyleRange):
2186         * page/AccessibilityRenderObject.cpp:
2187         (WebCore::AccessibilityRenderObject::visiblePositionRange):
2188         * rendering/RenderBox.cpp:
2189         (WebCore::RenderBox::positionForPoint):
2190
2191 2009-03-20  Dmitry Titov  <dimich@chromium.org>
2192
2193         Reviewed by Dimitri Glazkov.
2194
2195         https://bugs.webkit.org/show_bug.cgi?id=24689
2196         Add (upstream) V8 bindings for Workers. Mostly style cleaning.
2197
2198         * bindings/v8/WorkerContextExecutionProxy.cpp: Added.
2199         * bindings/v8/WorkerContextExecutionProxy.h: Added.
2200         * bindings/v8/WorkerScriptController.cpp: Added.
2201         * bindings/v8/WorkerScriptController.h: Added.
2202         * bindings/v8/V8Index.h: Added. This is just a wrapper for v8_index.h, like V8Proxy.h
2203         * bindings/v8/V8Proxy.h: Added domObjectMap() function that wraps GetDOMObjectMap().
2204         * bindings/v8/V8WorkerContextEventListener.cpp:
2205         (WebCore::V8WorkerContextEventListener::callListenerFunction): TrackEvent() renamed trackEvent()
2206
2207 2009-03-20  Stephen White  <senorblanco@chromium.org>
2208
2209         Reviewed by Eric Seidel.
2210
2211         Fix for LayoutTests/fast/canvas/canvas-text-alignment.html
2212         on chromium/skia.  The problem was that the gradient matrix
2213         for text was being applied twice.  Fixed by reverting some of
2214         https://bugs.webkit.org/show_bug.cgi?id=23957, so that skiaDrawText
2215         is no longer responsible for measuring the text and scaling up
2216         the gradient matrix.  Instead, the text bounding box is passed
2217         in from SVGPaintServerGradient.  I didn't make this change for CG,
2218         since it uses a different method (the gradient is drawn using the
2219         text as a pre-rendered mask).
2220         https://bugs.webkit.org/show_bug.cgi?id=24687
2221
2222         * platform/graphics/skia/SkiaFontWin.cpp:
2223         (WebCore::skiaDrawText):
2224         * svg/graphics/SVGPaintServerGradient.cpp:
2225         (WebCore::SVGPaintServerGradient::setup):
2226
2227 2009-03-20  Xan Lopez  <xlopez@igalia.com>
2228
2229         Rubber-stamped by Holger Freyther.
2230
2231         There seems to be some rounding error in cairo (or in how we use
2232         cairo) with some fonts, like DejaVu Sans Mono, which makes cairo
2233         report a height smaller than ascent + descent, which is wrong and
2234         confuses WebCore's layout system. Workaround this while we figure
2235         out what's going on.
2236
2237         * platform/graphics/gtk/SimpleFontDataGtk.cpp:
2238         (WebCore::SimpleFontData::platformInit):
2239         * platform/graphics/gtk/SimpleFontDataPango.cpp:
2240         (WebCore::SimpleFontData::platformInit):
2241
2242 2009-03-19  Alexey Proskuryakov  <ap@webkit.org>
2243
2244         Reviewed by Darin Adler.
2245
2246         https://bugs.webkit.org/show_bug.cgi?id=24122
2247         <rdar://problem/6674179>
2248         REGRESSION: DOM Range extractContents/deleteContents failures seen on Moxiecode tests
2249
2250         Test: fast/dom/Range/deleted-range-endpoints.html
2251
2252         * dom/Range.cpp: (WebCore::Range::processContents): Set the final range in accordance
2253         to the specification.
2254
2255 2009-03-19  Anders Carlsson  <andersca@apple.com>
2256
2257         Reviewed by Dan Bernstein.
2258
2259         <rdar://problem/6682554> Flash content not being rendered (Shockwave Flash 10.0 r22)
2260         
2261         If calling updateWidget for some reason resulted in another widget being added to m_widgetUpdateSet, then
2262         that object would never be updated.
2263         
2264         * page/FrameView.cpp:
2265         (WebCore::FrameView::updateWidgets):
2266         Factor the widget updating code out into this method. Return true if the update set is empty.
2267         
2268         (WebCore::FrameView::performPostLayoutTasks):
2269         Loop over the update set multiple times until all widgets have been updated or until we reach the cap.
2270         
2271         * page/FrameView.h:
2272
2273 2009-03-18  Timothy Hatcher  <timothy@apple.com>
2274
2275         Make the defered data loading timer honor the Page's scheduled runloop pairs.
2276         Introduces a new RunLoopTimer class that has an API mimicking Timer but
2277         allows it to be scheduled with one or more SchedulePairs.
2278
2279         <rdar://problem/6687342> -[WebView scheduleInRunLoop:forMode:] has no affect on timers
2280
2281         Reviewed by Darin Adler.
2282
2283         * WebCore.xcodeproj/project.pbxproj: Adds the new RunLoopTimer.{cpp,h} files.
2284         * loader/MainResourceLoader.cpp:
2285         (WebCore::MainResourceLoader::handleDataLoadNow): Use the MainResourceLoaderTimer typedef.
2286         (WebCore::MainResourceLoader::startDataLoadTimer): Added. Start the timer and on
2287         Mac platforms also schedule with the Page's SchedulePairs.
2288         (WebCore::MainResourceLoader::handleDataLoadSoon): Call startDataLoadTimer().
2289         (WebCore::MainResourceLoader::setDefersLoading): Ditto.
2290         * loader/MainResourceLoader.h:
2291         * platform/cf/RunLoopTimerCF.cpp: Added.
2292         (WebCore::RunLoopTimerBase::~RunLoopTimerBase):
2293         (WebCore::timerFired):
2294         (WebCore::RunLoopTimerBase::start):
2295         (WebCore::RunLoopTimerBase::schedule):
2296         (WebCore::RunLoopTimerBase::stop):
2297         (WebCore::RunLoopTimerBase::isActive):
2298         * platform/RunLoopTimer.h: Added.
2299         (WebCore::RunLoopTimerBase::RunLoopTimerBase):
2300         (WebCore::RunLoopTimerBase::startRepeating):
2301         (WebCore::RunLoopTimerBase::startOneShot):
2302         (WebCore::RunLoopTimer::RunLoopTimer):
2303         (WebCore::RunLoopTimer::fired):
2304
2305 2009-03-19  Dimitri Glazkov  <dglazkov@chromium.org>
2306
2307         Reviewed by Darin Fisher.
2308
2309         https://bugs.webkit.org/show_bug.cgi?id=24702
2310         Upstream miscellaneous bindings changes.
2311
2312         * bindings/v8/ScheduledAction.cpp:
2313         (WebCore::ScheduledAction::execute): Changed to call lower-case evaluate.
2314         * bindings/v8/ScriptCallStack.h: Added an extra include.
2315
2316 2009-03-19  Simon Fraser  <simon.fraser@apple.com>
2317
2318         Reviewed by Dave Hyatt
2319
2320         https://bugs.webkit.org/show_bug.cgi?id=24686
2321         
2322         When hit testing a RenderLayer whose parent lives in a preserves-3D hierarchy,
2323         we need to compare the computed z-offset with the depth-test z-offset before
2324         deciding that such a RenderLayer was hit. This fixes an issue, tested by the
2325         3d-point-mapping-overlapping.html test, where the child of a transformed element
2326         is found by hit testing, even when some other element with greater Z overlaps
2327         them both.
2328         
2329         Improved the code by adding a utility method, isHitCandidate(), which computes and tests
2330         z-depth when necessary.
2331
2332         Tests: transforms/3d/point-mapping/3d-point-mapping-coplanar.html
2333                transforms/3d/point-mapping/3d-point-mapping-overlapping.html
2334
2335         * rendering/RenderLayer.cpp:
2336         (WebCore::isHitCandidate):
2337         (WebCore::RenderLayer::hitTestLayer):
2338
2339 2009-03-19  Jeremy Moskovich  <jeremy@chromium.org>
2340
2341         Reviewed by Dimitri Glazkov.
2342
2343         https://bugs.webkit.org/show_bug.cgi?id=24456
2344         Split ColorChromium.cpp into Mac & Windows variants.
2345         Remove Chromium Dependency on platform/graphics/mac/ColorMac.mm since we
2346         ultimately need to take a different approach.  For now, createCGColor()
2347         is copied from ColorMac.mm.
2348
2349         No observable change in behavior, so no test.
2350
2351         * platform/graphics/chromium/ColorChromium.cpp:
2352         (WebCore::focusRingColor):
2353         * platform/graphics/chromium/ColorChromiumMac.mm: Added.
2354
2355 2009-03-19  Pavel Feldman  <pfeldman@chromium.org>
2356
2357         Reviewed by Dimitri Glazkov.
2358
2359         https://bugs.webkit.org/show_bug.cgi?id=24675
2360         Unforking frontend: add custom InspectorController methods
2361         implementation.
2362
2363         * bindings/v8/custom/V8InspectorControllerCustom.cpp: Added.
2364
2365 2009-03-19  Jay Campan  <jcampan@google.com>
2366
2367         Reviewed by Dimitri Glazkov.
2368
2369         https://bugs.webkit.org/show_bug.cgi?id=24625
2370         Adding an accessor to the currently selected index in the PopupMenuChromium.
2371         This is required for implementing the deletion of an autocomplete entry in Chromium.
2372
2373         * platform/chromium/PopupMenuChromium.cpp:
2374         (WebCore::PopupContainer::selectedIndex):
2375         * platform/chromium/PopupMenuChromium.h:
2376
2377 2009-03-19  Evan Stade  <estade@chromium.org>
2378
2379         Reviewed by Dimitri Glazkov.
2380
2381         https://bugs.webkit.org/show_bug.cgi?id=24526
2382         Improve windows skia text stroking.
2383
2384         Test: LayoutTests/svg/custom/struct-use-09-b.svg
2385
2386         * platform/graphics/skia/SkiaFontWin.cpp: Close the path representing
2387         each font glyph polygon, rather than only closing the path once per
2388         letter. This fixes stroking for letters with multiple polygons, such
2389         as 'A' or 'D'.
2390         (WebCore::getPathForGlyph):
2391         (WebCore::skiaDrawText):
2392
2393 2009-03-19  Simon Hausmann  <simon.hausmann@nokia.com>
2394
2395         Reviewed by Tor Arne Vestbø.
2396
2397         Fixed support for doing calls from JavaScript into NPAPI Plugins for the Qt port on Windows.
2398
2399         Removed dead code for distinguishing between Widget and PluginView in the Qt port.
2400
2401         * bindings/js/ScriptControllerQt.cpp:
2402         (WebCore::ScriptController::createScriptInstanceForWidget): Removed incorrect isNPAPI check.
2403         * plugins/PluginView.cpp:
2404         (WebCore::PluginView::PluginView): Removed m_isNPAPIPlugin variable.
2405         * plugins/PluginView.h: Removed setter/getter.
2406         * plugins/mac/PluginViewMac.cpp:
2407         (WebCore::PluginView::init): Removed call to setIsNPAPIPlugin.
2408         * plugins/qt/PluginViewQt.cpp:
2409         (WebCore::PluginView::init): Ditto.
2410
2411 2009-03-19  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2412
2413         Reviewed by Oliver Hunt.
2414
2415         Bug 24596: ASSERT in JSC::PropertySlot::slotBase @ iGoogle homepage
2416         <https://bugs.webkit.org/show_bug.cgi?id=24596>
2417         <rdar://problem/6686493>
2418
2419         JSDOMWindow::customGetOwnPropertySlot() does an access check after calling
2420         JSGlobalObject::getOwnPropertySlot(). This causes the PropertySlot to be
2421         set twice, once to the value that is illegal to access, and then to undefined
2422         This causes an assertion failure in property access caching code.
2423
2424         The fix is to do the access check before calling JSGlobalObject::getOwnPropertySlot().
2425
2426         * bindings/js/JSDOMWindowCustom.h:
2427         (WebCore::JSDOMWindow::customGetOwnPropertySlot):
2428
2429 2009-03-18  Alexey Proskuryakov  <ap@webkit.org>
2430
2431         Reviewed by Sam Weinig.
2432
2433         https://bugs.webkit.org/show_bug.cgi?id=24676
2434         Simple cross-origin requests shouldn't dispatch upload progress events
2435
2436         Test: http/tests/xmlhttprequest/simple-cross-origin-progress-events.html
2437
2438         * loader/CrossOriginAccessControl.cpp: (WebCore::passesAccessControlCheck): Added a comment
2439         explaining the somewhat unexpected behavior of this function.
2440
2441         * xml/XMLHttpRequestUpload.cpp: (WebCore::XMLHttpRequestUpload::hasListeners):
2442         * xml/XMLHttpRequestUpload.h:
2443         Report whether there are any event listeners registered.
2444
2445         * xml/XMLHttpRequest.h: Added m_uploadEventsAllowed.
2446
2447         * xml/XMLHttpRequest.cpp:
2448         (WebCore::XMLHttpRequest::createRequest): Set m_uploadEventsAllowed flag.
2449         (WebCore::XMLHttpRequest::makeSameOriginRequest): Ditto.
2450         (WebCore::XMLHttpRequest::makeCrossOriginAccessRequest): Ditto.
2451         (WebCore::XMLHttpRequest::makeSimpleCrossOriginAccessRequest): Set request body - it can be
2452         non-empty for POST requests.
2453         (WebCore::XMLHttpRequest::makeCrossOriginAccessRequestWithPreflight): Set m_uploadEventsAllowed flag.
2454         (WebCore::XMLHttpRequest::handleAsynchronousPreflightResult): Ditto.
2455         (WebCore::XMLHttpRequest::abort): Only dispatch upload progress events if allowed.
2456         (WebCore::XMLHttpRequest::networkError): Ditto.
2457         (WebCore::XMLHttpRequest::abortError): Ditto.
2458         (WebCore::XMLHttpRequest::didSendData): Ditto.
2459
2460 2009-03-18  Marc-Antoine Ruel  <maruel@chromium.org>
2461
2462         Reviewed by Darin Fisher.
2463
2464         https://bugs.webkit.org/show_bug.cgi?id=24398
2465         Fix a crash when loading a svg file in Chromium's test_shell and
2466         then reloading the page.
2467
2468         * history/BackForwardListChromium.cpp:
2469         (WebCore::BackForwardList::BackForwardList):
2470         (WebCore::BackForwardList::close):
2471
2472 2009-03-18  Eric Carlson  <eric.carlson@apple.com>
2473
2474         Reviewed by Simon Fraser.
2475
2476         Fix for <rdar://problem/6685235>
2477         <video> element poster cannot be set dynamically if not originally set up in HTML
2478         
2479         Allocate the media engine immediately so the plug-in proxy is available for
2480         scripting right away.
2481
2482         * platform/graphics/MediaPlayer.cpp:
2483         (WebCore::MediaPlayer::MediaPlayer):
2484
2485 2009-03-18  Beth Dakin  <bdakin@apple.com>
2486
2487         Reviewed by Dave Hyatt.
2488
2489         Fix for <rdar://problem/6636747> REGRESSION (Safari 4 PB-r41326): 
2490         Popup menu appears at the wrong location on page at http://
2491         www.signonsandiego.com/
2492
2493         This was a regression from http://trac.webkit.org/changeset/40769, 
2494         which changed the base class of RenderInline to 
2495         RenderBoxModelObject rather than RenderBox.
2496
2497         * rendering/RenderObject.cpp:
2498         (WebCore::RenderObject::offsetParent): offsetParent should return a 
2499         RenderBoxModelObject rather than just a RenderBox, which is more 
2500         restrictive. 
2501
2502 2009-03-18  Anders Carlsson  <andersca@apple.com>
2503
2504         Reviewed by Darin Adler.
2505
2506         <rdar://problem/6504776> 
2507         CrashTracer: [USER] 188 crashes in Safari at com.apple.WebCore • WTF::HashTableIterator<WTF::RefPtr<WebCore::ResourceLoader>, ...
2508
2509         Return early in case calling the client ends up spinning the run loop and completing/cancelling the load.
2510         
2511         * loader/NetscapePlugInStreamLoader.cpp:
2512         (WebCore::NetscapePlugInStreamLoader::didCancel):
2513
2514 2009-03-18  David Levin  <levin@chromium.org>
2515
2516         Reviewed by Dimitri Glazkov.
2517
2518         https://bugs.webkit.org/show_bug.cgi?id=24664
2519         Upstreaming v8 collection.h
2520
2521         No change in behavior, so no test.
2522
2523         * bindings/v8/V8Collection.h: Added.
2524
2525 2009-03-18  Sam Weinig  <sam@webkit.org>
2526
2527         Reviewed by Simon Fraser.
2528
2529         Fix for https://bugs.webkit.org/show_bug.cgi?id=23966
2530         REGRESSION: Custom arrow navigation functionality doesn't work at dropular.net
2531         <rdar://problem/6589657>
2532
2533         Match the CSSOM spec for getClientRects and getBoundingClientRect by
2534         returning a 0x0 rect at the correct top/left position for empty inline
2535         boxes.
2536
2537         * rendering/RenderInline.cpp:
2538         (WebCore::RenderInline::absoluteRects):
2539         (WebCore::RenderInline::absoluteQuads):
2540
2541 2009-03-18  David Levin  <levin@chromium.org>
2542
2543         Reviewed by Eric Seidel.
2544
2545         Match the changes done for windows in the bug
2546         https://bugs.webkit.org/show_bug.cgi?id=24530.
2547
2548         No change in behavior, so no test.
2549
2550         * rendering/RenderThemeChromiumLinux.cpp:
2551         (WebCore::RenderThemeChromiumLinux::extraDefaultStyleSheet):
2552
2553 2009-03-18  Dirk Schulze  <krit@webkit.org>
2554
2555         Reviewed by Holger Freyther.
2556
2557         Added support for SVG's stroked texts to Qt.
2558
2559         [Qt] SVGs stroked text support missing
2560         https://bugs.webkit.org/show_bug.cgi?id=24262
2561
2562         * platform/graphics/qt/FontQt.cpp:
2563         (WebCore::Font::drawComplexText):
2564
2565 2009-03-18  Mark Rowe  <mrowe@apple.com>
2566
2567         Reviewed by Alexey Proskuryakov.
2568
2569         Fix fast/encoding/char-decoding.html with recent ICU.
2570
2571         * platform/text/TextCodecICU.cpp:
2572         (WebCore::TextCodecICU::decode): Look for gb18030 case-insensitively,
2573         as newer versions of ICU use GB18030 as the canonical name.
2574
2575 2009-03-17  David Levin  <levin@chromium.org>
2576
2577         Reviewed by Dimitri Glazkov.
2578
2579         https://bugs.webkit.org/show_bug.cgi?id=24662
2580         Chromium build fixes.
2581
2582         Bug https://bugs.webkit.org/show_bug.cgi?id=24663 tracks
2583         the invalid implementation of ScriptCallStack.
2584
2585         No change in behavior, so no test.
2586
2587         * bindings/v8/ScriptCallStack.h:
2588         (WebCore::ScriptCallStack::state):
2589         * platform/graphics/skia/PlatformContextSkia.cpp:
2590         (PlatformContextSkia::drawRect):
2591
2592 2009-03-17  David Carson  <dacarson@apple.com>
2593
2594         Reviewed by David Hyatt.
2595
2596         Add anchor elements to the simple style sheet so that applications that 
2597         are using WebKit just for simple text and links will also take advantage
2598         of the fast path.
2599
2600         * css/CSSStyleSelector.cpp:
2601         (WebCore::elementCanUseSimpleDefaultStyle):
2602
2603 2009-03-17  Darin Adler  <darin@apple.com>
2604
2605         Reviewed by Adele Peterson.
2606
2607         <rdar://problem/6687005> Need support for new move-left/right selectors.
2608
2609         * editing/EditorCommand.cpp:
2610         (WebCore::executeMoveToLeftEndOfLine): Added.
2611         (WebCore::executeMoveToLeftEndOfLineAndModifySelection): Added.
2612         (WebCore::executeMoveToRightEndOfLine): Added.
2613         (WebCore::executeMoveToRightEndOfLineAndModifySelection): Added.
2614         Added command entries for the functions above.
2615
2616 2009-03-17  Ojan Vafai  <ojan@chromium.org>
2617
2618         Reviewed by Adele Peterson.
2619
2620         Put the padding inside scrollbars on textareas.
2621         https://bugs.webkit.org/show_bug.cgi?id=24370
2622         
2623         Put the padding inside the scrollbars on textareas. This is done by moving the
2624         overflow from the shadowNode to the RenderTextControlMultiline. As a result,
2625         all of the scroll handing methods that RenderTextControl overrides can be moved
2626         down into RenderTextControlSingleLine since RenderTextControlMultiline can now
2627         just use RenderBlock's versions. This also allows RenderTextControlMultiLine to
2628         no longer need a custom layout method since the shadowNode can now just size
2629         like a regular DIV.
2630
2631         * css/CSSStyleSelector.cpp:
2632         (WebCore::CSSStyleSelector::adjustRenderStyle):
2633         * rendering/RenderTextControl.cpp:
2634         (WebCore::RenderTextControl::styleDidChange):
2635         (WebCore::RenderTextControl::selection):
2636         (WebCore::RenderTextControl::calcHeight):
2637         (WebCore::RenderTextControl::hitInnerTextElement):
2638         * rendering/RenderTextControl.h:
2639         * rendering/RenderTextControlMultiLine.cpp:
2640         (WebCore::RenderTextControlMultiLine::nodeAtPoint):
2641         (WebCore::RenderTextControlMultiLine::createInnerTextStyle):
2642         * rendering/RenderTextControlMultiLine.h:
2643         * rendering/RenderTextControlSingleLine.cpp:
2644         (WebCore::RenderTextControlSingleLine::styleDidChange):
2645         (WebCore::RenderTextControlSingleLine::autoscroll):
2646         (WebCore::RenderTextControlSingleLine::scrollWidth):
2647         (WebCore::RenderTextControlSingleLine::scrollHeight):
2648         (WebCore::RenderTextControlSingleLine::scrollLeft):
2649         (WebCore::RenderTextControlSingleLine::scrollTop):
2650         (WebCore::RenderTextControlSingleLine::setScrollLeft):
2651         (WebCore::RenderTextControlSingleLine::setScrollTop):
2652         (WebCore::RenderTextControlSingleLine::scroll):
2653         * rendering/RenderTextControlSingleLine.h:
2654         * rendering/TextControlInnerElements.cpp:
2655         (WebCore::RenderTextControlInnerBlock::RenderTextControlInnerBlock):
2656         (WebCore::RenderTextControlInnerBlock::positionForPoint):
2657         (WebCore::TextControlInnerTextElement::createRenderer):
2658
2659 2009-03-17  Darin Adler  <darin@apple.com>
2660
2661         Reviewed by David Hyatt.
2662
2663         Bug 24517: REGRESSION (r41552): innerHTML does an updateLayout -- unneeded and can be slow
2664         https://bugs.webkit.org/show_bug.cgi?id=24517
2665
2666         * editing/DeleteButtonController.cpp:
2667         (WebCore::DeleteButtonController::enable): Added a call to updateRendering, since
2668         determining whether to display the delete button involves style and updateRendering
2669         also updates style (should probably be named updateStyle, in fact). Not needed to fix
2670         this bug, but would have prevented the crash that led to this bug in the first place.
2671
2672         * editing/EditCommand.cpp:
2673         (WebCore::EditCommand::EditCommand): Get rid of unneeded null check. All frames have
2674         delete button controllers.
2675         * editing/Editor.cpp:
2676         (WebCore::Editor::rangeForPoint): Ditto.
2677
2678         * editing/markup.cpp:
2679         (WebCore::appendStartMarkup): Changed a "&" to a "&&" so that generating markup
2680         doesn't depend on renderers at all when the convertBlocksToInlines boolean is false.
2681         This allows us to omit the call to updateLayoutIgnorePendingStylesheets in the
2682         createMarkup function that's called by innerHTML.
2683         (WebCore::MarkupAccumulator::appendMarkup): Turned this into a class with a member
2684         function. Added a feature where the accumulator will skip a node. Moved arguments
2685         that don't change during recursion into an object. This function still is a bit
2686         inefficient, since it creates a new HashMap at every level as it recurses, but for now
2687         I did not tackle that. Also replaced the onlyIncludeChildren boolean with EChildrenOnly
2688         for consistency and clarity.
2689         (WebCore::createMarkup): Removed the call to updateLayoutIgnorePendingStylesheets.
2690         Instead of calling disable/enable on the delete button controller's container element,
2691         pass it in to the markup accumulator as a node to skip.
2692
2693 2009-03-17  Scott Violet  <sky@google.com>
2694
2695         Reviewed by Eric Seidel.
2696
2697         https://bugs.webkit.org/show_bug.cgi?id=24651
2698         Skia does not always render text fill/stroke pattern/gradient/color correctly
2699
2700         Changes Skia's font rendering to only render gradient/pattern if current
2701         color space indicates the gradient/pattern should be used.
2702         This is covered by LayoutTests/fast/canvas/canvas-text-alignment.html .
2703     
2704         * platform/graphics/GraphicsContext.cpp:
2705         (WebCore::GraphicsContext::strokeColorSpace):
2706         (WebCore::GraphicsContext::fillColorSpace):
2707         * platform/graphics/GraphicsContext.h:
2708         (WebCore::):
2709         * platform/graphics/GraphicsContextPrivate.h:
2710         * platform/graphics/skia/SkiaFontWin.cpp:
2711         (WebCore::paintSkiaText):
2712
2713 2009-03-17  Adele Peterson  <adele@apple.com>
2714
2715         Reviewed by Darin Adler.
2716
2717         Fix for https://bugs.webkit.org/show_bug.cgi?id=24655
2718         <rdar://problem/6633727> Hitting return at the end of a line with an anchor jumps me to the bottom of the message
2719
2720         Test: editing/inserting/6633727.html
2721
2722         This changes does a few things:
2723         1) Renames pos to insertionPosition.
2724         2) Eliminates "startNode".  It doesn't work well to consider the node separately from the insertionPosition.  
2725            The insertionPosition gets updated at various times, and it seems likely that startNode can get out of sync.
2726         3) Before building up a list of ancestors to move around when we insert the new block, make sure to use the deepest
2727            representation of the insertionPosition, so all ancestor nodes are correctly included.
2728
2729         * editing/InsertParagraphSeparatorCommand.cpp: (WebCore::InsertParagraphSeparatorCommand::doApply):
2730
2731 2009-03-17  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2732
2733         Reviewed by Kevin Ollivier.
2734
2735         https://bugs.webkit.org/show_bug.cgi?id=24115
2736         Introduce platform independent stubs for plugins.
2737
2738         * plugins/PluginDataNone.cpp: Copied from WebCore/plugins/wx/PluginDataWx.cpp.
2739         * plugins/PluginPackageNone.cpp: Copied from WebCore/plugins/wx/PluginPackageWx.cpp.
2740         * plugins/PluginViewNone.cpp: Copied from WebCore/plugins/wx/PluginViewWx.cpp.
2741         * plugins/wx/PluginDataWx.cpp: Removed.
2742         * plugins/wx/PluginPackageWx.cpp: Removed.
2743         * plugins/wx/PluginViewWx.cpp: Removed.
2744         * webcore-wx.bkl:
2745
2746 2009-03-17  Darin Adler  <darin@apple.com>
2747
2748         Earlier version reviewed by Adele Peterson.
2749
2750         Bug 24304: REGRESSION (r39864): Hitting the space bar to select an <input type=radio>
2751         or push an <input type=button> or <button> causes the page to scroll down.
2752
2753         Would be best to add a regression test for Windows eventually; tested that this has
2754         no effect on the Mac OS X platform.
2755
2756         * html/HTMLInputElement.cpp:
2757         (WebCore::HTMLInputElement::defaultEventHandler): Added FIXMEs and tweaked formatting.
2758         Use the code that calls the base class's defaultEventHandler early only in the cases
2759         where it's needed: keydown and keypress events in text fields. In other cases, do the
2760         more typical thing and call the default handler only at the end of the function.
2761         This function already had code to make sure the keypress event for space never gets
2762         through, but it was running too late since the scrolling code was moved into the
2763         base class default event handler.
2764
2765 2009-03-17  Simon Fraser  <simon.fraser@apple.com>
2766
2767         Reviewed by Dave Hyatt
2768
2769         https://bugs.webkit.org/show_bug.cgi?id=24632
2770
2771         Fix repaint issues when composited layers come and go (only applies
2772         when ACCELERATED_COMPOSITING is turned on).
2773         
2774         * rendering/RenderLayer.cpp:
2775         (WebCore::RenderLayer::RenderLayer):
2776         * rendering/RenderLayer.h:
2777         (WebCore::RenderLayer::mustOverlayCompositedLayers):
2778         (WebCore::RenderLayer::setMustOverlayCompositedLayers):
2779         * rendering/RenderLayerBacking.cpp:
2780         (WebCore::RenderLayerBacking::RenderLayerBacking):
2781         * rendering/RenderLayerBacking.h:
2782
2783         Move what used to be the 'forceCompositingLayer' flag from RenderLayerBacking
2784         to RenderLayer, because we don't want the side-effects of creating RenderLayerBacking
2785         when setting this flag.
2786         
2787         * rendering/RenderLayerCompositor.cpp:
2788         (WebCore::RenderLayerCompositor::updateLayerCompositingState):
2789         When a RenderLayer flips into or out of compositing mode, compute a repaint
2790         rect relative to the containerForRepaint, and repaint it.
2791         
2792         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2793         Call layer->setMustOverlayCompositedLayers() rather than setForcedCompositingLayer().
2794         
2795         (WebCore::RenderLayerCompositor::needsToBeComposited):
2796         (WebCore::RenderLayerCompositor::requiresCompositingLayer):
2797         (WebCore::RenderLayerCompositor::requiresCompositingForTransform):
2798         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
2799         * rendering/RenderLayerCompositor.h:
2800         
2801         Rename requiresCompositingLayerForTransform() to requiresCompositingForTransform()
2802         and make it a class static method to match requiresCompositingForAnimation(). Both
2803         now take RenderObjects, rathern than RenderLayers.
2804         
2805         * rendering/style/RenderStyle.h:
2806         (WebCore::InheritedFlags::hasTransformRelatedProperty):
2807         Minor tidyup using convenience methods added in an earlier commit.
2808
2809 2009-03-17  Simon Fraser  <simon.fraser@apple.com>
2810
2811         Reviewed by Darin Adler
2812
2813         https://bugs.webkit.org/show_bug.cgi?id=24396
2814
2815         * config.h:
2816         Add WTF_USE_ACCELERATED_COMPOSITING, defined to 0 for now, and add some
2817         comments to make the #ifdefs more readable.
2818
2819         * css/CSSComputedStyleDeclaration.cpp:
2820         (WebCore::computedTransform):
2821         Add a comment to mention that we don't flatten the matrix.
2822         
2823         * css/MediaQueryEvaluator.cpp:
2824         (WebCore::transform_3dMediaFeatureEval):
2825         Have the 'transform-3d' media query evaluate to 'true' if 3d-rendering
2826         is supported.
2827         
2828         * platform/graphics/mac/GraphicsLayerCA.mm:
2829         (WebCore::GraphicsLayerCA::animateTransform):
2830         No need for the #ifdef here. If we don't support 3d, we will have already flattened
2831         the matrix.
2832         
2833         * platform/graphics/transforms/TransformationMatrix.cpp:
2834         (WebCore::TransformationMatrix::makeAffine):
2835         * platform/graphics/transforms/TransformationMatrix.h:
2836         New method to convert the matrix to an affine matrix by throwing a way the non-affine
2837         parts.
2838         
2839         * rendering/RenderLayer.cpp:
2840         (WebCore::RenderLayer::updateTransform):
2841         (WebCore::RenderLayer::currentTransform):
2842         * rendering/RenderLayerBacking.cpp:
2843         (WebCore::RenderLayerBacking::updateLayerTransform):
2844         If 3d rendering is not supported, convert the matrix to an affine matrix
2845         which can be rendered, and used for hit testing.
2846         
2847         * rendering/RenderLayerCompositor.cpp:
2848         Change the name of the exported symbol that webkitdirs.pm uses to know if
2849         3d rendering is supported. There is no other 3d-rendering-specific symbol we can sniff.
2850         
2851         * rendering/RenderObject.cpp:
2852         (WebCore::RenderObject::transformFromContainer):
2853         Only take perspective into account if 3d rendering is supported.
2854
2855         * rendering/RenderObject.h:
2856         (WebCore::makeMatrixRenderable):
2857         Utility method that flattens a matrix if 3d rendering is not supported.
2858
2859 2009-03-17  Kevin Ollivier  <kevino@theolliviers.com>
2860
2861         wx build fix. Fix typo after mouse wheel changes.
2862
2863         * platform/wx/MouseWheelEventWx.cpp:
2864         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
2865
2866 2009-03-17  Darin Adler  <darin@apple.com>
2867
2868         * inspector/ConsoleMessage.cpp:
2869         (WebCore::ConsoleMessage::isEqual): Fix build, remove stray parenthesis.
2870
2871 2009-03-17  Darin Adler  <darin@apple.com>
2872
2873         Fix crash seen right away when running run-webkit-tests.
2874
2875         * inspector/ConsoleMessage.cpp:
2876         (WebCore::ConsoleMessage::isEqual): Restore assertion to its behavior pre-refactoring.
2877         Also tweaked formatting a bit.
2878
2879 2009-03-17  Alexey Proskuryakov  <ap@webkit.org>
2880
2881         Reviewed by Darin Adler.
2882
2883         HTMLSelectElement::add() doesn't look at exception code returned from insertBefore(), so 
2884         it doesn't need to zero it out before calling.
2885
2886         * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): Removed "ec = 0" line.
2887
2888 2009-03-17  Dan Bernstein  <mitz@apple.com>
2889
2890         Reviewed by Adam Roben.
2891
2892         - WebCore part of adding a mechanism for controlling the caching of
2893           responses through WebFrameLoaderClient
2894
2895         Mac already has such a mechanism, and this adds one for CFNetwork ports.
2896
2897         * WebCore.vcproj/WebCore.vcproj: Added EmptyClients.h
2898         and ResourceLoaderCFNet.cpp.
2899
2900         * loader/EmptyClients.h:
2901         (WebCore::EmptyFrameLoaderClient::shouldCacheResponse): Added an
2902         implementation that always returns true.
2903
2904         * loader/FrameLoaderClient.h: Declared shouldCacheResponse().
2905
2906         * loader/ResourceLoader.h: Ditto.
2907
2908         * loader/cf/ResourceLoaderCFNet.cpp: Added.
2909         (WebCore::ResourceLoader::shouldCacheResponse): Added. Calls through to
2910         FrameLoaderClient::shouldCacheResponse().
2911
2912         * platform/network/ResourceHandleClient.h:
2913         (WebCore::ResourceHandleClient::shouldCacheResponse): Added an
2914         implementation that always returns true.
2915
2916         * platform/network/cf/ResourceHandleCFNet.cpp:
2917         (WebCore::willCacheResponse): Added a call to
2918         ResourceHandleClient::shouldCacheResponse(). If the client returns
2919         false, return 0, which will prevent CFNetwork from caching the response.
2920
2921 2009-03-17  Alexey Proskuryakov  <ap@webkit.org>
2922
2923         Reviewed by Darin Adler.
2924
2925         https://bugs.webkit.org/show_bug.cgi?id=13287
2926         Cannot change SELECT to a dynamically created option
2927
2928         Tests: fast/forms/add-and-remove-option.html
2929                fast/forms/add-remove-option-modification-event.html
2930                fast/forms/add-selected-option.html
2931                fast/forms/select-cache-desynchronization.html
2932
2933         * dom/ContainerNode.cpp:
2934         (WebCore::dispatchChildInsertionEvents): Increment DOM tree version. This will happen when
2935         dispatching DOMSubtreeModified again, but the version should be incremented for event
2936         listeners to have an up to date view of the DOM.
2937         (WebCore::dispatchChildRemovalEvents): Ditto.
2938
2939         * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::insertedIntoTree):
2940         Make sure that the select element knows about its new selected option.
2941
2942         * html/HTMLOptionElement.h: Use insertedIntoTree() instead of insertedIntoDocument(),
2943         because DOM also needs to be updated for forms that are not in document yet. Similar
2944         problems exist for node removing, but removedFromTree() is called at a wrong time, so
2945         those problems cannot be fixed without deeper refactoring.
2946
2947         * html/HTMLSelectElement.cpp:
2948         (WebCore::HTMLSelectElement::setRecalcListItems): Reset m_activeSelectionAnchorIndex - it
2949         doesn't make sense to keep the anchor after programmatically changing the selection, and
2950         keeping it was causing a failure in fast/forms/listbox-selection.html.
2951
2952         * html/HTMLSelectElement.h: Removed overrides for ContainerNode methods that only called
2953         base class versions.
2954
2955 2009-03-17  Steve Falkenburg  <sfalken@apple.com>
2956
2957         <rdar://problem/6690324> Accessing FTP sites reads unallocated memory, can result in garbled entries or crashes
2958         
2959         Reviewed by Darin Adler.
2960
2961         * loader/FTPDirectoryDocument.cpp:
2962         (WebCore::FTPDirectoryTokenizer::parseAndAppendOneLine): Assign CString to a local while we hold pointers into it.
2963
2964 2009-03-16  David Hyatt  <hyatt@apple.com>
2965
2966         <rdar://problem/6648411> REGRESSION: Layout of page is wrong at http://www.popcap.com/
2967
2968         Make sure that the initial shouldPaint check that looks at enclosingLayers properly skips over
2969         layers that don't paint themselves.  This is done by adding a new enclosingSelfPaintingLayer method
2970         so that RenderObjects can walk up the enclosing layer chain and skip any layers that don't paint
2971         themselves.
2972
2973         Reviewed by Darin Adler.
2974
2975         Added fast/block/float/overlapping-floats-with-overflow-hidden.html
2976
2977         * WebCore.base.exp:
2978         * rendering/RenderBlock.cpp:
2979         (WebCore::RenderBlock::addOverhangingFloats):
2980         * rendering/RenderObject.cpp:
2981         (WebCore::RenderObject::enclosingSelfPaintingLayer):
2982         * rendering/RenderObject.h:
2983
2984 2009-03-17  Xan Lopez  <xlopez@igalia.com>
2985
2986         Reviewed by Holger Freyther.
2987
2988         https://bugs.webkit.org/show_bug.cgi?id=24592
2989         [GTK] Crash in FcPatternHash
2990
2991         Style fixes.
2992
2993         * platform/graphics/gtk/FontPlatformDataGtk.cpp:
2994         (WebCore::FontPlatformData::operator=):
2995         * platform/graphics/gtk/FontPlatformDataPango.cpp:
2996
2997 2009-03-17  Xan Lopez  <xlopez@igalia.com>
2998
2999         Reviewed by Holger Freyther.
3000
3001         https://bugs.webkit.org/show_bug.cgi?id=24592
3002         [GTK] Crash in FcPatternHash
3003
3004         Sanitize memory management in pango fonts.
3005
3006         Release memory allocated by FontPlatformDataPango in its own
3007         destructor instead of doing it from other classes, and add copy
3008         constructor and '=' operator to be able to track referenced
3009         objects properly.
3010
3011         * platform/graphics/gtk/FontPlatformDataPango.cpp:
3012         (WebCore::FontPlatformData::~FontPlatformData):
3013         (WebCore::FontPlatformData::operator=):
3014         (WebCore::FontPlatformData::FontPlatformData):
3015         * platform/graphics/gtk/SimpleFontDataPango.cpp:
3016
3017 2009-03-17  Darin Adler  <darin@apple.com>
3018
3019         Reviewed by Alexey Proskuryakov.
3020
3021         Bug 24624: Crash in imageLoadEventTimerFired after adoptNode used on <img>,
3022         seen with inspector, which uses adoptNode
3023         https://bugs.webkit.org/show_bug.cgi?id=24624
3024         rdar://problem/6422850
3025
3026         Test: fast/dom/HTMLImageElement/image-load-cross-document.html
3027
3028         * dom/Document.cpp:
3029         (WebCore::Document::Document): Removed m_imageLoadEventTimer.
3030         (WebCore::Document::detach): Removed m_imageLoadEventDispatchSoonList and
3031         m_imageLoadEventDispatchingList.
3032         (WebCore::Document::implicitClose): Called ImageLoader::dispatchPendingLoadEvents
3033         instead of dispatchImageLoadEventsNow.
3034
3035         * dom/Document.h: Removed ImageLoader, dispatchImageLoadEventSoon,
3036         dispatchImageLoadEventsNow, removeImage, m_imageLoadEventDispatchSoonList,
3037         m_imageLoadEventDispatchingList, m_imageLoadEventTimer, and imageLoadEventTimerFired.
3038
3039         * loader/ImageLoader.cpp:
3040         (WebCore::loadEventSender): Added. Returns the single global ImageLoadEventSender
3041         object used privately as the target of the load event timer.
3042         (WebCore::ImageLoader::~ImageLoader): Call ImageLoadEventSender::cancelLoadEvent
3043         rather than Document::removeImage.
3044         (WebCore::ImageLoader::setImage): Use m_element directly, not element().
3045         (WebCore::ImageLoader::updateFromElement): Ditto. Also name the local variable
3046         document instead of doc.
3047         (WebCore::ImageLoader::notifyFinished): Call ImageLoadEventSender::dispatchLoadEventSoon
3048         rather than Document::dispatchImageLoadEventSoon.
3049         (WebCore::ImageLoader::dispatchPendingLoadEvent): Added. Handles the common logic
3050         about when load events can be dispatched so that dispatchLoadEvent only has to
3051         have the specific part for each derived class. This includes a check that the
3052         document is attached, which used to be handled by having documents empty out the
3053         image load event vectors in the detach function.
3054         (WebCore::ImageLoader::dispatchPendingLoadEvents): Added. Calls the appropriate
3055         function on the ImageLoadEventSender, which avoids the need to have that class be
3056         public in the ImageLoader header.
3057         (WebCore::ImageLoadEventSender::ImageLoadEventSender): Added. Has the code that
3058         was previously in the Document constructor.
3059         (WebCore::ImageLoadEventSender::dispatchLoadEventSoon): Added. Has the code that
3060         was previously in Document::dispatchImageLoadEventSoon.
3061         (WebCore::ImageLoadEventSender::cancelLoadEvent): Added. Has the code that was
3062         previously in Document::removeImage.
3063         (WebCore::ImageLoadEventSender::dispatchPendingLoadEvents): Added. Has the code
3064         that was previously in Document::dispatchImageLoadEventsNow.
3065         (WebCore::ImageLoadEventSender::timerFired): Added. Calls dispatchPendingLoadEvents.
3066
3067         * loader/ImageLoader.h: Improved comments. Made the virtual functions private
3068         or protected rather than public. Added static dispatchPendingLoadEvents function
3069         for use by Document and private dispatchPendingLoadEvent function for use by
3070         ImageLoadEventSender. Made setLoadingImage private and eliminated
3071         setHaveFiredLoadEvent since that can all be done inside the class without any
3072         member functions.
3073
3074         * html/HTMLImageLoader.cpp:
3075         (WebCore::HTMLImageLoader::dispatchLoadEvent): Removed logic to check whether a
3076         load event already fired and whether image() is 0. These are now both base class
3077         responsibilities.
3078         * svg/SVGImageLoader.cpp:
3079         (WebCore::SVGImageLoader::dispatchLoadEvent): Ditto.
3080         * wml/WMLImageLoader.cpp:
3081         (WebCore::WMLImageLoader::dispatchLoadEvent): Ditto.
3082
3083 2009-03-17  Dimitri Glazkov  <dglazkov@chromium.org>
3084
3085         Reviewed by Timothy Hatcher.
3086
3087         https://bugs.webkit.org/show_bug.cgi?id=24623
3088         Refactor ConsoleMessage to use ScriptFuncitonCall and eliminate JSC
3089         dependencies.
3090
3091         * bindings/js/ScriptFunctionCall.cpp:
3092         (WebCore::ScriptFunctionCall::appendArgument): Added uint and ScriptString-taking methods.
3093         * bindings/js/ScriptFunctionCall.h:
3094         * bindings/js/ScriptObjectQuarantine.cpp:
3095         (WebCore::quarantineValue): Added generic ScriptValue quarantine helper.
3096         * bindings/js/ScriptObjectQuarantine.h:
3097         * bindings/js/ScriptValue.cpp:
3098         (WebCore::ScriptValue::isEqual): Added.
3099         * bindings/js/ScriptValue.h:
3100         * inspector/ConsoleMessage.cpp:
3101         (WebCore::ConsoleMessage::ConsoleMessage):
3102         (WebCore::ConsoleMessage::addToConsole): Added.
3103         (WebCore::ConsoleMessage::isEqual): Changed to use ScriptValue::isEqual.
3104         * inspector/ConsoleMessage.h:
3105         (WebCore::ConsoleMessage::incrementCount): Added.
3106         * inspector/InspectorController.cpp:
3107         (WebCore::InspectorController::addConsoleMessage): Changed to use ConsoleMessage::addToConsole.
3108         (WebCore::InspectorController::populateScriptObjects): Ditto.
3109         * inspector/InspectorController.h:
3110
3111 2009-03-17  Kevin Ollivier  <kevino@theolliviers.com>
3112
3113         Reviewed by Mark Rowe.
3114
3115         Get BUILDING_ON_* defines from Platform.h.
3116         
3117         https://bugs.webkit.org/show_bug.cgi?id=24630
3118
3119         * WebCorePrefix.h:
3120
3121 2009-03-16  Xan Lopez  <xlopez@igalia.com>
3122
3123         Reviewed by Holger Freyther.
3124
3125         https://bugs.webkit.org/show_bug.cgi?id=24592
3126         [GTK] Crash in FcPatternHash
3127
3128         Sanitize memory management in gtk fonts.
3129
3130         Release memory allocated by FontPlatformDataGtk in its own
3131         destructor instead of doing it from other classes, and add copy
3132         constructor and '=' operator to be able to track referenced
3133         objects properly.
3134
3135         * platform/graphics/gtk/FontPlatformData.h:
3136         * platform/graphics/gtk/FontPlatformDataGtk.cpp:
3137         (WebCore::FontPlatformData::operator=):
3138         (WebCore::FontPlatformData::FontPlatformData):
3139         (WebCore::FontPlatformData::~FontPlatformData):
3140         * platform/graphics/gtk/SimpleFontDataGtk.cpp:
3141         (WebCore::SimpleFontData::platformDestroy):
3142
3143 2009-03-17  Ariya Hidayat  <ariya.hidayat@nokia.com>
3144
3145         Build fix for Qt < 4.5.
3146
3147         As reported by Yael Aharon  <yael.aharon@nokia.com>
3148
3149         * platform/graphics/qt/GraphicsContextQt.cpp:
3150         (WebCore::GraphicsContext::drawLine):
3151
3152 2009-03-17  Alexey Proskuryakov  <ap@webkit.org>
3153
3154         Reviewed by Sam Weinig.
3155
3156         https://bugs.webkit.org/show_bug.cgi?id=24614
3157         Access control checks are different in cached and uncached cases
3158
3159         Test: http/tests/xmlhttprequest/access-control-basic-non-simple-deny-cached.html
3160
3161         * loader/CrossOriginAccessControl.cpp:
3162         (WebCore::isOnAccessControlSimpleRequestMethodWhitelist): Factored out simple method
3163         check for use in both cached and uncached cases. In cached case, an old definition that
3164         omitted HEAD was still used.
3165         (WebCore::isOnAccessControlSimpleRequestHeaderWhitelist): Check that content type has an
3166         allowed value. This is needed in all call sites. Also changed to compare MIME type, not
3167         content type.
3168         (WebCore::isSimpleCrossOriginAccessRequest): Use the above methods.
3169
3170         * loader/CrossOriginAccessControl.h: Expose isOnAccessControlSimpleRequestMethodWhitelist.
3171
3172         * loader/CrossOriginPreflightResultCache.cpp:
3173         (WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginMethod):
3174         (WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginHeaders):
3175         Use the new checks for simple method and header.
3176
3177 2009-03-16  Gustavo Noronha Silva  <gns@gnome.org> and Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
3178
3179         Reviewed by Mark Rowe.
3180
3181         https://bugs.webkit.org/show_bug.cgi?id=24638
3182         [GTK] HTML5 media tags do not work
3183
3184         Add a repaint-requested signal to the video sink, and use it to
3185         call MediaPlayerPrivate::repaint, so that the video actually
3186         plays.
3187
3188         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
3189         (WebCore::mediaPlayerPrivateRepaintCallback):
3190         (WebCore::MediaPlayerPrivate::createGSTPlayBin):
3191         * platform/graphics/gtk/VideoSinkGStreamer.cpp:
3192         (webkit_video_sink_idle_func):
3193         (webkit_video_sink_render):
3194         (webkit_video_sink_class_init):
3195
3196 2009-03-16  Gustavo Noronha Silva  <gns@gnome.org> and Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
3197
3198         Reviewed by Holger Freyther.
3199
3200         https://bugs.webkit.org/show_bug.cgi?id=24638
3201         [GTK] HTML5 media tags do not work
3202
3203         Work-around the fact that gst_element_query_duration returns true even
3204         though it is unable to figure out the duration when in stream (push)
3205         mode.
3206
3207         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
3208         (WebCore::MediaPlayerPrivate::duration):
3209
3210 2009-03-16  Darin Adler  <darin@apple.com>
3211
3212         Reviewed by Kevin Decker.
3213
3214         <rdar://problem/6642742> Top Sites malfunction when switching text zoom mode
3215
3216         * page/Frame.cpp:
3217         (WebCore::Frame::setNeedsReapplyStyles): Don’t do anything if the frame is
3218         currently showing a non-HTML view.
3219
3220 2009-03-16  Darin Adler  <darin@apple.com>
3221
3222         Reviewed by Adele Peterson.
3223
3224         Bug 24629: moving forward or backward a paragraph fails at edge of document
3225         https://bugs.webkit.org/show_bug.cgi?id=24629
3226         rdar://problem/6544413
3227
3228         Test: editing/selection/move-paragraph-document-edges.html
3229
3230         * editing/visible_units.cpp:
3231         (WebCore::previousParagraphPosition): Use the last result from
3232         previousLinePosition rather than going all the way back to what was originally
3233         passed in when we hit exception cases like null or not moving. This correctly
3234         inherits the behavior of previousLinePosition when we are in a paragraph at the
3235         edge of a document.
3236         (WebCore::nextParagraphPosition): Ditto.
3237
3238 2009-03-16  Darin Adler  <darin@apple.com>
3239
3240         Reviewed by Adele Peterson.
3241
3242         Bug 24619: RenderObject::selectionStartEnd does not need to be a virtual function
3243         https://bugs.webkit.org/show_bug.cgi?id=24619
3244
3245         * rendering/RenderObject.h: Remove virtual keyword from selectionStartEnd declaration.
3246         * rendering/RenderView.h: Ditto.
3247
3248 2009-03-16  Peter Kasting  <pkasting@google.com>
3249
3250         Reviewed by David Hyatt.
3251
3252         https://bugs.webkit.org/show_bug.cgi?id=24368
3253         DOM scroll events should be based off the actual number of wheel
3254         ticks, not off the number of lines scrolled.  This matches IE.
3255
3256         * dom/Node.cpp:
3257         (WebCore::Node::dispatchWheelEvent):
3258         * dom/WheelEvent.cpp:
3259         (WebCore::WheelEvent::WheelEvent):
3260         * dom/WheelEvent.h:
3261         (WebCore::WheelEvent::create):
3262         * platform/PlatformWheelEvent.h:
3263         (WebCore::PlatformWheelEvent::wheelTicksX):
3264         (WebCore::PlatformWheelEvent::wheelTicksY):
3265         * platform/gtk/WheelEventGtk.cpp:
3266         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
3267         * platform/mac/WheelEventMac.mm:
3268         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
3269         * platform/qt/WheelEventQt.cpp:
3270         * platform/win/WheelEventWin.cpp:
3271         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
3272         * platform/wx/MouseWheelEventWx.cpp:
3273         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
3274
3275 2009-03-16  Simon Fraser  <simon.fraser@apple.com>
3276
3277         Reviewed by Eric Seidel
3278         
3279         Clean up a few issues in the Animation code:
3280
3281         * page/animation/AnimationBase.cpp:
3282         (WebCore::AnimationBase::updateStateMachine):
3283         Whitespace
3284         
3285         (WebCore::AnimationBase::willNeedService):
3286         Don't round to float, use std::max
3287
3288         * page/animation/AnimationController.cpp:
3289         (WebCore::AnimationControllerPrivate::startTimeResponse):
3290         Fix erroneously copied line to null out m_lastResponseWaiter.
3291
3292 2009-03-12  David Hyatt  <hyatt@apple.com>
3293
3294         Reviewed by Eric Seidel
3295
3296         https://bugs.webkit.org/show_bug.cgi?id=13632
3297
3298         Overflow scrolling needs to account for the bottom/right padding on the object itself as well
3299         as for bottom/right margins on children.
3300
3301         Existing tests cover this.
3302
3303         * rendering/RenderBlock.cpp:
3304         (WebCore::RenderBlock::lowestPosition):
3305         (WebCore::RenderBlock::rightmostPosition):
3306
3307 2009-03-16  Sam Weinig  <sam@webkit.org>
3308
3309         Reviewed by Anders Carlsson.
3310
3311         Fix for <rdar://problem/6320555>
3312         Add an upper limit for setting HTMLSelectElement.length.
3313
3314         Test: fast/forms/select-max-length.html
3315
3316         * html/HTMLSelectElement.cpp:
3317         (WebCore::HTMLSelectElement::setOption):
3318         (WebCore::HTMLSelectElement::setLength):
3319
3320 2009-03-16  Eric Carlson  <eric.carlson@apple.com>
3321
3322         Reviewed by Simon Fraser.
3323
3324         <rdar://problem/6686721> Media document crash in 64-bit WebKit
3325
3326         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3327         (WebCore::MediaPlayerPrivate::createQTMovieView): QTMovieContentViewClass is only used when
3328         rendering inline with old versions of QuickTime, so don't look for it when we are in a 
3329         media document.
3330
3331 2009-03-16  Dimitri Glazkov  <dglazkov@chromium.org>
3332
3333         Reviewed by Timothy Hatcher.
3334
3335         https://bugs.webkit.org/show_bug.cgi?id=24590
3336         Refactor InspectorDOMStorageResource to use ScriptFunctionCall.
3337
3338         * bindings/js/ScriptFunctionCall.cpp:
3339         (WebCore::ScriptFunctionCall::appendArgument): Added method for bool argument.
3340         * bindings/js/ScriptFunctionCall.h: Ditto, also cleaned up.
3341         * bindings/js/ScriptObjectQuarantine.cpp:
3342         (WebCore::getQuarantinedScriptObject): Added Storage helper.
3343         * bindings/js/ScriptObjectQuarantine.h: Ditto.
3344         * inspector/InspectorController.cpp:
3345         (WebCore::InspectorController::populateScriptObjects): Changed to use bind method.
3346         (WebCore::InspectorController::resetScriptObjects): Changed to use unbind method.
3347         (WebCore::InspectorController::didUseDOMStorage): Changed to use isSameHostAndType and bind methods.
3348         * inspector/InspectorController.h: Removed add/remove methods for DOM storage.
3349         * inspector/InspectorDOMStorageResource.cpp:
3350         (WebCore::InspectorDOMStorageResource::InspectorDOMStorageResource):
3351         (WebCore::InspectorDOMStorageResource::isSameHostAndType): Added.
3352         (WebCore::InspectorDOMStorageResource::bind): Added.
3353         (WebCore::InspectorDOMStorageResource::unbind): Added.
3354         * inspector/InspectorDOMStorageResource.h:
3355
3356 2009-03-16   Mike Belshe  <mike@belse.com>
3357
3358         Reviewed by Dimitri Glazkov.
3359
3360         https://bugs.webkit.org/show_bug.cgi?id=24580
3361         Fix query() to match KURL behavior, this time with the code that
3362         compiles.
3363
3364         * platform/KURLGoogle.cpp:
3365         (WebCore::KURL::query): Fix copy/paste mistake.
3366
3367 2009-03-16  Alexey Proskuryakov  <ap@webkit.org>
3368
3369         Reviewed by Darin Adler.
3370
3371         https://bugs.webkit.org/show_bug.cgi?id=21752
3372         REGRESSION: referencing XHR constructor for a not yet loaded frame permanently breaks it
3373
3374         Test: fast/dom/Window/window-early-properties-xhr.html
3375
3376         For some transitions, the Window object is not replaced, but Document is. When this happened,
3377         window.document property was updated, but references to Document kept in cached constructors
3378         were not.
3379
3380         * bindings/js/JSAudioConstructor.cpp:
3381         (WebCore::JSAudioConstructor::JSAudioConstructor):
3382         (WebCore::JSAudioConstructor::document):
3383         (WebCore::JSAudioConstructor::mark):
3384         * bindings/js/JSAudioConstructor.h:
3385         * bindings/js/JSImageConstructor.cpp:
3386         (WebCore::JSImageConstructor::JSImageConstructor):
3387         (WebCore::JSImageConstructor::document):
3388         (WebCore::JSImageConstructor::mark):
3389         * bindings/js/JSImageConstructor.h:
3390         * bindings/js/JSMessageChannelConstructor.cpp:
3391         (WebCore::JSMessageChannelConstructor::JSMessageChannelConstructor):
3392         (WebCore::JSMessageChannelConstructor::scriptExecutionContext):
3393         (WebCore::JSMessageChannelConstructor::mark):
3394         * bindings/js/JSMessageChannelConstructor.h:
3395         * bindings/js/JSOptionConstructor.cpp:
3396         (WebCore::JSOptionConstructor::JSOptionConstructor):
3397         (WebCore::JSOptionConstructor::document):
3398         (WebCore::JSOptionConstructor::mark):
3399         * bindings/js/JSOptionConstructor.h:
3400         * bindings/js/JSXMLHttpRequestConstructor.cpp:
3401         (WebCore::JSXMLHttpRequestConstructor::JSXMLHttpRequestConstructor):
3402         (WebCore::JSXMLHttpRequestConstructor::scriptExecutionContext):
3403         (WebCore::JSXMLHttpRequestConstructor::mark):
3404         * bindings/js/JSXMLHttpRequestConstructor.h:
3405         Changed cached constructors to keep a reference to Window, not Document.
3406
3407 2009-03-15  Alexey Proskuryakov  <ap@webkit.org>
3408
3409         Reviewed by Darin Adler.
3410
3411         https://bugs.webkit.org/show_bug.cgi?id=24549
3412         Impose a limit on Access-Control-Max-Age value
3413
3414         * loader/CrossOriginPreflightResultCache.cpp:
3415         (WebCore::CrossOriginPreflightResultCacheItem::parse):
3416
3417 2009-03-15  Greg Bolsinga  <bolsinga@apple.com>
3418
3419         Reviewed by David Kilzer.
3420
3421         <rdar://problem/6668875> Normalize Geolocation results
3422
3423         * platform/mac/GeolocationServiceMac.mm:
3424         (-[WebCoreCoreLocationObserver locationManager:didUpdateToLocation:fromLocation:]):
3425
3426 2009-03-15  Greg Bolsinga  <bolsinga@apple.com>
3427
3428         Reviewed by David Kilzer.
3429
3430         Update ::toString format as suggested by Darin Adler.
3431
3432         * page/Geoposition.cpp:
3433         (WebCore::Geoposition::toString):
3434
3435 2009-03-15  David Kilzer  <ddkilzer@apple.com>
3436
3437         <rdar://problem/6668238> WebCore is registering text encodings needlessly from KURL constructor.
3438
3439         Reviewed by Darin Adler.
3440
3441         Yet another case where we would trigger extended encoding loading needlessly.
3442
3443         * platform/text/TextEncoding.cpp:
3444         (WebCore::TextEncoding::encodingForFormSubmission):
3445
3446 2009-03-15  Simon Fraser  <simon.fraser@apple.com>
3447
3448         Build fix: no review.
3449
3450         * rendering/style/ContentData.h:
3451
3452 2009-03-15  David Kilzer  <ddkilzer@apple.com>
3453
3454         Bug 24542: Improve ContentData encapsulation
3455
3456         <https://bugs.webkit.org/show_bug.cgi?id=24542>
3457
3458         Reviewed by Simon Fraser.
3459
3460         No tests since there is no change in behavior.
3461
3462         * rendering/RenderObject.cpp:
3463         (WebCore::RenderObject::createObject): Used getter methods
3464         instead of data members on ContentData class.  Used isImage()
3465         convenience method.
3466         * rendering/RenderObjectChildList.cpp:
3467         (WebCore::RenderObjectChildList::updateBeforeAfterContent): Ditto.
3468
3469         * rendering/style/ContentData.cpp:
3470         (WebCore::ContentData::clear): Extracted code into
3471         deleteContent() method.
3472         (WebCore::ContentData::dataEquivalent): Added.  Extracted code
3473         from StyleRareNonInheritedData::contentDataEquivalent().
3474         (WebCore::ContentData::deleteContent): Added.  Used by setter
3475         methods.
3476         * rendering/style/ContentData.h: Made m_type, m_content and
3477         m_next private.
3478         (WebCore::ContentData::isCounter): Added.
3479         (WebCore::ContentData::isImage): Added.
3480         (WebCore::ContentData::isNone): Added.
3481         (WebCore::ContentData::isText): Added.
3482         (WebCore::ContentData::type): Added.
3483         (WebCore::ContentData::dataEquivalent): Added.
3484         (WebCore::ContentData::image): Added.
3485         (WebCore::ContentData::setImage): Added.
3486         (WebCore::ContentData::text): Added.
3487         (WebCore::ContentData::setText): Added.
3488         (WebCore::ContentData::counter): Added.
3489         (WebCore::ContentData::setCounter): Added.
3490         (WebCore::ContentData::next): Added.
3491         (WebCore::ContentData::setNext): Added.
3492
3493         * rendering/style/CounterContent.h:
3494         (WebCore::operator!=): Removed.
3495         (WebCore::operator==): Renamed operator!=() and reversed its
3496         logic after extracting code from
3497         StyleRareNonInheritedData::contentDataEquivalent() to create
3498         ContentData::dataEquivalent().
3499
3500         * rendering/style/RenderStyle.cpp:
3501         (WebCore::RenderStyle::setContent): Used new getters and setters
3502         on ContentData class.  Changed first argument from a StringImpl*
3503         to a PassRefPtr<StrimgImpl>.  Used isText() convenience method.
3504         * rendering/style/RenderStyle.h:
3505         (WebCore::RenderStyle::setContent): Updated declaration.
3506         * rendering/style/StyleRareNonInheritedData.cpp:
3507         (WebCore::StyleRareNonInheritedData::contentDataEquivalent):
3508         Extracted most logic in while() loop into
3509         ContentData::dataEquivalent().
3510
3511 2009-03-15  Gustavo Noronha Silva  <gns@gnome.org>
3512
3513         Reviewed by Anders Carlsson.
3514
3515         https://bugs.webkit.org/show_bug.cgi?id=24602
3516         [Gtk] Searching in thepiratebay.org doesn't work with more than 1 word
3517
3518         Reintroduce the URI into the soup message after having set it in
3519         the KURL, on redirects, to make sure it is properly encoded. This
3520         fixes bad request problems when servers give bad URIs on their
3521         response's Location header.
3522