[webkit-changes] cvs commit: WebCore/layout-tests/editing/pasteboard paste-text-019-expected.txt paste-text-019.html

Darin darin at opensource.apple.com
Sun Aug 14 22:01:54 PDT 2005


darin       05/08/14 22:01:53

  Modified:    .        ChangeLog
               khtml/editing visible_text.cpp
  Added:       layout-tests/editing/pasteboard paste-text-019-expected.txt
                        paste-text-019.html
  Log:
          Reviewed and landed by Darin.
  
          - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3429
            Text transformed with text-transform does not copy with transform applied
  
          Test cases added:
          * layout-tests/editing/pasteboard/paste-text-019-expected.txt: Added.
          * layout-tests/editing/pasteboard/paste-text-019.html: Added.
  
          * khtml/editing/visible_text.cpp:
          (khtml::TextIterator::handleTextNode): Use the DOMString from the RenderText, not the DOM text node.
          (khtml::TextIterator::handleTextBox): Ditto.
  
  Revision  Changes    Path
  1.4577    +15 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.4576
  retrieving revision 1.4577
  diff -u -r1.4576 -r1.4577
  --- ChangeLog	15 Aug 2005 04:58:39 -0000	1.4576
  +++ ChangeLog	15 Aug 2005 05:01:43 -0000	1.4577
  @@ -1,3 +1,18 @@
  +2005-08-14  Andrew Wellington  <proton at wiretapped.net>
  +
  +        Reviewed and landed by Darin.
  +
  +        - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3429
  +          Text transformed with text-transform does not copy with transform applied
  +
  +        Test cases added:
  +        * layout-tests/editing/pasteboard/paste-text-019-expected.txt: Added.
  +        * layout-tests/editing/pasteboard/paste-text-019.html: Added.
  +
  +        * khtml/editing/visible_text.cpp:
  +        (khtml::TextIterator::handleTextNode): Use the DOMString from the RenderText, not the DOM text node.
  +        (khtml::TextIterator::handleTextBox): Ditto.
  +
   2005-08-14  Darin Adler  <darin at apple.com>
   
           - fixed build of some unit tests
  
  
  
  1.33      +2 -2      WebCore/khtml/editing/visible_text.cpp
  
  Index: visible_text.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/visible_text.cpp,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- visible_text.cpp	10 Aug 2005 01:13:54 -0000	1.32
  +++ visible_text.cpp	15 Aug 2005 05:01:53 -0000	1.33
  @@ -216,7 +216,7 @@
       m_lastTextNode = m_node;
   
       RenderText *renderer = static_cast<RenderText *>(m_node->renderer());
  -    DOMString str = m_node->nodeValue();
  +    DOMString str = renderer->string();
   
       // handle pre-formatted text
       if (renderer->style()->whiteSpace() == khtml::PRE) {
  @@ -266,7 +266,7 @@
   void TextIterator::handleTextBox()
   {    
       RenderText *renderer = static_cast<RenderText *>(m_node->renderer());
  -    DOMString str = m_node->nodeValue();
  +    DOMString str = renderer->string();
       long start = m_offset;
       long end = (m_node == m_endContainer) ? m_endOffset : LONG_MAX;
       while (m_textBox) {
  
  
  
  1.1                  WebCore/layout-tests/editing/pasteboard/paste-text-019-expected.txt
  
  Index: paste-text-019-expected.txt
  ===================================================================
  EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
  EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
  EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
  EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
  EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
  EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
  EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
  EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
  EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
  EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
  EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
  EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
  EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
  EDITING DELEGATE: shouldInsertText:Bar replacingDOMRange:range from 4 of #text > SPAN > DIV > BODY > HTML > #document to 4 of #text > SPAN > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
  EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
  EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 3 of #text > SPAN > DIV > BODY > HTML > #document to 3 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
  EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
  EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
  layer at (0,0) size 800x600
    RenderCanvas at (0,0) size 800x600
  layer at (0,0) size 800x600
    RenderBlock {HTML} at (0,0) size 800x600
      RenderBody {BODY} at (8,8) size 784x584
        RenderBlock {DIV} at (0,0) size 784x288 [border: (2px solid #0000FF)]
          RenderBlock {DIV} at (14,14) size 756x84
            RenderText {TEXT} at (0,0) size 67x28
              text run at (0,0) width 67: "Tests: "
            RenderBR {BR} at (0,0) size 0x0
            RenderText {TEXT} at (0,28) size 162x28
              text run at (0,28) width 162: "Fix for this bug: "
            RenderInline {A} at (0,0) size 557x28 [color=#0000EE]
              RenderText {TEXT} at (162,28) size 557x28
                text run at (162,28) width 557: "<http://bugzilla.opendarwin.org/show_bug.cgi?id=3429>"
            RenderText {TEXT} at (0,56) size 729x28
              text run at (0,56) width 729: "Text transformed with text-transform does not copy with transform applied"
          RenderBlock {DIV} at (14,114) size 756x160
            RenderBlock (anonymous) at (0,0) size 756x56
              RenderText {TEXT} at (0,0) size 189x28
                text run at (0,0) width 189: "Expected Results: "
              RenderBR {BR} at (0,0) size 0x0
              RenderText {TEXT} at (0,28) size 202x28
                text run at (0,28) width 202: "Should see the string"
            RenderBlock {PRE} at (0,80) size 756x28
              RenderText {TEXT} at (0,0) size 210x28
                text run at (0,0) width 210: "Foo Bar baz Bar"
            RenderBlock (anonymous) at (0,132) size 756x28
              RenderText {TEXT} at (0,0) size 155x28
                text run at (0,0) width 155: "(case sensitive)."
        RenderBlock {DIV} at (0,312) size 784x32 [border: (2px solid #FF0000)]
          RenderInline {SPAN} at (0,0) size 153x28
            RenderInline {SPAN} at (0,0) size 78x28
              RenderText {TEXT} at (2,2) size 78x28
                text run at (2,2) width 78: "Foo Bar"
            RenderText {TEXT} at (80,2) size 40x28
              text run at (80,2) width 40: " baz"
            RenderText {TEXT} at (120,2) size 35x28
              text run at (120,2) width 35: "Bar"
          RenderText {TEXT} at (0,0) size 0x0
  caret: position 3 of child 2 {TEXT} of child 1 {SPAN} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
  
  
  
  1.1                  WebCore/layout-tests/editing/pasteboard/paste-text-019.html
  
  Index: paste-text-019.html
  ===================================================================
  <html> 
  <head>
  
  <style>
  .editing { 
      border: 2px solid red; 
      font-size: 24px; 
  }
  .explanation { 
      border: 2px solid blue; 
      padding: 12px; 
      font-size: 24px; 
      margin-bottom: 24px;
  }
  .scenario { margin-bottom: 16px;}
  .scenario:first-line { font-weight: bold; margin-bottom: 16px;}
  .expected-results:first-line { font-weight: bold }
  </style>
  <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
  
  <script>
  
  function editingTest() {
      for (i = 0; i < 4; i++)
          moveSelectionForwardByCharacterCommand();
      for (i = 0; i < 3; i++)
          extendSelectionForwardByCharacterCommand();
      copyCommand();
      for (i = 0; i < 4; i++)
          moveSelectionForwardByCharacterCommand();
      moveSelectionForwardByCharacterCommand();
      pasteAndMatchStyleCommand();
  }
  
  </script>
  
  <title>Editing Test</title> 
  </head> 
  <body>
  <div class="explanation">
  <div class="scenario">
  Tests: 
  <br>
  Fix for this bug: 
  <a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=3429">&lt;http://bugzilla.opendarwin.org/show_bug.cgi?id=3429&gt;</a> Text transformed with text-transform does not copy with transform applied
  </div>
  <div class="expected-results">
  Expected Results:
  <br>
  Should see the string <pre>Foo Bar baz Bar</pre> (case sensitive).
  </div>
  </div>
  <div contenteditable id="root" class="editing">
  <span id="test"><span style="text-transform: capitalize;">foo bar</span> baz</span>
  </div>
  
  <script>
  runEditingTest();
  </script>
  
  </body>
  </html>
  
  
  



More information about the webkit-changes mailing list