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