| <!DOCTYPE html> |
| <html> |
| <head> |
| <script> |
| function performTest() |
| { |
| // Have to set the selection manually here, since putting in [ and ] is invalid HTML and |
| // WebKit's parser will move the selection to before the table if we do that |
| var table = document.getElementsByTagName("TABLE")[0]; |
| var tds = document.getElementsByTagName("TD"); |
| var td1Offset = DOM_nodeOffset(tds[1]); |
| var td2Offset = DOM_nodeOffset(tds[2]); |
| |
| Selection_set(tds[1].parentNode,td1Offset,tds[2].parentNode,td2Offset+1); |
| |
| Formatting_applyFormattingChanges(".test",null); |
| } |
| </script> |
| </head> |
| <body> |
| <p>Paragraph one</p> |
| <p>Paragraph two</p> |
| <table border="1"> |
| <tr> |
| <td>One</td> |
| <td>Two</td> |
| </tr> |
| <tr> |
| <td>Three</td> |
| <td>Four</td> |
| </tr> |
| </table> |
| <p>Paragraph three</p> |
| <p>Paragraph four</p> |
| </body> |
| </html> |