Rubber stamped by Mitz
[WebKit-https.git] / WebCore / ChangeLog
1 2007-05-12  Brady Eidson  <beidson@apple.com>
2
3         Rubber stamped by Mitz
4
5         * html/HTMLInputElement.cpp:
6         (WebCore::HTMLInputElement::attach): unregister->register - I screwed this one up in last minute renaming
7           before committing  :(
8
9 2007-05-11  Brady Eidson  <beidson@apple.com>
10
11         Reviewed by Darin and Geoff
12
13         Fix for http://bugs.webkit.org/show_bug.cgi?id=13630
14         and
15         <rdar://problem/4873628>
16
17         Back/Forward cache should work with pages with login fields.
18
19         First change is to relocate the "useSecureKeyboardEntry" flag to the document.  This lets
20         it persist through page cache transitions and it is truly a per-document concept more than
21         per-frame anyways since its the document that has a password field, not the frame.
22
23         Second change is to introduce the concept of an Element getting a "didRestoreFromCache()" callback.
24         The idea is for elements to register with the document if they need work to be done when the
25         page comes out of the back/forward cache.  Currently the only client of this service is 
26         HTMLInputElements that are input type == PASSWORD.  Such an element's implementation for this
27         method is to call reset()
28
29         Finally, after a page is restored from the cache we have the document send the didRestoreFromCache()
30         callback to its registered Elements.  The whole design is to clear the password fields after 
31         restoring the page instead of when caching the page because we want to defer work for the common
32         case - there shouldn't be extra work here just to navigate away from a page when the common case
33         is that you'll never go back!
34
35         No layout tests possible until http://bugs.webkit.org/show_bug.cgi?id=13672 is resolved
36
37         * dom/Document.cpp:
38         (WebCore::Document::Document):
39         (WebCore::Document::registerForDidRestoreFromCacheCallback): Add an Element to the special page-restoration callback list
40         (WebCore::Document::unregisterForDidRestoreFromCacheCallback): Remove such an element
41         (WebCore::Document::didRestoreFromCache): Called by FrameLoader - dispatch to all the registered elements
42         (WebCore::Document::setUseSecureKeyboardEntryWhenActive): Set the local flag and call updateSecureKeyboardEntryIfActive
43           on the Frame
44         (WebCore::Document::useSecureKeyboardEntryWhenActive): Return the flag
45
46         * dom/Document.h:
47         (WebCore::Document::unregisterFormElementWithState): Renamed
48
49         * dom/Element.h:
50         (WebCore::Element::didRestoreFromCache): Added virtual base method
51
52         * html/HTMLInputElement.cpp:
53         (WebCore::HTMLInputElement::~HTMLInputElement): Deregister from the document if inputType == PASSWORD
54         (WebCore::HTMLInputElement::dispatchFocusEvent): Set the flag on the document, not the frame
55         (WebCore::HTMLInputElement::dispatchBlurEvent): Ditto
56         (WebCore::HTMLInputElement::setInputType): If changing to/from PASSWORD, register/deregister in the document accordingly
57         (WebCore::HTMLInputElement::attach): Call registerForDidRestoreFromCacheCallback(this) instead of passwordFieldAdded()
58         (WebCore::HTMLInputElement::didRestoreFromCache): Call reset();
59         * html/HTMLInputElement.h:
60
61         * html/HTMLSelectElement.cpp:
62         (WebCore::HTMLSelectElement::~HTMLSelectElement): Renamed deregisterFormElementWithState to unregisterFormElementWithState
63         * html/HTMLTextAreaElement.cpp:
64         (WebCore::HTMLTextAreaElement::~HTMLTextAreaElement): Ditto
65
66         * loader/FrameLoader.cpp:
67         (WebCore::FrameLoader::canCachePage): Remove the check for password fields - they're allowed now!
68         (WebCore::FrameLoader::opened): Tell the document to dispatch to the registered elements
69         (WebCore::FrameLoader::saveDocumentState): Remove the check for password fields.  Turns out that when we grab a copy a the
70           form state we're only copying the state of form elements that are registered with the Document - and that set 
71           explicitly excludes Password elements
72
73         * page/Frame.cpp:
74         (WebCore::Frame::setDocument): If the frame is active, set the setUseSecureKeyboardEntry based on the setting contained
75           in the new document
76         (WebCore::Frame::updateSecureKeyboardEntryIfActive): Notification for the secure entry flag changing - if the Frame is
77           active, then update to the new setting from the document
78         (WebCore::Frame::setIsActive): Grab the useSecureKeyboardEntry flag from the document instead of FramePrivate
79         (WebCore::FramePrivate::FramePrivate):
80         * page/Frame.h:
81         * page/FramePrivate.h:
82
83 2007-05-12  David Hyatt  <hyatt@apple.com>
84
85         Fix for bug 12740, bmw.com doesn't work.  We were missing a rule that is covered by the HTML5
86         parsing spec.  A <table> encountered while inside stray table content should close up the
87         table responsible for the stray content and start the new table as a sibling of the first.
88
89         Reviewed by mjs
90
91         fast/invalid/table-inside-stray-table-content.html
92
93 2007-05-12  Eric Seidel  <eric@webkit.org>
94
95         Reviewed by mjs.
96
97         Crash starting Safari with JavaScript disabled.
98         http://bugs.webkit.org/show_bug.cgi?id=13691
99         
100         Test: none possible.
101
102         * page/mac/FrameMac.mm:
103         (WebCore::Frame::cleanupPlatformScriptObjects): NULL check d->m_script
104
105 2007-05-11  David Hyatt  <hyatt@apple.com>
106
107         Fix for http://bugs.webkit.org/show_bug.cgi?id=13688, Colloquy is broken!
108
109         Make sure to adjust the baseline of a percentage height table cell's row if the
110         cell flexes (and lowers the baseline).
111
112         Reviewed by olliej
113
114         fast/tables/vertical-align-baseline-readjust.html
115
116         (WebCore::RenderTableSection::calcRowHeight):
117         (WebCore::RenderTableSection::layoutRows):
118         * rendering/RenderTableSection.h:
119         (WebCore::RenderTableSection::getBaseline):
120         
121 2007-05-11  David Hyatt  <hyatt@apple.com>
122
123         Make sure focus rings are always using the exterior style, regardless
124         of what the OS default is.
125
126         Reviewed by beth
127
128         * rendering/RenderThemeMac.mm:
129         (WebCore::RenderThemeMac::checkbox):
130         (WebCore::RenderThemeMac::radio):
131         (WebCore::RenderThemeMac::popupButton):
132         (WebCore::RenderThemeMac::search):
133         (WebCore::RenderThemeMac::sliderThumbHorizontal):
134         (WebCore::RenderThemeMac::sliderThumbVertical):
135
136 2007-05-11  Oliver Hunt  <oliver@apple.com>
137
138         Reviewed by Hyatt.
139         
140         <rdar://problem/5195473> REGRESSION: "Curly quote" fails to 
141         be displayed correctly even when META tag specifies charset=x-mac-roman
142
143
144         * platform/TextCodecICU.cpp:
145         (WebCore::TextCodecICU::registerExtendedEncodingNames):
146         Register the xmacroman encoding
147
148 2007-05-11  Maciej Stachowiak  <mjs@apple.com>
149
150         Reviewed by Hyatt.
151
152         REGRESSION (r21367): Crash due to null document deref when closing bookmarks
153         http://bugs.webkit.org/show_bug.cgi?id=13662
154
155         * loader/FrameLoader.cpp:
156         (WebCore::FrameLoader::provisionalLoadStarted): Remove some useless and now harmful
157         code - there's no need to clear in this case.
158
159 2007-05-11  Oliver Hunt  <oliver@apple.com>
160
161         GDK Build fix
162
163         * ChangeLog:
164         * dom/Document.cpp:
165         (WebCore::Document::importNode):
166
167 2007-05-11  Maciej Stachowiak  <mjs@apple.com>
168
169         Reviewed by Geoff.
170         
171         - fixed <rdar://problem/5197621> closing second window crashed webkit (13660)
172         http://bugs.webkit.org/show_bug.cgi?id=13660
173
174         No test case; not testable.
175
176         * page/mac/FrameMac.mm:
177         (WebCore::Frame::cleanupPlatformScriptObjects): Check if the interpreter is null;
178         if so, we don't want to do work that may lazily create it while the Frame is being
179         destroyed.
180
181 2007-05-11  Oliver Hunt  <oliver@apple.com>
182
183         Reviewed by Brady.
184         
185         <rdar://problem/5017375> WebKit should disable SVG in Dashboard
186         
187         Prevents an SVG document or element from being created when in
188         dashboard compatibility mode.
189         
190         Manually parsing, or using XHR to created a document removes our 
191         ability to detect Dashboard compatibility mode, so we also perform
192         the check when importing nodes from one document into another.
193
194         * dom/DOMImplementation.cpp:
195         (WebCore::DOMImplementation::createDocument):
196           Don't create an SVGDocument if we're in dashboard compatibility mode
197           
198         * dom/Document.cpp:
199         (WebCore::Document::importNode):
200           Don't import SVG nodes if we're in dashboard compatibility mode
201           
202         * ksvg2/scripts/make_names.pl:
203           Don't create SVG elements for documents that are in dashboard
204           compatibility mode
205
206 2007-05-11  Holger Hans Peter Freyther  <zecke@selfish.org>
207
208         Reviewed by Maciej.
209
210         Bug 13676: [cairo/gdk] Provide implementation for ImageBufferCairo
211         http://bugs.webkit.org/show_bug.cgi?id=13676
212
213         There are no test cases that explicitly cover platform/graphics at present.
214
215         * platform/graphics/ImageBuffer.h: Add cairo bits
216         * platform/graphics/cairo/ImageBufferCairo.cpp: Untested implementation of the ImagerBuffer using the image_surface
217         (WebCore::ImageBuffer::create): Create a reasonable sized surface
218         (WebCore::ImageBuffer::ImageBuffer): Use a cairo_surface and create a GraphicsContext. GraphicsContext takes the cairo_t ownership
219         (WebCore::ImageBuffer::~ImageBuffer): Unref the surface
220         (WebCore::ImageBuffer::context): simply return the GraphicsContext, it should be possible to directly draw on it.
221
222 2007-05-11  Mitz Pettel  <mitz@webkit.org>
223
224         Release build fix.
225
226         * platform/mac/ShapeArabic.c:
227         (shapeArabic):
228
229 2007-05-11  Geoffrey Garen  <ggaren@apple.com>
230
231         Reviewed by Darin Adler.
232
233         Removed +[WebScriptObject scriptObjectForJSObject:frame:] because the
234         WebScriptObject API has some serious limitations that make it not ready
235         to be used everywhere the C API is used. Hopefully we can add a good
236         ObjC API in the future that doesn't suffer from this problem.
237         
238         Preliminary notes about these limitations are in <rdar://problem/4876466>.
239
240         * bindings/objc/WebScriptObject.mm:
241         * bindings/objc/WebScriptObjectPendingPublic.h:
242
243 2007-05-11  Mitz Pettel  <mitz@webkit.org>
244
245         Reviewed by Darin.
246
247         - fix http://bugs.webkit.org/show_bug.cgi?id=13635
248           REGRESSION: Cannot log in to webmail.co.za account
249
250         Test: fast/dom/HTMLOptionElement/option-text.html
251
252         Despite the specification that the 'text' attribute of HTMLOptionElement
253         is "the text contained within the option element", other browsers return
254         the text as displayed in the list box or popup, which is without leading,
255         trailing and collapsible whitespace.
256
257         * html/HTMLOptionElement.cpp:
258         (WebCore::HTMLOptionElement::text): Moved the code to trim and collapse
259         whitespace and replace backslashes with the currency symbol into this
260         function.
261         (WebCore::HTMLOptionElement::optionText): Left only the code that adds
262         the leading spaces for grouped options. Removed code that, in quirks mode,
263         displayed the label if the option element contained no text. That behavior
264         did not match WinIE and the description of the expected behavior in
265         fast/forms/HTMLOptionElement_label06.html.
266
267 2007-05-11  Mitz Pettel  <mitz@webkit.org>
268
269         Reviewed by Darin.
270
271         - fix http://bugs.webkit.org/show_bug.cgi?id=13572
272           Arabic characters are not correctly joined when using Arial
273
274         No tests added because standard fonts do not use the character-based shaping
275         code path.
276
277         Added shapeArabic(), a private version of u_shapeArabic() from ICU,
278         patched to shape Arabic characters used in Persian, Urdu, Sindhi, etc.
279         (whose contextual forms belong to the Arabic Presentation Forms-A block).
280
281         * WebCore.xcodeproj/project.pbxproj: Added ShapeArabic.{c,h}.
282         * platform/mac/FontMac.mm:
283         (WebCore::shapeArabic): Changed to call shapeArabic() instead of u_shapeArabic().
284         * platform/mac/ShapeArabic.c: Added. Based on ushape.c from ICU, with
285         additional shaping data and logic for Arabic Presentation Forms-A. Removed
286         many options that are not used in WebKit and code that malloc()ed a temporary
287         buffer and reversed the string.
288         (changeLamAlef):
289         (specialChar):
290         (getLink):
291         (isTashkeelChar):
292         (shapeUnicode):
293         (shapeArabic):
294         * platform/mac/ShapeArabic.h: Added.
295
296 2007-05-11  Darin Adler  <darin@apple.com>
297
298         Reviewed by Mitz.
299
300         - fix http://bugs.webkit.org/show_bug.cgi?id=7452
301           <rdar://problem/3211749> line breaks ignored after <wbr> in <pre> block (affects livejournal.com)
302
303         - fix http://bugs.webkit.org/show_bug.cgi?id=10657
304           <rdar://problem/4274588> <wbr> tags are ignored
305
306         - fix http://bugs.webkit.org/show_bug.cgi?id=12689
307           <wbr> :before/:after content causes line break
308
309         - fix <rdar://problem/5127366> DOM tree isn't correct when parsing with <wbr>
310
311         Test: fast/text/wbr-pre.html
312         Test: fast/text/wbr.html
313         Test: fast/css-generated-content/wbr-with-before-content.html
314         Test: fast/parser/parse-wbr.html
315
316         * html/HTMLElement.h:
317         * html/HTMLElement.cpp:
318         (WebCore::HTMLElement::endTagRequirement): Use the same end tag requirement for a <wbr>
319         element as for a <br> element, TagStatusForbidden.
320         (WebCore::HTMLElement::tagPriority): Use the same priority for a <wbr> element as for a
321         <br> element, 0.
322         (WebCore::HTMLElement::createRenderer): Added. Create a RenderWordBreak to trigger the
323         new rendering code paths.
324
325         * rendering/RenderFlow.h: Add a virtual isWordBreak so we can detect RenderWordBreak.
326
327         * rendering/RenderWordBreak.h: Added.
328         * rendering/RenderWordBreak.cpp: Added.
329
330         * WebCore.pro: Added new files.
331         * WebCore.xcodeproj/project.pbxproj: Added new files.
332         * WebCoreSources.bkl: Added new files.
333
334         * rendering/RenderBlock.cpp: (WebCore::RenderBlock::calcInlinePrefWidths): Reset the
335         line when we hit a <wbr>.
336         * rendering/bidi.cpp: (WebCore::RenderBlock::findNextLineBreak): Add a line break when
337         we hit a <wbr>.
338
339         * dom/Node.cpp: (Node::createRendererIfNeeded): Fix a null check for the case where
340         createRenderer returns 0 even though rendererIsNeeded returned true. I can't reproduce
341         it on demand, but while running layout tests I hit this once. Since there was already
342         a null check here, I rearranged it so it guards all the code that uses the renderer.
343         Later we might want to figure out under exactly what circumstances rendererIsNeeded
344         will return true but createRenderer return 0 and consider eliminating them.
345
346 2007-05-11  David Hyatt  <hyatt@apple.com>
347
348         Fix for bug 13675, focus rings don't repaint properly on editable
349         continuations.
350
351         Reviewed by olliej
352
353         (WebCore::InlineFlowBox::paint):
354         * rendering/RenderBlock.cpp:
355         (WebCore::RenderBlock::paintObject):
356         (WebCore::continuationOutlineTable):
357         (WebCore::RenderBlock::addContinuationWithOutline):
358         (WebCore::RenderBlock::paintContinuationOutlines):
359         * rendering/RenderBlock.h:
360         * rendering/RenderBox.cpp:
361         (WebCore::RenderBox::absoluteClippedOverflowRect):
362         * rendering/RenderObject.cpp:
363         (WebCore::RenderObject::repaintAfterLayoutIfNeeded):
364         (WebCore::RenderObject::absoluteOutlineBox):
365
366 2007-05-11  Rob Buis  <buis@kde.org>
367
368         Reviewed by Oliver.
369
370         Cleanups mostly inspired by Coverage results.
371
372         * ksvg2/css/SVGCSSParser.cpp:
373         (WebCore::CSSParser::parseSVGValue):
374         (WebCore::CSSParser::parseSVGStrokeDasharray):
375         * ksvg2/css/SVGRenderStyleDefs.cpp:
376         (StyleFillData::operator==):
377         * ksvg2/svg/SVGColor.cpp:
378         (WebCore::SVGColor::colorFromRGBColorString):
379
380 2007-05-11  Holger Freyther <freyther@kde.org>
381
382         Reviewed by Mark Rowe.
383
384         Move libcurl configuration into WebKit.pri so it will be used by GdkLauncher.
385
386         * WebCore.pro:
387
388 2007-05-10  David Hyatt  <hyatt@apple.com>
389
390         <rdar://problem/5015522> Bounds rectangle of unloaded images is 
391         drawn briefly while loading
392         
393         When the image is null and has no size, don't draw the grey
394         rectangles or alt text any more.  Wait for an actual error to
395         occur with the image before we start showing alt text and borders.
396
397         (Images with no source set at all will continue to show alt text and
398         borders immediately.)
399
400         Reviewed by bradee-oh
401
402         * rendering/RenderImage.cpp:
403         (WebCore::RenderImage::paint):
404
405 2007-05-10  Mitz Pettel  <mitz@webkit.org>
406
407         Reviewed by Darin.
408
409         - fix http://bugs.webkit.org/show_bug.cgi?id=13655
410           Incomplete repaint when text-shadow is used in a render layer with explicit height
411
412         Test: fast/repaint/layer-full-repaint.html
413
414         Removed custom repaint logic from RenderLayer. repaintAfterLayoutIfNeeded()
415         knows how to do everything we need now. The only catch is that we cannot
416         rely on its "do a full repaint if the object needs layout" behavior, since
417         by the time we call it, the needs layout flag has been reset. The solution
418         is to cache the need for a full repaint in the layer.
419
420         * page/FrameView.cpp:
421         (WebCore::FrameView::layout): Removed call to checkForRepaintOnResize().
422         * rendering/RenderLayer.cpp:
423         (WebCore::RenderLayer::checkForRepaintOnResize): Removed.
424         (WebCore::RenderLayer::RenderLayer): Replaced the m_repaintOverflowOnResize
425         flag with a m_needsFullRepaint flag, which indicates that the layer needs
426         to do a full repaint in the next call to updateLayerPositions().
427         (WebCore::RenderLayer::updateLayerPositions): Simplified the repaint logic.
428         Either call repaintAfterLayoutIfNeeded() or do a full repaint, depending on
429         m_needsFullRepaint.
430         * rendering/RenderLayer.h:
431         (WebCore::RenderLayer::setNeedsFullRepaint):
432         * rendering/RenderObject.cpp:
433         (WebCore::RenderObject::setNeedsLayout): Mark the layer for full repaint.
434
435 2007-05-10  Justin Garcia  <justin.garcia@apple.com>
436
437         Reviewed by ggaren
438
439         <rdar://problem/5195166> Incorrect proposedRange DOMRange passed to WebViewEditing delegate
440         
441         In setModifyBias, we must cache the start and the end 
442         because the calls to setBase and setExtent can modify 
443         them (added a testcase).
444         The temporary SelectionController that we use in modify() to
445         produce the proposed range that will be passed to 
446         shouldChangeSelectedDOMRange must have the same m_modifyBias
447         as the original SelectionController, or else when the 
448         modification is performed, setModifyBias can swap the base 
449         and the extent incorrectly (added a testcase).
450         Renamed m_modifyBias to m_lastChangeWasHorizontalExtension.
451         Renamed setModifyBias to willBeModified.
452
453         * editing/SelectionController.cpp:
454         (WebCore::SelectionController::SelectionController):
455         (WebCore::SelectionController::setSelection):
456         (WebCore::SelectionController::willBeModified):
457         (WebCore::SelectionController::modify):
458         * editing/SelectionController.h:
459         (WebCore::SelectionController::setLastChangeWasHorizontalExtension):
460         * page/EventHandler.cpp:
461         (WebCore::EventHandler::handleMousePressEventSingleClick):
462         (WebCore::EventHandler::updateSelectionForMouseDragOverPosition):
463
464 2007-05-10  Geoffrey Garen  <ggaren@apple.com>
465
466         Reviewed by Darin Adler.
467
468         "IconDatabase::sharedIconDatabase()" => "iconDatabase()" for terseness,
469         in the style of WebCore::cache().
470
471         * WebCore.exp:
472         * history/HistoryItem.cpp: Removed retainIconInDatabase because calling
473         "retain" in order to release something is really confusing and, now that
474         iconDatabase() is more terse, we don't need this helper to shorten the
475         syntax. (The isEmpty() check is also done by the database, so we don't 
476         need it either.)
477
478         (WebCore::IconDatabase::~IconDatabase): ASSERT that our destructor isn't
479         called. We're a singleton, so it's confusing to have tear-down code.
480
481 2007-05-10  Adele Peterson  <adele@apple.com>
482
483         Reviewed by Hyatt.
484
485         WebCore part of fix for <rdar://problem/4100616> Doing a "find" in RSS doesn't scroll to result
486
487         Test: fast/overflow/scroll-nested-positioned-layer-in-overflow.html
488
489         Merged visibleSelectionRect into selectionRect.  selectionRect() now takes an argument to determine
490         whether or not to return a rect that clips to the visible content.  This change makes all of the implementations of selectionRect
491         consistent by having them all consider the repaint rect when clipping to visible content.
492
493         * page/Frame.cpp:
494         (WebCore::Frame::revealSelection): Call selectionRect with clipToVisibleContent = false, so we can get a rect that's not visible to reveal.
495         (WebCore::Frame::selectionRect): Added clipToVisibleContent argument, and merged visibleSelectionRect into this method.
496         (WebCore::Frame::setIsActive): Use selectionRect instead of visibleSelectionRect.
497         * page/Frame.h:
498         * page/mac/FrameMac.mm: (WebCore::Frame::selectionImage): Update layout before creating the image.  Use selectionRect instead of visibleSelectionRect.
499         * page/DragController.cpp: (WebCore::dragLocForSelectionDrag): Use selectionRect instead of visibleSelectionRect.
500
501         * rendering/RenderBR.h: (WebCore::RenderBR::selectionRect): Updated argument.
502         * rendering/RenderBlock.h: (WebCore::RenderBlock::selectionRect): ditto.
503         * rendering/RenderSVGInlineText.cpp: (WebCore::RenderSVGInlineText::selectionRect): ditto.
504         * rendering/RenderSVGInlineText.h: ditto.
505         * rendering/RenderObject.h: 
506         (WebCore::RenderObject::selectionRect): ditto.
507         (WebCore::RenderObject::SelectionInfo::SelectionInfo): ditto.
508         * rendering/RenderView.cpp:
509         (WebCore::RenderView::selectionRect): ditto.
510         (WebCore::RenderView::setSelection): ditto.
511         * rendering/RenderView.h:
512
513         * rendering/RenderText.h:
514         * rendering/RenderText.cpp: (WebCore::RenderText::selectionRect): Only call computeAbsoluteRepaintRect when clipping to visible content.
515         Otherwise, just adjust the rect to the correct position.
516         * rendering/RenderListMarker.h:
517         * rendering/RenderListMarker.cpp: (WebCore::RenderListMarker::selectionRect):
518           To match what we do in RenderText, if we're trying to clip to visible content, just call computeAbsoluteRepaintRect.
519         * rendering/RenderReplaced.h:
520         * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::selectionRect): ditto.
521
522         * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollRectToVisible): Check for a parent layer at the beginning, so we can try to scroll all of our parent layers 
523           first, before trying to scroll the top level view.  Also, don't try to scroll overflow layers that have -webkit-line-clamp restricting the height.
524           This will prevent us from revealing text hidden by the slider in Safari RSS.
525
526         * WebCore.exp: Update symbols for WebKit.
527
528 2007-05-10  David Hyatt  <hyatt@apple.com>
529
530         Fix for:
531
532         <rdar://problem/5195272> REGRESSION: broke outline rings for continuations 
533         with empty inline containers
534         
535         http://bugs.webkit.org/show_bug.cgi?id=13667
536
537         Make sure to only include collapsed top/bottom margins of the block portion
538         of the continuation if we know for sure that we have inline line boxes before
539         and after that would prevent the collapse from going further.
540
541         In plain English: the focus rings were too tall. :)
542
543         Reviewed by beth
544
545         * rendering/RenderFlow.cpp:
546         (WebCore::RenderFlow::addFocusRingRects):
547
548 2007-05-10  David Hyatt  <hyatt@apple.com>
549
550         Fix for:
551
552         <rdar://problem/5067235> REGRESSION: Excessively wide table, impossible to resize
553
554         The table used white-space: pre-wrap, which is supported only by WebKit.  There
555         was a bug with the computation of min pref width for pre-wrap text.
556
557         Reviewed by mitzpettel
558
559         fast/text/white-space/pre-wrap-line-test.html
560
561         * rendering/RenderText.cpp:
562         (WebCore::RenderText::calcPrefWidths):
563
564 2007-05-10  Brady Eidson  <beidson@apple.com>
565
566         Reviewed by Oliver
567
568         Cleanup from my earlier Java Applet patch.  We should keep a central location to query if 
569         a mime type counts as a Java Applet
570
571         * html/HTMLObjectElement.cpp:
572         (WebCore::HTMLObjectElement::containsJavaApplet): Query MimeTypeRegistry on the type
573
574         * platform/MimeTypeRegistry.cpp:
575         (WebCore::MimeTypeRegistry::isSupportedImageMIMEType): Update style
576         (WebCore::MimeTypeRegistry::isSupportedImageResourceMIMEType): Ditto
577         (WebCore::MimeTypeRegistry::isSupportedNonImageMIMEType): Ditto
578         (WebCore::MimeTypeRegistry::isJavaAppletMIMEType): Perform the Java Applet check
579         * platform/MimeTypeRegistry.h:
580
581         * rendering/RenderPartObject.cpp:
582         (WebCore::RenderPartObject::updateWidget): Query MimeTypeRegistry on the type
583
584 2007-05-10  Patti Hoa  <patti@apple.com>
585
586         Reviewed by Darin.
587         
588         <rdar://problem/4720109> Sentence textMarker methods do not work well with empty lines
589         
590         * bridge/mac/WebCoreAXObject.mm:
591         (-[WebCoreAXObject doAXNextSentenceEndTextMarkerForTextMarker:]):
592         (-[WebCoreAXObject doAXPreviousSentenceStartTextMarkerForTextMarker:]):
593         When a marker position is given, the sentence ax methods automatically shift position by one to make sure
594         not to ask for the current sentence again.  This is generally fine except when the position
595         shift over an empty line break, which is should be considered a separate sentence. In this case, 
596         if we used the shifted position to ask for sentence boundary, ICU parser is not given the text data
597         containing the newline to correctly determine the sentence boundary.  Since the ax sentence method is 
598         explicitly shifting the position to ask for sentence boundary, it should make sure not to skip over important
599         character that can be a standalone sentence.
600         * editing/visible_units.cpp:
601         (WebCore::nextBoundary):
602         When determining boundary, don't stop on a collapsed range, such as newline.  
603         Just pick the next valid position to use as boundary.
604
605 2007-05-10  Maciej Stachowiak  <mjs@apple.com>
606
607         Reviewed by Oliver.
608
609         - WebCore part of fix for:
610         <rdar://problem/5063277> blank screen after login to Citibank Online (accessing document before frame starts loading cancels load)
611         <rdar://problem/5159541> REGRESSION (r20972): Wall Street Journal pages replaced by advertisements (13465)
612
613         The basic approach is to have Frames start out containing an empty document instead of absolutely nothing,
614         so there is no need to initialize them on demand. Various side effects of that cause both of these bugs.
615         
616         However, this caused many regressions so I had to fix the fallout.
617         
618         * WebCore.exp: fix symbol exports
619         * bindings/js/kjs_window.cpp:
620         (KJS::createNewWindow): useless "created" bool (we don't need it here)
621         (KJS::WindowFunc::callAsFunction): detect if we created a new frame, because if so,
622         we need to initialize the domain (can't count on it not having a document), also
623         don't try to make a new document for it.
624         Also, stop properly.
625         * css/cssstyleselector.cpp:
626         (WebCore::CSSStyleSelector::CSSStyleSelector): don't count on document having a view here
627         * html/HTMLObjectElement.cpp:
628         (WebCore::HTMLObjectElement::isImageType): Ask client, to match how other <object> renderer
629         decisions are made.
630         * loader/FrameLoader.cpp:
631         (WebCore::FrameLoader::FrameLoader): Initialize new data members
632         (WebCore::FrameLoader::init): Do the slightly tricky sequence of steps to properly make
633         an empty document with everything hooked up.
634         (WebCore::FrameLoader::createWindow): Added "created" bool.
635         (WebCore::FrameLoader::stopLoading): (whitespace change)
636         (WebCore::FrameLoader::begin): Don't try to create an empty document.
637         (WebCore::FrameLoader::finishedParsing): If creating an initial empty document, don't
638         do any of this work.
639         (WebCore::FrameLoader::checkCompleted): Do checkLoadComplete() as well.
640         (WebCore::FrameLoader::baseURL): don't check for null document
641         (WebCore::FrameLoader::baseTarget): ditto
642         (WebCore::FrameLoader::completeURL): ditto
643         (WebCore::FrameLoader::didTellBridgeAboutLoad): ditto
644         (WebCore::FrameLoader::scheduleLocationChange): determine duringLoad differently; doc won't
645         be null.
646         (WebCore::FrameLoader::gotoAnchor): don't check for null document
647         (WebCore::FrameLoader::canTarget): don't check for null document
648         (WebCore::FrameLoader::stopForUserCancel): new method for explicit stops like window.stop().
649         (WebCore::FrameLoader::transitionToCommitted): check for pre-loaded state properly
650         (WebCore::FrameLoader::createEmptyDocument): removed
651         (WebCore::FrameLoader::checkLoadCompleteForThisFrame): don't send delegate callbacks when making initial
652         doc.
653         (WebCore::FrameLoader::tokenizerProcessedData): Assume document; just checkCompleted now that it
654         does checkLoadComplete.
655         (WebCore::FrameLoader::receivedMainResourceError): assume document
656         (WebCore::FrameLoader::saveDocumentState): Assume there's a document except during initial load
657         (WebCore::FrameLoader::mainReceivedCompleteError): do checkCompleted, not checkLoadComplete
658         (WebCore::FrameLoader::continueLoadWithData): assume document
659         * loader/FrameLoader.h:
660         * loader/MainResourceLoader.cpp:
661         (WebCore::MainResourceLoader::receivedError): Add more ref protection and do things in a slightly
662         different order.
663         * page/DOMWindow.cpp:
664         (WebCore::DOMWindow::document): don't force document creation, just assert there is one.
665         * page/Frame.cpp:
666         (WebCore::Frame::init): Added init method.
667         (WebCore::Frame::pageDestroyed): when a frame is removed, make sure to check if the parent is
668         done loading.
669         * page/Frame.h:
670         * page/mac/WebCoreFrameBridge.mm:
671         (-[WebCoreFrameBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]): No need to force
672         document.
673         (-[WebCoreFrameBridge aeDescByEvaluatingJavaScriptFromString:]): ditto
674         * platform/graphics/svg/SVGImage.cpp:
675         (WebCore::SVGImage::dataChanged): init the frame
676         * rendering/RenderPart.cpp:
677         (WebCore::RenderPart::updateWidgetPosition): If a subframe needs layout, then lay it out even
678         if the bounds did not change; the content size might be wrong.
679         * rendering/RenderTreeAsText.cpp:
680         (WebCore::externalRepresentation): Don't crash if the frame lacks a view.
681
682 2007-05-10  David Hyatt  <hyatt@apple.com>
683
684         Fix for:
685
686         <rdar://problem/5146757> REGRESSION: div that wrapped to screen width in 
687         tiger no longer wraps
688         
689         http://bugs.webkit.org/show_bug.cgi?id=13654
690
691         Reviewed by mitz
692
693         fast/text/whitespace/normal-after-nowrap-breaking.html
694
695         * rendering/RenderBlock.cpp:
696         (WebCore::RenderBlock::calcInlinePrefWidths):
697
698 2007-05-10  David Hyatt  <hyatt@apple.com>
699
700         Fix for:
701
702         <rdar://problem/4778099> Links with nested continuations fail to 
703         paint their outlines (11255)
704         
705         http://bugs.webkit.org/show_bug.cgi?id=11255
706
707         Fix multiple bugs with outline painting of continuations to ensure that
708         all combos work (empty/full inline - block with/without margins - 
709         empty/full inline).
710
711         Reviewed by mitz
712
713         fast/inline/continuation-outlines.html
714
715         * rendering/RenderBlock.cpp:
716         (WebCore::RenderBlock::paintObject):
717         * rendering/RenderFlow.cpp:
718         (WebCore::RenderFlow::addFocusRingRects):
719
720 2007-05-10  David Hyatt  <hyatt@apple.com>
721
722         Fix for:
723
724         <rdar://problem/5193529> REGRESSION: RTL Overflows scrollbar not showing 
725         when they should be
726         
727         Fallout from fix for bug 11926.  Make sure to restrict the fix to the
728         RenderView for now, since the full-blown overflow case is pretty involved.
729
730         Reviewed by mitzpettel
731
732         fast/overflow/unreachable-content-bug-rtl.html
733
734         * rendering/RenderBlock.cpp:
735         (WebCore::RenderBlock::lowestPosition):
736         (WebCore::RenderBlock::rightmostPosition):
737         (WebCore::RenderBlock::leftmostPosition):
738
739 2007-05-10  Brady Eidson <beidson@apple.com>
740
741         Reviewed by Oliver
742
743         Fix for http://bugs.webkit.org/show_bug.cgi?id=13636 and <rdar://problem/5190816>
744
745         When creating the applets collection, be sure to only count Objects if they contain
746         a java applet
747
748         * html/HTMLCollection.cpp:
749         (WebCore::HTMLCollection::traverseNextItem): Add the qualifier for Objects that 
750           containsJavaApplet() must be true
751
752         * html/HTMLObjectElement.cpp:
753         (WebCore::HTMLObjectElement::containsJavaApplet): Check this Object element and inner
754           nodes for any Java applets
755         * html/HTMLObjectElement.h: 
756
757 2007-05-10  David Hyatt  <hyatt@apple.com>
758
759         Fix for:
760
761         <rdar://problem/4694859> SAP: HTML tags with overflow:hidden consume
762         space on page, do not consume space in Firefox (11926)
763
764         http://bugs.webkit.org/show_bug.cgi?id=11926
765
766         Make sure that unreachable objects along one axis (e.g., top/left) do not
767         contribute to the scrollable area in the opposite axis (e.g., right/bottom).
768
769         Reviewed by olliej
770
771         fast/overflow/unreachable-content-test.html
772
773         * rendering/RenderBlock.cpp:
774         (WebCore::RenderBlock::lowestPosition):
775         (WebCore::RenderBlock::rightmostPosition):
776         (WebCore::RenderBlock::leftmostPosition):
777
778 2007-05-10  David Hyatt  <hyatt@apple.com>
779
780         Fix for:
781
782         <rdar://problem/4656825> REGRESSION: Japanese TV time table widget:
783         part of the number in background has been cut off.
784
785         Now that opacity uses a tight bounding box to clip, we need to make sure
786         to factor spillout caused by negative letter spacing into our right
787         overflow.  Latch on to the code that does this already for text-stroke
788         and text-shadow.
789
790         Reviewed by olliej
791
792         fast/text/letter-spacing-negative-opacity.html
793
794        * rendering/InlineFlowBox.cpp:
795         (WebCore::InlineFlowBox::placeBoxesHorizontally):
796
797 2007-05-10  Geoffrey Garen  <ggaren@apple.com>
798
799         Reviewed by Maciej Stachowiak.
800         
801         More fix-ups to the WebScriptObject/WebScripting APIs, related to
802         <rdar://problem/5140447> API for fetching JSGlobalContextRef from WebView 
803         or WebFrame
804
805         * bindings/objc/WebScriptObject.h: Fully specified the surprising rules for
806         type conversion between JavaScript and ObjC.
807         * bindings/objc/WebScriptObject.mm: Added up-call accessor to WebFrame.
808         This is kind of stinky, but I'm OK with it because eventually all of this
809         code should move up into WebKit.
810         (+[WebScriptObject scriptObjectForJSObject:frame:]):
811         (-[WebScriptObject valueForKey:]):
812         (-[WebScriptObject JSObject]): 
813             - Added _rootObject check because if _rootObject returns NULL it means 
814             that _imp is no longer GC protected, so it's not safe to use. 
815             - Added _isSafeScript check because that's what WebScriptObject methods
816             typically do, even though the value of doing so isn't clear to me.
817         * bindings/objc/WebScriptObjectPendingPublic.h: Added WebFrame* parameter
818         to -scriptObjectForJSObject:. This is required to wrap JS objects that
819         are not already in the wrapper cache. It would be nice to remove this
820         limitation of WebScriptObject some day.
821         * page/mac/FrameMac.mm:
822         (WebCore::Frame::cleanupPlatformScriptObjects): Force removal of m_windowScriptObject
823         from the cache, to avoid retrieving the m_windowScriptObject from the previous
824         page on a new page load. (It would be non-functional in that case.)
825
826 2007-05-10  David Hyatt  <hyatt@apple.com>
827
828         Fix for <rdar://problem/5183697>.
829
830         http://bugs.webkit.org/show_bug.cgi?id=13576
831
832         Make sure verticalPositionHint is not called on an inline-block from
833         content inside the inline-block (like text).
834
835         Reviewed by olliej
836
837         fast/inline-block/inline-block-vertical-align.html
838
839         * rendering/RenderObject.cpp:
840         (WebCore::RenderObject::verticalPositionHint):
841         * rendering/RenderText.cpp:
842         (WebCore::RenderText::verticalPositionHint):
843         * rendering/RenderThemeMac.mm:
844         (WebCore::RenderThemeMac::setFontFromControlSize):
845
846 2007-05-09  Holger Freyther <zecke@selfish.org>
847
848         Reviewed by Mark Rowe.
849
850         Gdk build fix with SVG enabled.  Stub out ImageBufferCairo.
851
852         * WebCore.pro: Build ImageBufferCairo.cpp
853         * platform/graphics/cairo/ImageBufferCairo.cpp: Added.
854         (WebCore::ImageBuffer::create):
855         (WebCore::ImageBuffer::~ImageBuffer):
856         (WebCore::ImageBuffer::context):
857
858 2007-05-08  Justin Garcia  <justin.garcia@apple.com>
859
860         Reviewed by darin
861         
862         <rdar://problem/5017613> Style changes don't effect fully selected ToDo content
863
864         * editing/ApplyStyleCommand.cpp:
865         (WebCore::ApplyStyleCommand::applyInlineStyle):
866         Use a for loop instead of while(1).
867         Simplify loop termination using Range::pastEndNode.
868         Don't handle the start.node() == end.node() case 
869         specially, it's unnecessary.
870         Apply the style change to fully selected plaintext-only
871         regions, not with wrapper spans inside the region, but 
872         by changing the element's inline style declaration.
873         Don't descend into nodes whose children we should ignore.
874
875 2007-05-09  Adele Peterson  <adele@apple.com>
876
877         Reviewed by Hyatt.
878
879         Fix for <rdar://problem/5113578> REGRESSION: textfields that set the height but not the font 
880         look different from IE & FF because the font is small
881
882         For plain text fields, don't stretch the inner text box.  Center it vertically in the field.
883
884         * rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::layout):
885
886 2007-05-09  Atul Mehrotra  <atul.mehrotra@celunite.com>
887
888         Gdk build fix.
889
890         * platform/gdk/TemporaryLinkStubs.cpp:
891         (Editor::newGeneralClipboard):
892
893 2007-05-09  Mitz Pettel  <mitz@webkit.org>
894
895         Reviewed by Dave Hyatt.
896
897         - fix http://bugs.webkit.org/show_bug.cgi?id=13037
898           REGRESSION: Copy-on-scroll not reset properly after back/forward navigation
899
900         * page/FrameView.cpp:
901         (WebCore::FrameViewPrivate::FrameViewPrivate): Moved initialization of
902         m_slowRepaintObjectCount here.
903         (WebCore::FrameViewPrivate::reset): Do not reset the slow repaint object
904         count here.
905         (WebCore::FrameView::useSlowRepaints):
906         (WebCore::FrameView::addSlowRepaintObject):
907         (WebCore::FrameView::removeSlowRepaintObject): Added an assertion that the
908         object count is positive.
909         * rendering/RenderObject.cpp:
910         (WebCore::RenderObject::setStyle): Corrected a mix up between old and new
911         style, which caused the object count to be decremented when it was supposed
912         to be incremented and vice versa.
913
914 2007-05-09  Peter Müller <pm@one.com>
915
916         Reviewed by Dave Hyatt.
917
918         Changed the hardcoded colors that are used for CSS 2.1 system colors.
919         Previous colors had numerous conflicts in semantic pairs, which
920         made text invisible in highlight, info and menu colored areas.
921         The new hardcoded colors are inspired by Aqua.
922
923         Ideally these colors should be fetched through AppKit instead,
924         though I am not sure if it is possible to make a 1:1 mapping
925         between CSS2.1 system colors and Mac OS X.
926
927         * css/cssstyleselector.cpp:
928         (WebCore::):
929
930 2007-05-09  Lars Knoll <lars@trolltech.com>
931
932         Fix the Qt build.
933
934         * editing/qt/EditorQt.cpp:
935
936 2007-05-08  Geoffrey Garen  <ggaren@apple.com>
937
938         Reviewed by Darin Adler.
939         
940         More fix-ups to the WebScriptObject/WebScripting APIs, related to
941         <rdar://problem/5140447> API for fetching JSGlobalContextRef from WebView 
942         or WebFrame
943         
944         1. Added -scriptObjectForJSObject: SPI so you can bridge back from JavaScriptCore
945         to WebScriptObject.
946         
947         2. Fixed WebScriptObject bridging so that you always get the same WebScriptObject
948         for a JSObject (like in the DOM). This makes -scriptObjectForJSObject: a
949         lot more coherent as an API.
950
951         * bindings/objc/DOMInternal.mm: Renamed wrapperCache to DOMWrapperCache
952         to distinguish from the JSWrapperCache. Added typedef for readability.
953         (WebCore::getDOMWrapper):
954         (WebCore::addDOMWrapper):
955         (WebCore::removeDOMWrapper):
956         * bindings/objc/WebScriptObject.mm: Added JSWrapperCache, which works just
957         like the DOMWrapperCache.
958         (WebCore::getJSWrapper):
959         (WebCore::addJSWrapper):
960         (WebCore::removeJSWrapper):
961         (WebCore::createJSWrapper):
962         (+[WebScriptObject scriptObjectForJSObject:]): This is the new API. It attempts
963         to return a specific DOM wrapper object, or, barring that, it returns a 
964         generic WebScriptObject.
965         (+[WebScriptObject scriptObjectForJSObject:originRootObject:rootObject:]):
966         Added this method to support our old WebScriptObject security and leak 
967         checking model, even though it doesn't work very well. 
968         (-[WebScriptObject _setImp:originRootObject:rootObject:]):
969         (-[WebScriptObject dealloc]):
970         (-[WebScriptObject finalize]):
971         (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
972         * bindings/objc/WebScriptObjectPendingPublic.h:
973         * bindings/objc/WebScriptObjectPrivate.h:
974         * page/mac/FrameMac.mm:
975         (WebCore::Frame::windowScriptObject): Changed to use the new API. This
976         fixes a bug where the object sent to -windowScriptObjectAvailable: and returned
977         from -windowScriptObject could not be round-tripped.
978
979 2007-05-09  Mark Rowe  <mrowe@apple.com>
980
981         Build fix.
982
983         * editing/Editor.cpp:
984         (WebCore::findFirstGrammarDetailInRange): Use unsigned rather than int.
985         (WebCore::findFirstBadGrammarInRange): Cast to unsigned in assertion.
986         (WebCore::isRangeUngrammatical): Remove unused variables.
987
988 2007-05-08  Oliver Hunt  <oliver@apple.com>
989
990         Reviewed by Darin.
991         
992         Fix <rdar://problem/5188938> arc method on Canvas causes hang or crash
993         
994         Workaround bad behaviour of CGPathAddArc when passed inf as start or
995         end angles.
996
997         * platform/graphics/cg/PathCG.cpp:
998         (WebCore::Path::addArc):
999
1000 2007-05-08  Darin Adler  <darin@apple.com>
1001
1002         Reviewed by Hyatt and Hatcher.
1003
1004         - fix auto-activation code path so Tiger and Leopard aren't different
1005
1006         * platform/mac/WebFontCache.mm: (+[WebFontCache fontWithFamily:traits:size:]):
1007         Do the auto-activation dance first before doing anything else, and ignore the
1008         font that it returns.
1009
1010 2007-05-08  Steve Falkenburg  <sfalken@apple.com>
1011
1012         Reviewed by Darin.
1013
1014         Moved most spelling/grammar logic to C++.  Now calls through to
1015         WebKit to actually invoke NSSpellChecker.
1016
1017         * editing/Editor.cpp:
1018         (WebCore::Editor::ignoreSpelling): Added (ported from EditorMac).
1019         (WebCore::Editor::learnSpelling): Added (ported from EditorMac).
1020         (WebCore::findFirstMisspellingInRange): Added (ported from EditorMac).
1021         (WebCore::paragraphAlignedRangeForRange): Added (ported from EditorMac).
1022         (WebCore::findFirstGrammarDetailInRange): Added (ported from EditorMac).
1023         (WebCore::findFirstBadGrammarInRange): Added (ported from EditorMac).
1024         (WebCore::Editor::advanceToNextMisspelling): Added (ported from EditorMac).
1025         (WebCore::Editor::isSelectionMisspelled): Added (ported from EditorMac).
1026         (WebCore::isRangeUngrammatical): Added (ported from EditorMac).
1027         (WebCore::Editor::isSelectionUngrammatical): Added (ported from EditorMac).
1028         (WebCore::Editor::guessesForUngrammaticalSelection): Added (ported from EditorMac).
1029         (WebCore::Editor::guessesForMisspelledSelection): Added (ported from EditorMac).
1030         (WebCore::Editor::showSpellingGuessPanel): Added (ported from EditorMac).
1031         (WebCore::Editor::spellingPanelIsShowing): Added (ported from EditorMac).
1032         (WebCore::Editor::markMisspellingsAfterTypingToPosition): Added (ported from EditorMac).
1033         (WebCore::markAllMisspellingsInRange): Added (ported from EditorMac).
1034         (WebCore::markAllBadGrammarInRange): Added (ported from EditorMac).
1035         (WebCore::markMisspellingsOrBadGrammar): Added (ported from EditorMac).
1036         (WebCore::Editor::markMisspellings): Added (ported from EditorMac).
1037         (WebCore::Editor::markBadGrammar): Added (ported from EditorMac).
1038         * editing/mac/EditorMac.mm: Removed Objective C version of spelling/grammar calls.
1039
1040 2007-05-08  Steve Falkenburg  <sfalken@apple.com>
1041
1042         Reviewed by Ada.
1043
1044         Slight modification to last editor method fix.
1045
1046         * bridge/EditorClient.h:
1047         * platform/gdk/EditorClientGdk.cpp:
1048         (WebCore::EditorClientGdk::updateSpellingUIWithGrammarString):
1049         * platform/gdk/EditorClientGdk.h:
1050         * platform/graphics/svg/SVGImageEmptyClients.h:
1051         (WebCore::SVGEmptyEditorClient::updateSpellingUIWithGrammarString):
1052
1053 2007-05-08  Alexey Proskuryakov  <ap@webkit.org>
1054
1055         Reviewed by Hyatt.
1056
1057         http://bugs.webkit.org/show_bug.cgi?id=13480
1058         window.Attr is undefined
1059
1060         Test: fast/dom/Window/attr-constructor.html
1061
1062         * dom/Attr.idl:
1063         * dom/CDATASection.idl:
1064         * dom/CharacterData.idl:
1065         * dom/Comment.idl:
1066         * dom/DOMImplementation.idl:
1067         * dom/DocumentType.idl:
1068         * dom/Entity.idl:
1069         * dom/EntityReference.idl:
1070         * dom/Notation.idl:
1071         * dom/ProcessingInstruction.idl:
1072         * dom/Text.idl:
1073         Added GenerateConstructor.
1074
1075         * page/DOMWindow.idl: Added constructor properties for DOM interfaces.
1076
1077 2007-05-07  Geoffrey Garen  <ggaren@apple.com>
1078
1079         Reviewed by Maciej Stachowiak.
1080
1081         Fixed <rdar://problem/5140447> API for fetching JSGlobalContextRef from 
1082         WebView or WebFrame
1083         
1084         Added support for new -[WebScriptObject JSObject] and -[WebFrame globalContext]
1085         APIs.
1086         
1087         Also fixed some more cases of <rdar://problem/4395622> API: 
1088         WebScriptObject.h incorrectly reports that -isSelectorExcludedFromWebScript 
1089         returns NO by default, and generally cleaned up that documentation.
1090
1091         * WebCore.exp: A lot of the diff here is from sorting.
1092         * WebCore.xcodeproj/project.pbxproj:
1093         * bindings/objc/WebScriptObject.h:
1094         * bindings/objc/WebScriptObject.mm:
1095         (-[WebScriptObject JSObject]):
1096         * bindings/objc/WebScriptObjectPendingPublic.h: Added.
1097
1098 2007-05-08  Lars Knoll <lars@trolltech.com>
1099
1100         Reviewed by Hyatt.
1101
1102         Fix valgrind reported uninitialized memory read.
1103
1104         * rendering/RenderText.cpp:
1105         (WebCore::RenderText::RenderText):
1106
1107 2007-05-07  Justin Garcia  <justin.garcia@apple.com>
1108
1109         Reviewed by oliver
1110
1111         <rdar://problem/4895428> Can't drag selected ToDo
1112         
1113         The user tries to drag a selection by mousing down
1114         on the editable part of a ToDo, which is focusable,
1115         since it is an editable node within non-editable 
1116         content.  But we focus focusable elements on mouse 
1117         down, and focusing the editable piece blows away 
1118         the selection and prevents the drag. This is how 
1119         IE behaves, but content seems generally difficult 
1120         to drag in IE, so this doesn't make it any worse.
1121         
1122         Since focus doesn't appear to be cancelable, either
1123         with a DOM event or an editing delegate, I fixed this
1124         by delaying the focus of focusable nodes that are 
1125         selected and inside an already focused node.  The 
1126         node will be focused if the user mouses up without 
1127         doing any dragging because the mouse up sets a
1128         selection, which calls setFocusNodeIfNeeded.
1129
1130         * page/EventHandler.cpp:
1131         (WebCore::EventHandler::dispatchMouseEvent):
1132
1133 2007-05-07  Atul Mehrotra <atul.mehrotra@celunite.com>
1134
1135         Reviewed by Maciej.
1136
1137         GDK Build fix
1138
1139         * platform/gdk/TemporaryLinkStubs.cpp:
1140
1141 2007-05-07  Oliver Hunt  <oliver@apple.com>
1142
1143         Reviewed by Maciej.
1144
1145         Correcting comparisons to handle NaN in the same manner
1146         as other Canvas methods.
1147
1148         * html/CanvasRenderingContext2D.cpp:
1149         (WebCore::CanvasRenderingContext2D::arcTo):
1150         (WebCore::CanvasRenderingContext2D::arc):
1151           Correcting arc/arcTo to match the WHAT WG draft.
1152         (WebCore::CanvasRenderingContext2D::rect):
1153         (WebCore::CanvasRenderingContext2D::clearRect):
1154         (WebCore::CanvasRenderingContext2D::fillRect):
1155         (WebCore::CanvasRenderingContext2D::strokeRect):
1156
1157 2007-05-07  David Hyatt  <hyatt@apple.com>
1158
1159         Add some comments to the glyph/font code (patch from MarvinD, tweaked by
1160         me to correct a few bits and to make it forward-compatible with the work
1161         going on in 3315.
1162
1163         Reviewed by me
1164
1165         * ChangeLog:
1166         * platform/Font.cpp:
1167         (WebCore::Font::glyphDataForCharacter):
1168         * platform/GlyphPageTreeNode.cpp:
1169         (WebCore::GlyphPageTreeNode::initializePage):
1170         * platform/GlyphPageTreeNode.h:
1171
1172 2007-05-07  Justin Garcia  <justin.garcia@apple.com>
1173
1174         Fix layout test failures.
1175
1176         * editing/SelectionController.cpp:
1177         (WebCore::SelectionController::contains): Use comparePositions
1178         instead of Range::comparePoint, because comparePositions can
1179         handle positions inside shadow trees.
1180
1181 2007-05-07  Justin Garcia  <justin.garcia@apple.com>
1182
1183         Reviewed by darin
1184         
1185         <rdar://problem/4895428> Can't drag selected To Do if it is not showing a due date
1186         
1187         The code in SelectionController::contains returned false 
1188         incorrectly if the selection end just after a table 
1189         and the position was inside that table.
1190
1191         * editing/SelectionController.cpp:
1192         (WebCore::SelectionController::contains): Compare the position with the
1193         ends of the selection and then use Range::comparePoint.
1194
1195 2007-05-07  Darin Adler  <darin@apple.com>
1196
1197         - rolling out setInnerHTML optimization until I can figure out why tests are failing
1198
1199 2007-05-07  Darin Adler  <darin@apple.com>
1200
1201         Reviewed by Hyatt.
1202
1203         - fix http://bugs.webkit.org/show_bug.cgi?id=13602
1204           Amazon product pages keep repainting over and over again
1205
1206         Optimize setInnerHTML, setOuterHTML, and setInnerText so they don't change the DOM at all
1207         if they don't need to.
1208
1209         Test: fast/dom/HTMLElement/set-inner-outer-optimization.html
1210
1211         * html/HTMLElement.cpp:
1212         (WebCore::equal): Added. Helper function that compares two Text nodes or two NamedAttrMap
1213         attribute maps.
1214         (WebCore::shallowEqual): Added. Helper function that compares two Element nodes or two
1215         arbitrary nodes.
1216         (WebCore::replaceChildrenWithFragment): Added. Helper function used by setInnerHTML and
1217         setInnerText. Optimizes the cases where all the nodes are the same, where both the current
1218         and the new content are single text nodes, and where the current content is a single node
1219         that can be replaced with replaceChild.
1220         (WebCore::replaceChildrenWithText): Added. Helper function used by setInnerText. Optimizes
1221         the case where the current content is a single text node or a single node that can be
1222         replaced with replaceChild.
1223         (WebCore::HTMLElement::setInnerHTML): Changed to call replaceChildrenWithFragment.
1224         (WebCore::HTMLElement::setOuterHTML): Added special case to optimize when the new content
1225         exactly matches the current node.
1226         (WebCore::HTMLElement::setInnerText): Changed to call replaceChildrenWithText in a few
1227         cases instead of doing removeChildren/appendChild. Changed code that was using
1228         DeprecatedString to instead use String. Changed general case to use a document fragment
1229         and replaceChildrenWithFragment.
1230
1231         * dom/CharacterData.cpp: (WebCore::CharacterData::dispatchModifiedEvent):
1232         Fixed bug where we would not dispatch the DOMSubtreeModified event unless someone
1233         was registered for the DOMCharacterDataModified event. Caused trouble in the test.
1234
1235 2007-05-06  Darin Adler  <darin@apple.com>
1236
1237         - blind try at fixing the Qt build
1238
1239         * platform/qt/TextBreakIteratorQt.cpp: (WebCore::sentenceBreakIterator):
1240         Added a placeholder.
1241
1242 2007-05-06  Darin Adler  <darin@apple.com>
1243
1244         Reviewed by Hyatt.
1245
1246         - fix http://bugs.webkit.org/show_bug.cgi?id=13537
1247           Canvex example starts rendering strangely after a while
1248
1249         * html/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::drawImage):
1250         Don't raise an exception if the source or destination rectangle is empty.
1251
1252 2007-05-06  Darin Adler  <darin@apple.com>
1253
1254         Reviewed by Hyatt.
1255
1256         - fix <rdar://problem/4585593> REGRESSION: Some 2-byte characters in printed page
1257           header are drawn with too-large font and clipped
1258
1259         Doesn't affect text within web pages, so no layout test.
1260
1261         * platform/mac/FontCacheMac.mm: (WebCore::FontCache::getFontDataForCharacters):
1262         Base the substitute font on the FontPlatformData rather than the FontDescription.
1263         Before, it was a mix of both. This works properly for fonts where we have no
1264         FontDescription and is also more internally consistent.
1265
1266 2007-05-06  Darin Adler  <darin@apple.com>
1267
1268         Reviewed by Hyatt.
1269
1270         - http://bugs.webkit.org/show_bug.cgi?id=13606
1271           some functions are virtual that don't need to be
1272
1273         * dom/Node.h: Made first/lastChild be inline functions that call virtual functions.
1274         This lets us hide the functions with another inline function in a derived class,
1275         yet still override the behavior here in the base class by overriding the virtual
1276         functions too.
1277         * dom/Node.cpp:
1278         (WebCore::Node::virtualFirstChild): Renamed virtual functions. There are now
1279         non-virtual inline functions that call these virtual functions.
1280         (WebCore::Node::virtualLastChild): Ditto.
1281
1282         * dom/ContainerNode.h: Added non-virtual first/lastChild functions that hide the ones
1283         inherited from the Node class; these also replace the fastFirst/LastChild functions,
1284         and transparently give callers the faster form if they have a pointer of the right
1285         type. But still override the virtual functions named virtualFirst/LastChild, because
1286         those can still be called through a Node*. Removed the "fast" from the names of
1287         fastSetFirst/LastChild.
1288         * dom/ContainerNode.cpp:
1289         (WebCore::ContainerNode::virtualFirstChild): Renamed virtual functions. There are now
1290         also non-virtual inline versions.
1291         (WebCore::ContainerNode::virtualLastChild): Ditto.
1292
1293         * dom/CharacterData.cpp: Removed implementations of data and length functons.
1294         * dom/CharacterData.h: Made data, setData, length, substringData, appendData,
1295         insertData, deleteData, and replaceData all non-virtual, and made data and length
1296         both be inline.
1297
1298         * dom/NamedAttrMap.h: (WebCore::NamedAttrMap::attributeItem): Removed a null check
1299         from this function. If the length of the map is known to be greater than 0, then
1300         the null check isn't needed. But if the length of the map hasn't been checked at all,
1301         then it's unsafe to call this function since it doesn't range check the array
1302         index. Thus the null check is never needed. I also looked at all callers.
1303
1304         * dom/Attr.cpp: (WebCore::Attr::createTextChild):
1305         * dom/Document.cpp: (WebCore::Document::recalcStyle):
1306         * dom/Element.cpp: (WebCore::Element::recalcStyle):
1307         * ksvg2/svg/SVGElement.cpp:
1308         (WebCore::SVGElement::haveLoadedRequiredResources):
1309         Removed "fast" prefix from calls to fastFirst/LastChild and fastSetFirst/LastChlld.
1310         It's not needed any more -- you still get fast behavior if the pointer has a type
1311         that's ContainerNode or derived from it.
1312
1313 2007-05-06  Mitz Pettel  <mitz@webkit.org>
1314
1315         Reviewed by Hyatt.
1316
1317         - fix http://bugs.webkit.org/show_bug.cgi?id=13557
1318           Crash when dragging selection over absolutely positioned generated content on block element
1319
1320         Test: fast/css-generated-content/positioned-background-hit-test-crash.html
1321
1322         * rendering/RenderLayer.cpp:
1323         (WebCore::RenderLayer::enclosingElement): Added. Factored out of hitTestLayer().
1324         (WebCore::RenderLayer::hitTestLayer): Implemented the fix for <rdar://problem/3552346>
1325         from r6106 to the self hit test as well, namely: return the enclosing element
1326         for generated positioned content.
1327         * rendering/RenderLayer.h:
1328
1329 2007-05-06  Alexey Proskuryakov  <ap@webkit.org>
1330
1331         Reviewed by Darin.
1332
1333         http://bugs.webkit.org/show_bug.cgi?id=13584
1334         <script> code wrongly assumes requests can't fail
1335
1336         Test: fast/loader/unloadable-script.html
1337
1338         * html/HTMLScriptElement.cpp:
1339         (WebCore::HTMLScriptElement::parseMappedAttribute):
1340         (WebCore::HTMLScriptElement::insertedIntoDocument):
1341         Check the return value of requestScript().
1342
1343 2007-05-06  Alexey Proskuryakov  <ap@webkit.org>
1344
1345         Reviewed by Darin.
1346
1347         http://bugs.webkit.org/show_bug.cgi?id=13304
1348         REGRESSION(14784): WebKit doesn't dynamically reflect changes to the highlight color in System Preferences
1349
1350         Implemented a notification observer that invalidates cached system colors.
1351
1352         No automated test possible.
1353
1354         * rendering/RenderTheme.cpp:
1355         (WebCore::RenderTheme::activeSelectionBackgroundColor):
1356         (WebCore::RenderTheme::inactiveSelectionBackgroundColor):
1357         (WebCore::RenderTheme::platformColorsDidChange):
1358         * rendering/RenderTheme.h:
1359         * rendering/RenderThemeMac.h:
1360         * rendering/RenderThemeMac.mm:
1361         (-[WebCoreRenderThemeNotificationObserver initWithTheme:WebCore::]):
1362         (-[WebCoreRenderThemeNotificationObserver systemColorsDidChange:]):
1363         (WebCore::theme):
1364         (WebCore::RenderThemeMac::RenderThemeMac):
1365         (WebCore::RenderThemeMac::~RenderThemeMac):
1366         (WebCore::RenderThemeMac::checkbox):
1367         (WebCore::RenderThemeMac::radio):
1368         (WebCore::RenderThemeMac::button):
1369         (WebCore::RenderThemeMac::popupButton):
1370         (WebCore::RenderThemeMac::search):
1371         (WebCore::RenderThemeMac::sliderThumbHorizontal):
1372         (WebCore::RenderThemeMac::sliderThumbVertical):
1373
1374 2007-05-05  Rob Buis  <buis@kde.org>
1375
1376         Reviewed by Oliver.
1377
1378         http://bugs.webkit.org/show_bug.cgi?id=13592
1379         parseMappedAttribute inconsistency
1380
1381         Do not use local vars in parseMappedAttribute for attr name and value.
1382
1383         * ksvg2/svg/SVGAnimateMotionElement.cpp:
1384         (WebCore::SVGAnimateMotionElement::parseMappedAttribute):
1385         * ksvg2/svg/SVGAnimateTransformElement.cpp:
1386         (WebCore::SVGAnimateTransformElement::parseMappedAttribute):
1387         * ksvg2/svg/SVGAnimationElement.cpp:
1388         (WebCore::SVGAnimationElement::parseMappedAttribute):
1389         * ksvg2/svg/SVGCircleElement.cpp:
1390         (WebCore::SVGCircleElement::parseMappedAttribute):
1391         * ksvg2/svg/SVGClipPathElement.cpp:
1392         (WebCore::SVGClipPathElement::parseMappedAttribute):
1393         * ksvg2/svg/SVGCursorElement.cpp:
1394         (WebCore::SVGCursorElement::parseMappedAttribute):
1395         * ksvg2/svg/SVGEllipseElement.cpp:
1396         (WebCore::SVGEllipseElement::parseMappedAttribute):
1397         * ksvg2/svg/SVGExternalResourcesRequired.cpp:
1398         (WebCore::SVGExternalResourcesRequired::parseMappedAttribute):
1399         * ksvg2/svg/SVGGradientElement.cpp:
1400         (WebCore::SVGGradientElement::parseMappedAttribute):
1401         * ksvg2/svg/SVGImageElement.cpp:
1402         (WebCore::SVGImageElement::parseMappedAttribute):
1403         * ksvg2/svg/SVGLineElement.cpp:
1404         (WebCore::SVGLineElement::parseMappedAttribute):
1405         * ksvg2/svg/SVGLinearGradientElement.cpp:
1406         (WebCore::SVGLinearGradientElement::parseMappedAttribute):
1407         * ksvg2/svg/SVGMarkerElement.cpp:
1408         (WebCore::SVGMarkerElement::parseMappedAttribute):
1409         * ksvg2/svg/SVGMaskElement.cpp:
1410         (WebCore::SVGMaskElement::parseMappedAttribute):
1411         * ksvg2/svg/SVGPathElement.cpp:
1412         (WebCore::SVGPathElement::parseMappedAttribute):
1413         * ksvg2/svg/SVGPatternElement.cpp:
1414         (WebCore::SVGPatternElement::parseMappedAttribute):
1415         * ksvg2/svg/SVGRadialGradientElement.cpp:
1416         (WebCore::SVGRadialGradientElement::parseMappedAttribute):
1417         * ksvg2/svg/SVGRectElement.cpp:
1418         (WebCore::SVGRectElement::parseMappedAttribute):
1419         * ksvg2/svg/SVGSVGElement.cpp:
1420         (WebCore::SVGSVGElement::parseMappedAttribute):
1421         * ksvg2/svg/SVGScriptElement.cpp:
1422         (WebCore::SVGScriptElement::parseMappedAttribute):
1423         * ksvg2/svg/SVGStopElement.cpp:
1424         (WebCore::SVGStopElement::parseMappedAttribute):
1425         * ksvg2/svg/SVGTests.cpp:
1426         (WebCore::SVGTests::parseMappedAttribute):
1427         * ksvg2/svg/SVGTextContentElement.cpp:
1428         (WebCore::SVGTextContentElement::parseMappedAttribute):
1429         * ksvg2/svg/SVGTextPositioningElement.cpp:
1430         (WebCore::SVGTextPositioningElement::parseMappedAttribute):
1431         * ksvg2/svg/SVGUseElement.cpp:
1432         (WebCore::SVGUseElement::parseMappedAttribute):
1433         * ksvg2/svg/SVGViewElement.cpp:
1434         (WebCore::SVGViewElement::parseMappedAttribute):
1435         * ksvg2/svg/SVGZoomAndPan.cpp:
1436         (WebCore::SVGZoomAndPan::parseMappedAttribute):
1437
1438 2007-05-05  Oliver Hunt  <oliver@apple.com>
1439
1440         Reviewed by Hyatt.
1441
1442         Initialise default fill with Color::black rather than parsing
1443         the string "black"
1444
1445         * ksvg2/svg/SVGPaint.cpp:
1446         (WebCore::SVGPaint::defaultFill):
1447
1448 2007-05-04  Steve Falkenburg  <sfalken@apple.com>
1449
1450         Reviewed by Oliver.
1451
1452         Use TextBreakIterator for sentence breaking instead of TextBoundaries.
1453
1454         * WebCore.xcodeproj/project.pbxproj: Added TextBreakIeratorInternalICUMac.mm
1455         * editing/visible_units.cpp:
1456         (WebCore::startSentenceBoundary): Call TextBreakIterator instead of TextBoundaries.
1457         (WebCore::endSentenceBoundary): Call TextBreakIterator instead of TextBoundaries.
1458         (WebCore::previousSentencePositionBoundary): Call TextBreakIterator instead of TextBoundaries.
1459         (WebCore::nextSentencePositionBoundary): Call TextBreakIterator instead of TextBoundaries.
1460         * platform/TextBoundaries.h: Removed findSentenceBoundary, findNextSentenceFromIndex.
1461         * platform/TextBreakIterator.h: Added sentenceBreakIterator.
1462         * platform/TextBreakIteratorICU.cpp:
1463         (WebCore::setUpIterator): Add locale parameter (needed to maintain functionality that TextBoundaries code had).
1464         (WebCore::characterBreakIterator): Pass en_us for locale (same as old code).
1465         (WebCore::wordBreakIterator): Pass en_us for locale (same as old code).
1466         (WebCore::lineBreakIterator): Pass en_us for locale (same as old code).
1467         (WebCore::sentenceBreakIterator): Added.
1468         * platform/TextBreakIteratorInternalICU.h: Added.
1469         * platform/gdk/TemporaryLinkStubs.cpp: Removed findNextSentenceFromIndex, findSentenceBoundary.
1470         (WebCore::currentTextBreakLocaleID): Added stub.
1471         * platform/mac/TextBoundaries.mm: Removed currentTextBreakLocaleID, findSentenceBoundary, findNextSentenceFromIndex.
1472         * platform/mac/TextBreakIteratorInternalICUMac.mm: Added.
1473         (WebCore::currentTextBreakLocaleID): Moved from TextBoundaries.mm
1474         * platform/qt/TextBoundaries.cpp: Removed findNextSentenceFromIndex, findSentenceBoundary.
1475
1476 2007-05-04  Adele Peterson  <adele@apple.com>
1477
1478         Reviewed by Hyatt.
1479
1480         Fix for <rdar://problem/5116871> REGRESSION: Can't select options in widget's listbox
1481
1482         Don't use user-select to determine whether or not options can be selected in listboxes.
1483         This will match Firefox behavior for -moz-user-select.
1484
1485         * html/HTMLSelectElement.cpp:
1486         (WebCore::HTMLSelectElement::canSelectAll):
1487         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
1488
1489 2007-05-04  Geoffrey Garen  <ggaren@apple.com>
1490
1491         Reviewed by Tim Hatcher.
1492
1493         First step in fixing <rdar://problem/5055182> The back cache has no global cap
1494
1495         Stop giving SnapBack infinite cache-ability. Instead, make SnapBack rely
1496         on the underlying back cache.
1497
1498         * WebCore.exp:
1499         * history/HistoryItem.cpp:
1500         (WebCore::HistoryItem::HistoryItem):
1501         * history/HistoryItem.h:
1502         * loader/FrameLoader.cpp:
1503         (WebCore::FrameLoader::purgePageCache):
1504
1505 2007-05-04  Geoffrey Garen  <ggaren@apple.com>
1506
1507         Reviewed by Brady Eidson.
1508         
1509         Removed export of clearPageCache(), since it was unused externally. I plan
1510         to remove its use from WebCore eventually, too.
1511
1512         Removed usesPageCache(), since it was unused and it duplicated pageCacheSize().
1513
1514         * WebCore.exp:
1515         * history/BackForwardList.cpp:
1516         * history/BackForwardList.h: Moved statics to the top of the class definition.
1517         * loader/FrameLoader.cpp:
1518         (WebCore::FrameLoader::canCachePage):
1519
1520 2007-05-04  Anders Carlsson  <andersca@apple.com>
1521
1522         Reviewed by Antti.
1523
1524         <rdar://problem/5179977> Use the correct URLs when dispatching delegate methods for data loads.
1525
1526         Restore behavior to matching release WebKit by adding a response URL to SubstituteData. If a nil base URL is
1527         passed, set the _request_ URL to "about:blank", but the response URL to a generated "applewebdata" URL.
1528
1529         * loader/FrameLoader.cpp:
1530         (WebCore::FrameLoader::commitProvisionalLoad):
1531         First, check for the SubstituteData's response URL.
1532
1533         (WebCore::FrameLoader::continueAfterNavigationPolicy):
1534         No need to special case applewebdata URLs here, they're only used in the response.
1535
1536         * loader/MainResourceLoader.cpp:
1537         (WebCore::MainResourceLoader::handleDataLoadNow):
1538         If the substitute data has a response URL, use it.
1539
1540         (WebCore::MainResourceLoader::loadNow):
1541         Only load "about:blank" as an empty document if there's no substitute data.
1542
1543         * loader/SubstituteData.h:
1544         (WebCore::SubstituteData::SubstituteData):
1545         (WebCore::SubstituteData::responseURL):
1546         Add responseURL member to SubstituteData.
1547
1548 2007-05-03  Steve Falkenburg  <sfalken@apple.com>
1549
1550         Reviewed by Oliver.
1551
1552         Add missing user description parameter to spelling-related editor client method.
1553
1554         * bridge/EditorClient.h:
1555         * platform/gdk/EditorClientGdk.cpp:
1556         (WebCore::EditorClientGdk::updateSpellingUIWithGrammarString):
1557         * platform/gdk/EditorClientGdk.h:
1558         * platform/graphics/svg/SVGImageEmptyClients.h:
1559         (WebCore::SVGEmptyEditorClient::updateSpellingUIWithGrammarString):
1560
1561 2007-05-03  Brady Eidson  <beidson@apple.com>
1562
1563         Reviewed by Oliver
1564
1565         Resolve an outstanding FIXME in Loader::numRequests()
1566
1567         Before, numRequests() would iterate through the list of requests pending load and the list of currently
1568         loading requests and tally up a count matching the current DocLoader.
1569
1570         I noticed while studying and cleaning up the loader code that numRequests() is potentially very hot!
1571         Indeed load a complex site with many resources and multiple frames, and this method gets called very often,
1572         tallying up this number every time.
1573
1574         The FIXME was to keep a collection of Requests mapped to each DocLoader.  In reality, since this map would
1575         simply be used for retrieving a count, that was overkill.  Keeping a request count in the DocLoader itself
1576         along with maintaining that count in Loader as requests come and go is a much better way to do this.
1577
1578         * loader/DocLoader.cpp:
1579         (WebCore::DocLoader::DocLoader):
1580         (WebCore::DocLoader::incrementRequestCount):
1581         (WebCore::DocLoader::decrementRequestCount):
1582         (WebCore::DocLoader::requestCount): Emulate the defunct Loader::numRequests()
1583         * loader/DocLoader.h:
1584
1585         * loader/FrameLoader.cpp:
1586         (WebCore::numRequests): Call DocLoader::requestCount() directly
1587         (WebCore::FrameLoader::checkCompleted): Use numRequests()
1588
1589         * loader/loader.cpp:
1590         (WebCore::Loader::load): Increment the DocLoader's request count
1591         (WebCore::Loader::servePendingRequests): If the SubresourceLoader failed to create, decrement the count
1592         (WebCore::Loader::didFinishLoading): If the Request is not Multipart, decrement the count
1593         (WebCore::Loader::didFail): If the Request is not Multipart, decrement the count
1594         (WebCore::Loader::didReceiveResponse): If the Request becomes Multipart, decrement the count
1595         (WebCore::Loader::cancelRequests): Decrement the count for the pending requests being tossed, and ASSERT the
1596           count is zero after all requests have been cancelled
1597         * loader/loader.h:
1598
1599 2007-05-03  Geoffrey Garen  <ggaren@apple.com>
1600
1601         Reviewed by Brady Eidson.
1602         
1603         Some cleanup in preparation for fixing <rdar://problem/5055182> The 
1604         back/forward cache has no global cap
1605
1606         * loader/FrameLoader.cpp:
1607         (WebCore::FrameLoader::provisionalLoadStarted): Moved "Can I cache this
1608         page?" logic to canCachePage(). Moved "I am caching this page" logic to
1609         cachePageToHistoryItem().
1610         (WebCore::FrameLoader::canCachePage): Moved above logic here.
1611         (WebCore::FrameLoader::cachePageToHistoryItem): Removed bogus NULL check
1612         and failure return value. Moved above logic here. Don't call setCachedPage()
1613         until the CachedPage is fully constructed.
1614         (WebCore::FrameLoader::purgePageCache): Removed comment that duplicated
1615         the function name.
1616         * loader/FrameLoader.h:
1617
1618 2007-05-03  Justin Garcia  <justin.garcia@apple.com>
1619
1620         Reviewed by harrison.
1621
1622         <rdar://problem/5120281> CrashTracer: [USER] 1 crash in Mail at WebCore::CSSComputedStyleDeclaration::copyInheritableProperties() const
1623
1624         Problem is that checkAncestor and lastClosed can be nil when createMarkup is called unrendered nodes, and that was not checked for.
1625         
1626         * editing/markup.cpp:
1627         (WebCore::createMarkup):
1628         Nil-check checkAncestor and lastClosed.
1629
1630 2007-05-03  Timothy Hatcher  <timothy@apple.com>
1631
1632         Reviewed by Kevin.
1633
1634         <rdar://problem/5016318> Contextual menu item for opening links is missing in compose windows but present in viewer
1635
1636         Add the Open Link, Open Link in New Window, Download Linked File and Copy Link menu
1637         items to the content editable context menu.
1638
1639         * platform/ContextMenu.cpp:
1640         (WebCore::ContextMenu::populate):
1641
1642 2007-05-03  Holger Freyther <freyther@kde.org>
1643
1644         Reviewed by Zack, landed by Simon.
1645         This is bugzilla bug 13499.
1646
1647         * WebCore.pro: Place the Qt port into the qt-port scope, add the Gdk port
1648
1649 2007-05-03  Adele Peterson  <adele@apple.com>
1650
1651         Use BUILDING_ON_TIGER.
1652
1653         * page/mac/FrameMac.mm: (WebCore::Frame::setUseSecureKeyboardEntry):
1654
1655 2007-05-03  Brady Eidson  <beidson@apple.com>
1656
1657         Reviewed by Darin
1658
1659         Some more minor cleanup that resolves a FIXME and ditches another pointless method
1660
1661         No change in functionality == no layout test
1662
1663         * loader/FrameLoader.cpp:
1664         (WebCore::FrameLoader::commitProvisionalLoad):  Updated a comment
1665         (WebCore::FrameLoader::continueLoadAfterWillSubmitForm): Folded startLoading() into this method
1666         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): continueAfterWillSubmitForm becomes continueLoadAfterWillSubmitForm
1667         * loader/FrameLoader.h: Removed startLoading()
1668
1669 2007-05-03  Adele Peterson  <adele@apple.com>
1670
1671         Reviewed by Tim Hatcher.
1672
1673         Fix for <rdar://problem/4727607> REGRESSION: KeyScript is deprecated, need a new solution for forcing Roman input for password fields on Leopard
1674
1675         * page/mac/FrameMac.mm: (WebCore::Frame::setUseSecureKeyboardEntry):
1676         Use TSMSetDocumentProperty and TSMRemoveDocumentProperty on Leopard disable and enable non-ascii input sources.
1677
1678 2007-05-03  Brady Eidson  <beidson@apple.com>
1679
1680         Reviewed by Anders
1681
1682         commitProvisionalLoad() was the name of two methods.
1683         One of them was private and only called from one other private place.
1684         This was driving me crazy.  I had to change that.
1685
1686         No change in functionality == no layout test
1687
1688         * loader/FrameLoader.cpp:
1689         (WebCore::FrameLoader::transitionToCommitted): roll commitProvisionalLoad() into this method
1690         * loader/FrameLoader.h: Removed commitProvisionalLoad()
1691
1692 2007-05-03  Darin Adler  <darin@apple.com>
1693
1694         Reviewed by Anders.
1695
1696         - make ICU initialization lazy to speed up application start-up time
1697           (when it includes an initial webpage load)
1698
1699         * platform/TextCodecICU.h: Replaced registerEncodingNames and
1700         registerCodecs with registerBaseEncodingNames, registerBaseCodecs,
1701         registerExtendedEncodingNames, and registerExtendedCodecs.
1702         * platform/TextCodecICU.cpp:
1703         (WebCore::newTextCodecICU): Moved up to the top of the file.
1704         (WebCore::TextCodecICU::registerBaseEncodingNames): Added. Registers
1705         just UTF-8.
1706         (WebCore::TextCodecICU::registerBaseCodecs): Ditto.
1707         (WebCore::TextCodecICU::registerExtendedEncodingNames): Renamed.
1708         (WebCore::TextCodecICU::registerExtendedCodecs): Ditto.
1709         (WebCore::TextCodecICU::createICUConverter): Compare with the name
1710         "GBK" in a way that does not require extending the maps.
1711
1712         * platform/TextEncoding.cpp:
1713         (WebCore::TextEncoding::usesVisualOrdering): Added code so this will
1714         just return false if we haven't used any extended encoding names yet.
1715         The result will be correct, and we won't ask for an encoding name that
1716         will require registering the extended encoding names.
1717         (WebCore::TextEncoding::isJapanese): Ditto.
1718         (WebCore::TextEncoding::backslashAsCurrencySymbol): Ditto, but return
1719         a backslash instead of false.
1720
1721         * platform/TextEncodingRegistry.h: Added a new function named
1722          noExtendedTextEncodingNameUsed.
1723         * platform/TextEncodingRegistry.cpp:
1724         (WebCore::buildBaseTextCodecMaps): Added. Registers the base encodings,
1725         including Latin-1 because it's the default, and the UTF encodings.
1726         (WebCore::extendTextCodecMaps): Added. Registers all the other encodings.
1727         (WebCore::newTextCodec): Removed the all to buildTextCodecMap because
1728         we always build the map when making the canonical encoding name.
1729         (WebCore::atomicCanonicalTextEncodingName): Changed code to build only
1730         the base maps at first, then extend the maps the first time we run into
1731         a name we don't know.
1732         (WebCore::noExtendedTextEncodingNameUsed): Added.
1733
1734 2007-05-03  Mark Rowe  <mrowe@apple.com>
1735
1736         Qt build fix.  In r21185 the Qt version of WebCore::scaleDragImage was
1737         updated to have the incorrect signature.
1738
1739         * platform/qt/DragImageQt.cpp:
1740         (WebCore::scaleDragImage):
1741
1742 2007-05-02  Beth Dakin  <bdakin@apple.com>
1743
1744         * dom/Node.h: Just fixing a variable name because it's driving me 
1745         mad.
1746
1747 2007-05-02  Beth Dakin  <bdakin@apple.com>
1748
1749         Reviewed by Hyatt.
1750
1751         Fix for <rdar://problem/4513966> Never-ending identical repaint @ 
1752         orbitz.com (Safari eating 85% CPU)
1753
1754         We need to be a little bit more savvy about when we do a FULL style 
1755         recalc since it can be unnecessary and expensive.
1756
1757         * css/CSSMutableStyleDeclaration.cpp:
1758         (WebCore::CSSMutableStyleDeclaration::setChanged): Now takes a 
1759         StyleChangeType as a parameter.
1760         (WebCore::CSSMutableStyleDeclaration::setProperty): Send 
1761         InlineStyleChange as the paramter. This is the optimization!
1762         * css/CSSMutableStyleDeclaration.h: setChanged takes a 
1763         StyleChangeType as a parameter.
1764         * dom/Document.cpp: setChanged now takes a StyleChangeType instead 
1765         of a bool.
1766         (WebCore::Document::recalcStyle): Same.
1767         * dom/Element.cpp: 
1768         (WebCore::Element::recalcStyle): This is the fix!! Only set change 
1769         to Force is we use descendant rules AND it's a FullStyleChange.
1770         * dom/Node.cpp: m_hasStyle was an unused bit on Node, so this patch 
1771         gets rid of it and uses that extra bit for m_changed to be a 
1772         StyleChangeType instead of a bool.
1773         (WebCore::Node::Node):
1774         (WebCore::Node::setChanged):
1775         (WebCore::Node::dump):
1776         * dom/Node.h: Same.
1777         (WebCore::): Define the StyleChangeType enum.
1778         (WebCore::Node::hasClass):
1779         (WebCore::Node::changed):
1780         (WebCore::Node::styleChangeType):
1781         (WebCore::Node::setHasClass):
1782         * dom/StyledElement.cpp:
1783         (WebCore::StyledElement::parseMappedAttribute): Don't bother 
1784         calling setHasStyle() since m_hasStyle is gone now. It was never 
1785         used, and this was the only place it was set.
1786         * dom/Text.cpp:
1787         (WebCore::Text::recalcStyle): setChanged now takes a 
1788         StyleChangeType instead of a bool.
1789         * html/HTMLFrameSetElement.cpp:
1790         (WebCore::HTMLFrameSetElement::recalcStyle): Same.
1791         * html/HTMLSelectElement.cpp:
1792         (WebCore::HTMLSelectElement::restoreState): Same.
1793         (WebCore::HTMLSelectElement::reset): Same.
1794         * html/HTMLTextAreaElement.cpp:
1795         (WebCore::HTMLTextAreaElement::setValue): Same.
1796         * ksvg2/misc/SVGTimer.cpp:
1797         (WebCore::SVGTimer::applyAnimations): Same.
1798         * ksvg2/svg/SVGUseElement.cpp:
1799         (WebCore::SVGUseElement::recalcStyle): Same.
1800         * platform/graphics/svg/SVGResource.cpp:
1801         (WebCore::SVGResource::repaintClients): Same.
1802
1803 2007-05-02  David Harrison  <harrison@apple.com>
1804
1805         Reviewed by Antti.
1806
1807         <rdar://problem/4859132> Grammar must always be checked in entire-sentence chunks, and shouldn't show markers for current sentence
1808
1809         Restore the remainder of the original fix now that blocking bug rdar://5174862 is addressed.
1810
1811         John made the original patch on 2007-04-10, but this fell prey to rdar://5157329.
1812         Justin backed out the whole patch on 2007-04-30 to avoid the crash.
1813         Justin then restored most of the original patch, but used word granularity instead, to keep the build working.
1814         I just addressed the root cause of rdar://5157329 in rdar://5174862.
1815         This patch switches the temp uses of word granularity back to sentence granularity.
1816         
1817         * editing/mac/EditorMac.mm:
1818         (WebCore::Editor::markMisspellingsAfterTypingToPosition):
1819         * page/Frame.cpp:
1820         (WebCore::Frame::respondToChangedSelection):
1821
1822 2007-05-02  David Harrison  <harrison@apple.com>
1823
1824         Reviewed by Antti.
1825
1826         <rdar://problem/5174862> Crash resulting from DeprecatedString::insert()
1827         
1828         Test added: editing/selection/move-by-sentence-001.html
1829
1830         * editing/visible_units.cpp:
1831         (WebCore::previousBoundary):
1832         (WebCore::nextBoundary):
1833         Use a UChar Vector instead of DeprecatedString.
1834         Avoid creating an extra string for secure bullet replacement unless it is actually needed.
1835         
1836         * platform/DeprecatedString.cpp:
1837         (WebCore::DeprecatedString::insert):
1838         Call forceUnicode() before setLength(), so that only the unicode buffer is resized.
1839
1840        (WebCore::DeprecatedString::setLength):
1841         Adjust the unicode buffer even if the ascii buffer is valid.
1842         
1843 2007-05-02  Mitz Pettel  <mitz@webkit.org>
1844
1845         Reviewed by Brady.
1846
1847         - http://bugs.webkit.org/show_bug.cgi?id=13564
1848           Remove friend class FrameLoader from Frame
1849
1850         No test added since there is no change in functionality.
1851
1852         * loader/FrameLoader.cpp:
1853         (WebCore::FrameLoader::didOpenURL):
1854         (WebCore::FrameLoader::begin):
1855         (WebCore::FrameLoader::open):
1856         * loader/FrameLoader.h: Made clear() private.
1857         * page/Frame.cpp:
1858         (WebCore::Frame::setDocument): Changed the argument into a PassRefPtr.
1859         * page/Frame.h:
1860         * xml/XSLTProcessor.cpp:
1861         (WebCore::XSLTProcessor::createDocumentFromSource):
1862
1863 2007-05-02  Mitz Pettel  <mitz@webkit.org>
1864
1865         Reviewed by Dave Hyatt.
1866
1867         - fix http://bugs.webkit.org/show_bug.cgi?id=9276
1868           Quirksmode: Image swap resize bug
1869
1870         Test: fast/replaced/image-resize-width.html
1871
1872         * rendering/RenderImage.cpp:
1873         (WebCore::RenderImage::imageChanged): Moved the call to dirtyPrefWidths()
1874         before the call to calcWidth().
1875
1876 2007-05-02  David Hyatt  <hyatt@apple.com>
1877
1878         Fix for bug 13566, broken Dashboard widgets.  setPrefWidthsDirty did
1879         the wrong thing for text children of a positioned element.
1880
1881         Reviewed by mitz
1882
1883         fast/block/positioning/pref-width-change.html
1884
1885         * rendering/RenderObject.cpp:
1886         (WebCore::RenderObject::setPrefWidthsDirty):
1887
1888 2007-05-01  Darin Adler  <darin@apple.com>
1889
1890         * rendering/RenderReplaced.cpp: Fix typo in a comment.
1891
1892 2007-05-01  David Hyatt  <hyatt@apple.com>
1893
1894         Fix for 13558, crash when using absolutely positioned generated content
1895         inside an inline.
1896
1897         Reviewed by darin
1898
1899         fast/css-generated-content/absolute-position-inside-inline.html
1900
1901         * rendering/RenderContainer.cpp:
1902         (WebCore::RenderContainer::updateBeforeAfterContentForContainer):
1903
1904 2007-05-01  Justin Garcia  <justin.garcia@apple.com>
1905
1906         Reviewed by darin
1907
1908         <rdar://problem/5002441> 
1909         Pressing space key does nothing above quoted content or a signature
1910         
1911         Inserting a space under these circumstances inserts a single 
1912         text node containing a regular space and then does a layout. 
1913         That space isn't rendered (which is correct).  Whitespace 
1914         rebalancing is supposed to correct it but failed.  It replaces 
1915         the space with a non-breaking space, but that change doesn't 
1916         dirty line boxes (9441) and so the space isn't rendered.
1917         
1918         This workaround turns all incoming spaces into non-breaking 
1919         spaces before they're inserted (they're rebalanced after 
1920         insertion and turned back into regular spaces if possible).
1921
1922         * editing/InsertTextCommand.cpp:
1923         (WebCore::InsertTextCommand::prepareForTextInsertion): Removed
1924         an old irrelevant FIXME.
1925         (WebCore::InsertTextCommand::input): Turn incoming spaces into
1926         non breaking spaces before inserting them.
1927         
1928 2007-05-01  Darin Adler  <darin@apple.com>
1929
1930         Reviewed by Hyatt.
1931
1932         - fix http://bugs.webkit.org/show_bug.cgi?id=13559
1933           REGRESSION: Canvas aspect ratio is incorrect
1934
1935         - remove intrinsicWidth/Height functions from RenderObject
1936
1937         Test: fast/canvas/canvas-size-change-after-layout.html
1938
1939         * html/HTMLCanvasElement.cpp:
1940         (WebCore::HTMLCanvasElement::createRenderer): Removed code to set
1941         the intrinsic size, because the renderer now takes care of this
1942         in its constructor.
1943         (WebCore::HTMLCanvasElement::reset): Instead of calling the
1944         setIntrinsicWidth/Height functions, call canvasSizeChanged, which
1945         takes care of layout, but only if the size actually changed. Also
1946         call repaint if the contents of the canvas changed.
1947
1948         * rendering/RenderApplet.h:
1949         * rendering/RenderApplet.cpp: (WebCore::RenderApplet::intrinsicSize):
1950         Override the new intrinsicSize function. This override still doesn't
1951         make sense, so left a FIXME in here.
1952
1953         * rendering/RenderBox.h: Added an intrinsicSize function here to replace
1954         the intrinsicWidth/Height functions removed from RenderObject.
1955         * rendering/RenderBox.cpp:
1956         (WebCore::RenderBox::calcReplacedWidthUsing): Use intrinsicSize instead
1957         of intrinsicWidth.
1958         (WebCore::RenderBox::calcReplacedHeightUsing): Ditto, but for height.
1959
1960         * rendering/RenderHTMLCanvas.h: Changed the constructor parameter to be
1961         an HTMLCanvasElement* instead of Node*. Also added a canvasSizeChanged
1962         function.
1963         * rendering/RenderHTMLCanvas.cpp:
1964         (WebCore::RenderHTMLCanvas::RenderHTMLCanvas): Pass an initial intrinsic
1965         size based on the current size of the canvas element. This is now the
1966         responsibility of the renderer and the DOM element calls the canvasSizeChanged
1967         function when the size changes.
1968         (WebCore::RenderHTMLCanvas::paint): Removed checks of the type of the element,
1969         and used the node() function because we don't have to worry about the anonymous
1970         case in this class.
1971         (WebCore::RenderHTMLCanvas::canvasSizeChanged): Added. Changes the size and
1972         then calls setNeedsLayout and setPrefWidthsDirty as needed. I based the logic
1973         here on careful reading of RenderImage::imageChanged.
1974
1975         * rendering/RenderImage.cpp:
1976         (WebCore::RenderImage::RenderImage): Pass a default intrinsic size of 0,0
1977         instead of calling setIntrinsicWidth/Height.
1978         (WebCore::RenderImage::setImageSizeForAltText): Call the new intrinsic size
1979         functions instead of the width/height ones. Simplifies the logic since we
1980         handle both dimensions at once.
1981         (WebCore::RenderImage::imageChanged): Ditto.
1982         (WebCore::RenderImage::layout): Ditto.
1983         (WebCore::RenderImage::calcAspectRatioWidth): Ditto.
1984         (WebCore::RenderImage::calcAspectRatioHeight): Ditto.
1985
1986         * rendering/RenderObject.h: Removed intrinsicWidth/Height virtual functions.
1987
1988         * rendering/RenderReplaced.h: Replaced intrinsicWidth, intrinsicHeight,
1989         setIntrinsicWidth, setIntrinsicHeight, m_intrinsicWidth, and m_intrinsicHeight
1990         with intrinsicSize, setIntrinsicSize, and m_intrinsicSize.
1991         * rendering/RenderReplaced.cpp:
1992         (WebCore::RenderReplaced::RenderReplaced): Added a second contructor that takes
1993         an intrinsic size parameter. Also updated constructor since the intrinsic size
1994         is now an IntSize instead of two integers.
1995         (WebCore::RenderReplaced::intrinsicSize): Added. No point in making this inline
1996         because it's a virtual function.
1997         (WebCore::RenderReplaced::setIntrinsicSize): Added. Didn't make this inline,
1998         partly because in the future we might want this to be more than just a simple
1999         setter function, factoring in common code used in both RenderImage and
2000         RenderHTMLCanvas.
2001
2002         * rendering/RenderWidget.h: Removed a stray using declaration that wasn't needed.
2003
2004 2007-05-01  David Hyatt  <hyatt@apple.com>
2005
2006         Fix for hang when incorrectly trying to add before/after content to
2007         a <select>.  Disallow generated content in all selects and also turn it
2008         off for <input> buttons.
2009
2010         Reviewed by aroben
2011
2012         * rendering/RenderBlock.cpp:
2013         (WebCore::RenderBlock::setStyle):
2014         * rendering/RenderButton.cpp:
2015         (WebCore::RenderButton::canHaveChildren):
2016         * rendering/RenderButton.h:
2017
2018 2007-05-01  Darin Adler  <darin@apple.com>
2019
2020         Reviewed by Hyatt.
2021
2022         - removed the m_implicit bit from Node, freeing up a bit
2023
2024         - fixed <rdar://problem/5172607> XML parser is creating implicit tbody elements
2025         - fixed <rdar://problem/5172596> HTML-parser-created tbody elements are being
2026           ignored when processing CSS child rules
2027
2028         Test: fast/css/child-selector-implicit-tbody.html
2029
2030         * css/cssstyleselector.cpp: (WebCore::CSSStyleSelector::checkSelector):
2031         Removed code that used to look at implicitNode(), which no longer exists.
2032
2033         * css/html4.css: Added a style rule to handle cases where we have a tr
2034         inside a table with no intervening table section.
2035
2036         * dom/Node.h: Removed the bit.
2037         * dom/Node.cpp:
2038         (WebCore::Node::Node): Don't initialize the bit.
2039         (WebCore::Node::dump): Don't dump the bit.
2040
2041         * dom/XMLTokenizer.cpp:
2042         (WebCore::XMLTokenizer::startElementNs): Remove the code that made a
2043         table body element. This is handled in the render tree, the DOM tree
2044         should not be mangled.
2045         (WebCore::XMLTokenizer::endElementNs): Removed code that used to look at
2046         implicitNode(), which no longer exists.
2047
2048         * html/HTMLElementFactory.cpp: (WebCore::tableSectionConstructor):
2049         Removed boolean parameter that was passed to the HTMLTableSectionElement
2050         constructor.
2051         * html/HTMLParser.cpp: (WebCore::HTMLParser::handleError): Ditto.
2052         * html/HTMLTableElement.cpp:
2053         (WebCore::HTMLTableElement::createTHead): Ditto.
2054         (WebCore::HTMLTableElement::createTFoot): Ditto.
2055         (WebCore::HTMLTableElement::insertRow): Changed to return a PassRefPtr,
2056         because it's possible the row could be removed from the table by JavaScript
2057         code responding to DOM mutation events before the function returns. Just
2058         something I noticed by code inspection.
2059
2060         * html/HTMLTableSectionElement.cpp:
2061         (WebCore::HTMLTableSectionElement::HTMLTableSectionElement): Removed
2062         boolean "implicit" parameter to the constructor.
2063         (WebCore::HTMLTableSectionElement::insertRow): Changed to return a
2064         PassRefPtr for the same reason cited above.
2065
2066         * html/HTMLTableElement.h: Changed the return value of insertRow to be
2067         a PassRefPtr.
2068         * html/HTMLTableSectionElement.h: Ditto.
2069
2070 2007-04-30  David Hyatt  <hyatt@apple.com>
2071
2072         Fix for bug 12691, generated content and display: table-cell duplicates
2073         content on a size change.  Make sure that the code to update before/after
2074         content is smart enough to drill into anonymous containers to find the
2075         old child.
2076
2077         Reviewed by olliej
2078
2079         Added fast/css-generated-content/table-cell-before-content.html
2080
2081         * rendering/RenderBlock.cpp:
2082         (WebCore::RenderBlock::setStyle):
2083         * rendering/RenderButton.cpp:
2084         (WebCore::RenderButton::updateBeforeAfterContent):
2085         * rendering/RenderButton.h:
2086         * rendering/RenderContainer.cpp:
2087         (WebCore::RenderContainer::beforeAfterContainer):
2088         (WebCore::RenderContainer::updateBeforeAfterContent):
2089         (WebCore::RenderContainer::updateBeforeAfterContentForObject):
2090         * rendering/RenderContainer.h:
2091         * rendering/RenderInline.cpp:
2092         (WebCore::RenderInline::setStyle):
2093         (WebCore::RenderInline::addChildToFlow):
2094         (WebCore::RenderInline::splitInlines):
2095
2096 2007-04-30  Jungshik Shin <jungshik.shin@gmail.com>
2097
2098         Reviewed by justin
2099         
2100         <http://bugs.webkit.org/show_bug.cgi?id=13552>
2101         comment to Range::comparePoint in dom/Range.cpp has 
2102         '0xD0' in place of '-': leading to a compiler warning
2103
2104         * dom/Range.cpp:
2105         (WebCore::Range::comparePoint):
2106
2107 2007-04-30  Justin Garcia  <justin.garcia@apple.com>
2108
2109         Reviewed by darin
2110
2111         <rdar://problem/4875189> List gets deleted when replacing contents
2112
2113         * editing/ReplaceSelectionCommand.cpp:
2114         (WebCore::ReplaceSelectionCommand::doApply): Don't expand
2115         to include elements, like lists, when deleting a selection 
2116         to replace it.
2117
2118 2007-04-30  Justin Garcia  <justin.garcia@apple.com>
2119
2120         Reviewed by ggaren
2121         
2122         Buildfix.  Leave in grammar checking machinery to 
2123         keep WebKit building on other platforms but don't
2124         operate on sentence sized chunks so that we don't
2125         re-introduce 5157329.
2126
2127         * editing/Editor.h:
2128         * editing/mac/EditorMac.mm:
2129         (WebCore::Editor::markMisspellingsAfterTypingToPosition):
2130         (WebCore::markMisspellingsOrBadGrammar):
2131         (WebCore::Editor::markMisspellings):
2132         (WebCore::Editor::markBadGrammar):
2133         * page/Frame.cpp:
2134         (WebCore::Frame::respondToChangedSelection):
2135
2136 2007-04-30  Justin Garcia  <justin.garcia@apple.com>
2137
2138         Reviewed by darin
2139
2140         <rdar://problem/5168598> 
2141         Crash when deleting a link inside an input field
2142         
2143         Deletion code tries to update one of its positions to keep 
2144         it valid and nullifies it.  Later in mergeParagraphs we try 
2145         to find out if it's valid by checking to see if it's still in 
2146         the document and crash.
2147         
2148         The fix is just to not bother keeping the position, 
2149         m_upstreamStart, valid, since after the point in the code 
2150         under examination, it doesn't need to be valid anymore.  
2151         Besides, code to update DeleteSelectionCommand's positions 
2152         should go in the functions that handle the content removal 
2153         that might invalid them (there are already FIXMEs about this).
2154         
2155         Also, users shouldn't be able to insert links (or any rich content)
2156         into plaintext-only regions like text fields, even if those
2157         text fields are inside richly editable regions.  This is a 
2158         separate bug and is filed as 5171552.
2159
2160         * editing/DeleteSelectionCommand.cpp:
2161         (WebCore::DeleteSelectionCommand::handleGeneralDelete): Don't
2162         bother updating m_upstreamStart.
2163
2164 2007-04-30  Patti Hoa  <patti@apple.com>
2165
2166         Reviewed by Dave Hyatt.
2167         
2168         <rdar://problem/5108546> REGRESSION: Zoom follows keyboard focus does not work
2169
2170         * WebCore.xcodeproj/project.pbxproj:
2171         Add new file SelectionControllerMac.mm
2172         * dom/Document.cpp:
2173         (WebCore::Document::updateSelection):
2174         Move the code to fire off AXSelectedTextChanged notification to a new method notifyAccessibilityForSelectionChange in SelectionControllerMac.mm
2175         * editing/SelectionController.cpp:
2176         (WebCore::SelectionController::setSelection):
2177         call notifyAccessibilityForSelectionChange to handle firing of accessibility notification and zoomFocusChange
2178         * editing/SelectionController.h:
2179         Add notifyAccessibilityForSelectionChange method for Mac platform
2180         * platform/Widget.h:
2181         * platform/mac/WidgetMac.mm:
2182         (WebCore::Widget::convertToScreenCoordinate):
2183         Add a helper routine that takes IntPoint in local coordinate and convert that to screen coordinate
2184
2185 2007-04-30  Justin Garcia  <justin.garcia@apple.com>
2186
2187         Reviewed by harrison
2188
2189         <rdar://problem/5157329> 
2190         REGRESSION: Crash at WTF::fastFree() when arrowing or deleting backward through editable text (13493)
2191         
2192         Backing out the changes for 4859132.
2193
2194         * editing/Editor.h:
2195         * editing/mac/EditorMac.mm:
2196         (WebCore::Editor::markMisspellingsAfterTypingToPosition):
2197         (WebCore::Editor::markMisspellings):
2198         * page/Frame.cpp:
2199         (WebCore::Frame::respondToChangedSelection):
2200
2201 2007-04-29  Antti Koivisto  <antti@apple.com>
2202
2203         Reviewed by Oliver.
2204
2205         Fix <rdar://problem/5169261>
2206         REGRESSION: Google Maps zooming too sensitive when using two fingers on trackpad
2207         
2208         Use line based delta values when generating DOM wheel events, use pixel deltas
2209         for scrolling only.
2210         
2211         No test case, requires user interaction and specific hardware.
2212
2213         * page/EventHandler.cpp:
2214         (WebCore::EventHandler::handleWheelEvent):
2215         * platform/PlatformWheelEvent.h:
2216         (WebCore::PlatformWheelEvent::continuousDeltaX):
2217         (WebCore::PlatformWheelEvent::continuousDeltaY):
2218         * platform/mac/WheelEventMac.mm:
2219         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
2220
2221 2007-04-29  Oliver Hunt  <oliver@apple.com>
2222
2223         Reviewed by Brady.
2224
2225         Build fix for experimental features build
2226
2227         * rendering/RenderForeignObject.cpp:
2228
2229 2007-04-29  Mitz Pettel  <mitz@webkit.org>
2230
2231         Reviewed by Dave Hyatt.
2232
2233         - fix http://bugs.webkit.org/show_bug.cgi?id=13544
2234           REGRESSION (r21120): Member profile frame not erased at Yahoo! Answers
2235
2236         Test: fast/repaint/layer-hide-when-needs-layout.html
2237
2238         * rendering/RenderObject.cpp:
2239         (WebCore::RenderObject::setStyle): If we get a layout hint, we count on
2240         layout() or updateLayerPositions() to repaint. In the case of a layer
2241         going invisible, however, we need to repaint here since neither of the
2242         above will do it.
2243
2244 2007-04-29  Oliver Hunt  <oliver@apple.com>
2245
2246         Reviewed by Steve.
2247
2248         Fix for <rdar://problem/5126393> REGRESSION (r19672-19697): Safari drag image drags at original size (13261)
2249
2250         Added logic to ensure that when we create the drag image
2251         we're looking at the rendered image size.
2252
2253         * page/DragController.cpp:
2254         (WebCore::DragController::doImageDrag):
2255           Pass the rendered image size to fitDragImageToMaxSize
2256
2257         * platform/DragImage.cpp:
2258         (WebCore::fitDragImageToMaxSize):
2259            Need to do scaling relative to rendered image size
2260
2261         * platform/DragImage.h:
2262            scaleDragImage needs x and y scales to allow for them to be
2263            scaled seperately on a page
2264
2265         * platform/gdk/DragImageGdk.cpp:
2266         (WebCore::scaleDragImage):
2267            Prevent build bustage
2268
2269         * platform/mac/DragImageMac.mm:
2270         (WebCore::scaleDragImage):
2271            scale width and height independently
2272
2273         * platform/qt/DragImageQt.cpp:
2274         (WebCore::scaleDragImage):
2275            Prevent build bustage
2276
2277 2007-04-29  Darin Adler  <darin@apple.com>
2278
2279         Reviewed by Adele.
2280
2281         - fix the Gmail part of http://bugs.webkit.org/show_bug.cgi?id=12798
2282           and <rdar://problem/4118559>
2283
2284         This patch changes things so that resizing can make things larger than their
2285         initial size, but not smaller. I believe this resolves the problem for Gmail,
2286         but you can still get strange behavior if you have a small right-aligned <textarea>.
2287
2288         * rendering/RenderLayer.cpp:
2289         (WebCore::RenderLayer::resize): Rewrote to use more IntPoint and IntSize and add
2290         in a new minimum-size algorithm. This function now has the side effect of storing
2291         a new minimumSizeForResizing in the element being resized, and respects any existing
2292         minimum as well.
2293         (WebCore::RenderLayer::offsetFromResizeCorner): Reversed this so it converts the
2294         point into coordinates relative to the resize corner, hence negative numbers mean
2295         the point is above and to the left. This is used only in the algorithm above.
2296
2297         * dom/Element.h: Removed unneeded include of Attr.h, and added forward declarations
2298         as needed. Removed all friend declarations; there was no need for any of them.
2299         Tweaked formatting of various declarations and removed unneeded parameter names.
2300         Made as much as possible private, and a couple things public to avoid the need for
2301         friend classes. Added minimumSizeForResizing, setMinimumSizeForResizing, rareData,
2302         and createRareData functions.
2303
2304         * dom/Element.cpp:
2305         (WebCore::rareDataMap): Added. Function to return the single global map.
2306         (WebCore::rareDataFromMap): Added. For use by inlined functions to get the
2307         data from the map in the case where it's present.
2308         (WebCore::ElementRareData::ElementRareData): Added.
2309         (WebCore::Element::~Element): Added code to delete the element from the rare
2310         data map when appropriate.
2311         (WebCore::Element::rareData): Added.
2312         (WebCore::Element::createRareData): Added.
2313         (WebCore::Element::setAttributeNodeNS): Got rid of the old inline version of this,
2314         since it was the sole reason we had to include Attr.h in Element.h.
2315         (WebCore::Element::minimumSizeForResizing): Added. Accesses rare data.
2316         (WebCore::Element::setMinimumSizeForResizing): Ditto.
2317
2318         * dom/Node.h: Renamed the m_specified bit since it's now used for two purposes.
2319         Its new long name is m_attrWasSpecifiedOrElementHasRareData.
2320
2321         * dom/Attr.cpp: (WebCore::Attr::Attr): Updated for bit name change.
2322         * dom/Attr.h:
2323         (WebCore::Attr::specified): Ditto.
2324         (WebCore::Attr::setSpecified): Added, since setting the bit directly is pretty ugly now.
2325         * dom/Document.cpp: (WebCore::Document::adoptNode): Updated for bit name change.
2326         * dom/Node.cpp:
2327         (WebCore::Node::Node): Ditto.
2328         (WebCore::Node::dump): Ditto.
2329
2330         * dom/NamedAttrMap.cpp: (WebCore::NamedAttrMap::isReadOnlyNode): Moved out of line,
2331         since this was the sole reason we had to include Element.h in NamedAttrMap.h.
2332
2333         * html/HTMLElement.cpp:
2334         (WebCore::HTMLElement::nodeName): Changed to use tagQName() since that's a public
2335         way to do something that's now private.
2336         (WebCore::HTMLElement::cloneNode): Ditto.
2337
2338         * dom/Attribute.cpp:
2339         * dom/NamedAttrMap.h:
2340         * dom/NamedMappedAttrMap.cpp:
2341         * dom/StyledElement.h:
2342         * html/HTMLTokenizer.h:
2343         * xml/XPathFunctions.cpp:
2344         * xml/XPathStep.cpp:
2345         Updated includes, and other administrivia.
2346
2347 2007-04-29  Mitz Pettel  <mitz@webkit.org>
2348
2349         Reviewed by Darin and Hyatt.
2350
2351         - http://bugs.webkit.org/show_bug.cgi?id=13487
2352           Implement O(1) absoluteClippedOverflowRect and absoluteOutlineBox during layout for a possible speed gain
2353
2354         Test for a bug fixed by this patch: fast/repaint/intermediate-layout-position-clip.html
2355
2356         By keeping track of the total translation and clip during layout, absolutePosition and
2357         computeAbsoluteRepaintRect become O(1).
2358
2359         * WebCore.pro: Added LayoutState.cpp
2360         * WebCore.vcproj/WebCore/WebCore.vcproj: Added LayoutState.{cpp,h}
2361         * WebCore.xcodeproj/project.pbxproj: Added LayoutState.{cpp,h}
2362         * WebCoreSources.bkl: Added LayoutState.cpp
2363         * page/FrameView.cpp:
2364         (WebCore::FrameView::layout): When doing subtree layout, push an initial layout state for the
2365         layout root.
2366         * rendering/LayoutState.cpp: Added. A LayoutState corresponding to a box consists of the origin of
2367         its coordinate system in view coordinates and possibly the clip rect, in view coordinates, which
2368         applies to its children.
2369         (WebCore::LayoutState::LayoutState):
2370         (WebCore::LayoutState::destroy):
2371         (WebCore::throw):
2372         (WebCore::LayoutState::operator delete):
2373         * rendering/LayoutState.h: Added.
2374         (WebCore::LayoutState::LayoutState):
2375         * rendering/RenderBlock.cpp:
2376         (WebCore::RenderBlock::layoutBlock): Factored out the "only positioned objects" case into
2377         layoutOnlyPositionedObjects(). Added code to push/pop LayoutState, unless we have columns, in
2378         which case we disable/enable LayoutState. Removed the translation by the layout delta
2379         of the old absolute rects, since that is now integral to absoluteClippedOverflowRect() and
2380         absoluteOutlineBox().
2381         (WebCore::RenderBlock::layoutOnlyPositionedObjects): Added this helper function that checks for
2382         and handles the case where only positioned objects need layout. Returns true in that case.
2383         (WebCore::RenderBlock::repaintOverhangingFloats): Disabled LayoutState when repainting floats, since
2384         they may belong to other containers.
2385         (WebCore::RenderBlock::updateFirstLetter): Disabled LayoutState when adding and removing from the
2386         first letter container, since it may be different than ourselves.
2387         * rendering/RenderBlock.h:
2388         * rendering/RenderBox.cpp:
2389         (WebCore::RenderBox::setStyle): Minor cleanup: changed element()->document() to the equivalent document().
2390         (WebCore::RenderBox::offsetForPositionedInContainer): Added. Factored out common code from
2391         absolutePosition, computeAbsoluteRepaintRect and RenderLayer::updateLayerPosition into this function.
2392         (WebCore::RenderBox::absolutePosition): Added an O(1) code path when this function is called during
2393         layout (and LayoutState has not been disabled). Factored out some code into
2394         offsetForPositionedInContainer.
2395         (WebCore::RenderBox::absoluteClippedOverflowRect): Added the layout delta here, so callers don't need
2396         to.
2397         (WebCore::RenderBox::computeAbsoluteRepaintRect): Added an O(1) code path when this function is called
2398         during layout (and LayoutState has not been disabled). Factored out some code into
2399         offsetForPositionedInContainer.
2400         * rendering/RenderContainer.cpp:
2401         (WebCore::RenderContainer::layout): Added LayoutState push/pop.
2402         * rendering/RenderFlexibleBox.cpp:
2403         (WebCore::RenderFlexibleBox::layoutBlock): Factored out the "only positioned objects" case into
2404         layoutOnlyPositionedObjects(). Added LayoutState push/pop. Removed the translation by the layout delta
2405         of the old absolute rects, since that is now integral to absoluteClippedOverflowRect() and
2406         absoluteOutlineBox().
2407         * rendering/RenderFlow.cpp:
2408         (WebCore::RenderFlow::absoluteClippedOverflowRect): Added an ASSERT.
2409         * rendering/RenderForeignObject.cpp:
2410         (WebCore::RenderForeignObject::layout): Disabled LayoutState because it is incompatible with arbitrary
2411         affine transforms.
2412         * rendering/RenderHTMLCanvas.cpp:
2413         (WebCore::RenderHTMLCanvas::layout): Removed the translation by the layout delta of the old absolute
2414         rects, since that is now integral to absoluteClippedOverflowRect() and absoluteOutlineBox().
2415         * rendering/RenderImage.cpp:
2416         (WebCore::RenderImage::layout): Ditto.
2417         * rendering/RenderLayer.cpp:
2418         (WebCore::RenderLayer::updateLayerPositions): Added ASSERTs. Factored out some code into
2419         RenderBox::offsetForPositionedInContainer.
2420         (WebCore::RenderLayer::updateScrollInfoAfterLayout): Disabled LayoutState around the call to
2421         scrollToOffset.
2422         * rendering/RenderListItem.cpp:
2423         (WebCore::RenderListItem::updateMarkerLocation): Disabled LayoutState when moving the list marker, since
2424         it can trigger repainting in other containers.
2425         * rendering/RenderObject.cpp:
2426         (WebCore::RenderObject::isRoot): Minor cleanup: changed element()->document() to the equivalent
2427         document().
2428         (WebCore::RenderObject::computeAbsoluteRepaintRect): Removed 'return' at the end of the function.
2429         (WebCore::RenderObject::container): Reordered to avoid calling isText() twice.
2430         (WebCore::RenderObject::absoluteOutlineBox): Added the layout delta here, so callers don't need to.
2431         * rendering/RenderSVGContainer.cpp:
2432         (WebCore::RenderSVGContainer::layout): Disabled LayoutState because it is incompatible with arbitrary
2433         affine transforms.
2434         * rendering/RenderTable.cpp:
2435         (WebCore::RenderTable::layout):  Factored out the "only positioned objects" case into
2436         layoutOnlyPositionedObjects(). Added LayoutState push/pop. Removed the translation by the layout delta
2437         of the old absolute rects, since that is now integral to absoluteClippedOverflowRect() and
2438         absoluteOutlineBox().
2439         * rendering/RenderTableCell.cpp:
2440         (WebCore::RenderTableCell::absoluteClippedOverflowRect): Added the layout delta here, so callers
2441         don't need to.
2442         (WebCore::RenderTableCell::computeAbsoluteRepaintRect): For the O(1) code path, skipped the correction
2443         for the parent row, because RenderTableRow doesn't push a translation into LayoutState.
2444         (WebCore::RenderTableCell::absolutePosition): Ditto.
2445         * rendering/RenderTableRow.cpp:
2446         (WebCore::RenderTableRow::layout): Added LayoutState push/pop.
2447         * rendering/RenderTableSection.cpp:
2448         (WebCore::RenderTableSection::setCellWidths): Added LayoutState push/pop if cells are repainted or
2449         receive layout.
2450         (WebCore::RenderTableSection::calcRowHeight): Ditto.
2451         (WebCore::RenderTableSection::layoutRows): Added LayoutState push/pop.
2452         * rendering/RenderView.cpp:
2453         (WebCore::RenderView::RenderView):
2454         (WebCore::RenderView::layout): Added initial LayoutState setup for the layout.
2455         (WebCore::RenderView::paintBoxDecorations): Minor cleanup: changed element()->document() to the
2456         equivalent document().
2457         (WebCore::RenderView::repaintViewRectangle): Ditto.
2458         (WebCore::RenderView::pushLayoutState): Added. Pushes initial layout state for subtree layout.
2459         * rendering/RenderView.h:
2460         (WebCore::RenderView::pushLayoutState):
2461         (WebCore::RenderView::popLayoutState):
2462         (WebCore::RenderView::layoutState):
2463         (WebCore::RenderView::disableLayoutState):
2464         (WebCore::RenderView::enableLayoutState):
2465
2466 2007-04-29  David Hyatt  <hyatt@apple.com>
2467
2468         Fix for bugzilla 13535, regression from positioning cleanup a while
2469         back.  Some code got added to compute available width for a relpositioned
2470         inline, only the code meant to be used for inline flows and not inline blocks.
2471
2472         Reviewed by mjs
2473
2474         fast/block/positioning/inline-block-relposition.html
2475
2476         * rendering/RenderBox.cpp:
2477         (WebCore::RenderBox::containingBlockWidthForPositioned):
2478
2479 2007-04-29  Oliver Hunt  <oliver@apple.com>
2480
2481         Reviewed by Zack.
2482
2483         Implement basic drag and drop support for qt
2484         this allows content and link dragging but does not
2485         provide the DOM data access methods.
2486
2487         * platform/DragData.h:
2488         * platform/qt/ClipboardQt.cpp:
2489         (WebCore::ClipboardQt::ClipboardQt):
2490         (WebCore::ClipboardQt::~ClipboardQt):
2491         (WebCore::ClipboardQt::clearData):
2492         (WebCore::ClipboardQt::clearAllData):
2493         (WebCore::ClipboardQt::setData):
2494         (WebCore::ClipboardQt::declareAndWriteDragImage):
2495         (WebCore::ClipboardQt::writeURL):
2496         (WebCore::ClipboardQt::writeRange):
2497         (WebCore::ClipboardQt::hasData):
2498         * platform/qt/ClipboardQt.h:
2499         (WebCore::ClipboardQt::clipboardData):
2500         (WebCore::ClipboardQt::invalidateWritableData):
2501         * platform/qt/DragDataQt.cpp:
2502         (WebCore::DragData::canSmartReplace):
2503         (WebCore::DragData::containsPlainText):
2504         (WebCore::DragData::asPlainText):
2505         (WebCore::DragData::createClipboard):
2506         (WebCore::DragData::containsCompatibleContent):
2507         (WebCore::DragData::containsURL):
2508         (WebCore::DragData::asURL):
2509         (WebCore::DragData::asFragment):
2510
2511 2007-04-28  Maciej Stachowiak  <mjs@apple.com>
2512
2513         Reviewed by Darin and Oliver.
2514
2515         - change Document to hold onto Frame* instead of FrameView*
2516         
2517         This is an architectural cleanup and a prerequisite to fixing citibank login
2518         in an architecturally sound way.
2519
2520         Some fixups for the page cache:
2521         
2522         * history/CachedPage.cpp:
2523         (WebCore::CachedPage::restore): Add an assert that the document's view
2524         matches the cached page's view - this needs to be true by the time this
2525         function is called.
2526         (WebCore::CachedPage::clear): Change assert to require frame matching, not
2527         view matching.
2528         * history/CachedPage.h:
2529         (WebCore::CachedPage::view): Add a way to get the view out.
2530         * loader/FrameLoader.cpp:
2531         (WebCore::FrameLoader::begin): pass Frame, not FrameView, when creating document
2532         (WebCore::FrameLoader::open): restore view based on CachedPage, not Document. 
2533
2534         Remaining changes are just straightforward updates based on which
2535         pointer is held or passed:
2536         
2537         * dom/DOMImplementation.cpp:
2538         (WebCore::DOMImplementation::createDocument):
2539         (WebCore::DOMImplementation::createHTMLDocument):
2540         * dom/DOMImplementation.h:
2541         * dom/Document.cpp:
2542         (WebCore::Document::Document):
2543         (WebCore::Document::view):
2544         (WebCore::Document::frame):
2545         (WebCore::Document::recalcStyle):
2546         (WebCore::Document::updateLayout):
2547         (WebCore::Document::attach):
2548         (WebCore::Document::detach):
2549         (WebCore::Document::createTokenizer):
2550         (WebCore::Document::recalcStyleSelector):
2551         (WebCore::Document::setInPageCache):
2552         (WebCore::Document::applyXSLTransform):
2553         * dom/Document.h:
2554         * html/HTMLDocument.cpp:
2555         (WebCore::HTMLDocument::HTMLDocument):
2556         * html/HTMLDocument.h:
2557         * html/HTMLViewSourceDocument.cpp:
2558         (WebCore::HTMLViewSourceDocument::HTMLViewSourceDocument):
2559         * html/HTMLViewSourceDocument.h:
2560         * ksvg2/svg/SVGDocument.cpp:
2561         (WebCore::SVGDocument::SVGDocument):
2562         * ksvg2/svg/SVGDocument.h:
2563         * loader/ImageDocument.cpp:
2564         (WebCore::ImageDocument::ImageDocument):
2565         * loader/ImageDocument.h:
2566         * loader/PluginDocument.cpp:
2567         (WebCore::PluginDocument::PluginDocument):
2568         * loader/PluginDocument.h:
2569         * loader/TextDocument.cpp:
2570         (WebCore::TextDocument::TextDocument):
2571         * loader/TextDocument.h:
2572         * xml/XSLTProcessor.cpp:
2573         (WebCore::XSLTProcessor::createDocumentFromSource):
2574         (WebCore::XSLTProcessor::transformToDocument):
2575         * xml/XSLTProcessor.h:
2576
2577 2007-04-28  Adele Peterson  <adele@apple.com>
2578
2579         RS by Darin.
2580
2581         Update to fix for <rdar://problem/5152299>
2582
2583         Test: fast/events/no-blur-on-enter-button.html
2584
2585         * html/HTMLButtonElement.cpp: (WebCore::HTMLButtonElement::defaultEventHandler):
2586         Don't blur the button when handling the enter key.  This matches our new behavior for input elements.
2587
2588 2007-04-28  Adele Peterson  <adele@apple.com>
2589
2590         Fix by Darin, reviewed by me.
2591
2592         Fix for <rdar://problem/5152299> REGRESSION: <button> elements do not respond to space and return key as similar <input> elements do
2593
2594         Tests:
2595         fast/forms/button-spacebar-click.html
2596         fast/forms/button-enter-click.html
2597
2598         * html/HTMLButtonElement.h: (WebCore::HTMLButtonElement::): Made type enum private.
2599         Removed unnecessary m_value and m_currValue, and unused m_dirty.
2600         * html/HTMLButtonElement.cpp:
2601         (WebCore::HTMLButtonElement::HTMLButtonElement): Removed initialization of m_dirty.
2602         (WebCore::HTMLButtonElement::parseMappedAttribute): Removed case to parse value and accesskey attributes, which don't do anything.
2603         (WebCore::HTMLButtonElement::defaultEventHandler): Removed unnecessary check for button type.
2604          Added cases to handle spacebar and enter keys in the same way that they're handled for <input type=button/reset/submit> buttons.
2605         (WebCore::HTMLButtonElement::isSuccessfulSubmitButton): Shortened comment.
2606         (WebCore::HTMLButtonElement::appendFormData): Use value() instead of m_currValue.  Renamed encoding argument to formData.
2607
2608 2007-04-28  Mitz Pettel  <mitz@webkit.org>
2609
2610         Reviewed by Darin.
2611
2612         - fix http://bugs.webkit.org/show_bug.cgi?id=13501
2613           REGRESSION (r21093): Pasting into text field fails and makes the caret disappear
2614
2615         Test: fast/dynamic/anonymous-block-layer-lost.html
2616
2617         * rendering/RenderBlock.cpp:
2618         (WebCore::RenderBlock::removeChild): Avoid cutting off layers when removing
2619         the anonymous block.
2620
2621 2007-04-28  Mitz Pettel  <mitz@webkit.org>
2622
2623         Reviewed by Darin.
2624
2625         - fix http://bugs.webkit.org/show_bug.cgi?id=13471
2626           REGRESSION (r21045): Secure keyboard entry mode remains in effect after leaving a password field by submitting
2627
2628         * loader/FrameLoader.cpp:
2629         (WebCore::FrameLoader::clear): Replaced direct access to Frame's d->m_doc
2630         with a call to Frame::setDocument.
2631         (WebCore::FrameLoader::begin): Ditto.
2632         (WebCore::FrameLoader::open): Ditto.
2633         (WebCore::FrameLoader::switchOutLowBandwidthDisplayIfReady): Ditto.
2634         (WebCore::FrameLoader::canCachePage): Added a comment.
2635         * manual-tests/secure-keyboard-enabled-after-submit.html: Added.
2636         * page/Frame.cpp:
2637         (WebCore::Frame::setDocument): Reset secure keyboard entry, in case the
2638         old document's focused node has set it.
2639
2640 2007-04-28  Mitz Pettel  <mitz@webkit.org>
2641
2642         Reviewed by Adele.
2643
2644         - fix http://bugs.webkit.org/show_bug.cgi?id=13379
2645           REGRESSION: Cannot add an option to a selected popup
2646
2647         * manual-tests/update-empty-popup.html: Added.
2648         * platform/mac/PopupMenuMac.mm:
2649         (WebCore::PopupMenu::show): Added a call to the client's hidePopup()
2650         callback before returning in the case that the menu is empty. Otherwise
2651         the client thinks that the menu stayed open.
2652
2653 2007-04-28  Adele Peterson  <adele@apple.com>
2654
2655         Reviewed by Darin.
2656
2657         Fix for <rdar://problem/4806988> REGRESSION: history.go(0) doesn't reload page (affects buttons at facebook.com)
2658
2659         Test: fast/history/history_reload.html
2660
2661         * loader/FrameLoader.cpp: (WebCore::FrameLoader::scheduleHistoryNavigation):
2662         We avoid doing a redirection when going to the same url in a history navigation, but we have to still
2663         schedule a redirection when the number of steps is zero so we can force a reload.
2664
2665 2007-04-28  Alexey Proskuryakov  <ap@webkit.org>
2666
2667         Reviewed by Darin.
2668
2669         http://bugs.webkit.org/show_bug.cgi?id=13514
2670         REGRESSION (r20997-21003): Crash in WebCore::Node::document
2671
2672         Test: fast/dom/NodeList/childNodes-reset-cache.html
2673
2674         * dom/Node.cpp:
2675         (WebCore::Node::notifyLocalNodeListsChildrenChanged): Reset the common caches for child node
2676         lists. We cannot rely on notifications, since there may be no list objects left around.
2677
2678         * dom/ChildNodeList.cpp:
2679         (WebCore::ChildNodeList::rootNodeChildrenChanged):
2680         * dom/ChildNodeList.h:
2681         Override rootNodeChildrenChanged() with an empty implementation, now that caches are reset
2682         in Node::notifyLocalNodeListsChildrenChanged().
2683
2684 2007-04-28  Mark Rowe  <mrowe@apple.com>
2685
2686         Build fix.  Change use of nil to 0 in C++ source file.
2687
2688         * editing/Editor.cpp:
2689         (WebCore::Editor::increaseSelectionListLevel):
2690         (WebCore::Editor::increaseSelectionListLevelOrdered):
2691         (WebCore::Editor::increaseSelectionListLevelUnordered):
2692
2693 2007-04-28  Darin Adler  <darin@apple.com>
2694
2695         Reviewed by Adele.
2696
2697         - fix http://bugs.webkit.org/show_bug.cgi?id=6216
2698           REGRESSION: getElementsByTagNameNS with empty namespace doesn't work
2699
2700         * dom/Node.cpp:
2701         (WebCore::TagNodeList::TagNodeList): Changed parameter to PassRefPtr, tweaked formatting.
2702         (WebCore::TagNodeList::item): Tweaked formatting.
2703         (WebCore::TagNodeList::nodeMatches): Tweaked formatting.
2704         (WebCore::Node::setPrefix): Tweaked formatting.
2705         (WebCore::Node::getElementsByTagNameNS): Added special case to turn empty namespaces into
2706         null namespaces.
2707
2708 2007-04-28  Darin Adler  <darin@apple.com>
2709
2710         Reviewed by Kevin Decker.
2711
2712         - fix <rdar://problem/5148271> Chinese numbers are incorrect in numbered lists
2713           (including pasting from TextEdit to Mail)
2714
2715         Covered by an existing regression test, which had wrong results checked in.
2716
2717         Hyatt told me not to use the algorithm in the CSS 3 specification, but I didn't listen!
2718         This corrects mistakes there and makes our results match current Firefox.
2719
2720         * rendering/RenderListMarker.cpp:
2721         (WebCore::toCJKIdeographic): Added code to strip off trailing zero digits.
2722         Added special case for zero, since that's the one case where we don't want
2723         to strip off trailing zero digits. Fixed mixed-up logic that would put the
2724         digits in each group backwards.
2725         (WebCore::listMarkerText): Corrected character values for the CJK_IDEOGRAPHIC case.
2726
2727 2007-04-28  Darin Adler  <darin@apple.com>
2728
2729         Reviewed by Oliver.
2730
2731         - fix <rdar://problem/5138250> REGRESSION (r18245): Changing any one aspect
2732           of a font applies all the aspects to selected text
2733
2734         Since this bug is only visible with the font panel, I don't
2735         think there's any way to make a DumpRenderTree-driven test.
2736
2737         * editing/Editor.cpp: (WebCore::Editor::fontForSelection):
2738         Set hasMultipleFonts properly. The old code had an early exit
2739         that was left over from when hasMultipleFonts was a pointer.
2740
2741 2007-04-27  Mitz Pettel  <mitz@webkit.org>
2742
2743         Reviewed by Dave Hyatt.
2744
2745         - fix http://bugs.webkit.org/show_bug.cgi?id=13525
2746           Repainting a listbox schedules a relayout
2747
2748         No test possible as there is no change to functionality.
2749
2750         - fix the root cause of http://bugs.webkit.org/show_bug.cgi?id=10862
2751           REGRESSION: Collapsing form input on www.myspace.com
2752
2753         No test possible since text fields are no longer implemented as flexboxes.
2754
2755         * rendering/RenderObject.cpp:
2756         (WebCore::RenderObject::scheduleRelayout): Added a check that the subtree
2757         root is in the tree and not free-floating.
2758         * rendering/bidi.cpp:
2759         (WebCore::RenderBlock::bidiReorderCharacters): Changed addChild and removeChild
2760         to appendChildNode and removeChildNode to save some unnecessary overhead.
2761         These calls still mark the tree for relayout, but the change in scheduleRelayout 
2762         ensures that a layout won't be scheduled.
2763
2764 2007-04-27  Patti Hoa  <patti@apple.com>
2765
2766         Reviewed by Darin.
2767         
2768         <rdar://problem/5153017> REPRODUCIBLE ASSERT: range != nil in WebViewFactory.mm:415 -[WebViewFactory startOfTextMarkerRange:] (13354)
2769         
2770         * bridge/mac/WebCoreAXObject.mm:
2771         (-[WebCoreAXObject textMarkerRangeForRange:]):
2772         Fix the range length check.  It was incorrectly assuming that the max range requested cannot be equal
2773         to the length of the string.  Since NSRange location is index based, it's perfectly valid to have the max
2774         range equal to the the text length.
2775
2776 2007-04-27  David Harrison  <harrison@apple.com>
2777
2778         Reviewed by Darin.
2779
2780         <rdar://problem/5160627> Export JS list creation support as ObjC SPI for Mail
2781
2782         * WebCore.exp:
2783         * editing/Editor.h:
2784         * editing/Editor.cpp:
2785         (WebCore::Editor::insertOrderedList):
2786         (WebCore::Editor::insertUnorderedList):
2787         (WebCore::Editor::canIncreaseSelectionListLevel):
2788         (WebCore::Editor::canDecreaseSelectionListLevel):
2789         (WebCore::Editor::increaseSelectionListLevel):
2790         (WebCore::Editor::increaseSelectionListLevelOrdered):
2791         (WebCore::Editor::increaseSelectionListLevelUnordered):
2792         (WebCore::Editor::decreaseSelectionListLevel):
2793         Add insertOrderedList() and insertUnorderedList().
2794         Move existing list management functions from WebCoreFrameBridge.
2795         The level increasing functions now return a PassRefPtr<Node> instead of Node.
2796         Add check for canEditRichly.
2797         
2798         - in many other functions, condense the check for nil client().
2799         
2800         * editing/InsertListCommand.h:
2801         * editing/InsertListCommand.cpp:
2802         (WebCore::InsertListCommand::insertList):
2803         (WebCore::InsertListCommand::fixOrphanedListChild):
2804         (WebCore::InsertListCommand::doApply):
2805         Add insertList(), which returns the new list element.
2806         Don't set the list element's ID if the specified ID was an empty string.
2807                 
2808         * editing/ModifySelectionListLevel.h:
2809         * editing/ModifySelectionListLevel.cpp:
2810         (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevelWithType):
2811         (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevel):
2812         (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevelOrdered):
2813         (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevelUnordered):
2814         Return PassRefPtr<Node> instead of Node.
2815
2816         * page/mac/WebCoreFrameBridge.h:
2817         * page/mac/WebCoreFrameBridge.mm:
2818         Move list management functions to Editor.h and Editor.cpp.
2819
2820
2821 2007-04-27  David Hyatt  <hyatt@apple.com>
2822
2823         Fix for <rdar://problem/5134254>, toolbar buttons don't work in gmail after double-click.  Make sure
2824         to clear out the capturing frame, since you don't get a second up when a double-click happens.
2825
2826         Reviewed by mjs
2827
2828         * page/EventHandler.cpp:
2829         (WebCore::EventHandler::handleMouseDoubleClickEvent):
2830
2831 2007-04-27  Justin Garcia  <justin.garcia@apple.com>
2832
2833         Reviewed by oliver
2834
2835         <rdar://problem/5164796> 
2836         Enable execCommand("CreateLink", ...) for caret selections
2837
2838         * editing/CreateLinkCommand.cpp:
2839         (WebCore::CreateLinkCommand::doApply): For a caret
2840         selection, insert a link at the caret position
2841         with the url as the link text.
2842         * editing/JSEditor.cpp: Enable CreateLink for caret 
2843         selections.
2844
2845 2007-04-27  Antti Koivisto  <antti@apple.com>
2846
2847         Reviewed by Darin, Hyatt.
2848         
2849         Fix http://bugs.webkit.org/show_bug.cgi?id=13081
2850         Empty table cells not handled correctly
2851         <rdar://problem/5067926>
2852         
2853         To match Firefox and IE, empty table cells with variable width need to be
2854         treated as special case. They generally get zero width.
2855
2856         * rendering/AutoTableLayout.cpp:
2857         (WebCore::AutoTableLayout::recalcColumn):
2858         (WebCore::AutoTableLayout::calcEffectiveWidth):
2859         (WebCore::AutoTableLayout::layout):
2860         * rendering/AutoTableLayout.h:
2861         (WebCore::AutoTableLayout::Layout::Layout):
2862         * rendering/RenderStyle.h:
2863         (WebCore::RenderStyle::hasPadding):
2864
2865 2007-04-27  Rob Buis  <buis@kde.org>
2866
2867         Reviewed by Oliver.
2868
2869         http://bugs.webkit.org/show_bug.cgi?id=13052
2870         Text not rendered in a second inline SVG element
2871
2872         Correct the rendering of svg text when embedded in non-svg container.
2873
2874         * rendering/RenderSVGText.cpp:
2875         (WebCore::RenderSVGText::paint):
2876
2877 2007-04-27  Mark Rowe  <mrowe@apple.com>
2878
2879         Reviewed by Maciej.
2880
2881         * WebCore.pro: Remove non-existent paths from qmake files.
2882
2883 2007-04-25  Lars Naesbye Christensen <lars@naesbye.dk>
2884
2885         Reviewed by Timothy Hatcher.
2886
2887         http://bugs.webkit.org/show_bug.cgi?id=13477
2888         Bug 13477: Help and context menu cursors need dropshadows.
2889
2890         * Resources/cellCursor.png:
2891         * Resources/contextMenuCursor.png:
2892         * Resources/helpCursor.png:
2893         * platform/mac/CursorMac.mm:
2894         (WebCore::contextMenuCursor):
2895         (WebCore::copyCursor):
2896         (WebCore::progressCursor):
2897         (WebCore::noDropCursor):
2898
2899 2007-04-27  Holger Freyther <freyther@kde.org>
2900
2901         Reviewed by Maciej.
2902
2903         Remove unmaintained CMake build system.
2904
2905         * CMakeLists.txt: Removed.
2906
2907 2007-04-26  Matt Perry  <mpComplete@gmail.com>
2908
2909         Reviewed by Maciej.
2910
2911         Added a version check to hackAroundLibXMLEntityBug, since that bug has
2912         been fixed in recent versions of libxml2.
2913
2914         * dom/XMLTokenizer.cpp:
2915         (WebCore::hackAroundLibXMLEntityBug):
2916
2917 2007-04-26  Christopher Brichford  <chrisb@adobe.com>
2918
2919         Reviewed by Timothy Hatcher.
2920
2921         - Fix for Bug 13204: Submit initial version of mac project files for apollo
2922           port of WebCore
2923           http://bugs.webkit.org/show_bug.cgi?id=13204
2924
2925         * WebCore.apolloproj/mac/WebCore.Debug.xcconfig: Added.
2926         * WebCore.apolloproj/mac/WebCore.Release.xcconfig: Added.
2927         * WebCore.apolloproj/mac/WebCore.xcconfig: Added.
2928         * WebCore.apolloproj/mac/WebCore.xcodeproj/project.pbxproj: Added.
2929
2930 2007-04-26  Alp Toker  <alp@atoker.com>
2931
2932         Reviewed by Maciej.
2933
2934         http://bugs.webkit.org/show_bug.cgi?id=13505
2935         Cast loses precision on x86_64
2936
2937         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2938         (WebCore::GraphicsContext::beginTransparencyLayer):
2939         (WebCore::GraphicsContext::endTransparencyLayer):
2940         Use a stack of opacity values instead of Cairo user data.
2941
2942 2007-04-26  Mitz Pettel  <mitz@webkit.org>
2943
2944         Reviewed by Darin.
2945
2946         - fix http://bugs.webkit.org/show_bug.cgi?id=13500
2947           REGRESSION: Listbox scrollbar does not reflect actual scrolled position when selected option is added after layout
2948
2949         Test: fast/forms/listbox-scrollbar-incremental-load.html
2950
2951         The scroller position was not updated correctly during insertion, since
2952         scrollbar proportions are updated only during layout
2953
2954         * rendering/RenderListBox.cpp:
2955         (WebCore::RenderListBox::selectionChanged): Delay scrolling to reveal the
2956         selection until after layout if m_optionsChanged is set. Layout is
2957         guaranteed to happen soon when the flag is set.
2958
2959 2007-04-26  David Hyatt  <hyatt@apple.com>
2960
2961         Fix for 13511, crash on a counters page.  Make sure that RenderTexts
2962         never get a null StringImpl.  I would have added an assert that the length
2963         had to be nonzero also, but unfortunately editing creates empty RenderTexts
2964         because of its EditingText DOM subclass that always forces renderers to be
2965         made.  I suppose there is a good reason for this...
2966
2967         Reviewed by aroben
2968
2969         * dom/CharacterData.cpp:
2970         (WebCore::CharacterData::setData):
2971         (WebCore::CharacterData::appendData):
2972         (WebCore::CharacterData::insertData):
2973         (WebCore::CharacterData::deleteData):
2974         (WebCore::CharacterData::replaceData):
2975         * rendering/RenderCounter.cpp:
2976         (WebCore::RenderCounter::RenderCounter):
2977         * rendering/RenderText.cpp:
2978         (WebCore::RenderText::RenderText):
2979         (WebCore::RenderText::trimmedPrefWidths):
2980         (WebCore::RenderText::setTextWithOffset):
2981         (WebCore::RenderText::setTextInternal):
2982         (WebCore::RenderText::setText):
2983
2984 2007-04-26  Alice Liu  <alice.liu@apple.com>
2985
2986         Reviewed by Oliver.
2987
2988         * editing/SelectionController.cpp:
2989         (WebCore::SelectionController::selectAll):
2990         adding null check
2991
2992 2007-04-26  Justin Garcia  <justin.garcia@apple.com>
2993
2994         Reviewed by oliver
2995
2996         <rdar://problem/5120591> 
2997         Crash when creating a link in Leopard wiki server
2998
2999         * editing/CreateLinkCommand.cpp:
3000         (WebCore::CreateLinkCommand::doApply): Use a RefPtr,
3001         setting the anchor's href can destroy it if there is
3002         an ancestor with a subtree modified event listener.
3003
3004 2007-04-26  Mitz Pettel  <mitz@webkit.org>
3005
3006         Reviewed by hyatt
3007
3008         - http://bugs.webkit.org/show_bug.cgi?id=13496
3009           Eliminate repaintObjectsBeforeLayout
3010
3011         No tests added since there is no change to functionality. Several
3012         tests in fast/repaint test repainting of objects that move during layout.
3013
3014         * page/FrameView.cpp:
3015         (WebCore::FrameView::layout):
3016         * rendering/RenderBlock.cpp:
3017         (WebCore::RenderBlock::layoutBlockChildren): Removed an early
3018         setNeedsLayout(false). Resetting the bit here prevents the full repaint
3019         that we rely on when we decide not to repaint children that move.
3020         * rendering/RenderBlock.h:
3021         * rendering/RenderObject.cpp:
3022         * rendering/RenderObject.h:
3023         * rendering/RenderTableSection.cpp:
3024         (WebCore::RenderTableSection::setCellWidths): Replaced the call to
3025         repaintObjectsBeforeLayout() if the cell didn't need layout with
3026         an unconditional repaint(). We don't bother with repainting only the
3027         delta between the old and new widths, since by marking the cell for
3028         layout results in a full repaint with the new width anyway.
3029
3030 2007-04-26  David Hyatt  <hyatt@apple.com>
3031
3032         Fix for 13509.  Don't recur to parent inline flows if they have been
3033         marked as needing layout themselves.
3034
3035         Reviewed by adele
3036
3037         * rendering/RenderFlow.cpp:
3038         (WebCore::RenderFlow::dirtyLinesFromChangedChild):
3039
3040 2007-04-26  Matt Perry  <mpComplete@gmail.com>
3041
3042         Reviewed and landed by Alexey.
3043
3044         http://bugs.webkit.org/show_bug.cgi?id=13495
3045         Crash when referencing an undefined entity in an XHTML document
3046
3047         Test: fast/parser/badentity.xhtml
3048
3049         * dom/XMLTokenizer.cpp:
3050         (WebCore::getEntityHandler): Check for a NULL returned from getXHTMLEntity
3051
3052 2007-04-26  Anders Carlsson  <andersca@apple.com>
3053
3054         Reviewed by Hyatt.
3055
3056         <rdar://problem/4851944>
3057         REGRESSION: With TOT, BMP images can no longer be opened in the browser window
3058         
3059         On Tiger, the MIME type for the com.microsoft.bmp UTI isn't in the registry, so add it manually.
3060         
3061         * platform/MimeTypeRegistry.cpp:
3062         (WebCore::initialiseSupportedImageMIMETypes):
3063
3064 2007-04-26  David Hyatt  <hyatt@apple.com>
3065
3066         Fix for bug 13503, invalidateContainingBlockPrefWidths is 15% of the
3067         nesting PLT.  Avoid O(n^2) behavior by including inlines in the minmax
3068         dirty chain.
3069
3070         Reviewed by kevin
3071
3072         * rendering/RenderBlock.cpp:
3073         (WebCore::RenderBlock::calcInlinePrefWidths):
3074         * rendering/RenderObject.cpp:
3075         (WebCore::RenderObject::setPrefWidthsDirty):
3076         (WebCore::RenderObject::invalidateContainerPrefWidths):
3077         * rendering/RenderObject.h:
3078
3079 2007-04-26  Anders Carlsson  <andersca@apple.com>
3080
3081         Reviewed by Darin.
3082
3083         <rdar://problem/5067925>
3084         Reproducible crash (infinite recursion) with a layout test that submits on unload (13078)
3085         
3086         Ask the document loader whether it's loading the main resource, since there are cases where the frame 
3087         loader's variable isn't updated correctly.
3088         
3089         In the distant future, the frame loader shouldn't have an instance variable but this is the least intrusive fix for now.
3090         
3091         I couldn't come up with a good test case for this since it requires running three tests in a row and scheduleLoad didn't work. Also,
3092         calling submit in the onunload prevents any new tests from loading!
3093         
3094         * loader/FrameLoader.cpp:
3095         (WebCore::FrameLoader::isLoading):
3096
3097 2007-04-26  Anders Carlsson  <andersca@apple.com>
3098
3099         ... and fix the build.
3100         
3101         * loader/FrameLoader.cpp:
3102         (WebCore::FrameLoader::continueAfterNavigationPolicy):
3103
3104 2007-04-26  Anders Carlsson  <andersca@apple.com>
3105
3106         Revert the previous change - activeDocumentLoader never returns the policy document loader.
3107         Instead, add a null check for the policy document loader.
3108         
3109         * loader/FrameLoader.cpp:
3110         (WebCore::FrameLoader::continueAfterNavigationPolicy):
3111
3112 2007-04-26  Anders Carlsson  <andersca@apple.com>
3113
3114         Use the active document loader instead of the policy document loader.
3115         
3116         * loader/FrameLoader.cpp:
3117         (WebCore::FrameLoader::continueAfterNavigationPolicy):
3118
3119 2007-04-26  Anders Carlsson  <andersca@apple.com>
3120
3121         Reviewed by Maciej.
3122
3123         <rdar://problem/5049099> documents no longer have a default base URL
3124
3125         Don't call canHandleRequest if we have valid substitute data and the protocol is "applewebdata".
3126         
3127         * loader/FrameLoader.cpp:
3128         (WebCore::FrameLoader::continueAfterNavigationPolicy):
3129
3130 2007-04-25  Stephanie Lewis <slewis@apple.com>
3131
3132         Reviewed by Darin.
3133
3134         Fix the build for platforms that overload the abs function.        
3135
3136         * dom/ChildNodeList.cpp:
3137         (WebCore::ChildNodeList::item):
3138
3139 2007-04-25  David Hyatt  <hyatt@apple.com>
3140
3141         Fix for bug 13373, make sure to invalidate the pref widths for objects
3142         with percentage padding.
3143
3144         Reviewed by beth
3145
3146         * rendering/RenderBlock.cpp:
3147         (WebCore::RenderBlock::layoutBlockChildren):
3148         (WebCore::RenderBlock::layoutPositionedObjects):
3149         * rendering/bidi.cpp:
3150         (WebCore::RenderBlock::layoutInlineChildren):
3151
3152 2007-04-25  David Harrison  <harrison@apple.com>
3153
3154         Comment change. Correct the header name in the endif comment.
3155         
3156         * editing/FormatBlockCommand.h:
3157         Change InsertListCommand_h to FormatBlockCommand_h.
3158
3159 2007-04-25  Darin Adler  <darin@apple.com>
3160
3161         Reviewed by Hyatt.
3162
3163         * platform/AtomicString.cpp: (WebCore::AtomicString::add):
3164         Removed unnecessary use of strlen to check if a string is empty.
3165
3166 2007-04-25  Mitz Pettel  <mitz@webkit.org>
3167
3168         Build fix.
3169
3170         * rendering/RenderListMarker.h: Undeleted the m_text member.
3171
3172 2007-04-25  David Hyatt  <hyatt@apple.com>
3173
3174         Rearchitect calcPrefWidths.  The calculation is now done lazily only when minPrefWidth
3175         or maxPrefWidth are asked for.  The result of the calculation is cached.
3176
3177         The new invalidation scheme for pref width invalidation follows the
3178         containing block hierarchy and knows to halt at positioned objects, since
3179         they cannot influence the size of their containers.
3180
3181         Reviewed by darin
3182
3183         * css/cssstyleselector.cpp:
3184         (WebCore::CSSStyleSelector::init):
3185         (WebCore::CSSStyleSelector::initForStyleResolve):
3186         * page/FrameView.cpp:
3187         (WebCore::FrameView::layout):
3188         * rendering/RenderApplet.cpp:
3189         (WebCore::RenderApplet::layout):
3190         * rendering/RenderBlock.cpp:
3191         (WebCore::RenderBlock::makeChildrenNonInline):
3192         (WebCore::RenderBlock::removeChild):
3193         (WebCore::RenderBlock::layout):
3194         (WebCore::RenderBlock::layoutBlock):
3195         (WebCore::RenderBlock::calcPrefWidths):
3196         (WebCore::InlineMinMaxIterator::endOfInline):
3197         (WebCore::shouldGrowTableCellForImage):
3198         (WebCore::RenderBlock::calcInlinePrefWidths):
3199         (WebCore::RenderBlock::calcBlockPrefWidths):
3200         * rendering/RenderBlock.h:
3201         * rendering/RenderBox.cpp:
3202         (WebCore::RenderBox::setStyle):
3203         (WebCore::RenderBox::minPrefWidth):
3204         (WebCore::RenderBox::maxPrefWidth):
3205         (WebCore::RenderBox::calcWidth):
3206         (WebCore::RenderBox::calcWidthUsing):
3207         (WebCore::RenderBox::calcAbsoluteHorizontal):
3208         (WebCore::RenderBox::calcAbsoluteHorizontalValues):
3209         * rendering/RenderBox.h:
3210         * rendering/RenderContainer.cpp:
3211         (WebCore::RenderContainer::removeChildNode):
3212         (WebCore::RenderContainer::appendChildNode):
3213         (WebCore::RenderContainer::insertChildNode):
3214         (WebCore::RenderContainer::layout):
3215         * rendering/RenderContainer.h:
3216         (WebCore::RenderContainer::moveChildNode):
3217         * rendering/RenderCounter.cpp:
3218         (WebCore::RenderCounter::dirtyLineBoxes):
3219         (WebCore::RenderCounter::calcPrefWidths):
3220         * rendering/RenderCounter.h:
3221         * rendering/RenderFileUploadControl.cpp:
3222         (WebCore::RenderFileUploadControl::calcPrefWidths):
3223         * rendering/RenderFlexibleBox.cpp:
3224         (WebCore::RenderFlexibleBox::calcHorizontalPrefWidths):
3225         (WebCore::RenderFlexibleBox::calcVerticalPrefWidths):
3226         (WebCore::RenderFlexibleBox::calcPrefWidths):
3227         (WebCore::RenderFlexibleBox::layoutBlock):
3228         * rendering/RenderForeignObject.cpp:
3229         (WebCore::RenderForeignObject::layout):
3230         * rendering/RenderFrameSet.cpp:
3231         (WebCore::RenderFrameSet::layout):
3232         * rendering/RenderHTMLCanvas.cpp:
3233         (WebCore::RenderHTMLCanvas::layout):
3234         * rendering/RenderImage.cpp:
3235         (WebCore::RenderImage::layout):
3236         * rendering/RenderInline.cpp:
3237         * rendering/RenderInline.h:
3238         * rendering/RenderListBox.cpp:
3239         (WebCore::RenderListBox::updateFromElement):
3240         (WebCore::RenderListBox::calcPrefWidths):
3241         * rendering/RenderListItem.cpp:
3242         (WebCore::firstNonMarkerChild):
3243         (WebCore::RenderListItem::updateMarkerLocation):
3244         (WebCore::RenderListItem::calcPrefWidths):
3245         (WebCore::RenderListItem::layout):
3246         * rendering/RenderListMarker.cpp:
3247         (WebCore::RenderListMarker::layout):
3248         (WebCore::RenderListMarker::calcPrefWidths):
3249         (WebCore::RenderListMarker::updateMargins):
3250         * rendering/RenderListMarker.h:
3251         * rendering/RenderObject.cpp:
3252         (WebCore::RenderObject::RenderObject):
3253         (WebCore::RenderObject::removeChildNode):
3254         (WebCore::RenderObject::moveChildNode):
3255         (WebCore::RenderObject::appendChildNode):
3256         (WebCore::RenderObject::insertChildNode):
3257         (WebCore::RenderObject::setPrefWidthsDirty):
3258         (WebCore::RenderObject::invalidateContainingBlockPrefWidths):
3259         (WebCore::RenderObject::information):
3260         (WebCore::RenderObject::setStyle):
3261         * rendering/RenderObject.h:
3262         (WebCore::RenderObject::layer):
3263         (WebCore::RenderObject::hasLayer):
3264         (WebCore::RenderObject::prefWidthsDirty):
3265         (WebCore::RenderObject::setNeedsLayoutAndPrefWidthsRecalc):
3266         (WebCore::RenderObject::setHasLayer):
3267         * rendering/RenderPartObject.cpp:
3268         (WebCore::RenderPartObject::layout):
3269         * rendering/RenderSVGContainer.cpp:
3270         (WebCore::RenderSVGContainer::layout):
3271         * rendering/RenderSVGContainer.h:
3272         * rendering/RenderSVGHiddenContainer.cpp:
3273         * rendering/RenderSVGHiddenContainer.h:
3274         * rendering/RenderSVGText.cpp:
3275         (WebCore::RenderSVGText::layout):
3276         * rendering/RenderTable.cpp:
3277         (WebCore::RenderTable::calcWidth):
3278         (WebCore::RenderTable::layout):
3279         (WebCore::RenderTable::removeChildNode):
3280         * rendering/RenderTable.h:
3281         * rendering/RenderTableRow.cpp:
3282         (WebCore::RenderTableRow::layout):
3283         * rendering/RenderTableSection.cpp:
3284         (WebCore::RenderTableSection::removeChildNode):
3285         * rendering/RenderTableSection.h:
3286         * rendering/RenderText.cpp:
3287         (WebCore::RenderText::trimmedPrefWidths):
3288         (WebCore::isSpaceAccordingToStyle):
3289         (WebCore::RenderText::minPrefWidth):
3290         (WebCore::RenderText::maxPrefWidth):
3291         (WebCore::RenderText::calcPrefWidths):
3292         (WebCore::RenderText::width):
3293         * rendering/RenderText.h:
3294         * rendering/RenderView.cpp:
3295         (WebCore::RenderView::RenderView):
3296         (WebCore::RenderView::calcPrefWidths):
3297         (WebCore::RenderView::layout):
3298         * rendering/RenderWidget.cpp:
3299         (WebCore::RenderWidget::layout):
3300
3301 2007-04-25  Steve Falkenburg  <sfalken@apple.com>
3302
3303         Reviewed by Adam.
3304
3305         Fix spelling error in spelling method name.
3306         Expose new spelling callback methods to all platforms.
3307
3308         * bridge/EditorClient.h:
3309         * platform/gdk/EditorClientGdk.cpp:
3310         (WebCore::EditorClientGdk::updateSpellingUIWithGrammarString):
3311         * platform/gdk/EditorClientGdk.h:
3312         * platform/graphics/svg/SVGImageEmptyClients.h:
3313         (WebCore::SVGEmptyEditorClient::updateSpellingUIWithGrammarString):
3314         (WebCore::SVGEmptyEditorClient::getGuessesForWord):
3315
3316 2007-04-24  Geoffrey Garen  <ggaren@apple.com>
3317
3318         Reviewed by Darin Adler, Tim Hatcher.
3319
3320         Fixed a few NSAutoreleasePool issues I noticed while reviewing Brady's patch.
3321
3322         * platform/graphics/mac/GraphicsContextMac.mm:
3323         (WebCore::GraphicsContext::setCompositeOperation): Call -drain instead of 
3324         -release, since -release is a no-op in a GC world.
3325
3326 2007-04-25  Alexey Proskuryakov  <ap@webkit.org>
3327
3328         Reviewed by Darin.
3329
3330         http://bugs.webkit.org/show_bug.cgi?id=13445
3331         NodeList access by index is slow
3332
3333         * dom/ChildNodeList.cpp:
3334         (WebCore::ChildNodeList::item): Support iterating backwards from the last accessed node
3335         or from the last child.
3336         * dom/NodeList.h: Make cachedLength unsigned.
3337
3338 2007-04-26  Mark Rowe  <mrowe@apple.com>
3339
3340         Gdk build fix.  Add missing stub.
3341
3342         * platform/gdk/TemporaryLinkStubs.cpp:
3343         (Editor::advanceToNextMisspelling):
3344
3345 2007-04-25  Rob Buis  <buis@kde.org>
3346
3347         Reviewed by Darin.
3348
3349         http://bugs.webkit.org/show_bug.cgi?id=12163
3350         SVG text does not appear in a scrolling <div>
3351
3352         Make sure SVG text is painted when scrolling by taking into account the relative offset of the non-SVG parent in the paintInfo rect.
3353
3354         * rendering/RenderSVGContainer.cpp:
3355         (WebCore::RenderSVGContainer::paint):
3356
3357 2007-04-26  Mark Rowe  <mrowe@apple.com>
3358
3359         Fix non-Mac builds after r21081.
3360
3361         Stub out new Editor methods for Qt and Gdk, and new SVGEmptyEditorClient methods
3362         for all non-Mac builds.
3363
3364         * editing/qt/EditorQt.cpp:
3365         (WebCore::Editor::showSpellingGuessPanel):
3366         (WebCore::Editor::spellingPanelIsShowing):
3367         * page/qt/EventHandlerQt.cpp:
3368         (WebCore::EventHandler::passWheelEventToWidget):
3369         (WebCore::EventHandler::passMousePressEventToScrollbar):
3370         * platform/gdk/TemporaryLinkStubs.cpp:
3371         (Editor::showSpellingGuessPanel):
3372         (Editor::spellingPanelIsShowing):
3373         * platform/graphics/svg/SVGImageEmptyClients.h:
3374         (WebCore::SVGEmptyEditorClient::ignoreWordInSpellDocument):
3375         (WebCore::SVGEmptyEditorClient::learnWord):
3376         (WebCore::SVGEmptyEditorClient::checkSpellingOfString):
3377         (WebCore::SVGEmptyEditorClient::checkGrammarOfString):
3378         (WebCore::SVGEmptyEditorClient::udpateSpellingUIWithGrammarString):
3379         (WebCore::SVGEmptyEditorClient::updateSpellingUIWithMisspelledWord):
3380         (WebCore::SVGEmptyEditorClient::showSpellingUI):
3381         (WebCore::SVGEmptyEditorClient::spellingUIIsShowing):
3382         (WebCore::SVGEmptyEditorClient::getGuessesForWord):
3383
3384 2007-04-25  Anders Carlsson  <andersca@apple.com>
3385
3386         Reviewed by Ada.
3387
3388         <rdar://problem/5122153>
3389         Crash occurs at WebCore::Frame::loader() when switching to Bookmarks view while loading standalone image
3390
3391         Don't call writeRawData if the data length is 0. (This is checked by the decoder for the non-raw case).
3392
3393         * loader/FrameLoader.cpp:
3394         (WebCore::FrameLoader::write):
3395
3396 2007-04-26  Mark Rowe  <mrowe@apple.com>
3397
3398         Gdk build fix courtesy of Alp Toker.
3399
3400         * make-generated-sources.sh:  Remove conditional logic to ensure the
3401         script exits with the correct exit code.
3402
3403 2007-04-24  Anders Carlsson  <andersca@apple.com>
3404
3405         Reviewed by Mitz.
3406
3407         <rdar://problem/4869095> 
3408         default content type for XMLHttpRequest POSTs changed (breaks Flickrator 0.1 widget)
3409         
3410         Use the right MIME type.
3411         
3412         * xml/xmlhttprequest.cpp:
3413         (WebCore::XMLHttpRequest::send):
3414
3415 2007-04-24  Darin Adler  <darin@apple.com>
3416
3417         Reviewed by Maciej.
3418
3419         - second round of preparation for Hyatt's "lazy minMaxWidth" change
3420           http://bugs.webkit.org/show_bug.cgi?id=13431
3421
3422         These are small changes that are either safe to do first, or unrelated to the main
3423         change in Hyatt's patch.
3424
3425         - Preallocate 4 entries each in m_layoutStruct and m_spanCells to save allocation
3426           in AutoTableLayout.
3427         - Add an early exit to RenderFlow::dirtyLinesFromChangedChild.
3428         - Change InlineBox::hasTextChildren() to use a bit directly and never a virtual function.
3429         - Save a virtual function call by using a local bool variable for isTableCell().
3430
3431         - Fix containingBlock() so it returns 0 for table cells with no parent.
3432
3433         - Change all callers who are getting at layer() as a boolean to use hasLayer().
3434         - Change if statements to max() function calls (only the ones Hyatt had in his patch).
3435         - Remove some old kdDebug calls.
3436         - Tweak formatting of some code.
3437         - Add const in one place.
3438
3439         * bindings/js/kjs_html.cpp:
3440         (KJS::HTMLElementFunction::callAsFunction):
3441         * page/EventHandler.cpp:
3442         (WebCore::EventHandler::eventMayStartDrag):
3443         * page/Frame.cpp:
3444         (WebCore::Frame::clearTimers):
3445         * rendering/AutoTableLayout.cpp:
3446         (WebCore::AutoTableLayout::recalcColumn):
3447         * rendering/AutoTableLayout.h:
3448         * rendering/InlineBox.h:
3449         (WebCore::InlineBox::InlineBox):
3450         (WebCore::InlineBox::hasTextChildren):
3451         * rendering/InlineFlowBox.cpp:
3452         (WebCore::InlineFlowBox::nodeAtPoint):
3453         * rendering/InlineFlowBox.h:
3454         (WebCore::InlineFlowBox::InlineFlowBox):
3455         * rendering/RenderBlock.cpp:
3456         (WebCore::RenderBlock::layoutBlock):
3457         (WebCore::RenderBlock::repaintOverhangingFloats):
3458         (WebCore::RenderBlock::paintChildren):
3459         (WebCore::RenderBlock::paintFloats):
3460         (WebCore::RenderBlock::fillBlockSelectionGaps):
3461         (WebCore::RenderBlock::insertFloatingObject):
3462         (WebCore::RenderBlock::floatRect):
3463         (WebCore::RenderBlock::lowestPosition):
3464         (WebCore::RenderBlock::rightmostPosition):
3465         (WebCore::RenderBlock::leftmostPosition):
3466         (WebCore::RenderBlock::addOverhangingFloats):
3467         (WebCore::RenderBlock::nodeAtPoint):
3468         (WebCore::RenderBlock::hitTestContents):
3469         (WebCore::RenderBlock::calcPrefWidths):
3470         (WebCore::InlineMinMaxIterator::next):
3471         (WebCore::getBorderPaddingMargin):
3472         (WebCore::RenderBlock::calcInlinePrefWidths):
3473         (WebCore::RenderBlock::calcBlockPrefWidths):
3474         * rendering/RenderContainer.cpp:
3475         (WebCore::RenderContainer::appendChildNode):
3476         (WebCore::RenderContainer::insertChildNode):
3477         * rendering/RenderFlexibleBox.cpp:
3478         (WebCore::RenderFlexibleBox::calcHorizontalPrefWidths):
3479         (WebCore::RenderFlexibleBox::calcVerticalPrefWidths):
3480         * rendering/RenderFlow.cpp:
3481         (WebCore::RenderFlow::dirtyLinesFromChangedChild):
3482         * rendering/RenderLayer.cpp:
3483         (WebCore::RenderLayer::updateVisibilityStatus):
3484         (WebCore::RenderLayer::updateLayerPosition):
3485         * rendering/RenderObject.cpp:
3486         (WebCore::RenderObject::containingBlock):
3487         * rendering/RenderTable.cpp:
3488         (WebCore::RenderTable::paint):
3489         * rendering/RenderTableCell.cpp:
3490         (WebCore::RenderTableCell::paintBackgroundsBehindCell):
3491         * rendering/RenderTableRow.cpp:
3492         (WebCore::RenderTableRow::nodeAtPoint):
3493         (WebCore::RenderTableRow::paint):
3494         * rendering/RenderTableSection.cpp:
3495         (WebCore::RenderTableSection::nodeAtPoint):
3496         * rendering/RenderTreeAsText.cpp:
3497         (WebCore::write):
3498
3499 2007-04-24  Steve Falkenburg  <sfalken@apple.com>
3500
3501         Reviewed by Darin, Oliver.
3502
3503         Refactor spelling codepaths
3504
3505         * bridge/EditorClient.h:
3506         * page/ContextMenuController.cpp:
3507         (WebCore::ContextMenuController::contextMenuItemSelected):
3508         * platform/ContextMenu.cpp:
3509         (WebCore::ContextMenu::populate):
3510         (WebCore::ContextMenu::checkOrEnableIfNeeded):
3511         * platform/gdk/EditorClientGdk.cpp:
3512         (WebCore::EditorClientGdk::ignoreWordInSpellDocument):
3513         (WebCore::EditorClientGdk::learnWord):
3514         (WebCore::EditorClientGdk::checkSpellingOfString):
3515         (WebCore::EditorClientGdk::checkGrammarOfString):
3516         (WebCore::EditorClientGdk::udpateSpellingUIWithGrammarString):
3517         (WebCore::EditorClientGdk::updateSpellingUIWithMisspelledWord):