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