LayoutTests:
[WebKit-https.git] / WebCore / ChangeLog
1 2007-04-27  Antti Koivisto  <antti@apple.com>
2
3         Reviewed by Darin, Hyatt.
4         
5         Fix http://bugs.webkit.org/show_bug.cgi?id=13081
6         Empty table cells not handled correctly
7         <rdar://problem/5067926>
8         
9         To match Firefox and IE, empty table cells with variable width need to be
10         treated as special case. They generally get zero width.
11
12         * rendering/AutoTableLayout.cpp:
13         (WebCore::AutoTableLayout::recalcColumn):
14         (WebCore::AutoTableLayout::calcEffectiveWidth):
15         (WebCore::AutoTableLayout::layout):
16         * rendering/AutoTableLayout.h:
17         (WebCore::AutoTableLayout::Layout::Layout):
18         * rendering/RenderStyle.h:
19         (WebCore::RenderStyle::hasPadding):
20
21 2007-04-27  Rob Buis  <buis@kde.org>
22
23         Reviewed by Oliver.
24
25         http://bugs.webkit.org/show_bug.cgi?id=13052
26         Text not rendered in a second inline SVG element
27
28         Correct the rendering of svg text when embedded in non-svg container.
29
30         * rendering/RenderSVGText.cpp:
31         (WebCore::RenderSVGText::paint):
32
33 2007-04-27  Mark Rowe  <mrowe@apple.com>
34
35         Reviewed by Maciej.
36
37         * WebCore.pro: Remove non-existent paths from qmake files.
38
39 2007-04-25  Lars Naesbye Christensen <lars@naesbye.dk>
40
41         Reviewed by Timothy Hatcher.
42
43         http://bugs.webkit.org/show_bug.cgi?id=13477
44         Bug 13477: Help and context menu cursors need dropshadows.
45
46         * Resources/cellCursor.png:
47         * Resources/contextMenuCursor.png:
48         * Resources/helpCursor.png:
49         * platform/mac/CursorMac.mm:
50         (WebCore::contextMenuCursor):
51         (WebCore::copyCursor):
52         (WebCore::progressCursor):
53         (WebCore::noDropCursor):
54
55 2007-04-27  Holger Freyther <freyther@kde.org>
56
57         Reviewed by Maciej.
58
59         Remove unmaintained CMake build system.
60
61         * CMakeLists.txt: Removed.
62
63 2007-04-26  Matt Perry  <mpComplete@gmail.com>
64
65         Reviewed by Maciej.
66
67         Added a version check to hackAroundLibXMLEntityBug, since that bug has
68         been fixed in recent versions of libxml2.
69
70         * dom/XMLTokenizer.cpp:
71         (WebCore::hackAroundLibXMLEntityBug):
72
73 2007-04-26  Christopher Brichford  <chrisb@adobe.com>
74
75         Reviewed by Timothy Hatcher.
76
77         - Fix for Bug 13204: Submit initial version of mac project files for apollo
78           port of WebCore
79           http://bugs.webkit.org/show_bug.cgi?id=13204
80
81         * WebCore.apolloproj/mac/WebCore.Debug.xcconfig: Added.
82         * WebCore.apolloproj/mac/WebCore.Release.xcconfig: Added.
83         * WebCore.apolloproj/mac/WebCore.xcconfig: Added.
84         * WebCore.apolloproj/mac/WebCore.xcodeproj/project.pbxproj: Added.
85
86 2007-04-26  Alp Toker  <alp@atoker.com>
87
88         Reviewed by Maciej.
89
90         http://bugs.webkit.org/show_bug.cgi?id=13505
91         Cast loses precision on x86_64
92
93         * platform/graphics/cairo/GraphicsContextCairo.cpp:
94         (WebCore::GraphicsContext::beginTransparencyLayer):
95         (WebCore::GraphicsContext::endTransparencyLayer):
96         Use a stack of opacity values instead of Cairo user data.
97
98 2007-04-26  Mitz Pettel  <mitz@webkit.org>
99
100         Reviewed by Darin.
101
102         - fix http://bugs.webkit.org/show_bug.cgi?id=13500
103           REGRESSION: Listbox scrollbar does not reflect actual scrolled position when selected option is added after layout
104
105         Test: fast/forms/listbox-scrollbar-incremental-load.html
106
107         The scroller position was not updated correctly during insertion, since
108         scrollbar proportions are updated only during layout
109
110         * rendering/RenderListBox.cpp:
111         (WebCore::RenderListBox::selectionChanged): Delay scrolling to reveal the
112         selection until after layout if m_optionsChanged is set. Layout is
113         guaranteed to happen soon when the flag is set.
114
115 2007-04-26  David Hyatt  <hyatt@apple.com>
116
117         Fix for 13511, crash on a counters page.  Make sure that RenderTexts
118         never get a null StringImpl.  I would have added an assert that the length
119         had to be nonzero also, but unfortunately editing creates empty RenderTexts
120         because of its EditingText DOM subclass that always forces renderers to be
121         made.  I suppose there is a good reason for this...
122
123         Reviewed by aroben
124
125         * dom/CharacterData.cpp:
126         (WebCore::CharacterData::setData):
127         (WebCore::CharacterData::appendData):
128         (WebCore::CharacterData::insertData):
129         (WebCore::CharacterData::deleteData):
130         (WebCore::CharacterData::replaceData):
131         * rendering/RenderCounter.cpp:
132         (WebCore::RenderCounter::RenderCounter):
133         * rendering/RenderText.cpp:
134         (WebCore::RenderText::RenderText):
135         (WebCore::RenderText::trimmedPrefWidths):
136         (WebCore::RenderText::setTextWithOffset):
137         (WebCore::RenderText::setTextInternal):
138         (WebCore::RenderText::setText):
139
140 2007-04-26  Alice Liu  <alice.liu@apple.com>
141
142         Reviewed by Oliver.
143
144         * editing/SelectionController.cpp:
145         (WebCore::SelectionController::selectAll):
146         adding null check
147
148 2007-04-26  Justin Garcia  <justin.garcia@apple.com>
149
150         Reviewed by oliver
151
152         <rdar://problem/5120591> 
153         Crash when creating a link in Leopard wiki server
154
155         * editing/CreateLinkCommand.cpp:
156         (WebCore::CreateLinkCommand::doApply): Use a RefPtr,
157         setting the anchor's href can destroy it if there is
158         an ancestor with a subtree modified event listener.
159
160 2007-04-26  Mitz Pettel  <mitz@webkit.org>
161
162         Reviewed by hyatt
163
164         - http://bugs.webkit.org/show_bug.cgi?id=13496
165           Eliminate repaintObjectsBeforeLayout
166
167         No tests added since there is no change to functionality. Several
168         tests in fast/repaint test repainting of objects that move during layout.
169
170         * page/FrameView.cpp:
171         (WebCore::FrameView::layout):
172         * rendering/RenderBlock.cpp:
173         (WebCore::RenderBlock::layoutBlockChildren): Removed an early
174         setNeedsLayout(false). Resetting the bit here prevents the full repaint
175         that we rely on when we decide not to repaint children that move.
176         * rendering/RenderBlock.h:
177         * rendering/RenderObject.cpp:
178         * rendering/RenderObject.h:
179         * rendering/RenderTableSection.cpp:
180         (WebCore::RenderTableSection::setCellWidths): Replaced the call to
181         repaintObjectsBeforeLayout() if the cell didn't need layout with
182         an unconditional repaint(). We don't bother with repainting only the
183         delta between the old and new widths, since by marking the cell for
184         layout results in a full repaint with the new width anyway.
185
186 2007-04-26  David Hyatt  <hyatt@apple.com>
187
188         Fix for 13509.  Don't recur to parent inline flows if they have been
189         marked as needing layout themselves.
190
191         Reviewed by adele
192
193         * rendering/RenderFlow.cpp:
194         (WebCore::RenderFlow::dirtyLinesFromChangedChild):
195
196 2007-04-26  Matt Perry  <mpComplete@gmail.com>
197
198         Reviewed and landed by Alexey.
199
200         http://bugs.webkit.org/show_bug.cgi?id=13495
201         Crash when referencing an undefined entity in an XHTML document
202
203         Test: fast/parser/badentity.xhtml
204
205         * dom/XMLTokenizer.cpp:
206         (WebCore::getEntityHandler): Check for a NULL returned from getXHTMLEntity
207
208 2007-04-26  Anders Carlsson  <andersca@apple.com>
209
210         Reviewed by Hyatt.
211
212         <rdar://problem/4851944>
213         REGRESSION: With TOT, BMP images can no longer be opened in the browser window
214         
215         On Tiger, the MIME type for the com.microsoft.bmp UTI isn't in the registry, so add it manually.
216         
217         * platform/MimeTypeRegistry.cpp:
218         (WebCore::initialiseSupportedImageMIMETypes):
219
220 2007-04-26  David Hyatt  <hyatt@apple.com>
221
222         Fix for bug 13503, invalidateContainingBlockPrefWidths is 15% of the
223         nesting PLT.  Avoid O(n^2) behavior by including inlines in the minmax
224         dirty chain.
225
226         Reviewed by kevin
227
228         * rendering/RenderBlock.cpp:
229         (WebCore::RenderBlock::calcInlinePrefWidths):
230         * rendering/RenderObject.cpp:
231         (WebCore::RenderObject::setPrefWidthsDirty):
232         (WebCore::RenderObject::invalidateContainerPrefWidths):
233         * rendering/RenderObject.h:
234
235 2007-04-26  Anders Carlsson  <andersca@apple.com>
236
237         Reviewed by Darin.
238
239         <rdar://problem/5067925>
240         Reproducible crash (infinite recursion) with a layout test that submits on unload (13078)
241         
242         Ask the document loader whether it's loading the main resource, since there are cases where the frame 
243         loader's variable isn't updated correctly.
244         
245         In the distant future, the frame loader shouldn't have an instance variable but this is the least intrusive fix for now.
246         
247         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,
248         calling submit in the onunload prevents any new tests from loading!
249         
250         * loader/FrameLoader.cpp:
251         (WebCore::FrameLoader::isLoading):
252
253 2007-04-26  Anders Carlsson  <andersca@apple.com>
254
255         ... and fix the build.
256         
257         * loader/FrameLoader.cpp:
258         (WebCore::FrameLoader::continueAfterNavigationPolicy):
259
260 2007-04-26  Anders Carlsson  <andersca@apple.com>
261
262         Revert the previous change - activeDocumentLoader never returns the policy document loader.
263         Instead, add a null check for the policy document loader.
264         
265         * loader/FrameLoader.cpp:
266         (WebCore::FrameLoader::continueAfterNavigationPolicy):
267
268 2007-04-26  Anders Carlsson  <andersca@apple.com>
269
270         Use the active document loader instead of the policy document loader.
271         
272         * loader/FrameLoader.cpp:
273         (WebCore::FrameLoader::continueAfterNavigationPolicy):
274
275 2007-04-26  Anders Carlsson  <andersca@apple.com>
276
277         Reviewed by Maciej.
278
279         <rdar://problem/5049099> documents no longer have a default base URL
280
281         Don't call canHandleRequest if we have valid substitute data and the protocol is "applewebdata".
282         
283         * loader/FrameLoader.cpp:
284         (WebCore::FrameLoader::continueAfterNavigationPolicy):
285
286 2007-04-25  Stephanie Lewis <slewis@apple.com>
287
288         Reviewed by Darin.
289
290         Fix the build for platforms that overload the abs function.        
291
292         * dom/ChildNodeList.cpp:
293         (WebCore::ChildNodeList::item):
294
295 2007-04-25  David Hyatt  <hyatt@apple.com>
296
297         Fix for bug 13373, make sure to invalidate the pref widths for objects
298         with percentage padding.
299
300         Reviewed by beth
301
302         * rendering/RenderBlock.cpp:
303         (WebCore::RenderBlock::layoutBlockChildren):
304         (WebCore::RenderBlock::layoutPositionedObjects):
305         * rendering/bidi.cpp:
306         (WebCore::RenderBlock::layoutInlineChildren):
307
308 2007-04-25  David Harrison  <harrison@apple.com>
309
310         Comment change. Correct the header name in the endif comment.
311         
312         * editing/FormatBlockCommand.h:
313         Change InsertListCommand_h to FormatBlockCommand_h.
314
315 2007-04-25  Darin Adler  <darin@apple.com>
316
317         Reviewed by Hyatt.
318
319         * platform/AtomicString.cpp: (WebCore::AtomicString::add):
320         Removed unnecessary use of strlen to check if a string is empty.
321
322 2007-04-25  Mitz Pettel  <mitz@webkit.org>
323
324         Build fix.
325
326         * rendering/RenderListMarker.h: Undeleted the m_text member.
327
328 2007-04-25  David Hyatt  <hyatt@apple.com>
329
330         Rearchitect calcPrefWidths.  The calculation is now done lazily only when minPrefWidth
331         or maxPrefWidth are asked for.  The result of the calculation is cached.
332
333         The new invalidation scheme for pref width invalidation follows the
334         containing block hierarchy and knows to halt at positioned objects, since
335         they cannot influence the size of their containers.
336
337         Reviewed by darin
338
339         * css/cssstyleselector.cpp:
340         (WebCore::CSSStyleSelector::init):
341         (WebCore::CSSStyleSelector::initForStyleResolve):
342         * page/FrameView.cpp:
343         (WebCore::FrameView::layout):
344         * rendering/RenderApplet.cpp:
345         (WebCore::RenderApplet::layout):
346         * rendering/RenderBlock.cpp:
347         (WebCore::RenderBlock::makeChildrenNonInline):
348         (WebCore::RenderBlock::removeChild):
349         (WebCore::RenderBlock::layout):
350         (WebCore::RenderBlock::layoutBlock):
351         (WebCore::RenderBlock::calcPrefWidths):
352         (WebCore::InlineMinMaxIterator::endOfInline):
353         (WebCore::shouldGrowTableCellForImage):
354         (WebCore::RenderBlock::calcInlinePrefWidths):
355         (WebCore::RenderBlock::calcBlockPrefWidths):
356         * rendering/RenderBlock.h:
357         * rendering/RenderBox.cpp:
358         (WebCore::RenderBox::setStyle):
359         (WebCore::RenderBox::minPrefWidth):
360         (WebCore::RenderBox::maxPrefWidth):
361         (WebCore::RenderBox::calcWidth):
362         (WebCore::RenderBox::calcWidthUsing):
363         (WebCore::RenderBox::calcAbsoluteHorizontal):
364         (WebCore::RenderBox::calcAbsoluteHorizontalValues):
365         * rendering/RenderBox.h:
366         * rendering/RenderContainer.cpp:
367         (WebCore::RenderContainer::removeChildNode):
368         (WebCore::RenderContainer::appendChildNode):
369         (WebCore::RenderContainer::insertChildNode):
370         (WebCore::RenderContainer::layout):
371         * rendering/RenderContainer.h:
372         (WebCore::RenderContainer::moveChildNode):
373         * rendering/RenderCounter.cpp:
374         (WebCore::RenderCounter::dirtyLineBoxes):
375         (WebCore::RenderCounter::calcPrefWidths):
376         * rendering/RenderCounter.h:
377         * rendering/RenderFileUploadControl.cpp:
378         (WebCore::RenderFileUploadControl::calcPrefWidths):
379         * rendering/RenderFlexibleBox.cpp:
380         (WebCore::RenderFlexibleBox::calcHorizontalPrefWidths):
381         (WebCore::RenderFlexibleBox::calcVerticalPrefWidths):
382         (WebCore::RenderFlexibleBox::calcPrefWidths):
383         (WebCore::RenderFlexibleBox::layoutBlock):
384         * rendering/RenderForeignObject.cpp:
385         (WebCore::RenderForeignObject::layout):
386         * rendering/RenderFrameSet.cpp:
387         (WebCore::RenderFrameSet::layout):
388         * rendering/RenderHTMLCanvas.cpp:
389         (WebCore::RenderHTMLCanvas::layout):
390         * rendering/RenderImage.cpp:
391         (WebCore::RenderImage::layout):
392         * rendering/RenderInline.cpp:
393         * rendering/RenderInline.h:
394         * rendering/RenderListBox.cpp:
395         (WebCore::RenderListBox::updateFromElement):
396         (WebCore::RenderListBox::calcPrefWidths):
397         * rendering/RenderListItem.cpp:
398         (WebCore::firstNonMarkerChild):
399         (WebCore::RenderListItem::updateMarkerLocation):
400         (WebCore::RenderListItem::calcPrefWidths):
401         (WebCore::RenderListItem::layout):
402         * rendering/RenderListMarker.cpp:
403         (WebCore::RenderListMarker::layout):
404         (WebCore::RenderListMarker::calcPrefWidths):
405         (WebCore::RenderListMarker::updateMargins):
406         * rendering/RenderListMarker.h:
407         * rendering/RenderObject.cpp:
408         (WebCore::RenderObject::RenderObject):
409         (WebCore::RenderObject::removeChildNode):
410         (WebCore::RenderObject::moveChildNode):
411         (WebCore::RenderObject::appendChildNode):
412         (WebCore::RenderObject::insertChildNode):
413         (WebCore::RenderObject::setPrefWidthsDirty):
414         (WebCore::RenderObject::invalidateContainingBlockPrefWidths):
415         (WebCore::RenderObject::information):
416         (WebCore::RenderObject::setStyle):
417         * rendering/RenderObject.h:
418         (WebCore::RenderObject::layer):
419         (WebCore::RenderObject::hasLayer):
420         (WebCore::RenderObject::prefWidthsDirty):
421         (WebCore::RenderObject::setNeedsLayoutAndPrefWidthsRecalc):
422         (WebCore::RenderObject::setHasLayer):
423         * rendering/RenderPartObject.cpp:
424         (WebCore::RenderPartObject::layout):
425         * rendering/RenderSVGContainer.cpp:
426         (WebCore::RenderSVGContainer::layout):
427         * rendering/RenderSVGContainer.h:
428         * rendering/RenderSVGHiddenContainer.cpp:
429         * rendering/RenderSVGHiddenContainer.h:
430         * rendering/RenderSVGText.cpp:
431         (WebCore::RenderSVGText::layout):
432         * rendering/RenderTable.cpp:
433         (WebCore::RenderTable::calcWidth):
434         (WebCore::RenderTable::layout):
435         (WebCore::RenderTable::removeChildNode):
436         * rendering/RenderTable.h:
437         * rendering/RenderTableRow.cpp:
438         (WebCore::RenderTableRow::layout):
439         * rendering/RenderTableSection.cpp:
440         (WebCore::RenderTableSection::removeChildNode):
441         * rendering/RenderTableSection.h:
442         * rendering/RenderText.cpp:
443         (WebCore::RenderText::trimmedPrefWidths):
444         (WebCore::isSpaceAccordingToStyle):
445         (WebCore::RenderText::minPrefWidth):
446         (WebCore::RenderText::maxPrefWidth):
447         (WebCore::RenderText::calcPrefWidths):
448         (WebCore::RenderText::width):
449         * rendering/RenderText.h:
450         * rendering/RenderView.cpp:
451         (WebCore::RenderView::RenderView):
452         (WebCore::RenderView::calcPrefWidths):
453         (WebCore::RenderView::layout):
454         * rendering/RenderWidget.cpp:
455         (WebCore::RenderWidget::layout):
456
457 2007-04-25  Steve Falkenburg  <sfalken@apple.com>
458
459         Reviewed by Adam.
460
461         Fix spelling error in spelling method name.
462         Expose new spelling callback methods to all platforms.
463
464         * bridge/EditorClient.h:
465         * platform/gdk/EditorClientGdk.cpp:
466         (WebCore::EditorClientGdk::updateSpellingUIWithGrammarString):
467         * platform/gdk/EditorClientGdk.h:
468         * platform/graphics/svg/SVGImageEmptyClients.h:
469         (WebCore::SVGEmptyEditorClient::updateSpellingUIWithGrammarString):
470         (WebCore::SVGEmptyEditorClient::getGuessesForWord):
471
472 2007-04-24  Geoffrey Garen  <ggaren@apple.com>
473
474         Reviewed by Darin Adler, Tim Hatcher.
475
476         Fixed a few NSAutoreleasePool issues I noticed while reviewing Brady's patch.
477
478         * platform/graphics/mac/GraphicsContextMac.mm:
479         (WebCore::GraphicsContext::setCompositeOperation): Call -drain instead of 
480         -release, since -release is a no-op in a GC world.
481
482 2007-04-25  Alexey Proskuryakov  <ap@webkit.org>
483
484         Reviewed by Darin.
485
486         http://bugs.webkit.org/show_bug.cgi?id=13445
487         NodeList access by index is slow
488
489         * dom/ChildNodeList.cpp:
490         (WebCore::ChildNodeList::item): Support iterating backwards from the last accessed node
491         or from the last child.
492         * dom/NodeList.h: Make cachedLength unsigned.
493
494 2007-04-26  Mark Rowe  <mrowe@apple.com>
495
496         Gdk build fix.  Add missing stub.
497
498         * platform/gdk/TemporaryLinkStubs.cpp:
499         (Editor::advanceToNextMisspelling):
500
501 2007-04-25  Rob Buis  <buis@kde.org>
502
503         Reviewed by Darin.
504
505         http://bugs.webkit.org/show_bug.cgi?id=12163
506         SVG text does not appear in a scrolling <div>
507
508         Make sure SVG text is painted when scrolling by taking into account the relative offset of the non-SVG parent in the paintInfo rect.
509
510         * rendering/RenderSVGContainer.cpp:
511         (WebCore::RenderSVGContainer::paint):
512
513 2007-04-26  Mark Rowe  <mrowe@apple.com>
514
515         Fix non-Mac builds after r21081.
516
517         Stub out new Editor methods for Qt and Gdk, and new SVGEmptyEditorClient methods
518         for all non-Mac builds.
519
520         * editing/qt/EditorQt.cpp:
521         (WebCore::Editor::showSpellingGuessPanel):
522         (WebCore::Editor::spellingPanelIsShowing):
523         * page/qt/EventHandlerQt.cpp:
524         (WebCore::EventHandler::passWheelEventToWidget):
525         (WebCore::EventHandler::passMousePressEventToScrollbar):
526         * platform/gdk/TemporaryLinkStubs.cpp:
527         (Editor::showSpellingGuessPanel):
528         (Editor::spellingPanelIsShowing):
529         * platform/graphics/svg/SVGImageEmptyClients.h:
530         (WebCore::SVGEmptyEditorClient::ignoreWordInSpellDocument):
531         (WebCore::SVGEmptyEditorClient::learnWord):
532         (WebCore::SVGEmptyEditorClient::checkSpellingOfString):
533         (WebCore::SVGEmptyEditorClient::checkGrammarOfString):
534         (WebCore::SVGEmptyEditorClient::udpateSpellingUIWithGrammarString):
535         (WebCore::SVGEmptyEditorClient::updateSpellingUIWithMisspelledWord):
536         (WebCore::SVGEmptyEditorClient::showSpellingUI):
537         (WebCore::SVGEmptyEditorClient::spellingUIIsShowing):
538         (WebCore::SVGEmptyEditorClient::getGuessesForWord):
539
540 2007-04-25  Anders Carlsson  <andersca@apple.com>
541
542         Reviewed by Ada.
543
544         <rdar://problem/5122153>
545         Crash occurs at WebCore::Frame::loader() when switching to Bookmarks view while loading standalone image
546
547         Don't call writeRawData if the data length is 0. (This is checked by the decoder for the non-raw case).
548
549         * loader/FrameLoader.cpp:
550         (WebCore::FrameLoader::write):
551
552 2007-04-26  Mark Rowe  <mrowe@apple.com>
553
554         Gdk build fix courtesy of Alp Toker.
555
556         * make-generated-sources.sh:  Remove conditional logic to ensure the
557         script exits with the correct exit code.
558
559 2007-04-24  Anders Carlsson  <andersca@apple.com>
560
561         Reviewed by Mitz.
562
563         <rdar://problem/4869095> 
564         default content type for XMLHttpRequest POSTs changed (breaks Flickrator 0.1 widget)
565         
566         Use the right MIME type.
567         
568         * xml/xmlhttprequest.cpp:
569         (WebCore::XMLHttpRequest::send):
570
571 2007-04-24  Darin Adler  <darin@apple.com>
572
573         Reviewed by Maciej.
574
575         - second round of preparation for Hyatt's "lazy minMaxWidth" change
576           http://bugs.webkit.org/show_bug.cgi?id=13431
577
578         These are small changes that are either safe to do first, or unrelated to the main
579         change in Hyatt's patch.
580
581         - Preallocate 4 entries each in m_layoutStruct and m_spanCells to save allocation
582           in AutoTableLayout.
583         - Add an early exit to RenderFlow::dirtyLinesFromChangedChild.
584         - Change InlineBox::hasTextChildren() to use a bit directly and never a virtual function.
585         - Save a virtual function call by using a local bool variable for isTableCell().
586
587         - Fix containingBlock() so it returns 0 for table cells with no parent.
588
589         - Change all callers who are getting at layer() as a boolean to use hasLayer().
590         - Change if statements to max() function calls (only the ones Hyatt had in his patch).
591         - Remove some old kdDebug calls.
592         - Tweak formatting of some code.
593         - Add const in one place.
594
595         * bindings/js/kjs_html.cpp:
596         (KJS::HTMLElementFunction::callAsFunction):
597         * page/EventHandler.cpp:
598         (WebCore::EventHandler::eventMayStartDrag):
599         * page/Frame.cpp:
600         (WebCore::Frame::clearTimers):
601         * rendering/AutoTableLayout.cpp:
602         (WebCore::AutoTableLayout::recalcColumn):
603         * rendering/AutoTableLayout.h:
604         * rendering/InlineBox.h:
605         (WebCore::InlineBox::InlineBox):
606         (WebCore::InlineBox::hasTextChildren):
607         * rendering/InlineFlowBox.cpp:
608         (WebCore::InlineFlowBox::nodeAtPoint):
609         * rendering/InlineFlowBox.h:
610         (WebCore::InlineFlowBox::InlineFlowBox):
611         * rendering/RenderBlock.cpp:
612         (WebCore::RenderBlock::layoutBlock):
613         (WebCore::RenderBlock::repaintOverhangingFloats):
614         (WebCore::RenderBlock::paintChildren):
615         (WebCore::RenderBlock::paintFloats):
616         (WebCore::RenderBlock::fillBlockSelectionGaps):
617         (WebCore::RenderBlock::insertFloatingObject):
618         (WebCore::RenderBlock::floatRect):
619         (WebCore::RenderBlock::lowestPosition):
620         (WebCore::RenderBlock::rightmostPosition):
621         (WebCore::RenderBlock::leftmostPosition):
622         (WebCore::RenderBlock::addOverhangingFloats):
623         (WebCore::RenderBlock::nodeAtPoint):
624         (WebCore::RenderBlock::hitTestContents):
625         (WebCore::RenderBlock::calcPrefWidths):
626         (WebCore::InlineMinMaxIterator::next):
627         (WebCore::getBorderPaddingMargin):
628         (WebCore::RenderBlock::calcInlinePrefWidths):
629         (WebCore::RenderBlock::calcBlockPrefWidths):
630         * rendering/RenderContainer.cpp:
631         (WebCore::RenderContainer::appendChildNode):
632         (WebCore::RenderContainer::insertChildNode):
633         * rendering/RenderFlexibleBox.cpp:
634         (WebCore::RenderFlexibleBox::calcHorizontalPrefWidths):
635         (WebCore::RenderFlexibleBox::calcVerticalPrefWidths):
636         * rendering/RenderFlow.cpp:
637         (WebCore::RenderFlow::dirtyLinesFromChangedChild):
638         * rendering/RenderLayer.cpp:
639         (WebCore::RenderLayer::updateVisibilityStatus):
640         (WebCore::RenderLayer::updateLayerPosition):
641         * rendering/RenderObject.cpp:
642         (WebCore::RenderObject::containingBlock):
643         * rendering/RenderTable.cpp:
644         (WebCore::RenderTable::paint):
645         * rendering/RenderTableCell.cpp:
646         (WebCore::RenderTableCell::paintBackgroundsBehindCell):
647         * rendering/RenderTableRow.cpp:
648         (WebCore::RenderTableRow::nodeAtPoint):
649         (WebCore::RenderTableRow::paint):
650         * rendering/RenderTableSection.cpp:
651         (WebCore::RenderTableSection::nodeAtPoint):
652         * rendering/RenderTreeAsText.cpp:
653         (WebCore::write):
654
655 2007-04-24  Steve Falkenburg  <sfalken@apple.com>
656
657         Reviewed by Darin, Oliver.
658
659         Refactor spelling codepaths
660
661         * bridge/EditorClient.h:
662         * page/ContextMenuController.cpp:
663         (WebCore::ContextMenuController::contextMenuItemSelected):
664         * platform/ContextMenu.cpp:
665         (WebCore::ContextMenu::populate):
666         (WebCore::ContextMenu::checkOrEnableIfNeeded):
667         * platform/gdk/EditorClientGdk.cpp:
668         (WebCore::EditorClientGdk::ignoreWordInSpellDocument):
669         (WebCore::EditorClientGdk::learnWord):
670         (WebCore::EditorClientGdk::checkSpellingOfString):
671         (WebCore::EditorClientGdk::checkGrammarOfString):
672         (WebCore::EditorClientGdk::udpateSpellingUIWithGrammarString):
673         (WebCore::EditorClientGdk::updateSpellingUIWithMisspelledWord):
674         (WebCore::EditorClientGdk::showSpellingUI):
675         (WebCore::EditorClientGdk::spellingUIIsShowing):
676         (WebCore::EditorClientGdk::getGuessesForWord):
677         * platform/gdk/EditorClientGdk.h:
678
679 2007-04-24  Darin Adler  <darin@apple.com>
680
681         Reviewed by Adele.
682
683         - first round of preparation for Hyatt's "lazy minMaxWidth" change
684           http://bugs.webkit.org/show_bug.cgi?id=13431
685
686         This patch limits itself to renaming and making other super-simple
687         changes so that the above change will be smaller and easier to review
688         and understand.
689
690         Rename:
691
692             calcHorizontalMinMaxWidth -> calcHorizontalPrefWidths
693             calcMinMaxWidth -> calcPrefWidths
694             calcMinMaxWidthInternal -> calcPrefWidthsInternal
695             calcVerticalMinMaxWidth -> calcVerticalPrefWidths
696             setNeedsLayoutAndMinMaxRecalc -> setNeedsLayoutAndPrefWidthsRecalc
697             trimmedMinMaxWidth -> trimmedPrefWidths
698
699             RenderObject::m_maxWidth -> RenderObject::m_maxPrefWidth
700             RenderObject::m_minWidth -> RenderObject::m_minPrefWidth
701             RenderObject::maxWidth() -> RenderObject::maxPrefWidth()
702             RenderObject::minWidth() -> RenderObject::minPrefWidth()
703
704         Replace m_minMaxKnown, minMaxKnown(), and setMinMaxKnown() with
705         m_prefWidthsDirty, prefWidthsDirty(), and setPrefWidthsDirty(),
706         a boolean with the opposite sense.
707
708         Convert some uses of if statements into "max".
709
710         Change many uses of layer() to hasLayer(). For now it's just a boolean
711         version of layer(), but Hyatt's patch makes it faster by using a bit.
712
713         Added a guard to use of axObjectCache() to make RenderObject destruction
714         a little faster for the normal case.
715
716         Removed some assertions that will be removed in Hyatt's patch.
717
718         Made some functions const that will be const in Hyatt's patch.
719
720         Put in some revised comments from Hyatt's patch.
721
722         Removed an unneeded nil check from RenderListMarker::setStyle.
723
724         Moved RootInlineBox::setHorizontalOverflowPositions and
725         RootInlineBox::setVerticalSelectionPositions to the RootInlineBox.h
726         header and marked them inline.
727
728         * dom/Document.cpp:
729         (WebCore::Document::updateStyleSelector):
730         * html/HTMLTextAreaElement.cpp:
731         (WebCore::HTMLTextAreaElement::parseMappedAttribute):
732         * page/Frame.cpp:
733         (WebCore::Frame::forceLayoutWithPageWidthRange):
734         * rendering/AutoTableLayout.cpp:
735         (WebCore::AutoTableLayout::recalcColumn):
736         (WebCore::AutoTableLayout::calcPrefWidths):
737         (WebCore::AutoTableLayout::calcEffectiveWidth):
738         * rendering/AutoTableLayout.h:
739         * rendering/CounterNode.cpp:
740         (WebCore::CounterNode::recount):
741         * rendering/FixedTableLayout.cpp:
742         (WebCore::FixedTableLayout::calcPrefWidths):
743         * rendering/FixedTableLayout.h:
744         * rendering/InlineFlowBox.cpp:
745         (WebCore::InlineFlowBox::paint):
746         * rendering/RenderApplet.cpp:
747         (WebCore::RenderApplet::layout):
748         * rendering/RenderBlock.cpp:
749         (WebCore::RenderBlock::removeChild):
750         (WebCore::RenderBlock::layoutBlock):
751         (WebCore::RenderBlock::handleCompactChild):
752         (WebCore::RenderBlock::getClearDelta):
753         (WebCore::RenderBlock::calcPrefWidths):
754         (WebCore::RenderBlock::calcInlinePrefWidths):
755         (WebCore::RenderBlock::calcBlockPrefWidths):
756         * rendering/RenderBlock.h:
757         * rendering/RenderBox.cpp:
758         (WebCore::RenderBox::RenderBox):
759         (WebCore::RenderBox::nodeAtPoint):
760         (WebCore::RenderBox::calcWidth):
761         (WebCore::RenderBox::calcWidthUsing):
762         (WebCore::RenderBox::calcAbsoluteHorizontal):
763         (WebCore::RenderBox::calcAbsoluteHorizontalValues):
764         * rendering/RenderBox.h:
765         (WebCore::RenderBox::minPrefWidth):
766         (WebCore::RenderBox::maxPrefWidth):
767         * rendering/RenderContainer.cpp:
768         (WebCore::RenderContainer::removeChildNode):
769         (WebCore::RenderContainer::appendChildNode):
770         (WebCore::RenderContainer::insertChildNode):
771         (WebCore::RenderContainer::layout):
772         * rendering/RenderContainer.h:
773         (WebCore::RenderContainer::calcPrefWidths):
774         * rendering/RenderCounter.cpp:
775         (WebCore::RenderCounter::calcPrefWidths):
776         * rendering/RenderCounter.h:
777         * rendering/RenderFieldset.cpp:
778         (WebCore::RenderFieldset::calcPrefWidths):
779         * rendering/RenderFieldset.h:
780         * rendering/RenderFileUploadControl.cpp:
781         (WebCore::RenderFileUploadControl::calcPrefWidths):
782         * rendering/RenderFileUploadControl.h:
783         * rendering/RenderFlexibleBox.cpp:
784         (WebCore::RenderFlexibleBox::calcHorizontalPrefWidths):
785         (WebCore::RenderFlexibleBox::calcVerticalPrefWidths):
786         (WebCore::RenderFlexibleBox::calcPrefWidths):
787         (WebCore::RenderFlexibleBox::layoutBlock):
788         (WebCore::RenderFlexibleBox::allowedChildFlex):
789         * rendering/RenderFlexibleBox.h:
790         (WebCore::RenderFlexibleBox::hasMultipleLines):
791         (WebCore::RenderFlexibleBox::isVertical):
792         (WebCore::RenderFlexibleBox::isHorizontal):
793         * rendering/RenderFlow.cpp:
794         (WebCore::RenderFlow::absoluteClippedOverflowRect):
795         * rendering/RenderForeignObject.cpp:
796         (WebCore::RenderForeignObject::layout):
797         * rendering/RenderFrameSet.cpp:
798         (WebCore::RenderFrameSet::layout):
799         * rendering/RenderHTMLCanvas.cpp:
800         (WebCore::RenderHTMLCanvas::layout):
801         * rendering/RenderImage.cpp:
802         (WebCore::RenderImage::imageChanged):
803         (WebCore::RenderImage::layout):
804         (WebCore::RenderImage::calcPrefWidths):
805         * rendering/RenderImage.h:
806         * rendering/RenderInline.cpp:
807         (WebCore::RenderInline::addChildToFlow):
808         (WebCore::RenderInline::splitInlines):
809         (WebCore::RenderInline::splitFlow):
810         (WebCore::RenderInline::calcPrefWidths):
811         * rendering/RenderInline.h:
812         * rendering/RenderListBox.cpp:
813         (WebCore::RenderListBox::updateFromElement):
814         (WebCore::RenderListBox::calcPrefWidths):
815         * rendering/RenderListBox.h:
816         * rendering/RenderListItem.cpp:
817         (WebCore::RenderListItem::updateValue):
818         (WebCore::RenderListItem::updateMarkerLocation):
819         (WebCore::RenderListItem::calcPrefWidths):
820         (WebCore::RenderListItem::layout):
821         (WebCore::RenderListItem::explicitValueChanged):
822         * rendering/RenderListItem.h:
823         * rendering/RenderListMarker.cpp:
824         (WebCore::RenderListMarker::setStyle):
825         (WebCore::RenderListMarker::layout):
826         (WebCore::RenderListMarker::imageChanged):
827         (WebCore::RenderListMarker::calcPrefWidths):
828         (WebCore::RenderListMarker::calcWidth):
829         * rendering/RenderListMarker.h:
830         * rendering/RenderMenuList.cpp:
831         (WebCore::RenderMenuList::updateOptionsWidth):
832         (WebCore::RenderMenuList::calcPrefWidths):
833         * rendering/RenderMenuList.h:
834         * rendering/RenderObject.cpp:
835         (WebCore::RenderObject::RenderObject):
836         (WebCore::addLayers):
837         (WebCore::RenderObject::removeLayers):
838         (WebCore::RenderObject::moveLayers):
839         (WebCore::RenderObject::addAbsoluteRectForLayer):
840         (WebCore::RenderObject::checkForRepaintDuringLayout):
841         (WebCore::RenderObject::dump):
842         (WebCore::RenderObject::setStyle):
843         (WebCore::RenderObject::destroy):
844         (WebCore::RenderObject::recalcMinMaxWidths):
845         * rendering/RenderObject.h:
846         (WebCore::RenderObject::hasLayer):
847         (WebCore::RenderObject::prefWidthsDirty):
848         (WebCore::RenderObject::setPrefWidthsDirty):
849         (WebCore::RenderObject::setNeedsLayoutAndPrefWidthsRecalc):
850         (WebCore::RenderObject::calcPrefWidths):
851         (WebCore::RenderObject::minPrefWidth):
852         (WebCore::RenderObject::maxPrefWidth):
853         * rendering/RenderPart.cpp:
854         (WebCore::RenderPart::setWidget):
855         * rendering/RenderPartObject.cpp:
856         (WebCore::RenderPartObject::updateWidget):
857         (WebCore::RenderPartObject::layout):
858         * rendering/RenderReplaced.cpp:
859         (WebCore::RenderReplaced::calcPrefWidths):
860         * rendering/RenderReplaced.h:
861         * rendering/RenderSVGContainer.cpp:
862         (WebCore::RenderSVGContainer::calcPrefWidths):
863         (WebCore::RenderSVGContainer::layout):
864         * rendering/RenderSVGContainer.h:
865         * rendering/RenderSVGHiddenContainer.cpp:
866         (WebCore::RenderSVGHiddenContainer::calcPrefWidths):
867         * rendering/RenderSVGHiddenContainer.h:
868         * rendering/RenderSVGText.cpp:
869         (WebCore::RenderSVGText::layout):
870         * rendering/RenderSlider.cpp:
871         (WebCore::RenderSlider::calcPrefWidths):
872         * rendering/RenderSlider.h:
873         * rendering/RenderTable.cpp:
874         (WebCore::RenderTable::calcWidth):
875         (WebCore::RenderTable::layout):
876         (WebCore::RenderTable::calcPrefWidths):
877         (WebCore::RenderTable::splitColumn):
878         (WebCore::RenderTable::appendColumn):
879         * rendering/RenderTable.h:
880         * rendering/RenderTableCell.cpp:
881         (WebCore::RenderTableCell::updateFromElement):
882         (WebCore::RenderTableCell::styleOrColWidth):
883         (WebCore::RenderTableCell::calcPrefWidths):
884         * rendering/RenderTableCell.h:
885         * rendering/RenderTableCol.cpp:
886         (WebCore::RenderTableCol::updateFromElement):
887         * rendering/RenderTableRow.cpp:
888         (WebCore::RenderTableRow::layout):
889         * rendering/RenderTableSection.cpp:
890         (WebCore::RenderTableSection::paint):
891         * rendering/RenderText.cpp:
892         (WebCore::RenderText::trimmedPrefWidths):
893         (WebCore::RenderText::calcPrefWidths):
894         (WebCore::RenderText::calcPrefWidthsInternal):
895         (WebCore::RenderText::setText):
896         * rendering/RenderText.h:
897         (WebCore::RenderText::minPrefWidth):
898         (WebCore::RenderText::maxPrefWidth):
899         * rendering/RenderTextControl.cpp:
900         (WebCore::RenderTextControl::calcPrefWidths):
901         * rendering/RenderTextControl.h:
902         * rendering/RenderView.cpp:
903         (WebCore::RenderView::RenderView):
904         (WebCore::RenderView::calcPrefWidths):
905         (WebCore::RenderView::layout):
906         * rendering/RenderView.h:
907         * rendering/RenderWidget.cpp:
908         (WebCore::RenderWidget::layout):
909         * rendering/RootInlineBox.cpp:
910         * rendering/RootInlineBox.h:
911         (WebCore::RootInlineBox::setHorizontalOverflowPositions):
912         (WebCore::RootInlineBox::setVerticalSelectionPositions):
913         * rendering/TableLayout.h:
914
915 2007-04-24  Justin Garcia  <justin.garcia@apple.com>
916
917         Reviewed by oliver
918         
919         <rdar://problem/5156401> 
920         Crash when dragging text into a link inside a table cell
921
922         * editing/CompositeEditCommand.cpp:
923         (WebCore::CompositeEditCommand::positionAvoidingSpecialElementBoundary):
924         Don't avoid the anchor if doing so would skip over a line break, that
925         would put content in the wrong paragraph, which can throw ReplaceSelectionCommand,
926         which relies on moveParagraphs into infinite recursion.
927         Renamed the input position.
928         Don't need to re-fetch the enclosing anchor when preparing to push it down,
929         since it hasn't changed since the top of the function.
930
931 2007-04-24  Timothy Hatcher  <timothy@apple.com>
932
933         Reviewed by Adam.
934
935         <rdar://problem/5133011> 64-bit: Attempting to paste copied text in a input field results in a crash at WebCore::Range::startPosition()
936
937         Change a couple incorrect uses of LONG_MAX to INT_MAX to match the variable type they are used in.
938         The LONG_MAX on 64-bit was overflowing the int variables, causing this crash on paste.
939
940         * bridge/mac/WebCoreAXObject.mm:
941         (-[WebCoreAXObject value]):
942         * editing/TextIterator.cpp:
943         (WebCore::TextIterator::handleTextNode):
944         (WebCore::TextIterator::handleTextBox):
945
946 2007-04-24  Timothy Hatcher  <timothy@apple.com>
947
948         Reviewed by Adam.
949
950         <rdar://problem/4966982> 64-bit: In a unordered list, TYPE=DISC and TYPE=CIRCLE attribute values are ignored
951
952         We need to draw our full-circle arcs counter-clockwise, since a clockwise arc from 0 to 2Ï\80 is no arc at all!
953         This only worked on 32-bit due to a rounding error in CoreGraphics, causing it to draw a full circle anyway.
954
955         * platform/graphics/cg/GraphicsContextCG.cpp:
956         (WebCore::GraphicsContext::drawEllipse):
957
958 2007-04-24  Brady Eidson  <beidson@apple.com>
959
960         Reviewed by Beth, Hyatt, Ada, and Darin
961
962         <rdar://problem/5011477> and <rdar://problem/5011514>
963         Provide support for the icon.db to be moved to a different directory from the old WebKit-style
964         icons, and remove the old directory if that is the case
965
966         Support for this starts in WebCore, where we can use the metadata table in the icon.db to track
967         whether or not we've ever done the import
968
969         * WebCore.exp:
970         * loader/icon/IconDatabase.cpp:
971         (WebCore::IconDatabase::defaultDatabaseFilename): Changed to "Icons.db"
972         (WebCore::IconDatabase::IconDatabase):
973         (WebCore::IconDatabase::deleteAllPreparedStatements): Delete the new statements added
974         (WebCore::IconDatabase::imported): Grab this flag from the DB or return the cached flag
975         (WebCore::IconDatabase::setImported): Store this flag into the DB
976         (WebCore::IconDatabase::importedQuery): Actually do the DB query for this save
977         (WebCore::IconDatabase::setImportedQuery): Actually do the DB query for this retrieval
978         * loader/icon/IconDatabase.h:
979
980 2007-04-24  Darin Adler  <darin@apple.com>
981
982         Reviewed by Justin.
983
984         - fix <rdar://problem/4356361> Selection after multiple delete
985           keypresses and undo selects only the last deleted character
986
987         Test: editing/undo/undo-combined-delete-boundary.html
988         Test: editing/undo/undo-combined-delete.html
989         Test: editing/undo/undo-delete-boundary.html
990         Test: editing/undo/undo-delete.html
991         Test: editing/undo/undo-forward-delete-boundary.html
992         Test: editing/undo/undo-forward-delete.html
993
994         * editing/TypingCommand.cpp:
995         (WebCore::TypingCommand::insertText): Fix obviously-wrong code where there were missing
996         braces. I couldn't find any real symptom of this, but I think the fix should go in anyway.
997         All layout tests still pass.
998         (WebCore::TypingCommand::deleteKeyPressed): Added code to compute a selection that goes
999         back to the beginning of the composite editing operation.
1000         (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
1001
1002         * editing/Selection.h:
1003         * editing/Selection.cpp: (WebCore::Selection::setWithoutValidation):
1004         Added. Back door to allow setting the ends of a selection without revalidating,
1005         because we need to use it on a selection where the endpoints may no longer be
1006         valid due to mutations done by earlier pieces of the editing operation.
1007
1008         * editing/EditCommand.h:
1009         (WebCore::EditCommand::startingSelection): Return a const& for speed.
1010         (WebCore::EditCommand::endingSelection): Ditto.
1011
1012 2007-04-24  Sam Weinig  <sam@webkit.org>
1013
1014         Reviewed by Mitz.
1015
1016         - fix for http://bugs.webkit.org/show_bug.cgi?id=13448
1017           REGRESSION: setting an input element's value to JavaScript null gives "null"
1018
1019         Test: fast/forms/input-null.html
1020
1021         * html/HTMLInputElement.idl: Convert JS null to the empty string on setting
1022         DOMString attributes.
1023
1024 2007-04-24  Mitz Pettel  <mitz@webkit.org>
1025
1026         Reviewed by Dave Hyatt.
1027
1028         - fix http://bugs.webkit.org/show_bug.cgi?id=13453
1029           Control clip isn't applied to children's backgrounds, outlines and floats
1030
1031         Test: fast/forms/control-clip.html
1032
1033         * rendering/RenderBlock.cpp:
1034         (WebCore::RenderBlock::paint): Apply the clip in all phases that paint
1035         children. Split PaintPhaseOutline and PaintPhaseChildBlockBackground into
1036         two phases each, applying the clip only to the children.
1037         * rendering/RenderListBox.cpp:
1038         (WebCore::RenderListBox::paintObject): Treat the scrollbar as part of the
1039         background rather than as a child's background, now that children are
1040         clipped out.
1041
1042 2007-04-24  Benjamin Otte  <otte@gnome.org>
1043
1044         Reviewed by Mark Rowe.
1045
1046         Gdk build system improvements.
1047
1048         * make-generated-sources.sh: Exit with failure status if make fails.
1049
1050 2007-04-24  Benjamin Otte  <otte@gnome.org>
1051
1052         Reviewed by Mark Rowe.
1053
1054         Gdk build system improvements.
1055
1056         * Projects/gdk/webcore-gdk.bkl:
1057         fail if running any of the commands failed. In particular
1058         make-generated-sources.sh
1059
1060 2007-04-23  Beth Dakin  <bdakin@apple.com>
1061
1062         Reviewed by Adam.
1063
1064         Fix for <rdar://problem/5155507> REGRESSION: Crash in 
1065         RenderLayer::setHasVisibleContent()
1066
1067         * rendering/RenderContainer.cpp:
1068         (WebCore::RenderContainer::appendChildNode): Must null-check 
1069         enclosingLayer()
1070         (WebCore::RenderContainer::insertChildNode): Same.
1071
1072 2007-04-23  David Hyatt  <hyatt@apple.com>
1073
1074         Fix for bug 13337, deep tag nesting is slow.  This patch fixes a number of O(n^2) issues as well as making
1075         a few performance optimizations based off profiling.  Details next to each change below.
1076
1077         Note that calcMinMaxWidth being slow is a critical separate piece of this puzzle.  Until bug 13430 is fixed,
1078         render tree construction will be O(n^2) (because of the minmaxrecalc bit setting being stupid enough to
1079         always crawl to the root of the tree) and calcMinMaxWidth will waste tons of unnecessary time.
1080
1081         When these fixes are combined with the calcMinMaxWidth fix in 13430, the penguin page specified in 13337
1082         loads in < 2 seconds (down from an infinite hang before).
1083
1084         Reviewed by aroben, ollie
1085
1086         * css/cssstyleselector.cpp:
1087         (WebCore::CSSStyleSelector::locateCousinList):
1088         (WebCore::CSSStyleSelector::locateSharedStyle):
1089         * css/csstyleselector.h
1090         Cap the depth of cousin searching on the shared style optimization.  We will be willing to (at most) crawl
1091         up the tree the same distance that we were willing to crawl backwards through sibling lists.  Leaving it
1092         uncapped resulted in pathological style resolution for the case of an infinitely nested chain of singletons.
1093
1094         * html/HTMLParser.cpp:
1095         (WebCore::HTMLParser::handleResidualStyleCloseTagAcrossBlocks):
1096         (WebCore::HTMLParser::popBlock):
1097         Cap the number of residual style tags that we are willing to reopen.  We will reopen at most 200
1098         residual style tags, since the assumption is that once that many tags are on the stack, you're probably already
1099         every kind of bold, italic, and color of the rainbow.
1100
1101         * rendering/RenderFlow.cpp:
1102         (WebCore::RenderFlow::absoluteClippedOverflowRect):
1103         absoluteClippedOverflowRect can just return the empty rect when the inline flow has no line boxes instead of
1104         doing a bunch of work (and calling containingBlock()) for no reason.
1105
1106         * rendering/RenderInline.cpp:
1107         (WebCore::RenderInline::addChildToFlow):
1108         Remove the useless containingBlock() check from addChildToFlow.  Obviously every inline's containing block
1109         is a block flow.
1110
1111         * rendering/bidi.cpp:
1112         (WebCore::inlineWidth):
1113         (WebCore::RenderBlock::createLineBoxes):
1114         Cap the depth of individual line trees to 200.  Again the assumption is that once that many open inlines exist
1115         all on one line that there's no way this would be intentional.
1116
1117 2007-04-23  David Hyatt  <hyatt@apple.com>
1118
1119         Fix for bug 13430, cap inline splitting for continuations to a maximum depth of 200.
1120
1121         Reviewed by olliej, antti
1122
1123         * rendering/RenderInline.cpp:
1124         (WebCore::RenderInline::splitInlines):
1125
1126 2007-04-23  Alp Toker  <alp@atoker.com>
1127
1128         Gdk build fix. Track EventHandler change made in r21042.
1129
1130         * page/gdk/EventHandlerGdk.cpp:
1131         (WebCore::EventHandler::passWheelEventToWidget):
1132         (WebCore::EventHandler::passMousePressEventToScrollbar):
1133
1134 2007-04-23  Timothy Hatcher  <timothy@apple.com>
1135
1136         Reviewed by Darin.
1137
1138         <rdar://problem/5024945> -[DOMRange lineBoxRects] doesn't include start and end nodes that have offsets
1139
1140         * rendering/RenderText.cpp:
1141         (WebCore::RenderText::addLineBoxRects): Use min(box->len(), end) instead of special-casing UINT_MAX.
1142
1143 2007-04-23  Adele Peterson  <adele@apple.com>
1144
1145         Fix by Darin, reviewed by me.
1146
1147         Fix for REGRESSION: Can't upload attachments to bugzilla since the file upload control is reset immediately 
1148         http://bugs.webkit.org/show_bug.cgi?id=13461
1149
1150         * rendering/RenderFileUploadControl.cpp: (WebCore::RenderFileUploadControl::updateFromElement):
1151         Only clear the FileChooser if the value is empty *and* (not or) the filename is empty.
1152
1153 2007-04-23  Adele Peterson  <adele@apple.com>
1154
1155         Reviewed by Adam.
1156
1157         Updated fix for <rdar://problem/4887426> Set a reasonable maximum number of recent searches for search menu
1158
1159         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::parseMappedAttribute): Use a const int maxSavedResults instead of magic number 256.
1160
1161 2007-04-23  Timothy Hatcher  <timothy@apple.com>
1162
1163         Reviewed by Hyatt.
1164
1165         <rdar://problem/5024945> -[DOMRange lineBoxRects] doesn't include start and end nodes that have offsets
1166
1167         Don't call selectionRect with a -1 end position, instead use the text length.
1168
1169         * rendering/RenderText.cpp:
1170         (WebCore::RenderText::addLineBoxRects):
1171
1172 2007-04-23  Adele Peterson  <adele@apple.com>
1173
1174         Fixed and reviewed by Darin, Adele, and Oliver.
1175
1176         WebCore part of fix for <rdar://problem/5107538> REGRESSION: Page scroll when selecting characters from inline input candidate window by arrow buttons
1177         http://bugs.webkit.org/show_bug.cgi?id=13263
1178
1179         * dom/KeyboardEvent.h: (WebCore::KeypressCommand::isEmpty): Added helper method.
1180
1181 2007-04-23  Patti Hoa  <patti@apple.com>
1182         
1183         <rdar://problem/4938364> Attachment button has different string length between attributeStringForRange and stringForRange
1184         <rdar://problem/4939536> AXLengthForTextMarkerRange returns zero length for the range of an attachment
1185         
1186         Reviewed by Darin.
1187
1188         * bridge/mac/WebCoreAXObject.mm:
1189         (nsStringForReplacedNode):
1190         Added helper routine to check if the replaced node should be exposed as an attachment character in string representation.
1191         Added an additional check to make sure that text node is not considered a replaced node.
1192         Removed helper routine AXAttributedStringAppendReplaced since half of the functions are now taken care by nsStringForReplacedNode.
1193         The other half is directly used in the doAXAttributedStringForTextMarkerRange method.
1194         (-[WebCoreAXObject doAXStringForTextMarkerRange:]):
1195         (-[WebCoreAXObject doAXAttributedStringForTextMarkerRange:]):
1196         Both string and AttrbributedString methods will now utilize the helper routine nsStringForReplacedNode to return replacement
1197         characters for range occupied by attachment.
1198         
1199 2007-04-23  Adele Peterson  <adele@apple.com>
1200
1201         Reviewed by Oliver.
1202
1203         Fix for <rdar://problem/4887426> Set a reasonable maximum number of recent searches for search menu
1204
1205         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::parseMappedAttribute):
1206         Enforce a maximum of 256 saved results for the search field.
1207
1208 2007-04-23  Adele Peterson  <adele@apple.com>
1209
1210         Reviewed by Hyatt & Adam.
1211
1212         Fix for <rdar://problem/4807799> REGRESSION: calling select() in onSearch handler doesn't work if you hit enter to trigger the event
1213         Fix for <rdar://problem/5153970> onChange doesn't fire when focusing a popup, using type-ahead to select, and leaving
1214
1215         This previous behavior to blur controls when hitting enter was added to achieve the result of firing the change event.  Firefox does not
1216         fire blur- just the change event, so this fix will match Firefox behavior.
1217
1218         This also fixes a bug where we didn't fire the change event when using type-ahead selection with the popup menu.
1219
1220         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler): Fire change event instead of blur event when hitting enter.
1221
1222         * html/HTMLSelectElement.cpp:
1223         (WebCore::HTMLSelectElement::dispatchFocusEvent): Now that we have type-ahead selection for popups that can be opened with the arrow keys,
1224          we should always save the last selection when a popup gets focus, so it can be compared to the current selection when it loses focus.
1225         (WebCore::HTMLSelectElement::dispatchBlurEvent): For the same reasons as above, we should fire onChange for all popups on blur.
1226
1227         (WebCore::HTMLSelectElement::menuListDefaultEventHandler): Fire change event instead of blur event when hitting enter.  Removed an unnecessary
1228          check for form() before calling menuListOnChange().  Removed an unnecessary check for renderer() and usesMenuList().
1229         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler): Remove call to blur.  Since list boxes fire the change event immediately after an
1230          action is taken, we don't need to fire anything after hitting enter.
1231         (WebCore::HTMLSelectElement::menuListOnChange): Reset m_lastOnChangeIndex after firing the change event.
1232
1233 2007-04-23  Anders Carlsson  <andersca@apple.com>
1234
1235         Reviewed by Ada.
1236
1237         <rdar://problem/5061022>
1238         REGRESSION: Acrobat 8 plug-in fails to scroll with trackpad two-finger scroll or mouse wheel (12995)
1239         
1240         Pass wheel events to all widgets.
1241         
1242         * page/EventHandler.cpp:
1243         (WebCore::EventHandler::handleWheelEvent):
1244         * page/EventHandler.h:
1245         * page/mac/EventHandlerMac.mm:
1246         (WebCore::EventHandler::passWheelEventToWidget):
1247
1248 2007-04-23  Alp Toker  <alp@atoker.com>
1249
1250         Reviewed by Mark.
1251
1252         Save and restore the context state when beginning and ending a transparency layer.
1253
1254         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1255         (WebCore::GraphicsContext::beginTransparencyLayer):
1256         (WebCore::GraphicsContext::endTransparencyLayer):
1257
1258 2007-04-23  Alp Toker  <alp@atoker.com>
1259
1260         Reviewed by Mark.
1261
1262         Further implementation and checks. The opacity layer code is not so beautiful
1263         but gets the job done with fewer complications than maintaining our own stack.
1264
1265         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1266         (WebCore::GraphicsContext::translate):
1267         (WebCore::GraphicsContext::setPlatformStrokeThickness):
1268         (WebCore::GraphicsContext::beginTransparencyLayer):
1269         (WebCore::GraphicsContext::endTransparencyLayer):
1270         (WebCore::GraphicsContext::setCompositeOperation):
1271         (WebCore::GraphicsContext::rotate):
1272         (WebCore::GraphicsContext::scale):
1273
1274 2007-04-23  Darin Adler  <darin@apple.com>
1275
1276         Reviewed by Hyatt.
1277
1278         - rename box-sizing to -webkit-box-sizing
1279           because of <rdar://problem/4667227> REGRESSION: Shifted table on page at
1280           https://us.etrade.com/e/t/home (due to box-sizing)
1281
1282         * css/CSSComputedStyleDeclaration.cpp:
1283         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Rename.
1284         * css/CSSPropertyNames.in: Ditto.
1285         * css/cssparser.cpp: (WebCore::CSSParser::parseValue): Rename and take out comment
1286         explaining why we aren't prefacing with -webkit.
1287         * css/cssstyleselector.cpp:
1288         (WebCore::CSSStyleSelector::applyProperty): Rename.
1289         * css/html4.css: Rename.
1290         * css/quirks.css: Rename.
1291
1292 2007-04-23  Alp Toker  <alp@atoker.com>
1293
1294         Reviewed by Hyatt.
1295
1296         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1297         (WebCore::GraphicsContext::drawEllipse):
1298         (WebCore::GraphicsContext::drawConvexPolygon):
1299         Fix stroking and filling of ellipses and polygons.
1300         * platform/graphics/cairo/ImageCairo.cpp:
1301         (WebCore::BitmapImage::draw): Make use of a new GraphicsContext
1302         function to simplify the code.
1303         (WebCore::Image::drawPattern): Now implemented. This makes content
1304         with tiled patterns (eg. CSS repeat) render correctly.
1305         * platform/graphics/gdk/ImageGdk.cpp:
1306         (WebCore::Image::drawPattern): Remove old stub.
1307
1308 2007-04-22  Lars Naesbye Christensen  <lars@naesbye.dk>
1309
1310         Reviewed by Tim Hatcher.
1311
1312         Prettier, more modern 'cell' cursor
1313         http://bugs.webkit.org/show_bug.cgi?id=13441
1314         Also updates past ChangeLog entries to new email address
1315
1316         * ChangeLog:
1317         * ChangeLog-2006-12-31:
1318         * Resources/cellCursor.png:
1319
1320 2007-04-23  Mark Rowe  <mrowe@apple.com>
1321
1322         Rubber-stamped by Hyatt.
1323
1324         Rename cMaxPenderingSourceLengthInLowBandwidthDisplay to cMaxPendingSourceLengthInLowBandwidthDisplay.
1325
1326         * loader/FrameLoader.cpp:
1327         (WebCore::FrameLoader::switchOutLowBandwidthDisplayIfReady):
1328
1329 2007-04-22  Maciej Stachowiak  <mjs@apple.com>
1330
1331         Reviewed by Darin and Geoff.
1332
1333         - move most of Window's data members into a separate private object, to avoid needing
1334         to use the oversize allocator for it
1335         http://bugs.webkit.org/show_bug.cgi?id=13381
1336         
1337         It was the only remaining JSObject subclass to use the oversize
1338         allocator on 32-bit platforms, and having oversize objects around
1339         makes garbage collection slower so this would hurt performance
1340         with many tabs/windows open.
1341         
1342         No significant effect on JS iBench.
1343
1344         * bindings/js/kjs_events.cpp:
1345         (KJS::JSUnprotectedEventListener::JSUnprotectedEventListener):
1346         (KJS::JSUnprotectedEventListener::~JSUnprotectedEventListener):
1347         (KJS::JSEventListener::JSEventListener):
1348         (KJS::JSEventListener::~JSEventListener):
1349         (KJS::JSLazyEventListener::parseCode):
1350         * bindings/js/kjs_window.cpp:
1351         (KJS::WindowPrivate::WindowPrivate):
1352         (KJS::Window::Window):
1353         (KJS::Window::~Window):
1354         (KJS::Window::location):
1355         (KJS::Window::selection):
1356         (KJS::Window::locationbar):
1357         (KJS::Window::menubar):
1358         (KJS::Window::personalbar):
1359         (KJS::Window::statusbar):
1360         (KJS::Window::toolbar):
1361         (KJS::Window::scrollbars):
1362         (KJS::Window::mark):
1363         (KJS::Window::getValueProperty):
1364         (KJS::Window::findJSEventListener):
1365         (KJS::Window::findJSUnprotectedEventListener):
1366         (KJS::Window::clearHelperObjectProperties):
1367         (KJS::Window::clear):
1368         (KJS::Window::setCurrentEvent):
1369         (KJS::Window::setReturnValueSlot):
1370         (KJS::Window::clearAllTimeouts):
1371         (KJS::Window::installTimeout):
1372         (KJS::Window::pauseTimeouts):
1373         (KJS::Window::resumeTimeouts):
1374         (KJS::Window::clearTimeout):
1375         (KJS::Window::timerFired):
1376         (KJS::Window::disconnectFrame):
1377         (KJS::Window::jsEventListeners):
1378         (KJS::Window::jsHTMLEventListeners):
1379         (KJS::Window::jsUnprotectedEventListeners):
1380         (KJS::Window::jsUnprotectedHTMLEventListeners):
1381         * bindings/js/kjs_window.h:
1382
1383 2007-04-22  David Hyatt  <hyatt@apple.com>
1384
1385         Fix 1% regression on the PLT.  Make sure roundToDevicePixels does no
1386         work when no scale is in effect.
1387
1388         Reviewed by mjs
1389
1390 2007-04-22  Darin Adler  <darin@apple.com>
1391
1392         Reviewed by Oliver.
1393
1394         - fix small things noticed while looking into a font subsitution bug
1395
1396         * platform/Font.h: (WebCore::Font::operator==): Corrected a misleading comment.
1397
1398         * platform/Font.cpp:
1399         (WebCore::Font::Font): Initialize m_pageZero to 0 in the empty constructor instead
1400         of leaving it uninitialized. Initialize m_fontList for tighter code. Remove unneeded
1401         initialization of RefPtr members to 0. Changed the copy constructor to use initialization
1402         for tighter code.
1403         (WebCore::Font::operator=): Sorted to match the order from the header and the copy
1404         constructor, and removed the uneeded self-assignment check.
1405
1406 2007-04-22  Darin Adler  <darin@apple.com>
1407
1408         Reviewed by Maciej.
1409
1410         - fix http://bugs.webkit.org/show_bug.cgi?id=5196
1411           <rdar://problem/4537384> input type=file fields with style=display:none do not post
1412           their values (5196)
1413
1414         - fix http://bugs.webkit.org/show_bug.cgi?id=8248
1415           Can not clear file input field
1416
1417         * manual-tests/clear-input-file.html: Added.
1418
1419         * html/HTMLInputElement.cpp:
1420         (WebCore::HTMLInputElement::appendFormData): Remove check that prevents submission of
1421         form data when there is no renderer or the renderer is invisible. While well-intentioned,
1422         the rule does not match the behavior of other web browsers.
1423         (WebCore::HTMLInputElement::setValue): Instead of disallowing all value changes for file
1424         type, allow changes to the empty string.
1425         (WebCore::HTMLInputElement::storesValueSeparateFromAttribute): Made file type return true
1426         for this. 1) The file type does store its value separate from the value attribute.
1427         2) The code in setInputType() should do the right thing given this new value, according to
1428         my inspection of the code. 3) The code in both reset() and setValue() will work properly
1429         if this is true, which was the motivation for changing it.
1430
1431         * platform/FileChooser.h: Added a clear function.
1432         * platform/FileChooser.cpp: (WebCore::FileChooser::clear): Clear the filename and the icon.
1433
1434         * rendering/RenderFileUploadControl.cpp:
1435         (WebCore::RenderFileUploadControl::valueChanged): Used a local variable to make the code
1436         a little bit more readable (and match the change below).
1437         (WebCore::RenderFileUploadControl::updateFromElement): Used local variables a bit more in
1438         the old code. Added code that will call clear on the FileChooser and repaint if the DOM
1439         element has an empty value and the FileChooser does not.
1440
1441 2007-04-22  Grace Kloba  <klobag@gmail.com>
1442
1443         Reviewed by Hyatt.
1444
1445         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12279
1446         Implemented two pass loading. Enabled by WTF_USE_LOW_BANDWIDTH_DISPLAY flag.
1447
1448         * dom/Document.cpp:
1449         (WebCore::Document::Document): initialize member variable m_inLowBandwidthDisplay
1450
1451         * dom/Document.h:
1452         (WebCore::Document::haveStylesheetsLoaded): while in low bandwidth display mode, ignore pending style sheets
1453         (WebCore::Document::setDocLoader):
1454         (WebCore::Document::inLowBandwidthDisplay):
1455         (WebCore::Document::setLowBandwidthDisplay):
1456         * html/HTMLTokenizer.cpp:
1457         (WebCore::HTMLTokenizer::scriptHandler): while in low bandwidth display mode, don't execute JavaScript
1458
1459         * loader/Cache.cpp:
1460         (WebCore::Cache::requestResource): while in low bandwidth display mode, don't let style sheet and JavaScript block
1461
1462         * loader/CachedCSSStyleSheet.cpp:
1463         (WebCore::CachedCSSStyleSheet::checkNotify): add notifyFinished() as client may need "this" pointer
1464
1465         * loader/DocLoader.h:
1466         (WebCore::DocLoader::replaceDocument):
1467         * loader/FrameLoader.cpp:
1468         (WebCore::FrameLoader::FrameLoader):
1469         (WebCore::FrameLoader::requestFrame): while in low bandwidth display mode, don't load sub-frame
1470         (WebCore::FrameLoader::stopLoading):
1471         (WebCore::FrameLoader::begin): set to low bandwidth display mode if the top frame is HTML document
1472         (WebCore::FrameLoader::write):
1473         (WebCore::FrameLoader::endIfNotLoading):
1474         (WebCore::FrameLoader::checkCompleted): while in low bandwidth display mode, don't set complete
1475         (WebCore::FrameLoader::requestObject): while in low bandwidth display mode, don't care Object
1476         (WebCore::FrameLoader::addLowBandwidthDisplayRequest):
1477         (WebCore::FrameLoader::removeAllLowbandwidthDisplayRequests):
1478         (WebCore::FrameLoader::notifyFinished):
1479         (WebCore::FrameLoader::switchOutLowBandwidthDisplayIfReady):
1480         * loader/FrameLoader.h:
1481         (WebCore::FrameLoader::FrameLoader::needToSwitchOutLowBandwidthDisplay):
1482         (WebCore::FrameLoader::FrameLoader::setUseLowBandwidthDisplay):
1483         (WebCore::FrameLoader::FrameLoader::useLowBandwidthDisplay):
1484
1485 2007-04-22  Darin Adler  <darin@apple.com>
1486
1487         Reviewed by Tim Hatcher.
1488
1489         - fix http://bugs.webkit.org/show_bug.cgi?id=13439
1490           4 problems found in dashboard-region parser and serializer
1491
1492         Test: fast/css/dashboard-region-parser.html
1493
1494         * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::cssText):
1495         Fix code that overwrote each additional region with the previous one to
1496         instead build a space-separated list. Check for the case of an identifier
1497         that's invalid, since that's (accidentally) how we represent a region
1498         value that doesn't have explicit top/right/bottom/left values. The old code
1499         would end up writing out four spaces after the region type.
1500
1501         * css/cssparser.cpp: (WebCore::CSSParser::parseDashboardRegions):
1502         Fail to parse if there is something after the "none" identifier or after
1503         the arguments inside the dashboard-region "function". Also replaced code
1504         that produced a identifier with CSS_VAL_INVALID in a roundabout way with
1505         code that does it explicitly.
1506
1507 2007-04-22  Darin Adler  <darin@apple.com>
1508
1509         Reviewed by Adele.
1510
1511         - support for fix for <rdar://problem/5100240> REGRESSION: Control-O broken
1512
1513         * dom/KeyboardEvent.h: Include a vector of command names in the KeypressCommand object
1514         instead of a single command name.
1515
1516 2007-04-22  Alexey Proskuryakov  <ap@webkit.org>
1517
1518         Reviewed by Darin.
1519
1520         http://bugs.webkit.org/show_bug.cgi?id=13115
1521         REGRESSION: 1000% performance regression in DOM access by index, which was already slow
1522
1523         * dom/NodeList.h: Move cached data into a separate class, so it can be shared.
1524
1525         * dom/Node.h: Replace the set of registered NodeLists with a struct that also
1526         contains a shared NodeList::Caches (so the size of Node doesn't change).
1527
1528         * dom/NodeList.cpp:
1529         (WebCore::NodeList::NodeList):
1530         (WebCore::NodeList::~NodeList):
1531         (WebCore::NodeList::recursiveLength):
1532         (WebCore::NodeList::itemForwardsFromCurrent):
1533         (WebCore::NodeList::itemBackwardsFromCurrent):
1534         (WebCore::NodeList::recursiveItem):
1535         (WebCore::NodeList::itemWithName):
1536         (WebCore::NodeList::rootNodeChildrenChanged):
1537         (WebCore::NodeList::NodeListInfo::NodeListInfo):
1538         (WebCore::NodeList::NodeListInfo::reset):
1539         * dom/ChildNodeList.cpp:
1540         (WebCore::ChildNodeList::ChildNodeList):
1541         (WebCore::ChildNodeList::length):
1542         (WebCore::ChildNodeList::item):
1543         (WebCore::ChildNodeList::nodeMatches):
1544         * dom/ChildNodeList.h:
1545         * dom/Node.cpp:
1546         (WebCore::Node::childNodes):
1547         (WebCore::Node::registerNodeList):
1548         (WebCore::Node::unregisterNodeList):
1549         (WebCore::Node::notifyLocalNodeListsAttributeChanged):
1550         (WebCore::Node::notifyLocalNodeListsChildrenChanged):
1551         Adjust for the above changes.
1552
1553 2007-04-21  Mitz Pettel  <mitz@webkit.org>
1554
1555         Reviewed by Darin.
1556
1557         - fix http://bugs.webkit.org/show_bug.cgi?id=13391
1558           REGRESSION (r18819): Incomplete repaint of button text
1559
1560         Test: fast/repaint/control-clip.html
1561
1562         Ignore controls' lightweight clip in repaint rect computation for now.
1563
1564         * rendering/RenderBox.cpp:
1565         (WebCore::RenderBox::computeAbsoluteRepaintRect):
1566
1567 2007-04-21  Darin Adler  <darin@apple.com>
1568
1569         Reviewed by Adam.
1570
1571         - fix <rdar://problem/4816343> :-khtml-drag CSS pseudo-class changed to :-webkit-drag, need alias
1572
1573         * css/CSSSelector.cpp: (WebCore::CSSSelector::extractPseudoType):
1574         Since Apple documentation claims "-khtml-drag" works, we need to keep it working,
1575         so add it back as an alias.
1576
1577 2007-04-21  Darin Adler  <darin@apple.com>
1578
1579         Reviewed by Oliver.
1580
1581         - fix <rdar://problem/4782422> REGRESSION: -[stringByEvaluatingJavaScriptFromString]
1582           returns an empty string instead of nil for non-string results
1583
1584         * page/mac/WebCoreFrameBridge.mm:
1585         (-[WebCoreFrameBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
1586         Added a call to nsStringNilIfEmpty to restore the old behavior. It might be nice to
1587         distinguish the empty string from a non-string result, but there's no obvious way
1588         to do that, and for compatibility it's probably best to just restore the old
1589         behavior instead.
1590
1591 2007-04-21  David Hyatt  <hyatt@apple.com>
1592
1593         Fix for bug 13432, determineFlowSpacing is O(n^2).
1594
1595         Reviewed by aroben
1596
1597         * rendering/InlineBox.cpp:
1598         (WebCore::InlineBox::nextOnLineExists):
1599         (WebCore::InlineBox::prevOnLineExists):
1600         * rendering/InlineBox.h:
1601         (WebCore::InlineBox::InlineBox):
1602
1603 2007-04-21  Lamar Goddard <lamargoddard@gmail.com>
1604
1605         Reviewed by Darin.
1606
1607         Fix for http://bugs.webkit.org/show_bug.cgi?id=5262
1608         <rdar://problem/5018778>
1609         XMLSerializer drops Namespace information
1610
1611         Updated WebCore::markup to output namespace information for elements/attributes whose namespace information
1612         doesn't appear in its scope in the output.
1613
1614         Added test case: fast/dom/serialize-nodes.xhtml
1615
1616         * WebCore/editing/markup.cpp:
1617         (WebCore::createMarkup(const Node*, ...)): Changed call to WebCore::markup to match parameters
1618         (WebCore::markup): Changed recursive call to match tree structure, removed ASSERT and no longer needed includeSiblings parameter.
1619         (WebCore::startMarkup): Added optional parameter to track namespaces in the current scope.
1620         (WebCore::addNamespace): Function to add namespace information to markup.
1621         (WebCore::shouldAddNamespaceAttr):
1622         (WebCore::shouldAddNamespaceElem): Functions that test whether namespace information should be added for a given node.
1623         * WebCore/dom/Document.idl:
1624         (createElementNS):
1625         (createAttributeNS):
1626         (getElementsByTagNameNS): Added [ConvertNullToNullString] to namespaceURI parameter.
1627         * WebCore/dom/Node.cpp:
1628         (Node::getElementsByTagNameNS): removed test for namespaceURI being null as null can be a valid namespace.
1629
1630 2007-04-21  Alexey Proskuryakov  <ap@webkit.org>
1631
1632         Reviewed by Darin.
1633
1634         http://bugs.webkit.org/show_bug.cgi?id=13300
1635         Reproducible crash opening anekdot.ru
1636
1637         * html/HTMLParser.cpp:
1638         (WebCore::HTMLParser::HTMLParser):
1639         (WebCore::HTMLParser::getNode):
1640         (WebCore::HTMLParser::handleIsindex):
1641         * html/HTMLParser.h:
1642         Made HTMLParser::form a RefPtr, and renamed it to m_currentFormElement.
1643         Made m_currentMapElement a RefPtr.
1644
1645 2007-04-21  Mitz Pettel  <mitz@webkit.org>
1646
1647         Reviewed by Darin.
1648
1649         - fix http://bugs.webkit.org/show_bug.cgi?id=13353
1650           REGRESSION (r20754-20766): Textarea does not resize when scrollbar is present
1651
1652         Test: fast/overflow/hit-test-overflow-controls.html
1653
1654         * page/EventHandler.cpp:
1655         (WebCore::EventHandler::handleMouseMoveEvent): Avoid activating scrollbars
1656         during layer resize.
1657         * rendering/RenderBlock.cpp:
1658         (WebCore::RenderBlock::isPointInOverflowControl): Renamed isPointInScrollbar
1659         to this, to reflect that it returns true for points in the resize corner
1660         as well. Changed it to call the layer to do the actual work.
1661         (WebCore::RenderBlock::nodeAtPoint): Updated for the above rename.
1662         * rendering/RenderBlock.h:
1663         * rendering/RenderLayer.cpp:
1664         (WebCore::RenderLayer::horizontalScrollbarWidget): Fixed typo in this function's
1665         name (it was horizontaScrollbarWidget).
1666         (WebCore::RenderLayer::hitTestOverflowControls): Added. Returns whether the
1667         hit point is in one of the scrollbars or the resize corner, and updates the
1668         platform scrollbar in the hit test result if a scrollbar was hit.
1669         * rendering/RenderLayer.h:
1670         * rendering/RenderListBox.cpp:
1671         (WebCore::RenderListBox::isPointInOverflowControl): Rename.
1672         * rendering/RenderListBox.h:
1673
1674 2007-04-21  Mitz Pettel  <mitz@webkit.org>
1675
1676         Reviewed by Darin.
1677
1678         - fix http://bugs.webkit.org/show_bug.cgi?id=13417
1679           Repro crash when the first argument to getMatchedCSSRules is not an element
1680
1681         Test: fast/dom/Window/getMatchedCSSRules-null-crash.html
1682
1683         * css/cssstyleselector.cpp:
1684         (WebCore::CSSStyleSelector::styleRulesForElement): Added null check.
1685
1686 2007-04-21  Mitz Pettel  <mitz@webkit.org>
1687
1688         Reviewed by Darin.
1689
1690         - fix http://bugs.webkit.org/show_bug.cgi?id=13416
1691           Repro crash after referencing the user stylesheet from JavaScript
1692
1693         No test included because DumpRenderTree does not support setting the user stylesheet.
1694
1695         * css/cssstyleselector.cpp:
1696         (WebCore::CSSStyleSelector::CSSStyleSelector):
1697         (WebCore::CSSStyleSelector::~CSSStyleSelector):
1698         * css/cssstyleselector.h: Made m_userSheet a RefPtr.
1699
1700 2007-04-21  MorganL  <morganl.webkit@yahoo.com>
1701
1702         Reviewed by Adam.
1703
1704         NPObject should be forward declared using 'struct' instead of 'class'
1705
1706         * page/Frame.h:
1707
1708 2007-04-21  Alp Toker  <alp@atoker.com>
1709
1710         Gdk build fix.
1711
1712         * platform/gdk/FontPlatformDataGdk.cpp:
1713         (WebCore::FontPlatformData::FontPlatformData): Use the correct casts.
1714
1715 2007-04-20  Brady Eidson  <beidson@apple.com>
1716
1717         Reviewed by Oliver (Black Sheep)
1718
1719         <rdar://problem/3559794>
1720         [WebView setMaintainsBackForwardList:] doesn't actually flush out the current page caches
1721
1722         * WebCore.exp:
1723         * history/BackForwardList.cpp:
1724         (WebCore::BackForwardList::BackForwardList): Set the flag to true by default
1725         (WebCore::BackForwardList::addItem): Check the flag and bail if its false
1726         (WebCore::BackForwardList::setCapacity): More correct if it set the m_current to 
1727           NoCurrentItemIndex if we're setting capacity to 0
1728         (WebCore::BackForwardList::enabled): 
1729         (WebCore::BackForwardList::setEnabled): If we're disabling, cycle capacity to 0 and 
1730           back to flush things out
1731         * history/BackForwardList.h: Add enabled(), setEnabled(bool), and m_enabled
1732
1733 2007-04-20  David Hyatt  <hyatt@apple.com>
1734
1735         Bug 13424, firstLineStyle and verticalPositionHint together take
1736         33% of the time on the new tag nesting PLT.  Don't waste time even
1737         looking for first-line styles if no stylesheet used them.
1738
1739         Reviewed by beth
1740
1741         * css/CSSGrammar.y:
1742         * dom/Document.cpp:
1743         (WebCore::Document::Document):
1744         * dom/Document.h:
1745         (WebCore::Document::usesFirstLineRules):
1746         (WebCore::Document::setUsesFirstLineRules):
1747         * rendering/RenderObject.cpp:
1748         (WebCore::RenderObject::verticalPositionHint):
1749         (WebCore::RenderObject::firstLineStyle):
1750
1751 2007-04-20  Peter Kasting  <pkasting@google.com>
1752
1753         Reviewed by Oliver.
1754
1755         - fix http://bugs.webkit.org/show_bug.cgi?id=13420
1756
1757         * platform/TextEncodingRegistry.cpp:
1758         (WebCore::addToTextEncodingNameMap): Change a pointer comparison to a
1759         strcmp(), since the strings here are not necessarily
1760         pointer-equivalent.
1761
1762 2007-04-20  Darin Adler  <darin@apple.com>
1763
1764         Reviewed by Geoff Garen and John Sullivan.
1765
1766         - fix <rdar://problem/4671964> document property on <iframe> elements causes problems for SAP application
1767
1768         Test: fast/dom/iframe-document.html
1769
1770         * bindings/js/kjs_html.h: Removed IFrameDocument.
1771         * bindings/js/kjs_html.cpp: (KJS::JSHTMLElement::iFrameGetter): Ditto.
1772
1773 2007-04-19  Alp Toker  <alp@atoker.com>
1774
1775         Reviewed by Mark.
1776
1777         * platform/gdk/FontGdk.cpp:
1778         (WebCore::Font::drawGlyphs):
1779         * platform/gdk/FontPlatformDataGdk.cpp:
1780         (WebCore::FontPlatformData::FontPlatformData): Fix font support in Gdk port.
1781
1782 2007-04-19  David Hyatt  <hyatt@apple.com>
1783
1784         Fix for bug 13208, implement word-break.  This patch produces a partial
1785         implementation of word-break.  word-break: break-all is implemented.  In
1786         addition, a custom value, word-break: break-word is added that is a hybrid
1787         of word-wrap: break-word and word-break: break-all (and more useful than
1788         either).
1789
1790         Reviewed by beth
1791
1792         Added fast/text/word-break.html
1793
1794         * css/CSSComputedStyleDeclaration.cpp:
1795         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
1796         * css/CSSPropertyNames.in:
1797         * css/CSSValueKeywords.in:
1798         * css/cssparser.cpp:
1799         (WebCore::CSSParser::parseValue):
1800         * css/cssstyleselector.cpp:
1801         (WebCore::CSSStyleSelector::applyProperty):
1802         * rendering/RenderStyle.cpp:
1803         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
1804         (WebCore::StyleRareInheritedData::operator==):
1805         (WebCore::RenderStyle::diff):
1806         * rendering/RenderStyle.h:
1807         (WebCore::):
1808         (WebCore::RenderStyle::breakWords):
1809         (WebCore::RenderStyle::wordBreak):
1810         (WebCore::RenderStyle::setWordBreak):
1811         (WebCore::RenderStyle::initialWordBreak):
1812         (WebCore::RenderStyle::initialWordWrap):
1813         * rendering/RenderText.cpp:
1814         (WebCore::RenderText::calcMinMaxWidthInternal):
1815         * rendering/RenderTextControl.cpp:
1816         (WebCore::RenderTextControl::createInnerTextStyle):
1817         (WebCore::RenderTextControl::calcHeight):
1818         * rendering/bidi.cpp:
1819         (WebCore::RenderBlock::findNextLineBreak):
1820
1821 2007-04-20  Mark Rowe  <mrowe@apple.com>
1822
1823         Qt build fix for FreeBSD.
1824
1825         * WebCore.pro: FreeBSD needs HAVE_PTHREAD_NP_H defined.
1826
1827 2007-04-19  Mitz Pettel  <mitz@webkit.org>
1828
1829         Reviewed by Darin.
1830
1831         - fix http://bugs.webkit.org/show_bug.cgi?id=13403
1832           REGRESSION (r18875-r18899): Can no longer type into search form field after searching and then clicking "back"
1833
1834         The problem was that the page was loaded from the page cache with a subtree
1835         marked for layout and the layout timer stopped (having been stopped when the
1836         page entered the page cache). FrameView::needsLayout() was returning false
1837         which prevented the pending layout from completing.
1838
1839         * page/FrameView.cpp:
1840         (WebCore::FrameView::clear): Removed the call to stop the layout timer, since
1841         reset() does that already.
1842         (WebCore::FrameView::needsLayout): Changed to return true if there's a subtree
1843         pending relayout.
1844
1845 2007-04-19  Justin Garcia  <justin.garcia@apple.com>
1846
1847         Reviewed by harrison
1848         
1849         <rdar://problem/5144139> 
1850         On delete, <BR> inserted into non-editable ToDo <TABLE> element
1851         
1852         The fact that the br was being inserted at a bad position 
1853         (a non-editable position and one inside a table instead of 
1854         before it) was fixed in the previous checkin. This change 
1855         stops us from inserting a br at all, to fix the bug.
1856         
1857         After a delete, we need a placeholder if the selection
1858         started at the start of a paragraph and ended at the end 
1859         of a paragraph. But not if it starts just before a table 
1860         and ends inside that table.  We need placeholders to hold 
1861         open emptied out table cells, but that is handled separately.
1862         
1863         Also, moved lineBreakExistsAtPosition to htmlediting.cpp 
1864         so that it can be used in more places.
1865
1866         * editing/CompositeEditCommand.cpp:
1867         (WebCore::CompositeEditCommand::removePlaceholderAt):
1868         (WebCore::CompositeEditCommand::moveParagraphs):
1869         * editing/DeleteSelectionCommand.cpp:
1870         (WebCore::DeleteSelectionCommand::doApply):
1871         * editing/InsertLineBreakCommand.cpp:
1872         * editing/InsertParagraphSeparatorCommand.cpp:
1873         (WebCore::InsertParagraphSeparatorCommand::doApply):
1874         * editing/htmlediting.cpp:
1875         (WebCore::lineBreakExistsAtPosition):
1876         * editing/htmlediting.h:
1877
1878 2007-04-19  Justin Garcia  <justin.garcia@apple.com>
1879
1880         Reviewed by harrison
1881         
1882         Fixes some issues found while investigating:
1883         <rdar://problem/5144139> On delete, <BR> inserted into non-editable ToDo <TABLE> element
1884         
1885         Move the code to handle inserting content before/after
1886         tables for [table, 0/max] to insertNodeAt, so that
1887         all insertions get it, not just some.
1888         Changed insertNodeAt to take in a position instead of a
1889         node and an offset.
1890
1891         * editing/CompositeEditCommand.cpp:
1892         (WebCore::CompositeEditCommand::insertNodeAt):
1893         (WebCore::CompositeEditCommand::insertNodeAtTabSpanPosition):
1894         (WebCore::CompositeEditCommand::insertBlockPlaceholder):
1895         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
1896         If paragrahStart.node() is an atomic node, insertNodeAt can handle
1897         insertion, we don't need to special case it.
1898         (WebCore::CompositeEditCommand::moveParagraphs):
1899         (WebCore::CompositeEditCommand::positionAvoidingSpecialElementBoundary):
1900         * editing/CompositeEditCommand.h:
1901         * editing/DeleteSelectionCommand.cpp:
1902         (WebCore::DeleteSelectionCommand::mergeParagraphs):
1903         (WebCore::DeleteSelectionCommand::doApply):
1904         * editing/FormatBlockCommand.cpp:
1905         (WebCore::FormatBlockCommand::doApply):
1906         * editing/IndentOutdentCommand.cpp:
1907         (WebCore::IndentOutdentCommand::indentRegion):
1908         (WebCore::IndentOutdentCommand::outdentParagraph):
1909         * editing/InsertLineBreakCommand.cpp:
1910         (WebCore::InsertLineBreakCommand::doApply):
1911         * editing/InsertListCommand.cpp:
1912         (WebCore::InsertListCommand::doApply):
1913         * editing/InsertParagraphSeparatorCommand.cpp:
1914         (WebCore::InsertParagraphSeparatorCommand::doApply):
1915         * editing/InsertTextCommand.cpp:
1916         (WebCore::InsertTextCommand::prepareForTextInsertion): Removed some
1917         dead code that handled insertion at non-editable positions.
1918         (WebCore::InsertTextCommand::insertTab):
1919         * editing/ReplaceSelectionCommand.cpp:
1920         (WebCore::ReplaceSelectionCommand::doApply):
1921         (WebCore::ReplaceSelectionCommand::insertNodeAtAndUpdateNodesInserted):
1922         * editing/ReplaceSelectionCommand.h:
1923
1924 2007-04-19  Mitz Pettel  <mitz@webkit.org>
1925
1926         Reviewed by Darin.
1927
1928         - fix http://bugs.webkit.org/show_bug.cgi?id=13336
1929           REGRESSION (r20646): editing/execCommand/hilitecolor.html crashes under guardMalloc
1930
1931         Avoid calling selectionRect() and selectionGapRects() on a renderer that needs
1932         layout.
1933
1934         * rendering/RenderBlock.cpp:
1935         (WebCore::RenderBlock::selectionGapRects):
1936         * rendering/RenderBlock.h:
1937         (WebCore::RenderBlock::BlockSelectionInfo::BlockSelectionInfo):
1938         * rendering/RenderListMarker.cpp:
1939         (WebCore::RenderListMarker::selectionRect):
1940         * rendering/RenderObject.h:
1941         (WebCore::RenderObject::SelectionInfo::SelectionInfo):
1942         * rendering/RenderReplaced.cpp:
1943         (WebCore::RenderReplaced::selectionRect):
1944         * rendering/RenderText.cpp:
1945         (WebCore::RenderText::selectionRect):
1946
1947 2007-04-19  Justin Garcia  <justin.garcia@apple.com>
1948
1949         Reviewed by darin
1950
1951         <rdar://problem/5142012> 
1952         GoogleDocs: Crash at WebCore::Range::startPosition() when creating a list from a link
1953         
1954         List creation uses moveParagraphs to push content into list items.
1955         Its fragment creation (using createMarkup) incorrectly uses regular
1956         spaces instead of nbsps for spaces that were rendered (11475), which 
1957         causes spaces to be collapsed during the move operation.  This results 
1958         in a call to rangeFromLocationAndLength with a location past the end
1959         of the document.  We use the result from rangeFromLocationAndLength
1960         (null) and crash.
1961         
1962         Also when moveParagraphs tries to push content into a list item surrounded
1963         by an anchor, it fails because positionAvoidingSpecialElementBoundary avoids 
1964         the anchor, which also avoids the list item.  This was fixed by pushing
1965         down anchors before avoiding them.
1966         
1967         * editing/CompositeEditCommand.cpp:
1968         (WebCore::CompositeEditCommand::pushAnchorElementDown): Remove the
1969         old anchor after we push down clones of it, this is what callers
1970         expect.
1971         (WebCore::CompositeEditCommand::pushPartiallySelectedAnchorElementsDown):
1972         Call the new enclosingAnchorElement, that takes in a position instead
1973         of a node.
1974         (WebCore::CompositeEditCommand::moveParagraphs): If spaces collapsed
1975         as a result of the move, rangeFromLocationAndLength can return null,
1976         bail and don't try to preserve the selection in that case.
1977         (WebCore::CompositeEditCommand::positionAvoidingSpecialElementBoundary):
1978         Moved from htmlediting.cpp.
1979         Make sure anchors are pushed down before avoiding them so that we don't
1980         also avoid structural elements like lists and blocks.
1981         * editing/CompositeEditCommand.h:
1982         * editing/TypingCommand.cpp: Moved isFirst/LastPositionBefore/AfterTable
1983         to htmlediting.cpp.
1984         * editing/htmlediting.cpp:
1985         Moved positionAvoidingSpecialElementBoundary so that it could call
1986         pushAnchorElementDown.
1987         (WebCore::isFirstPositionAfterTable): Moved here.
1988         (WebCore::isLastPositionBeforeTable): Moved here.
1989         (WebCore::enclosingAnchorElement): Moved here.
1990         (WebCore::enclosingListChild): Removed an extraneous space.
1991         * editing/htmlediting.h:
1992
1993 2007-04-19  Beth Dakin  <bdakin@apple.com>
1994
1995         Reviewed by Hyatt.
1996
1997         Fix for <rdar://problem/5120889> Sized table cells w/borders not 
1998         drawn to correct size
1999
2000         When table cells have children with %-height, the cells were 
2001         incorrectly shrinking down to be the size of the child. This 
2002         exposed another problem with replaced children and sizing.
2003
2004         * rendering/RenderBox.cpp:
2005         (WebCore::RenderBox::calcReplacedHeightUsing): The exposed problem. 
2006         Subtract our borders and padding in the auto or percent table cell 
2007         containing block case.
2008         * rendering/RenderTableSection.cpp:
2009         (WebCore::RenderTableSection::layoutRows): When our children can 
2010         flex, do not always set the cellTopExtra and cellBottomExtra to 0! 
2011         That is bad! We should do the same as the non-flex case.
2012
2013 2007-04-19  Anders Carlsson  <andersca@apple.com>
2014
2015         Reviewed by Geoff.
2016
2017         http://bugs.webkit.org/show_bug.cgi?id=13333
2018         Support naturalWidth/naturalHeight on image elements
2019
2020         * html/HTMLImageElement.cpp:
2021         (WebCore::HTMLImageElement::naturalWidth):
2022         (WebCore::HTMLImageElement::naturalHeight):
2023         * html/HTMLImageElement.h:
2024         * html/HTMLImageElement.idl:
2025
2026 2007-04-19  Patti Hoa  <patti@apple.com>
2027
2028         Reviewed by Darin.
2029         - review suggestion for rdar://5145011 code change
2030         
2031         * bridge/mac/WebCoreAXObject.mm:
2032         (-[WebCoreAXObject value]):
2033         return early if value attribute is not supported by the attachment view.
2034
2035 2007-04-19  Patti Hoa  <patti@apple.com>
2036
2037         Reviewed by Darin.
2038
2039         <rdar://problem/5145011> Allow attachment view of web object to handle accessibility actions
2040         
2041         * bridge/mac/WebCoreAXObject.mm:
2042         (-[WebCoreAXObject value]):
2043         Only allow asking the attachmentView for value if attachmentView supports this value attribute 
2044         (-[WebCoreAXObject title]):
2045         (-[WebCoreAXObject accessibilityAttributeNames]):
2046         Should not return that long list of unrelated attributes for attachmentView.
2047         (-[WebCoreAXObject accessibilityActionNames]):
2048         (-[WebCoreAXObject accessibilityPerformAction:]):
2049         Allow attachmentView a chance to handle actions.
2050         (-[WebCoreAXObject accessibilityParameterizedAttributeNames]):
2051         Should not return that long list of unrelated attributes for attachmentView.
2052         
2053 2007-04-19  Mitz Pettel  <mitz@webkit.org>
2054
2055         Reviewed by Hyatt.
2056
2057         - fix http://bugs.webkit.org/show_bug.cgi?id=13291
2058           REGRESSION (r19595): WebViewDidBeginEditingNotification not posted when focusing with the mouse
2059
2060         Covered by editing tests.
2061
2062         * dom/Document.cpp:
2063         (WebCore::Document::setFocusedNode): Moved the call to Editor::didBeginEditing()
2064         back into here.
2065         * dom/Element.cpp:
2066         (WebCore::Element::updateFocusAppearance): Removed the call to didBeginEditing().
2067         * html/HTMLInputElement.cpp:
2068         (WebCore::HTMLInputElement::updateFocusAppearance): Ditto.
2069
2070 2007-04-19  Sam Weinig  <sam@webkit.org>
2071
2072         Reviewed by Darin.
2073
2074         - Patch for http://bugs.webkit.org/show_bug.cgi?id=12249
2075           FCKeditor: <hr>, <ul> and <ol> have id="undefined"
2076
2077         Convert undefined and null to a null string for third argument of
2078         execCommand(); 
2079
2080         Test: editing/execCommand/arguments-combinations.html
2081
2082         * WebCore.xcodeproj/project.pbxproj:
2083         * bindings/js/kjs_binding.cpp:
2084         (KJS::valueToStringWithUndefinedOrNullCheck):
2085         * bindings/js/kjs_binding.h:
2086         * bindings/scripts/CodeGeneratorJS.pm:
2087         * dom/Document.idl:
2088
2089 2007-04-19  Alp Toker  <alp@atoker.com>
2090
2091         Reviewed by hyatt.
2092
2093         * WebCoreSources.bkl: Remove obsolete source file from build.
2094
2095 2007-04-18  Alp Toker  <alp@atoker.com>
2096
2097         Gdk build fix.  Reviewed by Sam Weinig.
2098
2099         Track changes to make GdkLauncher work again.
2100
2101         * WebCoreSources.bkl:
2102         * platform/gdk/ChromeClientGdk.h:
2103         * platform/gdk/TemporaryLinkStubs.cpp:
2104         (ChromeClientGdk::createWindow):
2105         (ChromeClientGdk::createModalDialog):
2106         (Editor::markBadGrammar):
2107
2108 2007-04-17  Brady Eidson  <beidson@apple.com>
2109
2110         Reviewed by Tim
2111
2112         <rdar://problem/5008925>
2113         Expose the NSURLConnection delegate willCacheResponse API to WebResourceLoadDelegate
2114
2115         * WebCore.xcodeproj/project.pbxproj: Added ResourceLoaderMac.mm
2116
2117         * loader/FrameLoaderClient.h: Add the willCacheResponse SPI for WebKit to implement
2118
2119         * loader/ResourceLoader.h:
2120         * loader/mac/ResourceLoaderMac.mm: Added.
2121         (WebCore::ResourceLoader::willCacheResponse): Return the new cachedResponse from the client
2122
2123         * platform/graphics/svg/SVGImageEmptyClients.h:
2124         (WebCore::SVGEmptyFrameLoaderClient::willCacheResponse): Stub
2125
2126         * platform/network/ResourceHandleClient.h:
2127         (WebCore::ResourceHandleClient::willCacheResponse):  Return the new cachedResponse from the client
2128
2129         * platform/network/mac/ResourceHandleMac.mm:
2130         (-[WebCoreResourceHandleAsDelegate connection:willCacheResponse:]): Call to get the new 
2131           cachedURLResponse before calling for the cache policy
2132
2133 2007-04-18  Darin Adler  <darin@apple.com>
2134
2135         Reviewed by Hyatt.
2136
2137         - fix http://bugs.webkit.org/show_bug.cgi?id=13375
2138           REGRESSION (r20901): failing fast/overflow/scrollRevealButton.html
2139
2140         * dom/Document.cpp: (WebCore::Document::updateLayout):
2141         If we have a parent frame, update its layout too.
2142
2143 2007-04-18  Alp Toker  <alp@atoker.com>
2144
2145         Gdk build fix.  Reviewed by Mark.
2146
2147         * loader/gdk/FrameLoaderClientGdk.cpp:
2148         (WebCore::FrameLoaderClientGdk::loadedFromCachedPage):
2149         (WebCore::FrameLoaderClientGdk::setDocumentViewFromCachedPage):
2150         (WebCore::FrameLoaderClientGdk::saveDocumentViewToCachedPage):
2151         * loader/gdk/FrameLoaderClientGdk.h:
2152         * platform/gdk/TemporaryLinkStubs.cpp:
2153         (CachedPage::close): Track PageCache to CachedPage refactoring.
2154
2155 2007-04-17  Mitz Pettel  <mitz@webkit.org>
2156
2157         Reviewed by Darin.
2158
2159         - fix http://bugs.webkit.org/show_bug.cgi?id=13369
2160           REGRESSION (r13366): Invisible table cell background is painted
2161
2162         Test: fast/table/invisible-cell-background.html
2163
2164         * rendering/RenderTableCell.cpp:
2165         (WebCore::RenderTableCell::paintBackgroundsBehindCell): Don't paint any
2166         background if the cell is not visible. This behavior matches WinIE and Opera.
2167
2168 2007-04-17  Justin Garcia  <justin.garcia@apple.com>
2169
2170         Reviewed by harrison
2171
2172         <rdar://problem/5119244> 
2173         Crash when indenting a selected ToDo
2174         
2175         indentRegion() was using the old (incorrect) editable root 
2176         getter, which returned null for a valid, editable position, 
2177         causing the crash.
2178
2179         * editing/IndentOutdentCommand.cpp:
2180         (WebCore::IndentOutdentCommand::indentRegion):
2181         The editable root for a position is editableRootForPosition(p),
2182         not p.node()->rootEditableElement(), because of VisiblePositions 
2183         before/after tables, replaced elements and others.
2184
2185 2007-04-17  Justin Garcia  <justin.garcia@apple.com>
2186
2187         Reviewed by hyatt
2188
2189         <rdar://problem/5138441> 
2190         GoogleDocs: Indented text looks like text that's been Quoted
2191         
2192         GoogleDocs uses FormatBlock, blockquotes and a style rule
2193         for blockquotes to implement a "Quote Text" feature.  Styles
2194         intended only for those blockquotes were added to the 
2195         blockquotes that we use for indenting.
2196
2197         * css/html4.css: Removed the webkit-indent-blockquote class rule.
2198         * editing/IndentOutdentCommand.cpp:
2199         (WebCore::createIndentBlockquoteElement): Use custom margins
2200         and turn off border and padding to override author rules for
2201         blockquotes.
2202
2203 2007-04-17  Justin Garcia  <justin.garcia@apple.com>
2204
2205         Reviewed by darin
2206
2207         <rdar://problem/5136770> 
2208         Gmail Editor: Hang when turning a particular multi-line selection into a list
2209         
2210         When InsertListCommand pushes content into list items, 
2211         it creates an empty list item and then calls moveParagraphs.  
2212         But moveParagraphs' selection preservation code fails when 
2213         it encounters empty list items (list items w/o placeholders).
2214         This causes InsertListCommand to lose track of where it has 
2215         already been performed, which causes the hang.
2216
2217         * editing/InsertListCommand.cpp:
2218         (WebCore::InsertListCommand::doApply): Use brs to hold open 
2219         empty list items.
2220
2221 2007-04-17  Darin Adler  <darin@apple.com>
2222
2223         Oops, rolled that last change out. I'll redo it again later after making
2224         som additional refinments.
2225
2226 2007-04-17  Darin Adler  <darin@apple.com>
2227
2228         Reviewed by Brady.
2229
2230         - a few baby steps to try to make lockHistory and userGesture less confusing
2231
2232         * page/FrameLoadRequest.h:
2233         (WebCore::FrameLoadRequest::FrameLoadRequest): Add initialization of m_isUserGesture
2234         to true.
2235         (WebCore::FrameLoadRequest::shouldLockHistory): Renamed from lockHistory to avoid having
2236         a getter that sounds like a verb phrase.
2237         (WebCore::FrameLoadRequest::setShouldLockHistory): Ditto.
2238         (WebCore::FrameLoadRequest::isUserGesture): Added.
2239         (WebCore::FrameLoadRequest::setIsUserGesture): Ditto.
2240
2241         * loader/FrameLoader.h: Remove userGesture parameter from load that takes
2242         FrameLoadRequest. Remove default values for lockHistory and userGesture parameters,
2243         since that just makes it more likely we'll forget to pass them in. Remove one of
2244         the overloads of urlSelected, since it's only called one place.
2245
2246         * loader/FrameLoader.cpp:
2247         (WebCore::FrameLoader::createWindow): Remove userGesture parameter, relying on
2248         the true default in FrameLoadRequest.
2249         (WebCore::FrameLoader::urlSelected): Call setShouldLockHistory and setIsUserGesture
2250         on the FrameLoadRequest, and call load directly; also eliminate the other urlSelected
2251         overload since this was the only place it was called.
2252         (WebCore::FrameLoader::load): Remove userGesture parameter, relying on the true
2253         default in FrameLoadRequest. In the other overload, clean up logic to eliminate the
2254         argsReferrer variable and get rid of the userGesture parameter, using the value from
2255         FrameLoadRequest.
2256         (WebCore::FrameLoader::submitForm): Remove userGesture parameter, relying on the value
2257         in the FrameLoadRequest. This actually changes behavior.
2258
2259         * bindings/js/kjs_html.cpp: (KJS::JSHTMLDocument::putValueProperty): Pass
2260         false for userGesture explicitly instead of relying on default argument.
2261
2262         * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected):
2263         Remove userGesture parameter, relying on the true default in FrameLoadRequest.
2264
2265 2007-04-16  David Kilzer  <ddkilzer@webkit.org>
2266
2267         Reviewed by NOBODY (fixed misspelling).
2268
2269         * manual-tests/containing-block-position-chage.html: Removed.
2270         * manual-tests/containing-block-position-change.html: Added.
2271
2272 2007-04-16  Justin Garcia  <justin.garcia@apple.com>
2273
2274         Reviewed by darin
2275
2276         <rdar://problem/5134759> 
2277         GMail Editor: Hang after pasting underlined text multiple times
2278         
2279         The moveParagraphs call that ReplaceSelectionCommand
2280         performs must receive only inline content from createMarkup, 
2281         or else it will result in another call to moveParagraphs 
2282         when it performs the move, resulting in infinite recursion.
2283
2284         * editing/markup.cpp:
2285         (WebCore::startMarkup): We were only converting a block to
2286         an inline if it had an inline style declaration or styles 
2287         coming from matched rules.  Cleaned up this code a bit by 
2288         handling an element's style separately from its other 
2289         attributes.
2290
2291 2007-04-16  Darin Adler  <darin@apple.com>
2292
2293         - get layout tests going again
2294
2295         * page/mac/FrameMac.mm: (WebCore::Frame::setUseSecureKeyboardEntry):
2296         Replace assertion with a runtime check. We can consider changing it back to
2297         an assertion some day, but it's not important.
2298
2299 2007-04-16  Darin Adler  <darin@apple.com>
2300
2301         Reviewed by John Sullivan.
2302
2303         - fix http://bugs.webkit.org/show_bug.cgi?id=13303
2304           <rdar://problem/5126341> REGRESSION: controls in a background Safari window
2305           maintain active appearance if the address bar has focus (13303)
2306
2307         - fix a related problem where elements could look focused in non-active windows
2308
2309         - simplify secure keyboard entry logic in Frame::setIsActive
2310
2311         * WebCore.exp: Add two new symbols for use by WebKit.
2312
2313         * html/HTMLInputElement.cpp:
2314         (WebCore::HTMLInputElement::dispatchFocusEvent): Call setUseSecureKeyboardEntryWhenActive
2315         rather than calling setSecureKeyboardEntry directly -- does nothing if the frame is not active.
2316         (WebCore::HTMLInputElement::dispatchBlurEvent): Ditto.
2317
2318         * page/Frame.cpp:
2319         (WebCore::Frame::setUseSecureKeyboardEntryWhenActive): Added. Calls
2320         setUseSecureKeyboardEntry only if the frame is active, but also stores away the state,
2321         so that the setIsActive function doesn't have to recompute it.
2322         (WebCore::Frame::setIsActive): Rewrote all the comments in the function. Removed the code
2323         to manage control tints, which are not based on the whether the frame is active but rather
2324         on AppKit's concept of whether the window should have "key appearance". Simplified the
2325         logic about when to call setUseSecureKeyboardEntry by using the value of
2326         m_useSecureKeyboardEntryWhenActive.
2327         (WebCore::FramePrivate::FramePrivate): Initialize m_useSecureKeyboardEntryWhenActive.
2328         * page/Frame.h: Made setSecureKeyboardEntry private and renamed it to
2329         setUseSecureKeyboardEntry, removed isSecureKeyboardEntry, and
2330         added a public setUseSecureKeyboardEntryWhenActive.
2331         * page/FramePrivate.h: Added m_useSecureKeyboardEntryWhenActive.
2332         * page/mac/FrameMac.mm: (WebCore::Frame::setUseSecureKeyboardEntry): Added an assertion,
2333         and removed isSecureKeyboardEntry().
2334
2335         * page/FrameView.h: Added updateControlTints.
2336         * page/FrameView.cpp: (WebCore::FrameView::updateControlTints): Added. Code was moved
2337         here from setIsActive for two reasons: (1) it makes more sense in the view class, and
2338         (2) it needs to be called at the appropriate time for AppKit, not when active changes.
2339
2340         * rendering/RenderTheme.cpp: (WebCore::RenderTheme::isFocused): Added an isActive
2341         check here to match the logic in the implementation of the CSS pseudo-state.
2342         * rendering/RenderThemeMac.mm:
2343         (WebCore::RenderThemeMac::updateFocusedState): Use the isFocused function instead of
2344         repeating the logic here. Removed the "need to add a key window test here" comment.
2345         (WebCore::RenderThemeMac::controlSupportsTints): Added a comment about the NSCell
2346         SPI that's related to the _windowChangedKeyState method we now use in WebHTMLView.
2347
2348 2007-04-16  Darin Adler  <darin@apple.com>
2349
2350         Reviewed by John Sullivan.
2351
2352         - fix http://bugs.webkit.org/show_bug.cgi?id=13227
2353           StringImpl::isLower incorrectly assumes islower returns 1 (it can return any non-0)
2354
2355         * platform/StringImpl.cpp:
2356         (WebCore::StringImpl::isLower): Based on test application results, changed to use &&
2357         instead of trying to use & to avoid branches. Use U16_NEXT so we can handle characters
2358         outside the BMP. Improved comments.
2359         (WebCore::StringImpl::lower): Improved comments.
2360         (WebCore::equalIgnoringCase): Changed to use && instead of trying to use & to avoid
2361         branches. Improved comments. Added an assertion about the assumption we're
2362         making that characters in the char* are all ASCII.
2363
2364 2007-04-13  David Kilzer  <ddkilzer@webkit.org>
2365
2366         Patch and review by hyatt.  Testing and landing by ddkilzer.
2367
2368         <rdar://problem/5078866>
2369         tables don't inherit text-align (in strict mode; they're not supposed to in quirks mode)
2370
2371         Test: fast/css/table-text-align-quirk.html
2372               fast/css/table-text-align-strict.html
2373
2374         Previous commit (r20731) removed the wrong property from WebCore/css/html4.css.  However,
2375         when the correct property was removed, it caused tables to inherit alignment properties
2376         from tags like <center> and <div align="center">.  This is fixed in
2377         WebCore::CSSStyleSelector::adjustRenderStyle() by special-casing tables to reset the
2378         text-align property.
2379
2380         * css/CSSComputedStyleDeclaration.cpp:
2381         (WebCore::valueForTextAlign): Renamed KHTML_CENTER, KHTML_LEFT and KHTML_RIGHT to
2382         WEBKIT_CENTER, WEBKIT_LEFT and WEBKIT_RIGHT.
2383         * css/cssparser.cpp:
2384         (WebCore::CSSParser::parseValue): Ditto.
2385         * css/cssstyleselector.cpp:
2386         (WebCore::CSSStyleSelector::adjustRenderStyle): Tables should not support -webkit-center,
2387         -webkit-left or -webkit-right values for text-align, so reset them back to auto.
2388         * css/html4.css: Removed "text-align: -webkit-auto;" property from tables selector.  It
2389         was previously added to css/quirks.css in r20731.
2390         * rendering/RenderBlock.cpp:
2391         (WebCore::RenderBlock::determineHorizontalPosition): Renamed KHTML_* to WEBKIT_*.
2392         * rendering/RenderBox.cpp:
2393         (WebCore::RenderBox::calcHorizontalMargins): Ditto.
2394         * rendering/RenderFlow.cpp:
2395         (WebCore::RenderFlow::caretRect): Ditto.
2396         * rendering/RenderStyle.h: Ditto.
2397         (WebCore::):
2398         * rendering/bidi.cpp:
2399         (WebCore::RenderBlock::computeHorizontalPositionsForLine): Ditto.
2400
2401 2007-04-12  Brady Eidson  <beidson@apple.com>
2402
2403         Reviewed by Black Sheep
2404
2405         <rdar://problem/4664154> and http://bugs.webkit.org/show_bug.cgi?id=3546
2406
2407         When you click on a link that opens in a new window from within gmail, they first create a new window 
2408         with an empty URL, then immediately document.write() into the window to schedule a redirect.
2409
2410         Since the initial page doesn't have a URL associated with it, a history item never gets created.  The 
2411         reasonable solution?  To actually create the history item after the redirect (in updateHistoryForInternalLoad)
2412
2413         * loader/FrameLoader.cpp:
2414         (WebCore::FrameLoader::addHistoryForCurrentLocation): Updates global and B/F history with a new history item
2415         (WebCore::FrameLoader::updateHistoryForStandardLoad): Call addHistoryForCurrentLocation
2416         (WebCore::FrameLoader::updateHistoryForInternalLoad): Call addHistoryForCurrentLocation if there is not already
2417           a current history item
2418         * loader/FrameLoader.h:
2419
2420 2007-04-12  Oliver Hunt  <oliver@apple.com>
2421
2422         Reviewed by Adam.
2423
2424         This fixes <rdar://problem/5060766> -- Frameset with 
2425         an empty frame crashes due to null document.  Debug
2426         builds hit the frame->document() assertion in 
2427         EventHandler::prepareMouseEvent
2428
2429         This null check seems necessary now, having run through 
2430         all the logic on the path to this crash it appears that
2431         we can't avoid this null check.  
2432
2433         * page/EventHandler.cpp:
2434         (WebCore::EventHandler::updateDragAndDrop):
2435
2436 2007-04-12  Justin Garcia  <justin.garcia@apple.com>
2437
2438         Reviewed by darin
2439         
2440         <rdar://problem/5131716> 
2441         Clicking just before a ToDo doesn't put the caret before the ToDo
2442         
2443         * rendering/RenderBlock.cpp:
2444         (WebCore::RenderBlock::positionForCoordinates):
2445         Consider clicks inside the blocks padding, instead of
2446         incorrectly sending them to the position before the block.
2447
2448 2007-04-12  John Sullivan  <sullivan@apple.com>
2449
2450         Reviewed by Anders
2451
2452         - WebCore part of fix for:
2453         <rdar://problem/5128697> REGRESSION: At least one PDF context menu item isn't appearing on Leopard
2454
2455         * platform/ContextMenuItem.h:
2456         (WebCore::):
2457         add two PDF-related context menu items to enum to keep it in sync with WebKit
2458
2459         * platform/ContextMenu.cpp:
2460         (WebCore::ContextMenu::checkOrEnableIfNeeded):
2461         add the new context menu items to the do-nothing case of a big switch statement
2462
2463 2007-04-12  Simon Hausmann  <hausmann@kde.org>
2464
2465         Reviewed by Zack.
2466
2467         Fixed drawing of justified text in the Qt port.
2468
2469         * platform/qt/FontQt.cpp:
2470         (Font::drawGlyphs):
2471
2472 2007-04-11  Oliver Hunt  <oliver@apple.com>
2473
2474         Reviewed by Maciej.
2475
2476         Adding RetainPtr to the many global obj-c pointers we use in
2477         C/C++ methods.  This is necessary to prevent GC from collecting
2478         globals we want to keep around.
2479
2480         We use RetainPtr in obj-c++ and c++ files, and CFRetain/Release in pure
2481         obj-c.
2482
2483         Also made the Pasteboard::m_pasteboard a RetainPtr although it
2484         shouldn't be necessary as the only NSPasteboard instances that 
2485         should ever be inserted are the system clipboard and dragging 
2486         pasteboard.  Neither of which should ever be collected.
2487
2488         * page/mac/WebCoreFrameBridge.mm:
2489         (_getPreSmartSet):
2490         (_getPostSmartSet):
2491         * platform/Pasteboard.h:
2492         * platform/graphics/mac/ColorMac.mm:
2493         (WebCore::nsColor):
2494         * platform/graphics/mac/GraphicsContextMac.mm:
2495         (WebCore::GraphicsContext::drawLineForMisspellingOrBadGrammar):
2496         * platform/mac/FontDataMac.mm:
2497         (WebCore::webFallbackFontFamily):
2498         * platform/mac/PasteboardMac.mm:
2499         (WebCore::writableTypesForURL):
2500         (WebCore::writableTypesForImage):
2501         (WebCore::Pasteboard::clear):
2502         (WebCore::Pasteboard::writeSelection):
2503         (WebCore::Pasteboard::writeURL):
2504         (WebCore::Pasteboard::writeFileWrapperAsRTFDAttachment):
2505         (WebCore::Pasteboard::writeImage):
2506         (WebCore::Pasteboard::canSmartReplace):
2507         (WebCore::Pasteboard::plainText):
2508         (WebCore::Pasteboard::documentFragment):
2509
2510 2007-04-11  Mitz Pettel  <mitz@webkit.org>
2511
2512         Reviewed by Dave Hyatt.
2513
2514         - fix http://bugs.webkit.org/show_bug.cgi?id=11362
2515           Native popup with size="1" wraps options
2516
2517         Test: fast/forms/menulist-option-wrap.html
2518
2519         * css/html4.css: Added white-space declaration for select[size="0"] and
2520         select[size="1"]. Added border-radius declaration for select.
2521
2522 2007-04-11  MorganL  <morganl.webkit@yahoo.com>
2523
2524         Reviewed by Maciej.
2525
2526         Add a Frame pointer to ChromeClient methods:
2527         http://bugs.webkit.org/show_bug.cgi?id=13127
2528
2529         * loader/FrameLoader.cpp:
2530         (WebCore::FrameLoader::createWindow):
2531         * page/Chrome.cpp:
2532         (WebCore::Chrome::createWindow):
2533         (WebCore::Chrome::createModalDialog):
2534         * page/Chrome.h:
2535         * page/ChromeClient.h:
2536         * page/ContextMenuController.cpp:
2537         (WebCore::openNewWindow):
2538         * platform/graphics/svg/SVGImageEmptyClients.h:
2539         (WebCore::SVGEmptyChromeClient::createWindow):
2540         (WebCore::SVGEmptyChromeClient::createModalDialog):
2541
2542 2007-04-11  Brady Eidson  <beidson@apple.com>
2543
2544         Reviewed by Ada
2545
2546         <rdar://problem/5080987> - Crash in DocumentLoader::frameLoader() const
2547
2548         This was free nil checking lost during the ObjC -> C++ conversion
2549
2550         * loader/FrameLoader.cpp:
2551         (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Null check the DocumentLoader
2552
2553 2007-04-11  Justin Garcia  <justin.garcia@apple.com>
2554
2555         Reviewed by harrison
2556
2557         <rdar://problem/5126166> 
2558         Deleting selection starting at before ToDo checkbox to end of line, inserts a BR in the subsequent ToDo
2559         
2560         If a selection ends in a table cell, we shouldn't perform
2561         a merge after deleting that selection.  We have code in
2562         place to prevent those merges, but it failed here.
2563         
2564         It fails because the end of the selection was [tableCell, 0],
2565         (normally not a valid VisiblePosition, but valid here
2566         because the table cell is empty).  We prevent the merge
2567         if the node of the position at the end of the selection 
2568         has an enclosingTableCell.  Even though [tableCell, 0] has 
2569         an enclosing table cell, the node tableCell doesn't, so 
2570         the check fails.
2571         
2572         Fixed this by changing enclosingTableCell to take in
2573         a position, instead of a node.  The other enclosing element
2574         getters should be changed in this way as well.
2575
2576         * editing/DeleteSelectionCommand.cpp:
2577         (WebCore::DeleteSelectionCommand::initializePositionData):
2578         Call the new enclosingTableCell.
2579         * editing/ReplaceSelectionCommand.cpp:
2580         (WebCore::ReplaceSelectionCommand::shouldMerge): Ditto.
2581         * editing/htmlediting.cpp:
2582         (WebCore::enclosingTableCell): Take in a position instead
2583         of a node.
2584         * editing/htmlediting.h:
2585
2586 2007-04-12  Mark Rowe  <mrowe@apple.com>
2587
2588         Qt build fix.
2589
2590         * WebCore.pro:
2591         * editing/qt/EditorQt.cpp:
2592         (WebCore::Editor::markBadGrammar):
2593         * history/qt/CachedPageQt.cpp: Added.
2594         (WebCore::CachedPage::close):
2595         * history/qt/PageCacheQt.cpp: Removed.
2596
2597 2007-04-11  Brady Eidson  <beidson@apple.com>
2598
2599         Reviewed by Antti
2600
2601         <rdar://problem/5125648> and http://bugs.webkit.org/show_bug.cgi?id=13326
2602
2603         Crash opening a link in a new window from Gmail
2604
2605         Problem here is that the currentHistoryItem in the new window is null.  This *shouldn't* be the case, 
2606         and is the cause of a very long standing bug - 
2607         http://bugs.webkit.org/show_bug.cgi?id=3546 - Can't go back to first page in new window opened from gmail
2608
2609         For now, adding a null check prevents this crash and restores the original, long standing regression
2610  
2611         * loader/FrameLoader.cpp:
2612         (WebCore::FrameLoader::updateHistoryForInternalLoad): NULL check
2613
2614 2007-04-11  Adam Roben  <aroben@apple.com>
2615
2616         Reviewed by Anders.
2617
2618         Made image document copying more cross-platform.
2619
2620         All layout tests pass.
2621
2622         * editing/Editor.cpp:
2623         (WebCore::imageNodeFromImageDocument): Added.
2624         (WebCore::Editor::canCopy): Called imageNodeFromImageDocument.
2625         (WebCore::Editor::copy): Ditto.
2626         (WebCore::Editor::copyImage): Updated for changes to Pasteboard.
2627         * platform/Pasteboard.h: Made writeImage more general, which allowed
2628         getting rid of its second incarnation.
2629         * platform/gdk/TemporaryLinkStubs.cpp:
2630         * platform/mac/PasteboardMac.mm:
2631         (WebCore::Pasteboard::writeImage): Collapsed logic from the two
2632         writeImage methods into one.
2633         (Pasteboard::writeImage): Updated for Pasteboard changes.
2634         * platform/qt/PasteboardQt.cpp:
2635         (WebCore::Pasteboard::writeImage): Ditto.
2636
2637 2007-04-11  Darin Adler  <darin@apple.com>
2638
2639         * css/CSSValueKeywords.in: Fix a comment.
2640
2641 2007-04-09  Justin Garcia  <justin.garcia@apple.com>
2642
2643         Reviewed by harrison
2644         
2645         <rdar://problem/4932260> 
2646         Invalid attributed string for attachment range obtained via AXPreviousWordStartTextMarkerForTextMarker
2647         
2648         By default, text iterators don't emit anything for replaced 
2649         elements.  Boundary finding code works around this but has 
2650         bugs: replaced elements act as sentence boundaries and the 
2651         above bug, where previousBoundary moves past the start of a 
2652         word if there is a replaced element just before it. This 
2653         patch fixes these issues by treating replaced elements as 
2654         punctuation for boundary finding.
2655
2656         * editing/TextIterator.cpp:
2657         (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
2658         Set m_pastStartNode, the node after (in a reverse pre-order traversal) the 
2659         last one that should be processed.
2660         (WebCore::SimplifiedBackwardsTextIterator::advance):
2661         Stop at m_pastStartNode.
2662         Iterate over nodes in reverse pre-order (TextIterator traverses in 
2663         pre-orer). This makes knowing when to emit characters after nodes vs. when
2664         to emit characters before nodes easier.
2665         Remove the special case for entering a new block, emitting characters 
2666         after nodes can now be handled generally, in handleNonTextNode(), because
2667         of the way we traverse.
2668         Set m_handledChildren to false every iteration since we now do traverse in 
2669         reverse pre-order.
2670         (WebCore::SimplifiedBackwardsTextIterator::handleReplacedElement):
2671         Emit a comma for replaced elements.  We only use this kind of iterator 
2672         for finding boundaries, so we can do this unconditionally.
2673         (WebCore::SimplifiedBackwardsTextIterator::handleNonTextNode):
2674         Don't use emitNewline, instead specify where the newline should be positioned.
2675         A node is handled before its children, so characters emitted here should 
2676         be positioned after the node, not before it.
2677         (WebCore::SimplifiedBackwardsTextIterator::exitNode): 
2678         Don't use emitNewline, instead specify where the newline should be positioned.
2679         (WebCore::CharacterIterator::CharacterIterator): 
2680         Create a TextIterator that emits content for replaced elements, if requested.
2681         * editing/TextIterator.h:
2682         * editing/visible_units.cpp:
2683         (WebCore::previousBoundary): 
2684         Removed replaced element handling code.
2685         If the start of the chunk that contained the boundary was in a non-text
2686         node, then the boundary is not necessarily in that node.  Particularly
2687         because it is only the end of the chunk that is guaranteed to be a valid
2688         position in those cases.  We must iterate backwards by character from 
2689         the end of the chunk to find the boundary.
2690         (WebCore::nextBoundary): Removed replaced element handling code.
2691
2692 2007-04-10  Brady Eidson  <beidson@apple.com>
2693
2694         Reviewed by Darin
2695
2696         <rdar://problem/4887095> - PageCache and PageState should be combined
2697
2698         These two objects are a relic of when the PageCache was split between WebCore and WebKit
2699         It just makes good sense to combine them now, and the new object is more appropriately
2700         called "CachedPage"
2701
2702         This patch is vast in scope, but simple in depth - anywhere a PageCache or PageState object 
2703         was used has been adjusted to use a CachedPage object instead.  The most notable change is
2704         that HistoryItem - which always used to have a PageCache object which may or may not have 
2705         had a PageState - now may or may not have a CachedPage.  This actually simplifies the 
2706         HistoryItem code a bit while making the role of CachedPage much more clear.
2707
2708         * WebCore.exp:
2709         * WebCore.xcodeproj/project.pbxproj:
2710
2711         * history/BackForwardList.cpp:
2712         (WebCore::BackForwardList::addItem):
2713         (WebCore::BackForwardList::setCapacity):
2714         (WebCore::BackForwardList::setPageCacheSize):
2715         (WebCore::BackForwardList::clearPageCache):
2716         (WebCore::BackForwardList::close):
2717
2718         * history/PageCache.cpp: Removed.
2719         * history/PageCache.h: Removed.
2720         * page/PageState.cpp: Removed.
2721         * page/PageState.h: Removed.
2722         * history/CachedPage.cpp: Added.
2723         (WebCore::CachedPage::create):
2724         (WebCore::CachedPage::CachedPage):
2725         (WebCore::CachedPage::~CachedPage):
2726         (WebCore::CachedPage::restore):
2727         (WebCore::CachedPage::clear):
2728         (WebCore::CachedPage::setDocumentLoader):
2729         (WebCore::CachedPage::documentLoader):
2730         (WebCore::CachedPage::setTimeStamp):
2731         (WebCore::CachedPage::setTimeStampToNow):
2732         (WebCore::CachedPage::timeStamp):
2733         * history/CachedPage.h: Added.
2734         (WebCore::CachedPage::document):
2735         (WebCore::CachedPage::mousePressNode):
2736         (WebCore::CachedPage::URL):
2737
2738         * history/HistoryItem.cpp:
2739         (WebCore::HistoryItem::HistoryItem):
2740         (WebCore::HistoryItem::setCachedPage):
2741         (WebCore::HistoryItem::setURL):
2742         (WebCore::HistoryItem::alwaysAttemptToUseCachedPage):
2743         (WebCore::HistoryItem::setAlwaysAttemptToUseCachedPage):
2744         (WebCore::HistoryItem::cachedPage):
2745         (WebCore::cachedPagesPendingRelease):
2746         (WebCore::HistoryItem::releaseCachedPagesOrReschedule):
2747         (WebCore::HistoryItem::releaseAllPendingCachedPages):
2748         (WebCore::HistoryItem::scheduleCachedPageForRelease):
2749         * history/HistoryItem.h:
2750         * history/mac/HistoryItemMac.mm:
2751
2752         * history/HistoryItemTimer.cpp:
2753         (WebCore::HistoryItemTimer::HistoryItemTimer):
2754         (WebCore::HistoryItemTimer::callReleaseCachedPagesOrReschedule):
2755         * history/HistoryItemTimer.h:
2756
2757         * history/mac/PageCacheMac.mm: Removed.
2758         * history/mac/CachedPageMac.mm: Added.
2759         (WebCore::CachedPage::close):
2760         (WebCore::CachedPage::setDocumentView):
2761         (WebCore::CachedPage::documentView):
2762
2763         * loader/DocumentLoader.cpp:
2764         (WebCore::DocumentLoader::DocumentLoader):
2765         (WebCore::DocumentLoader::loadFromCachedPage):
2766         (WebCore::DocumentLoader::setLoadingFromCachedPage):
2767         (WebCore::DocumentLoader::isLoadingFromCachedPage):
2768         * loader/DocumentLoader.h:
2769
2770         * loader/FrameLoader.cpp:
2771         (WebCore::FrameLoader::provisionalLoadStarted):
2772         (WebCore::FrameLoader::commitProvisionalLoad):
2773         (WebCore::FrameLoader::transitionToCommitted):
2774         (WebCore::FrameLoader::open):
2775         (WebCore::FrameLoader::startLoading):
2776         (WebCore::FrameLoader::receivedMainResourceError):
2777         (WebCore::FrameLoader::opened):
2778         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2779         (WebCore::FrameLoader::loadProvisionalItemFromCachedPage):
2780         (WebCore::FrameLoader::cachePageToHistoryItem):
2781         (WebCore::FrameLoader::createHistoryItem):
2782         (WebCore::FrameLoader::purgePageCache):
2783         (WebCore::FrameLoader::invalidateCurrentItemCachedPage):
2784         (WebCore::FrameLoader::loadItem):
2785         (WebCore::FrameLoader::updateHistoryForStandardLoad):
2786         (WebCore::FrameLoader::updateHistoryForClientRedirect):
2787         (WebCore::FrameLoader::updateHistoryForBackForwardNavigation):
2788         (WebCore::FrameLoader::updateHistoryForReload):
2789         (WebCore::FrameLoader::updateHistoryForInternalLoad):
2790         (WebCore::FrameLoader::updateHistoryForCommit):
2791         * loader/FrameLoader.h:
2792         * loader/FrameLoaderClient.h:
2793
2794         * page/mac/WebCoreFrameBridge.h: Got rid of unused WebCorePageCacheStateKey
2795         * page/mac/WebCoreFrameBridge.mm: Ditto
2796
2797         * platform/graphics/svg/SVGImage.cpp:
2798         * platform/graphics/svg/SVGImageEmptyClients.h: Update to reflect the new names
2799         (WebCore::SVGEmptyFrameLoaderClient::loadProvisionalItemFromCachedPage):
2800         (WebCore::SVGEmptyFrameLoaderClient::invalidateCurrentItemCachedPage):
2801         (WebCore::SVGEmptyFrameLoaderClient::loadedFromCachedPage):
2802         (WebCore::SVGEmptyFrameLoaderClient::clearLoadingFromCachedPage):
2803         (WebCore::SVGEmptyFrameLoaderClient::isLoadingFromCachedPage):
2804         (WebCore::SVGEmptyFrameLoaderClient::setDocumentViewFromCachedPage):
2805         (WebCore::SVGEmptyFrameLoaderClient::saveDocumentViewToCachedPage):
2806
2807 2007-04-10  Antti Koivisto  <antti@apple.com>
2808
2809         Reviewed by Hyatt.
2810
2811         Fix <rdar://5057686> 
2812         Flex box layout example hangs in WebCore::RenderFlexibleBox::allowedChildFlex
2813         
2814         Forcibly distribute remaining pixels if the algorithm is not advancing.
2815
2816         * rendering/RenderFlexibleBox.cpp:
2817         (WebCore::RenderFlexibleBox::layoutHorizontalBox):
2818         (WebCore::RenderFlexibleBox::layoutVerticalBox):
2819
2820 2007-04-11  Mark Rowe  <mrowe@apple.com>
2821
2822         Build fix.
2823
2824         * bridge/mac/WebCoreAXObject.mm:
2825         (-[WebCoreAXObject accessibilityDescription]):
2826
2827 2007-04-10  Patti Hoa <patti@apple.com>
2828
2829         Reviewed by Justin Garcia.
2830
2831         <rdar://problem/5122276> Allow focused frame to fire off notification
2832         Improve accessibility support for Mail WebView embedded Notes.
2833
2834         * bridge/mac/AXObjectCacheMac.mm:
2835         (WebCore::AXObjectCache::postNotification):
2836         The focused document with the selection change should fire the selection changed notification, not the top level document
2837         * bridge/mac/WebCoreAXObject.mm:
2838         (-[WebCoreAXObject accessibilityDescription]):
2839         Allow the name attribute of the html body to be used as the accessibility description
2840
2841 2007-04-09  Geoffrey Garen  <ggaren@apple.com>
2842
2843         Reviewed by Maciej Stachowiak.
2844         
2845         Support for fixing fast/forms/textarea-paste-newline.html.
2846         
2847         Changed clients to use new preference specifying whether a Page should 
2848         allow pasting through the DOM API, instead of a global flag.
2849
2850         Removed old behavior of always allowing DOM paste in debug builds. In 
2851         light of the new preference-based API, that behavior makes no sense anymore. 
2852         Instead, developers who want to test paste inside Safari can set the 
2853         preference for themselves.
2854
2855         * WebCore.exp:
2856         * editing/CommandByName.cpp: Removed crazy hack to keep an identically 
2857         named but invalid copy of the global "pate allowed" flag in this file.
2858         (WebCore::Frame::enabledPaste):
2859         * editing/JSEditor.cpp: Removed "always allow" behavior for debug builds.
2860         (WebCore::JSEditor::queryCommandSupported):
2861         * editing/JSEditor.h:
2862         * page/Settings.cpp:
2863         (WebCore::Settings::setDOMPasteAllowed):
2864         * page/Settings.h:
2865         (WebCore::Settings::isDOMPasteAllowed):
2866         * rendering/RenderTreeAsText.cpp:
2867         (WebCore::externalRepresentation): Removed crazy hack to allow DOM paste
2868         after this function has been called.
2869
2870 2007-04-10  John Sullivan  <sullivan@apple.com>
2871
2872         Reviewed by Tim Hatcher
2873
2874         - fixed <rdar://problem/4859132> Grammar must always be checked in entire-sentence chunks, 
2875           and shouldn't show markers for current sentence
2876
2877         * editing/Editor.h:
2878         add markBadGrammar, now distinct from markMisspellings
2879
2880         * editing/mac/EditorMac.mm:
2881         (WebCore::Editor::markMisspellingsAfterTypingToPosition):
2882         call markMisspellings on one word, and markBadGrammar on entire sentence
2883         (WebCore::markMisspellingsOrBadGrammar):
2884         new static function, extracted from markMisspellings
2885         (WebCore::Editor::markMisspellings):
2886         now calls extracted function
2887         (WebCore::Editor::markBadGrammar):
2888         new method, calls extracted function
2889
2890         * page/Frame.cpp:
2891         (WebCore::Frame::respondToChangedSelection):
2892         update grammar markers for entire new and old sentences
2893
2894 2007-04-09  Anders Carlsson  <andersca@apple.com>
2895
2896         Reviewed by John.
2897
2898         * WebCore.exp:
2899         Add __ZNK7WebCore11FrameLoader10isCompleteEv.
2900         
2901 2007-04-09  Brady Eidson  <beidson@apple.com>
2902
2903         Reviewed by Darin
2904
2905         Fixes <rdar://4921797> and http://bugs.webkit.org/show_bug.cgi?id=12005
2906
2907         The original regression was to claim that more loads were the result of a "user gesture" than really
2908         were.  A lot of the ways a frame load could be kicked off didn't properly set up this flag, and it 
2909         wasn't properly propagated and respected where it should've been.
2910
2911         This patch cleans much of that up.  One loose end is the "treatAsUserGesture" flag which is a stop
2912         gap measure to keep "slow redirects" working to create a new history item.  In the future, we need
2913         to cleanup the meaning and use of "userGesture" and "lockHistory."  This includes integrating them 
2914         in to FrameLoadRequest and being very clear of what their meaning actually is at different stages of
2915         the Frame load process.
2916
2917         * dom/Document.cpp:
2918         (WebCore::Document::processHttpEquiv): Pass only the delay for the redirect
2919
2920         * html/HTMLAnchorElement.cpp:
2921         (WebCore::HTMLAnchorElement::defaultEventHandler): Pass "lockHistory" false, "userGesture" true
2922
2923         * ksvg2/svg/SVGAElement.cpp:
2924         (WebCore::SVGAElement::defaultEventHandler): Pass "lockHistory" false, "userGesture" true
2925
2926         * loader/FrameLoader.cpp:
2927         (WebCore::ScheduledRedirection::ScheduledRedirection): Figure "lockHistory" and "userGesture" from the 
2928           delay here, instead of at 3 other different sites that call this method
2929         (WebCore::FrameLoader::changeLocation): Set userGesture correctly
2930         (WebCore::FrameLoader::urlSelected): Propagate userGesture down
2931         (WebCore::FrameLoader::requestFrame): 
2932         (WebCore::FrameLoader::receivedFirstData):
2933         (WebCore::FrameLoader::scheduleRedirection): Pass only the delay here
2934         (WebCore::FrameLoader::redirectionTimerFired): Set userGesture correctly
2935         (WebCore::FrameLoader::load):
2936         (WebCore::FrameLoader::updateHistoryForInternalLoad): Insteading of asserting we aren't a redirect,
2937           handle the case where we *are* a redirect by updating the previous history item
2938         * loader/FrameLoader.h:
2939
2940 2007-04-09  Anders Carlsson  <andersca@apple.com>
2941
2942         Reviewed by Darin.
2943
2944         <rdar://problem/5120801> 
2945         http://bugs.webkit.org/show_bug.cgi?id=13247
2946         Closing a page during slow cloning causes crash in setJSStatusBarText (13247)
2947
2948         * bindings/js/kjs_window.cpp:
2949         (KJS::Window::put):
2950         Return early if m_frame is null. A closed window only has one property, "closed" 
2951         so no properties should be settable in that case.
2952
2953 2007-04-09  Andrew Wellington  <proton@wiretapped.net>
2954
2955         Reviewed by Justin Garcia.
2956         
2957         Fix for http://bugs.webkit.org/show_bug.cgi?id=12959
2958         "REGRESSION: Edit -> Copy not enabled on standalone images"
2959
2960         * dom/Document.h: Add support for determining if a document is an image
2961         (WebCore::Document::isImageDocument):
2962         * editing/Editor.cpp:
2963         (WebCore::Editor::canCopy): Image documents are copyable
2964         (WebCore::Editor::copy): If copying an image document, call appropriate pasteboard methods
2965         * loader/ImageDocument.h:
2966         (WebCore::ImageDocument::isImageDocument): Override to return true for image documents
2967         * platform/Pasteboard.h: Add new writeImage function to pasteboard
2968         * platform/mac/PasteboardMac.mm:
2969         (WebCore::Pasteboard::writeImage): Add writeImage implementation that takes Node and URL
2970         * platform/qt/PasteboardQt.cpp:
2971         (WebCore::Pasteboard::writeImage): Stub for Qt implementation of pasteboard
2972
2973 2007-04-08  Oliver Hunt  <oliver@apple.com>
2974
2975         rs=Adam.
2976
2977         Add ASSERT(selectedRange) to previous change
2978
2979         * platform/mac/PasteboardMac.mm:
2980         (WebCore::Pasteboard::writeSelection):
2981
2982 2007-04-08  Oliver Hunt  <oliver@apple.com>
2983
2984         rs=Adam.
2985
2986         Fix minor error when writing selection to pasteboard.
2987         This shouldn't have an effect as selectedRange should be the
2988         selected range from source frame, however this is safer.
2989
2990         * platform/mac/PasteboardMac.mm:
2991         (WebCore::Pasteboard::writeSelection):
2992
2993 2007-04-08  David Hyatt  <hyatt@apple.com>
2994
2995         Fix mouseover/out failing layout tests.
2996
2997         Reviewed by aroben
2998
2999         * page/EventHandler.cpp:
3000         (WebCore::EventHandler::handleMouseMoveEvent):
3001         (WebCore::EventHandler::updateMouseEventTargetNode):
3002         (WebCore::EventHandler::dispatchMouseEvent):
3003         * page/EventHandler.h:
3004
3005 2007-04-08  Oliver Hunt  <oliver@apple.com>
3006
3007         Reviewed by Adam.
3008
3009         Fix for <rdar://problem/5113621> REGRESSION: Dragging PDF as image does not give any feedback
3010
3011         If we fail when attempting to create a drag image for a dragged
3012         image, we fall back to the appropriate icon.
3013
3014         * page/DragController.cpp:
3015         (WebCore::DragController::doImageDrag):
3016
3017 2007-04-08  Adam Roben  <aroben@apple.com>
3018
3019         Reviewed by Oliver.
3020
3021         Bestowed the gift of -webkit-dashboard-region upon all platforms, since
3022         there's nothing Mac-specific about it other than the name. This also
3023         allowed me to get rid of FrameViewMac.mm.
3024
3025         Removed a lot of #if PLATFORM(MAC):
3026
3027         * css/CSSComputedStyleDeclaration.cpp:
3028         (WebCore::):
3029         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
3030         * css/CSSPrimitiveValue.cpp:
3031         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3032         (WebCore::CSSPrimitiveValue::cleanup):
3033         (WebCore::CSSPrimitiveValue::cssText):
3034         * css/CSSPrimitiveValue.h:
3035         (WebCore::CSSPrimitiveValue::getDashboardRegionValue):
3036         (WebCore::CSSPrimitiveValue::):
3037         * css/cssparser.cpp:
3038         (WebCore::CSSParser::parseValue):
3039         (WebCore::CSSParser::parseDashboardRegions):
3040         * css/cssparser.h:
3041         * css/cssstyleselector.cpp:
3042         (WebCore::CSSStyleSelector::applyProperty):
3043         * dom/Document.cpp:
3044         (WebCore::Document::Document):
3045         * dom/Document.h:
3046         * page/Frame.cpp:
3047         (WebCore::Frame::paint):
3048         * page/Frame.h:
3049         * page/FrameView.cpp:
3050         (WebCore::FrameView::layout):
3051         (WebCore::FrameView::updateDashboardRegions): Moved from FrameViewMac.mm.
3052         * page/FrameView.h:
3053         * page/qt/FrameQt.cpp:
3054         (WebCore::Frame::dashboardRegionsChanged): Stubbed out.
3055         * platform/gdk/FrameGdk.cpp:
3056         (WebCore::Frame::dashboardRegionsChanged): Ditto.
3057         * rendering/RenderLayer.cpp:
3058         (WebCore::RenderLayer::scrollToOffset):
3059         (WebCore::RenderLayer::setHasHorizontalScrollbar):
3060         (WebCore::RenderLayer::setHasVerticalScrollbar):
3061         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
3062         * rendering/RenderObject.cpp:
3063         (WebCore::RenderObject::setStyle):
3064
3065         * WebCore.xcodeproj/project.pbxproj: Removed FrameViewMac.mm.
3066         * bridge/mac/FrameViewMac.mm: Removed.
3067
3068 2007-04-08  Mark Rowe  <mrowe@apple.com>
3069
3070         Qt build fix.
3071
3072         * platform/qt/TemporaryLinkStubs.cpp:
3073
3074 2007-04-06  Geoffrey Garen  <ggaren@apple.com>
3075
3076         Reviewed by Beth Dakin.
3077         
3078         Fixed one more case of <rdar://problem/5112273> REGRESSION(TOT): 
3079         Reproducible crash loading an old version of amazon.com as a web archive
3080
3081         * bindings/js/JSXMLHttpRequest.cpp:
3082         (KJS::JSXMLHttpRequestPrototypeFunction::callAsFunction):
3083
3084 2007-04-06  Oliver Hunt  <oliver@apple.com>
3085
3086         Reviewed by Adam.
3087
3088         Fix MouseEvent so it's possible to distinguish between
3089         a MouseMouseEvent with NoButton down, and a move with
3090         LeftButton down.  It would be nice if the DOM allowed 
3091         for NoButton to exist, but it doesn't so this is necessary.
3092
3093         * dom/EventTargetNode.cpp:
3094         (WebCore::EventTargetNode::dispatchMouseEvent):
3095         * dom/MouseEvent.cpp:
3096         (WebCore::MouseEvent::MouseEvent):
3097         (WebCore::MouseEvent::initMouseEvent):
3098         * dom/MouseEvent.h:
3099         (WebCore::MouseEvent::noButton):
3100
3101 2007-04-06  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
3102
3103         Not reviewed - gdk build fix.
3104
3105         * platform/gdk/MouseEventGdk.cpp:
3106
3107 2007-04-06  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
3108
3109         Reviewed by darin.
3110
3111         Coverity fix. Coverity says:
3112         "Event var_deref_op: Variable "info_ptr" tracked as NULL was dereferenced."
3113
3114         * platform/image-decoders/png/pngrutil.c:
3115         (png_handle_gAMA):
3116
3117 2007-04-06  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
3118
3119         Reviewed by darin.
3120
3121         Coverity fix. Coverity says:
3122         "Event var_deref_model: Variable "(this)->clientptr" tracked as NULL was passed to a function that dereferences it."
3123
3124         * platform/image-decoders/gif/GIFImageReader.cpp:
3125         (GIFImageReader::read):
3126
3127 2007-04-06  David Hyatt  <hyatt@apple.com>
3128
3129         Fix more of the layout test failures caused by fixing the slider layout test failure (sigh).  clear()
3130         needs to null out the capturingMouseEventsNode in the case where a mousedown or move while captured
3131         causes a navigation to another page.
3132
3133         * page/EventHandler.cpp:
3134         (WebCore::EventHandler::clear):
3135         (WebCore::EventHandler::handleMouseReleaseEvent):
3136
3137 2007-04-06  David Hyatt  <hyatt@apple.com>
3138
3139         Fix failing slider layout test.  Don't clear the subframe capture unless we really were capturing on a
3140         subframe.
3141
3142         Reviewed by adele, darin
3143
3144         * page/EventHandler.cpp:
3145         (WebCore::EventHandler::handleMouseReleaseEvent):
3146
3147 2007-04-06  Beth Dakin  <bdakin@apple.com>
3148
3149         Reviewed by Geoff and Darin.
3150
3151         Fix for <rdar://problem/4875433> WebView underlines are too thick 
3152         when scaled small
3153
3154         When we have a small scale factor, we should follow the line-
3155         drawing code as if we were printing. Meaning, specifically, that we 
3156         should not round to device pixels and we should antialias.
3157
3158         * platform/graphics/cg/GraphicsContextCG.cpp:
3159         (WebCore::GraphicsContext::drawLineForText):
3160
3161 2007-04-06  Geoffrey Garen  <ggaren@apple.com>
3162
3163         Reviewed by Beth Dakin.
3164         
3165         Fixed <rdar://problem/5112273> REGRESSION(TOT): Reproducible crash loading 
3166         an old version of amazon.com as a web archive
3167         
3168         The problem was JavaScript executing inside a frame with a NULL document.
3169         It's probably a bug that the document was NULL, but we don't want a minor
3170         bug to be a crasher, and we don't want the DOM to depend on the implementation
3171         details of the JS bindings, so I added NULL checks.
3172
3173         * bindings/js/kjs_window.cpp: Call FrameLoader::completeURL instead of
3174         Document::completeURL, since FrameLoader::completeURL is safe against a
3175         NULL document.
3176         (KJS::Window::put):
3177         (KJS::WindowFunc::callAsFunction):
3178         (KJS::Location::put):
3179         (KJS::LocationFunc::callAsFunction):
3180
3181 2007-04-06  David Hyatt  <hyatt@apple.com>
3182
3183         Fix for bug 13274.  Rework mouse events so that subframe capturing works again.  Make sure
3184         everything just comes down through the top FrameView even when capturing is in effect.  Update
3185         scrollbar handling logic so that scrollbars receive events correctly while capturing is in
3186         effect.  Eliminate the notion of widget capture.  Fix mouse moves so that they only fire
3187         on the innermost hit frame.
3188
3189         Reviewed by olliej
3190
3191         * page/EventHandler.cpp:
3192         (WebCore::EventHandler::handleMouseDraggedEvent):
3193         (WebCore::subframeForTargetNode):
3194         (WebCore::EventHandler::handleMousePressEvent):
3195         (WebCore::EventHandler::handleMouseMoveEvent):
3196         (WebCore::EventHandler::handleMouseReleaseEvent):
3197         * page/EventHandler.h:
3198         * platform/PopupMenu.h:
3199         (WebCore::PopupMenu::scrollbarCapturingMouse):
3200         (WebCore::PopupMenu::setScrollbarCapturingMouse):
3201         * platform/ScrollBar.h:
3202         (WebCore::Scrollbar::handleMouseReleaseEvent):
3203         * platform/Widget.h:
3204         (WebCore::Widget::geometryChanged):
3205
3206 2007-04-06  Justin Garcia  <justin.garcia@apple.com>
3207
3208         Reviewed by john
3209
3210         <rdar://problem/5115601> 
3211         REGRESSION: Crash deleting a selection that starts in an editable table cell
3212         
3213         The selection starts at the start of an editable 
3214         root that's embedded in a non-editable ToDo (table).  
3215         Removing the selection removes all editable 
3216         VisiblePositions from the root.  Then, the creation 
3217         of mergeDestination fails, and using it causes a crash.
3218
3219         * editing/DeleteSelectionCommand.cpp:
3220         (WebCore::DeleteSelectionCommand::mergeParagraphs):
3221         Nil-check mergeDestination to avoid crashing and
3222         also insert a break in that case at m_upstreamStart, 
3223         so that we can create a valid mergeDestination and
3224         perform the merge.
3225         
3226         
3227 2007-04-06  Mitz Pettel  <mitz@webkit.org>
3228
3229         Reviewed by Oliver.
3230
3231         Eliminate PlatformMouseEvent::currentEvent.
3232
3233         No test possible (no change to functionality).
3234
3235         * page/EventHandler.cpp:
3236         (WebCore::EventHandler::handleDrag):
3237         * platform/PlatformMouseEvent.h:
3238         * platform/gdk/TemporaryLinkStubs.cpp:
3239         * platform/mac/PlatformMouseEventMac.mm:
3240         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
3241         * platform/qt/PlatformMouseEventQt.cpp:
3242         * platform/win/TemporaryLinkStubs.cpp:
3243
3244 2007-04-05  Oliver Hunt  <oliver@apple.com>
3245
3246         Reviewed by Maciej.
3247
3248         Fix for rdar://problem/4849948 -- JSCanvasRenderingContext2D::drawImage
3249         crashes when given invalid arguments.
3250
3251         JSCanvasRenderingContext2D frequently casts from JSValue* to JSObject*
3252         and then checks isObject *after* the cast.  JSObject::isObject is unsafe 
3253         if applied to a JSImmediate value (null, undefined, etc).  This patch 
3254         corrects the logic in a number of places by performing the isObject check
3255         before casting to JSObject.
3256
3257         * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
3258         (WebCore::JSCanvasRenderingContext2D::drawImage):
3259         (WebCore::JSCanvasRenderingContext2D::drawImageFromRect):
3260         (WebCore::JSCanvasRenderingContext2D::createPattern):
3261
3262 2007-04-05  Adele Peterson  <adele@apple.com>
3263
3264         Reviewed by Oliver.
3265
3266         Fix for <rdar://problem/4965597> REGRESSION: mouseup doesn't fire for slider (causes it to always default to max)
3267
3268         Test: fast/forms/slider-mouse-events.html
3269
3270         * page/EventHandler.cpp: (WebCore::EventHandler::dispatchMouseEvent):
3271         Since the actual target node of the event can't be a shadow node, set the target node to the capturing node before adjusting it.
3272
3273 2007-04-05  Kevin McCullough  <kmccullough@apple.com>
3274
3275         Reviewed by Darin.
3276
3277         - Added reportLocalLoadFailed to FrameLoader to send an error to the console when
3278         calls to canLoad fail. 
3279
3280         * loader/Cache.cpp:
3281         (WebCore::Cache::requestResource):
3282         * loader/FrameLoader.cpp:
3283         (WebCore::FrameLoader::loadSubframe):
3284         (WebCore::FrameLoader::loadPlugin):
3285         (WebCore::FrameLoader::load):
3286         (WebCore::FrameLoader::reportLocalLoadFailed):
3287         * loader/FrameLoader.h:
3288         * loader/SubresourceLoader.cpp:
3289         (WebCore::SubresourceLoader::create):
3290
3291 2007-04-05  Adele Peterson  <adele@apple.com>
3292
3293         Reviewed by Maciej.
3294
3295         Add text-align: -webkit-auto for form controls.  Buttons already override this property to center their text.
3296
3297         * css/html4.css:
3298
3299 2007-04-05  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
3300
3301         Reviewed by rwlbuis.
3302
3303         Coverity fix. Coverity says:
3304         "Event var_deref_model: Variable "page" tracked as NULL was passed to a function that dereferences it."
3305
3306         * platform/Font.cpp:
3307         (WebCore::Font::glyphDataForCharacter):
3308
3309 2007-04-05  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
3310
3311         Reviewed by darin.
3312
3313         Coverity fix. Coverity says:
3314         "Event var_deref_model: Variable "unicode" tracked as NULL was passed to a 
3315         function that dereferences it."
3316
3317         * platform/DeprecatedString.cpp:
3318         (WebCore::DeprecatedString::DeprecatedString):
3319
3320 2007-04-05  Adele Peterson  <adele@apple.com>
3321
3322         Reviewed by Hyatt.
3323
3324         Fix for <rdar://problem/5113593> REGRESSION: Search fields in RSS pages don't show ibeam cursor
3325
3326         * css/html4.css: Set the cursor values explicitly for input, textarea (to auto), & select (to default).
3327
3328 2007-04-05  David Hyatt  <hyatt@apple.com>
3329
3330         Fix for <rdar://problem/5078866> tables should only reset text-align
3331         in quirks mode.
3332
3333         Reviewed by beth
3334
3335         * css/html4.css:
3336         * css/quirks.css:
3337
3338 2007-04-05  Adele Peterson  <adele@apple.com>
3339
3340         Fixing typo that's crashing.
3341
3342         * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::defaultEventHandler):
3343           Use evt instead of null variable k.
3344
3345 2007-04-05  Adele Peterson  <adele@apple.com>
3346
3347         Reviewed by Hyatt.
3348
3349         Fix for <rdar://problem/5021500> Cursor should stay as pointer when slider is being dragged
3350
3351         Don't set the selection ibeam cursor when there's a node that's capturing mouse events.
3352
3353         * page/EventHandler.cpp:
3354         (WebCore::selectCursor):
3355         (WebCore::EventHandler::handleMouseMoveEvent):
3356
3357 2007-04-05  Geoffrey Garen  <ggaren@apple.com>
3358
3359         Reviewed by Beth Dakin.
3360
3361         More clean-up while fixing <rdar://problem/5112273> REGRESSION(TOT): 
3362         Reproducible crash loading an old version of amazon.com as a web archive
3363         
3364         Layout tests pass.
3365         
3366         Removed more superfluous document NULL checks. (Node::document() never 
3367         returns NULL, and it asserts as much.)
3368         
3369         Merged some duplicate editing code into a static inline function.
3370         
3371         * page/mac/WebCoreFrameBridge.mm:
3372         (updateRenderingForBindings): Removed superfluous static_cast.
3373
3374 2007-04-05  Adele Peterson  <adele@apple.com>
3375
3376         Reviewed by Darin.
3377
3378         A little cleanup from my last checkin.  Always check if an Event is really a MouseEvent or a KeyboardEvent
3379         before casting it.
3380
3381         * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::defaultEventHandler):
3382         * html/HTMLSelectElement.cpp:
3383         (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
3384         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
3385         * html/HTMLTextFieldInnerElement.cpp:
3386         (WebCore::HTMLSearchFieldResultsButtonElement::defaultEventHandler):
3387         (WebCore::HTMLSearchFieldCancelButtonElement::defaultEventHandler):
3388         * ksvg2/svg/SVGAElement.cpp: (WebCore::SVGAElement::defaultEventHandler):
3389         * page/ContextMenuController.cpp: (WebCore::ContextMenuController::handleContextMenuEvent):
3390         * rendering/RenderFrameSet.cpp: (WebCore::RenderFrameSet::userResize):
3391         * rendering/RenderSlider.cpp: (WebCore::HTMLSliderThumbElement::defaultEventHandler):
3392
3393 2007-04-05  Geoffrey Garen  <ggaren@apple.com>
3394
3395         Reviewed by Beth Dakin.
3396         
3397         Some clean-up while fixing <rdar://problem/5112273> REGRESSION(TOT): 
3398         Reproducible crash loading an old version of amazon.com as a web archive
3399         
3400         Removed superfluous document NULL checks. (Node::document() never returns
3401         NULL, and it asserts as much.)
3402         
3403         Removed duplicate implementation of displayString.
3404         
3405         Layout tests pass.
3406
3407         * bindings/objc/DOMInternal.h:
3408         * bindings/objc/DOMInternal.mm:
3409         * html/HTMLGenericFormElement.cpp:
3410         (WebCore::HTMLGenericFormElement::supportsFocus):
3411         * html/HTMLPlugInElement.cpp:
3412         (WebCore::HTMLPlugInElement::createNPObject):
3413         * platform/ContextMenu.cpp:
3414         (WebCore::ContextMenu::checkOrEnableIfNeeded):
3415         * rendering/HitTestResult.cpp:
3416         (WebCore::displayString):
3417         * rendering/HitTestResult.h:
3418         * rendering/RenderLayer.cpp:
3419         (WebCore::RenderLayer::updateHoverActiveState):
3420
3421 === Safari-5522.6 ===
3422
3423 2007-04-05  Oliver Hunt  <oliver@apple.com>
3424
3425         Reviewed by Adam.
3426
3427         Fix rdar://problem/5030934 -- landscape PDFs embedded as an image are cut off
3428         also fixes scaling of pdf images
3429
3430         PDFDocumentImage was not accounting for page rotation in a number of places
3431
3432         * platform/graphics/cg/PDFDocumentImage.cpp:
3433         (WebCore::PDFDocumentImage::size):
3434           we need to account for rotation of the pdf image effecting our bounds
3435         (WebCore::PDFDocumentImage::draw):
3436           When compensating for flipped coords we need to use the correct rect for the 
3437           coordinate space.  We can't pass size() to CGContextDrawPDFDocument as it
3438           returns the rotated bounds now -- this is also save the old 
3439           FloatSize -> IntSize -> FloatSize conversions.
3440           
3441 2007-04-04  Alexey Proskuryakov  <ap@webkit.org>
3442
3443         Reviewed by Darin.
3444
3445         http://bugs.webkit.org/show_bug.cgi?id=13278
3446         REGRESSION: cannot change SELECT option
3447
3448         Test: fast/forms/option-change-single-selected.html
3449
3450         * html/HTMLSelectElement.cpp:
3451         (WebCore::HTMLSelectElement::setSelectedIndex): If multiple selection is not allowed, 
3452         be sure to deselect the previous option.
3453
3454 2007-04-04  Adele Peterson  <adele@apple.com>
3455
3456         Reviewed by Oliver.
3457
3458         Fix for <rdar://5105009> Prepare for fix to send mousedown and mouseup (but not click) events when right-clicking
3459
3460         * page/EventHandler.cpp: Don't ever send click events for right-clicks.
3461         (WebCore::EventHandler::handleMouseDoubleClickEvent):
3462         (WebCore::EventHandler::handleMouseReleaseEvent):
3463         
3464         Check that the mousedown and mouseup are not with the right button before performing default behavior.
3465         * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::defaultEventHandler):
3466         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler):
3467         * html/HTMLSelectElement.cpp:
3468         (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
3469         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
3470         * html/HTMLTextFieldInnerElement.cpp:
3471         (WebCore::HTMLSearchFieldResultsButtonElement::defaultEventHandler):
3472         (WebCore::HTMLSearchFieldCancelButtonElement::defaultEventHandler):
3473         * ksvg2/svg/SVGAElement.cpp:(WebCore::SVGAElement::defaultEventHandler):
3474         * rendering/RenderFrameSet.cpp: (WebCore::RenderFrameSet::userResize):
3475         * rendering/RenderSlider.cpp: (WebCore::HTMLSliderThumbElement::defaultEventHandler):
3476
3477 2007-04-03  Justin Garcia  <justin.garcia@apple.com>
3478
3479         Reviewed by darin
3480         
3481         <rdar://problem/5026848> Can cut/delete ToDo subunits
3482         
3483         We were removing non-editable content during a delete.
3484
3485         * editing/DeleteSelectionCommand.cpp: 
3486         (WebCore::DeleteSelectionCommand::initializePositionData): 
3487         Set m_startRoot and m_endRoot.
3488         (WebCore::DeleteSelectionCommand::removeNode): If a node
3489         is not inside both the start and end roots, remove it only
3490         if it is in editable content.
3491         * editing/DeleteSelectionCommand.h: Added m_startRoot and 
3492         m_endRoot, the editable roots that contain the start and end
3493         of the selection, respectively.  We consult these every
3494         time we remove a node, and don't want to recompute them 
3495         on every call to removeNode().
3496
3497 2007-04-03  David Hyatt  <hyatt@apple.com>
3498
3499         Fix for <rdar://problem/5108896>, make sure the assert for setEncodedSize
3500         deals with the error case.
3501
3502         Reviewed by andersca
3503
3504         * loader/CachedResource.cpp:
3505         (WebCore::CachedResource::setEncodedSize):
3506
3507 2007-04-03  Anders Carlsson  <andersca@apple.com>
3508
3509         Reviewed by Dave Hyatt.
3510
3511         * loader/ImageDocument.cpp:
3512         Don't call error() in stopParsing.
3513
3514 2007-04-03  Justin Garcia  <justin.garcia@apple.com>
3515
3516         Reviewed by darin
3517         
3518         <rdar://problem/5107422> 
3519         TOT REGRESSION: Delete key fails to delete text, and cursor disappears in Mail.app
3520         <rdar://problem/5107413> 
3521         TOT REGRESSION: Crash deleting text in email (infinite recursion in shouldInsertNode)
3522
3523         * editing/CompositeEditCommand.cpp:
3524         (WebCore::CompositeEditCommand::moveParagraphs):
3525         Back out the call to shouldInsert until we
3526         add WebViewInsertActionMoved, because Mail returns
3527         NO from shouldInsert for WebViewInsertActionPasted
3528         to override our Paste operation.
3529
3530 2007-04-03  Anders Carlsson  <andersca@apple.com>
3531
3532         Reviewed by Mitz.
3533
3534         Make window.innerWidth/innerHeight include the size of any present scrollbar to match Firefox.
3535         
3536         Make document.body.clientWidth/clientHeight return the width/height of the visible content when in
3537         quirks mode to match WinIE.
3538         
3539         * bindings/js/kjs_window.cpp:
3540         (KJS::Window::getValueProperty):
3541         Return the width and height of the scroll view, not the visible width and height.
3542         
3543         * dom/Element.cpp:
3544         (WebCore::Element::clientWidth):        
3545         (WebCore::Element::clientHeight):
3546         Return the visible size if the element is the body element and we're in quirks mode.
3547
3548 2007-04-03  Adele Peterson  <adele@apple.com>
3549
3550         Reviewed by Darin.
3551
3552         Updated fix for <rdar://problem/5107095> REGRESSION: disabled text color calculations are slowing down launchtime measurements
3553
3554         * platform/graphics/Color.cpp: Moved optimization for lightening black and darkening white into the Color class.