Changeset 43243 in webkit
- Timestamp:
- May 5, 2009 10:33:10 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r43238 r43243 1 2009-05-05 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Darin Adler. 4 5 - updated results for <rdar://problem/5760774> Replying to a Mail 6 message that contains fixed width text can change the size of the text 7 8 * editing/execCommand/19089-expected.txt: 9 * editing/execCommand/5770834-1-expected.txt: 10 * platform/mac/editing/deleting/delete-br-011-expected.txt: 11 * platform/mac/editing/deleting/delete-select-all-001-expected.txt: 12 * platform/mac/editing/execCommand/remove-formatting-2-expected.txt: 13 * platform/mac/editing/pasteboard/5027857-expected.checksum: 14 * platform/mac/editing/pasteboard/5027857-expected.png: 15 * platform/mac/editing/pasteboard/5027857-expected.txt: 16 * platform/mac/editing/pasteboard/paste-pre-002-expected.checksum: 17 * platform/mac/editing/pasteboard/paste-pre-002-expected.png: 18 * platform/mac/editing/pasteboard/paste-pre-002-expected.txt: 19 * platform/mac/editing/style/block-style-004-expected.txt: 20 * platform/mac/editing/style/block-style-005-expected.txt: 21 * platform/mac/editing/style/block-style-006-expected.txt: 22 1 23 2009-05-05 Eric Seidel <eric@webkit.org> 2 24 -
trunk/LayoutTests/editing/execCommand/19089-expected.txt
r34390 r43243 1 1 This tests to make sure an ASSERT doesn't fire when performing a FormatBlock operation on a selection that ends just after a horizontal rule that is the last element in the document. The test should not assert. 2 <pre><span class="Apple-style-span" style="font-family: Times; font-size: 16px;white-space: normal; "><hr></span></pre>2 <pre><span class="Apple-style-span" style="font-family: Times; white-space: normal; "><hr></span></pre> -
trunk/LayoutTests/editing/execCommand/5770834-1-expected.txt
r30987 r43243 3 3 4 4 <div style="text-align: right;"> 5 <div style="text-align: auto;">foo<br><div style="text-align: auto;">bar</div></div>5 <div>foo<br><div style="text-align: auto;">bar</div></div> 6 6 </div> 7 7 -
trunk/LayoutTests/platform/mac/editing/deleting/delete-br-011-expected.txt
r34681 r43243 17 17 text run at (0,0) width 31: "hello" 18 18 RenderBlock {DIV} at (0,18) size 784x56 [border: (2px solid #FF0000)] 19 RenderInline {FONT} at (0,0) size 0x22 20 RenderInline {SPAN} at (0,0) size 0x18 21 RenderInline {FONT} at (0,0) size 0x28 22 RenderInline {SPAN} at (0,0) size 0x28 23 RenderBR {BR} at (14,14) size 0x28 19 RenderInline {SPAN} at (0,0) size 0x18 20 RenderInline {FONT} at (0,0) size 0x28 21 RenderInline {SPAN} at (0,0) size 0x28 22 RenderBR {BR} at (14,14) size 0x28 24 23 RenderBlock (anonymous) at (0,74) size 784x0 25 caret: position 0 of child 0 {BR} of child 0 {SPAN} of child 0 {FONT} of child 0 {SPAN} of child 0 {FONT} of child1 {DIV} of child 1 {BODY} of child 0 {HTML} of document24 caret: position 0 of child 0 {BR} of child 0 {SPAN} of child 0 {FONT} of child 0 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document -
trunk/LayoutTests/platform/mac/editing/deleting/delete-select-all-001-expected.txt
r25970 r43243 16 16 RenderBlock {DIV} at (0,0) size 784x46 [border: (2px solid #FF0000)] 17 17 RenderBlock (anonymous) at (14,14) size 756x18 18 RenderInline {FONT} at (0,0) size 0x18 19 RenderInline {SPAN} at (0,0) size 0x18 20 RenderBR {BR} at (0,0) size 0x18 21 caret: position 0 of child 0 {BR} of child 0 {SPAN} of child 0 {FONT} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document 18 RenderInline {SPAN} at (0,0) size 0x18 19 RenderBR {BR} at (0,0) size 0x18 20 caret: position 0 of child 0 {BR} of child 0 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document -
trunk/LayoutTests/platform/mac/editing/execCommand/remove-formatting-2-expected.txt
r30635 r43243 17 17 text run at (0,18) width 625: "document default style to the selection if that's necessary in order to leave the selected text unstyled." 18 18 RenderBlock {DIV} at (0,52) size 784x18 19 RenderText {#text} at (0,0) size 305x18 20 text run at (0,0) width 305: "This text should look the same as the text above." 19 RenderText {#text} at (0,0) size 28x18 20 text run at (0,0) width 28: "This" 21 RenderText {#text} at (28,0) size 277x18 22 text run at (28,0) width 277: " text should look the same as the text above." 21 23 selection start: position 0 of child 0 {#text} of child 2 {DIV} of child 1 {BODY} of child 0 {HTML} of document 22 24 selection end: position 4 of child 0 {#text} of child 2 {DIV} of child 1 {BODY} of child 0 {HTML} of document -
trunk/LayoutTests/platform/mac/editing/pasteboard/5027857-expected.checksum
r38122 r43243 1 dca49965de716b797f22b7c91f9839421 e4120b331169668f85721755e0874d62 -
trunk/LayoutTests/platform/mac/editing/pasteboard/5027857-expected.txt
r43215 r43243 3 3 layer at (0,0) size 800x600 4 4 RenderBlock {HTML} at (0,0) size 800x600 5 RenderBody {BODY} at (8,8) size 784x57 65 RenderBody {BODY} at (8,8) size 784x579 6 6 RenderBlock {P} at (0,0) size 784x36 7 7 RenderText {#text} at (0,0) size 765x36 … … 10 10 text run at (0,18) width 134: "form of that markup. " 11 11 text run at (134,18) width 333: "You should see markup in the editable region below." 12 RenderBlock {PRE} at (0,52) size 784x1 812 RenderBlock {PRE} at (0,52) size 784x15 13 13 RenderBlock (anonymous) at (0,0) size 784x0 14 14 RenderInline {SPAN} at (0,0) size 0x0 15 RenderBlock (anonymous) at (0,0) size 784x1 816 RenderBlock {PRE} at (0,0) size 784x1 817 RenderText {#text} at (0,0) size 410x1818 text run at (0,0) width 410: "<input type='button'>foo<br>bar<b>baz</b>"19 RenderBlock (anonymous) at (0, 34) size 784x015 RenderBlock (anonymous) at (0,0) size 784x15 16 RenderBlock {PRE} at (0,0) size 784x15 17 RenderText {#text} at (0,0) size 328x15 18 text run at (0,0) width 328: "<input type='button'>foo<br>bar<b>baz</b>" 19 RenderBlock (anonymous) at (0,28) size 784x0 20 20 RenderInline {SPAN} at (0,0) size 0x0 21 21 caret: position 41 of child 0 {#text} of child 0 {PRE} of child 0 {SPAN} of child 2 {PRE} of child 1 {BODY} of child 0 {HTML} of document -
trunk/LayoutTests/platform/mac/editing/pasteboard/paste-pre-002-expected.checksum
r38122 r43243 1 64cf24533dc634bc90c5d5daac7f92fb 1 0c6f9d4d736653b2141ebd55f069296e -
trunk/LayoutTests/platform/mac/editing/pasteboard/paste-pre-002-expected.txt
r25970 r43243 13 13 layer at (0,0) size 800x600 14 14 RenderBlock {HTML} at (0,0) size 800x600 15 RenderBody {BODY} at (8,8) size 784x57 615 RenderBody {BODY} at (8,8) size 784x579 16 16 RenderBlock {DIV} at (0,0) size 784x36 17 17 RenderText {#text} at (0,0) size 147x18 … … 25 25 text run at (0,18) width 263: "is selected, copied, and pasted over itself. " 26 26 text run at (263,18) width 205: "You'll see foo/nbar if successful." 27 RenderBlock {DIV} at (0, 52) size 784x3628 RenderBlock {DIV} at (0,0) size 784x3 629 RenderBlock {PRE} at (0,0) size 784x3 627 RenderBlock {DIV} at (0,49) size 784x30 28 RenderBlock {DIV} at (0,0) size 784x30 29 RenderBlock {PRE} at (0,0) size 784x30 30 30 RenderBlock (anonymous) at (0,0) size 784x0 31 31 RenderInline {SPAN} at (0,0) size 0x0 32 RenderBlock (anonymous) at (0,0) size 784x3 633 RenderBlock {PRE} at (0,0) size 784x3 634 RenderText {#text} at (0,0) size 30x3635 text run at (0,0) width 30: "foo"36 text run at ( 30,0) width 0: " "37 text run at (0,1 8) width 30: "bar"38 RenderBlock (anonymous) at (0, 52) size 784x032 RenderBlock (anonymous) at (0,0) size 784x30 33 RenderBlock {PRE} at (0,0) size 784x30 34 RenderText {#text} at (0,0) size 24x30 35 text run at (0,0) width 24: "foo" 36 text run at (24,0) width 0: " " 37 text run at (0,15) width 24: "bar" 38 RenderBlock (anonymous) at (0,43) size 784x0 39 39 RenderInline {SPAN} at (0,0) size 0x0 40 40 caret: position 7 of child 0 {#text} of child 0 {PRE} of child 0 {SPAN} of child 1 {PRE} of child 1 {DIV} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document -
trunk/LayoutTests/platform/mac/editing/style/block-style-004-expected.txt
r25970 r43243 54 54 RenderBR {BR} at (0,0) size 0x55 55 55 RenderBlock {DIV} at (0,110) size 784x55 56 RenderInline {FONT} at (0,0) size 0x55 57 RenderInline {SPAN} at (0,0) size 0x55 58 RenderBR {BR} at (0,0) size 0x55 56 RenderInline {SPAN} at (0,0) size 0x55 57 RenderBR {BR} at (0,0) size 0x55 59 58 RenderBlock {DIV} at (0,165) size 784x55 60 59 RenderInline {SPAN} at (0,0) size 24x55 61 60 RenderText {#text} at (0,0) size 24x55 62 61 text run at (0,0) width 24: "x" 63 caret: position 0 of child 0 {BR} of child 0 {SPAN} of child 0 {FONT} of child3 {DIV} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document62 caret: position 0 of child 0 {BR} of child 0 {SPAN} of child 3 {DIV} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document -
trunk/LayoutTests/platform/mac/editing/style/block-style-005-expected.txt
r25970 r43243 57 57 RenderBR {BR} at (0,0) size 0x55 58 58 RenderBlock {DIV} at (0,110) size 784x55 59 RenderInline {FONT} at (0,0) size 0x55 60 RenderInline {SPAN} at (0,0) size 0x55 61 RenderBR {BR} at (0,0) size 0x55 62 caret: position 0 of child 0 {BR} of child 0 {SPAN} of child 0 {FONT} of child 3 {DIV} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document 59 RenderInline {SPAN} at (0,0) size 0x55 60 RenderBR {BR} at (0,0) size 0x55 61 caret: position 0 of child 0 {BR} of child 0 {SPAN} of child 3 {DIV} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document -
trunk/LayoutTests/platform/mac/editing/style/block-style-006-expected.txt
r41465 r43243 55 55 RenderBR {BR} at (0,0) size 0x55 56 56 RenderBlock {DIV} at (0,110) size 784x55 57 RenderInline {FONT} at (0,0) size 0x55 58 RenderInline {SPAN} at (0,0) size 0x55 59 RenderBR {BR} at (0,0) size 0x55 57 RenderInline {SPAN} at (0,0) size 0x55 58 RenderBR {BR} at (0,0) size 0x55 60 59 RenderBlock {DIV} at (0,165) size 784x55 61 60 RenderInline {SPAN} at (0,0) size 24x55 -
trunk/WebCore/ChangeLog
r43242 r43243 1 2009-05-05 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Darin Adler. 4 5 - fix <rdar://problem/5760774> Replying to a Mail message that contains 6 fixed width text can change the size of the text 7 8 Covered by existing tests: editing/pasteboard/5027857.html 9 editing/pasteboard/paste-pre-002.html 10 11 * css/CSSComputedStyleDeclaration.cpp: 12 (WebCore::CSSComputedStyleDeclaration::getFontSizeCSSValuePreferringKeyword): 13 Added. If the font-size is keyword-based, returns the keyword value 14 instead of the pixel size. 15 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): If 16 font-family is a generic family, return the generic family instead of 17 the the internal string -webkit-[serif|sans-serif|cursive|fantasy 18 |monospace]. 19 (WebCore::CSSComputedStyleDeclaration::copyInheritableProperties): 20 For the font-size property, prefer a keyword value over a pixel size. 21 * css/CSSComputedStyleDeclaration.h: 22 * editing/ApplyStyleCommand.cpp: 23 (WebCore::StyleChange::currentlyHasStyle): For the font-size property, 24 call getFontSizeCSSValuePreferringKeyword(). 25 * platform/graphics/FontDescription.h: 26 (WebCore::FontDescription::keywordSize): Changed the return type to 27 unsigned. 28 (WebCore::FontDescription::setKeywordSize): Changed the parameter type 29 to unsigned. 30 (WebCore::FontDescription::m_keywordSize): Changed the type of this 31 4-bit field to unsigned, because it takes values as high as 8. 32 1 33 2009-05-05 Oliver Hunt <oliver@apple.com> 2 34 -
trunk/WebCore/css/CSSComputedStyleDeclaration.cpp
r42116 r43243 539 539 } 540 540 541 static int cssIdentifierForFontSizeKeyword(int keywordSize) 542 { 543 ASSERT_ARG(keywordSize, keywordSize); 544 ASSERT_ARG(keywordSize, keywordSize <= 8); 545 return CSSValueXxSmall + keywordSize - 1; 546 } 547 548 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getFontSizeCSSValuePreferringKeyword() const 549 { 550 Node* node = m_node.get(); 551 if (!node) 552 return 0; 553 554 node->document()->updateLayoutIgnorePendingStylesheets(); 555 556 RefPtr<RenderStyle> style = node->computedStyle(); 557 if (!style) 558 return 0; 559 560 if (int keywordSize = style->fontDescription().keywordSize()) 561 return CSSPrimitiveValue::createIdentifier(cssIdentifierForFontSizeKeyword(keywordSize)); 562 563 return CSSPrimitiveValue::create(style->fontDescription().computedPixelSize(), CSSPrimitiveValue::CSS_PX); 564 } 565 541 566 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int propertyID) const 542 567 { 543 568 return getPropertyCSSValue(propertyID, UpdateLayout); 569 } 570 571 static int toCSSIdentifier(FontDescription::GenericFamilyType genericFamily) 572 { 573 switch (genericFamily) { 574 case FontDescription::SerifFamily: 575 return CSSValueSerif; 576 break; 577 case FontDescription::SansSerifFamily: 578 return CSSValueSansSerif; 579 break; 580 case FontDescription::MonospaceFamily: 581 return CSSValueMonospace; 582 break; 583 case FontDescription::CursiveFamily: 584 return CSSValueCursive; 585 break; 586 case FontDescription::FantasyFamily: 587 return CSSValueFantasy; 588 break; 589 case FontDescription::StandardFamily: 590 case FontDescription::NoFamily: 591 default: 592 return 0; 593 break; 594 } 544 595 } 545 596 … … 724 775 case CSSPropertyFloat: 725 776 return CSSPrimitiveValue::create(style->floating()); 726 case CSSPropertyFontFamily: 777 case CSSPropertyFontFamily: { 727 778 // FIXME: This only returns the first family. 779 if (int id = toCSSIdentifier(style->fontDescription().genericFamily())) 780 return CSSPrimitiveValue::createIdentifier(id); 781 728 782 return CSSPrimitiveValue::create(style->fontDescription().family().family().string(), CSSPrimitiveValue::CSS_STRING); 783 } 729 784 case CSSPropertyFontSize: 730 785 return CSSPrimitiveValue::create(style->fontDescription().computedPixelSize(), CSSPrimitiveValue::CSS_PX); … … 1433 1488 style->removeProperty(CSSPropertyWebkitTextStrokeColor, ec); 1434 1489 ASSERT(ec == 0); 1490 if (int keywordSize = m_node->computedStyle()->fontDescription().keywordSize()) 1491 style->setProperty(CSSPropertyFontSize, cssIdentifierForFontSizeKeyword(keywordSize)); 1435 1492 } 1436 1493 return style.release(); -
trunk/WebCore/css/CSSComputedStyleDeclaration.h
r39601 r43243 51 51 52 52 PassRefPtr<CSSValue> getPropertyCSSValue(int propertyID, EUpdateLayout) const; 53 PassRefPtr<CSSValue> getFontSizeCSSValuePreferringKeyword() const; 53 54 #if ENABLE(SVG) 54 55 PassRefPtr<CSSValue> getSVGPropertyCSSValue(int propertyID, EUpdateLayout) const; -
trunk/WebCore/editing/ApplyStyleCommand.cpp
r43187 r43243 230 230 ASSERT(pos.isNotNull()); 231 231 RefPtr<CSSComputedStyleDeclaration> style = pos.computedStyle(); 232 RefPtr<CSSValue> value = style->getPropertyCSSValue(property->id(), DoNotUpdateLayout); 232 RefPtr<CSSValue> value; 233 if (property->id() == CSSPropertyFontSize) 234 value = style->getFontSizeCSSValuePreferringKeyword(); 235 else 236 value = style->getPropertyCSSValue(property->id(), DoNotUpdateLayout); 233 237 if (!value) 234 238 return false; -
trunk/WebCore/platform/graphics/FontDescription.h
r34794 r43243 82 82 bool usePrinterFont() const { return m_usePrinterFont; } 83 83 FontRenderingMode renderingMode() const { return static_cast<FontRenderingMode>(m_renderingMode); } 84 intkeywordSize() const { return m_keywordSize; }84 unsigned keywordSize() const { return m_keywordSize; } 85 85 86 86 FontTraitsMask traitsMask() const; … … 96 96 void setUsePrinterFont(bool p) { m_usePrinterFont = p; } 97 97 void setRenderingMode(FontRenderingMode mode) { m_renderingMode = mode; } 98 void setKeywordSize( ints) { m_keywordSize = s; }98 void setKeywordSize(unsigned s) { m_keywordSize = s; } 99 99 100 100 private: … … 115 115 unsigned m_renderingMode : 1; // Used to switch between CG and GDI text on Windows. 116 116 117 intm_keywordSize : 4; // We cache whether or not a font is currently represented by a CSS keyword (e.g., medium). If so,117 unsigned m_keywordSize : 4; // We cache whether or not a font is currently represented by a CSS keyword (e.g., medium). If so, 118 118 // then we can accurately translate across different generic families to adjust for different preference settings 119 119 // (e.g., 13px monospace vs. 16px everything else). Sizes are 1-8 (like the HTML size values for <font>).
Note: See TracChangeset
for help on using the changeset viewer.