Skip to content

Add comprehensive text-align test cases to fixtures/html#313

Merged
yorkie merged 2 commits intomainfrom
copilot/fix-ed2e3040-e933-47a4-890f-dd198d92234f
Sep 16, 2025
Merged

Add comprehensive text-align test cases to fixtures/html#313
yorkie merged 2 commits intomainfrom
copilot/fix-ed2e3040-e933-47a4-890f-dd198d92234f

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Sep 16, 2025

Enhanced the existing text-rendering-test.html file to include all text-align values supported by JSAR Runtime's CSS implementation.

Background

The existing text alignment tests only covered the basic CSS text-align values (left, center, right, justify), but JSAR Runtime's CSS parser in src/client/cssom/values/specified/text.hpp supports additional values that were missing from the test suite.

Changes

Added three missing text-align test cases:

  • text-align: start - Aligns text to the start edge (writing direction dependent)
  • text-align: end - Aligns text to the end edge (writing direction dependent)
  • text-align: match-parent - Inherits parent's text alignment behavior

Each test case includes:

  • Appropriate CSS class definitions following existing patterns
  • Bilingual test content (Chinese and English) for comprehensive validation
  • Consistent styling and layout with existing tests

Implementation Details

The changes maintain the existing file structure and follow established patterns:

.align-start { text-align: start; }
.align-end { text-align: end; }
.align-match-parent { text-align: match-parent; }
<div class="test-item">
  <div class="test-label">text-align: start</div>
  <p class="align-start">这是起始对齐的文本。This is start-aligned text...</p>
</div>

Visual Result

Text Alignment Tests

The screenshot shows all seven text-align values now working correctly in the test suite, providing comprehensive coverage for text alignment functionality in JSAR Runtime.

Testing

Verified that all test cases render correctly and demonstrate the expected text alignment behaviors. The enhanced test file maintains backward compatibility while expanding test coverage for the complete set of supported text-align values.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • registry.npmmirror.com
    • Triggering command: npm ci (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: yorkie <1935767+yorkie@users.noreply.github.com>
Copilot AI changed the title [WIP] 在 fixtures/html 下,添加 text-align 的测试用例(请先看下 fixtures/html 是否有合适的已经存在文件适合存放该用例,如果没有的话,再新建一个 .html) Add comprehensive text-align test cases to fixtures/html Sep 16, 2025
Copilot AI requested a review from yorkie September 16, 2025 11:23
@yorkie yorkie marked this pull request as ready for review September 16, 2025 18:13
@yorkie yorkie merged commit af07862 into main Sep 16, 2025
4 checks passed
@yorkie yorkie deleted the copilot/fix-ed2e3040-e933-47a4-890f-dd198d92234f branch September 16, 2025 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants