Reviewed by hyatt
[WebKit-https.git] / WebCore / ChangeLog
1 2006-05-11  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2
3         Reviewed by hyatt
4
5         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8851
6           REGRESSION: RTL text shifted to the right
7
8         Already covered by several tests in fast/text
9
10         * platform/Font.h:
11         (WebCore::TextRun::TextRun): Added length parameter.
12         * rendering/InlineTextBox.cpp: Pass the length to the TextRun constructor.
13         (WebCore::InlineTextBox::selectionRect):
14         (WebCore::InlineTextBox::paint):
15         (WebCore::InlineTextBox::paintSelection):
16         (WebCore::InlineTextBox::paintMarkedTextBackground):
17         (WebCore::InlineTextBox::paintTextMatchMarker):
18         (WebCore::InlineTextBox::offsetForPosition):
19         (WebCore::InlineTextBox::positionForOffset):
20         * rendering/RenderText.cpp:
21         (WebCore::RenderText::widthFromCache): Pass length and from instead of from and to
22         to the TextRun constructor.
23         (WebCore::RenderText::width): Ditto.
24
25 2006-05-11  David Hyatt  <hyatt@apple.com>
26
27         Fix a regression from the TextRun landing.  Delete the characters in
28         the adjustedRun, not the ones in the original run!
29
30         Reviewed by beth
31
32         * platform/mac/FontMac.mm:
33         (WebCore::Font::drawComplexText):
34
35 2006-05-10  Justin Garcia  <justin.garcia@apple.com>
36
37         Reviewed by thatcher, levi
38
39         * editing/ReplaceSelectionCommand.cpp:
40         (WebCore::ReplaceSelectionCommand::doApply):
41         Removed a use fragment.hasMoreThanOneBlock to decide if the paragraph containing the
42         position pasted into must be split to avoid block nesting.  We now split unnecessarily
43         some times, but the end merge cleans up for us.
44
45 2006-05-11  David Hyatt  <hyatt@apple.com>
46
47         This patch makes drawHighlightForText a completely cross-platform method
48         implemented by the GraphicsContext.  The platform-specific implementations
49         of the method in the Font class have been eliminated.
50
51         Reviewed by andersca
52
53         * platform/Font.h:
54         * platform/FontData.h:
55         Remove the drawHighlight methods.  Change the selectionRect method in
56         Font to return a FloatRect so that the GraphicsContext can do an accurate
57         fill.
58
59         * platform/GraphicsContext.cpp:
60         (WebCore::GraphicsContext::drawHighlightForText):
61         Implement the drawHighlightFunction in terms of the cross-platform
62         Font selectionRect functions and a new float-based fillRect graphics context
63         function.
64
65         * platform/GraphicsContext.h:
66         * platform/cairo/GraphicsContextCairo.cpp:
67         (WebCore::GraphicsContext::fillRect):
68         * platform/cg/GraphicsContextCG.cpp:
69         (WebCore::GraphicsContext::fillRect):
70         Add the new float-based fillRect function for Cairo and CG.
71
72         * platform/mac/FontData.mm:
73         (WebCore::CG_draw):
74         (WebCore::ATSU_draw):
75         Removed the CG and ATSU drawHighlight methods.  Remove the drawing of
76         the background from the deprecated draw methods (they'll be removed
77         soon).
78
79         * platform/mac/FontMac.mm:
80         (WebCore::Font::selectionRectForText):
81         * platform/win/FontWin.cpp:
82         (WebCore::Font::selectionRectForText):
83         Change selectionRectForText to return a FloatRect instead of an IntRect,
84         so that the GraphicsContext can do a precise fill.
85
86         * rendering/InlineTextBox.cpp:
87         (WebCore::InlineTextBox::selectionRect):
88         (WebCore::InlineTextBox::positionForOffset):
89         Modify the callers who expect an int-based selection rect so that they call
90         enclosingIntRect.
91
92 2006-05-11  Darin Adler  <darin@apple.com>
93
94         Reviewed by Adele.
95
96         - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=8743
97           REGRESSION: focus() on input field selects all text within it
98           (was: cannot select cities on British Rail reservation site)
99
100         Test: fast/forms/double-focus.html
101
102         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::focus):
103         Changed to only call setFocusNode, select, and revealSelection
104         if the element is not already focused. Also changed to use return
105         a bit more rather than else.
106
107 2006-05-11  Darin Adler  <darin@apple.com>
108
109         Reviewed by Tim Hatcher (earlier version).
110
111         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8821
112           use the preprocessor for IDL files
113
114         * bindings/scripts/IDLParser.pm: Invoke the preprocessor via the "gcc"
115         driver script, passing "-E" so we only preprocess, "-P" so we don't get
116         "#line" directives, and "-x c++" so we handle both C and C++ comments.
117         Removed the code to eliminate comments since the preprocessor handles that.
118         * css/make-css-file-arrays.pl: This already invoked the preprocessor, but
119         updated it to do the same way as above.
120
121 2006-05-11  Anders Carlsson  <acarlsson@apple.com>
122
123         Reviewed by Darin.
124
125         http://bugzilla.opendarwin.org/show_bug.cgi?id=7838
126         Add support for mozilla-style node constructors as properties of the window object
127         
128         * DerivedSources.make:
129         * WebCore.xcodeproj/project.pbxproj:
130         Add new generated files.
131         
132         * bindings/js/JSCanvasRenderingContext2DBase.cpp:
133         (WebCore::JSCanvasRenderingContext2DBaseProtoFunc::callAsFunction):
134         * bindings/js/JSHTMLElementWrapperFactory.cpp:
135         (WebCore::createJSWrapper):
136         Specify the KJS namespace for JSHTMLElmement.
137                 
138         * bindings/js/kjs_dom.cpp:
139         (KJS::toJS):
140         Create a WebCore::JSHTMLDocument for document nodes. Also, create
141         JSDocumentFragments for document fragments (instead of plain node objects).
142         
143         * bindings/js/kjs_html.cpp:
144         (KJS::JSHTMLDocumentProtoFunc::callAsFunction):
145         (KJS::JSHTMLDocument::JSHTMLDocument):
146         (KJS::JSHTMLDocument::getOwnPropertySlot):
147         Add a prototype for JSHTMLDocument and move all functions there.
148         
149         (KJS::JSHTMLElement::JSHTMLElement):
150         (KJS::JSHTMLElement::getOwnPropertySlot):
151         Update since JSHTMLElement now inherits from WebCore::JSHTMLElement.
152         
153         (KJS::JSHTMLElement::getValueProperty):
154         (KJS::JSHTMLElement::putValueProperty):
155         Remove title setter and getter. Those are autogenerated now.
156         
157         * bindings/js/kjs_html.h:
158         (KJS::JSHTMLElement::):
159         Inherit from WebCore::JSHTMLElement. Clarify the inheritance chain.
160         
161         * bindings/scripts/CodeGeneratorJS.pm:
162         Always generate a prototype object, regardless of whether the object has any functions or
163         constants.
164         
165         Use the type of generator attributes to determine what constructor to use. This is useful for
166         the XMLDocument property in DOMWindow.idl, since that's just an alias for the Document constructor.
167         
168         * dom/DocumentFragment.idl: Added.        
169         * html/HTMLDocument.idl: Added.
170         * html/HTMLElement.idl: Added.
171         
172         * page/DOMWindow.idl:
173         Add constructors for DocumentFragment, HTMLElement, HTMLDocument and XMLDocument. XMLDocument is just
174         an alias for the Document constructor.
175         
176 2006-05-11  David Hyatt  <hyatt@apple.com>
177
178         Bug 8845.  Define a TextRun (similar to the old WebCoreTextRun) and
179         make it the new API for Font and GraphicsContext when drawing/measuring
180         text.
181
182         Reviewed by andersca
183
184         * platform/Font.cpp:
185         (WebCore::m_finalRoundingWidth):
186         (WebCore::WidthIterator::advance):
187         (WebCore::WidthIterator::normalizeVoicingMarks):
188         (WebCore::Font::width):
189         (WebCore::Font::canUseGlyphCache):
190         (WebCore::Font::drawSimpleText):
191         (WebCore::Font::drawText):
192         (WebCore::Font::floatWidth):
193         (WebCore::Font::floatWidthForSimpleText):
194         * platform/Font.h:
195         (WebCore::TextRun::m_to):
196         (WebCore::TextRun::operator[]):
197         (WebCore::TextRun::data):
198         (WebCore::TextRun::adjustFrom):
199         (WebCore::TextRun::adjustTo):
200         (WebCore::TextRun::characters):
201         (WebCore::TextRun::length):
202         (WebCore::TextRun::from):
203         (WebCore::TextRun::to):
204         * platform/GraphicsContext.cpp:
205         (WebCore::GraphicsContext::drawText):
206         (WebCore::GraphicsContext::drawHighlightForText):
207         * platform/GraphicsContext.h:
208         * platform/mac/FontMac.mm:
209         (WebCore::addDirectionalOverride):
210         (WebCore::overrideLayoutOperation):
211         (WebCore::ATSULayoutParameters::initialize):
212         (WebCore::Font::selectionRectForText):
213         (WebCore::Font::drawComplexText):
214         (WebCore::Font::drawHighlightForText):
215         (WebCore::Font::floatWidthForComplexText):
216         (WebCore::Font::checkSelectionPoint):
217         * platform/win/FontWin.cpp:
218         (WebCore::hackishExtentForString):
219         (WebCore::Font::floatWidth):
220         (WebCore::Font::drawText):
221         (WebCore::Font::drawHighlightForText):
222         (WebCore::Font::selectionRectForText):
223         (WebCore::Font::checkSelectionPoint):
224         * rendering/InlineTextBox.cpp:
225         (WebCore::InlineTextBox::selectionRect):
226         (WebCore::InlineTextBox::paint):
227         (WebCore::InlineTextBox::paintSelection):
228         (WebCore::InlineTextBox::paintMarkedTextBackground):
229         (WebCore::InlineTextBox::paintTextMatchMarker):
230         (WebCore::InlineTextBox::offsetForPosition):
231         (WebCore::InlineTextBox::positionForOffset):
232         * rendering/RenderBlock.cpp:
233         (WebCore::stripTrailingSpace):
234         * rendering/RenderFlexibleBox.cpp:
235         (WebCore::RenderFlexibleBox::layoutVerticalBox):
236         * rendering/RenderImage.cpp:
237         (WebCore::RenderImage::imageChanged):
238         (WebCore::RenderImage::paint):
239         * rendering/RenderText.cpp:
240         (WebCore::RenderText::cacheWidths):
241         (WebCore::RenderText::widthFromCache):
242         (WebCore::RenderText::trimmedMinMaxWidth):
243         (WebCore::RenderText::calcMinMaxWidth):
244         (WebCore::RenderText::width):
245         * rendering/RenderTextField.cpp:
246         (WebCore::RenderTextField::calcMinMaxWidth):
247         * rendering/bidi.cpp:
248         (WebCore::RenderBlock::tabWidth):
249         (WebCore::RenderBlock::checkLinesForTextOverflow):
250         * rendering/render_line.cpp:
251         (WebCore::EllipsisBox::paint):
252         * rendering/render_list.cpp:
253         (WebCore::RenderListMarker::paint):
254         (WebCore::RenderListMarker::calcMinMaxWidth):
255         (WebCore::RenderListMarker::getRelativeMarkerRect):
256
257 2006-05-10  Justin Garcia  <justin.garcia@apple.com>
258
259         Reviewed by darin
260
261         * editing/ReplaceSelectionCommand.cpp:
262         (WebCore::ReplaceSelectionCommand::doApply):
263         Removed the code to find out if we must later add smart replace whitespace.  We can 
264         wait until we've done the insertion to figure it out, and the position sampled (startPos)
265         to make the decision about trailing whitespace was wrong.
266         Changed the order that work is done during a paste: 1) Insert everything 2) Do one of
267         the following: a) handle a trailing interchange newline, b) uncollapse the last incoming
268         br if it has been collapsed because of quirks mode, c) do an end merge 3) Add smart replace
269         whitespace (2 and 3 were reversed because the end merge must happen before we can know
270         whether or not we need to add a trailing space).
271         Don't do an end merge if the last node inserted was a br because the end merge will 
272         clobber it.
273         
274         (WebCore::ReplaceSelectionCommand::removeEndBRIfNeeded):
275         brs where [br, 0] is at the end of a block and not at the start of a paragraph
276         are the ones that are collapsed because of quirks mode.
277
278 2006-05-10  David Hyatt  <hyatt@apple.com>
279
280         Rename isSpace to treatAsSpace.  Move it and the rounding hack function into
281         Font and make them static methods (inlined in the header).  Make the rounding
282         hack character table a static member as well.  Remove the redundant space/rounding
283         functions from FontData.mm.
284
285         Reviewed by darin
286
287         * platform/Font.cpp:
288         (WebCore::):
289         (WebCore::m_finalRoundingWidth):
290         (WebCore::WidthIterator::advance):
291         * platform/Font.h:
292         (WebCore::Font::treatAsSpace):
293         (WebCore::Font::isRoundingHackCharacter):
294         * platform/mac/FontData.mm:
295         (WebCore::overrideLayoutOperation):
296         (WebCore::createATSULayoutParameters):
297         (WebCore::initializeWidthIterator):
298         (WebCore::advanceWidthIterator):
299         * platform/mac/FontMac.mm:
300         (WebCore::overrideLayoutOperation):
301         (WebCore::ATSULayoutParameters::initialize):
302
303 2006-05-10  Darin Adler  <darin@apple.com>
304
305         * WebCore: Removed an extra WebCore subtree that somehow got checked in.
306
307 >>>>>>> .r14297
308 2006-05-10  David Carson <dacarson@gmail.com>
309
310         - Fix for bug 8833. Removed inline keyword from functions declared
311         in .mm and .cpp files. inline function code needs to reside in the
312         header file for the linker to find the code. 
313         http://www.parashift.com/c++-faq-lite/inline-functions.html#faq-9.7
314
315         Reviewed by Darin, landed by Timothy.
316
317         * platform/Font.cpp:
318         (WebCore::isSpace):
319         * platform/mac/FontData.mm:
320         (WebCore::widthForGlyph):
321         (WebCore::isRoundingHackCharacter):
322         (WebCore::glyphForCharacter):
323
324 2006-05-10  Mitz Pettel  <opendarwin.org@mitzpettel.com>
325
326         Reviewed and landed by Anders.
327
328         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8830
329           REGRESSION: Words render on top of each other when fallback font is used
330
331         Already covered by several pixel tests in fast/text
332
333         * platform/Font.cpp:
334         (WebCore::Font::drawSimpleText):
335
336 2006-05-10  David Hyatt  <hyatt@apple.com>
337
338         Fix for bug 8809, lift the Mac-specific WebTextRenderer code for
339         drawing and measuring of runs up into the Font class.  The fast code
340         path is in Font.cpp and is designed to be mostly cross-platform.  The
341         slow code path is in FontMac.cpp and is Mac-specific.
342
343         Reviewed by darin
344
345         * WebCore.xcodeproj/project.pbxproj:
346         * platform/Font.cpp:
347         (WebCore::isSpace):
348         (WebCore::):
349         (WebCore::isRoundingHackCharacter):
350         (WebCore::m_finalRoundingWidth):
351         (WebCore::WidthIterator::advance):
352         (WebCore::WidthIterator::normalizeVoicingMarks):
353         (WebCore::Font::primaryFont):
354         (WebCore::Font::setAlwaysUseComplexPath):
355         (WebCore::Font::canUseGlyphCache):
356         (WebCore::Font::drawSimpleText):
357         (WebCore::Font::drawText):
358         (WebCore::Font::floatWidth):
359         (WebCore::Font::floatWidthForSimpleText):
360         * platform/Font.h:
361         * platform/FontData.h:
362         (WebCore::FontData::platformData):
363         * platform/GlyphBuffer.h: Added.
364         (WebCore::GlyphBuffer::GlyphBuffer):
365         (WebCore::GlyphBuffer::isEmpty):
366         (WebCore::GlyphBuffer::size):
367         (WebCore::GlyphBuffer::glyphs):
368         (WebCore::GlyphBuffer::advances):
369         (WebCore::GlyphBuffer::fontDataAt):
370         (WebCore::GlyphBuffer::swap):
371         (WebCore::GlyphBuffer::glyphAt):
372         (WebCore::GlyphBuffer::advanceAt):
373         (WebCore::GlyphBuffer::add):
374         * platform/mac/FontData.mm:
375         (WebCore::isSpace):
376         (WebCore::isRoundingHackCharacter):
377         (WebCore::FontData::widthForGlyph):
378         (WebCore::m_ATSUMirrors):
379         (WebCore::FontData::xHeight):
380         (WebCore::FontData::smallCapsFontData):
381         (WebCore::findSubstituteFont):
382         (WebCore::rendererForAlternateFont):
383         (WebCore::findSubstituteRenderer):
384         (WebCore::FontData::findSubstituteFontData):
385         (WebCore::computeWidthForSpace):
386         (WebCore::FontData::updateGlyphMapEntry):
387         (WebCore::extendGlyphMap):
388         (WebCore::extendWidthMap):
389         (WebCore::createATSULayoutParameters):
390         (WebCore::FontData::glyphForCharacter):
391         (WebCore::advanceWidthIterator):
392         (WebCore::shouldUseATSU):
393         * platform/mac/FontMac.mm:
394         (WebCore::ATSULayoutParameters::m_padPerSpace):
395         (WebCore::addDirectionalOverride):
396         (WebCore::initializeATSUStyle):
397         (WebCore::overrideLayoutOperation):
398         (WebCore::ATSULayoutParameters::initialize):
399         (WebCore::disposeATSULayoutParameters):
400         (WebCore::Font::drawComplexText):
401         (WebCore::Font::floatWidthForComplexText):
402         (WebCore::Font::drawGlyphs):
403         * platform/mac/WebCoreTextRenderer.mm:
404         (WebCoreSetAlwaysUseATSU):
405
406 2006-05-10  Darin Adler  <darin@apple.com>
407
408         - another try at fixing the Windows build
409
410         * platform/win/FontWin.cpp: (WebCore::getFontData): Use characters()
411         instead of unicode().
412
413 == Rolled over to ChangeLog-2006-05-10 ==