Skip to content

Conversation

@hlecorche
Copy link
Contributor

Textarea widget included the "pattern" attribute but is not valid by W3C standards.

(See PR 2666 - New PR because rebase inside the 2.0 branch)

@fabpot
Copy link
Member

fabpot commented Nov 18, 2011

@hlecorche: Thanks for your work on this issue. Can you update the unit tests to be sure that this case is covered? If you're not comfortable with this, just tell me and I will do it myself

@hlecorche
Copy link
Contributor Author

@fabpot: I did'nt commited because I am not sure. I changed the "tests/Symfony/Tests/Component/Form/AbstractLayoutTest.php" file :

public function testTextarea()
{
    $form = $this->factory->createNamed('textarea', 'na&me', 'foo&bar', array(
        'property_path' => 'name',
        'pattern' => 'foo',
    ));

    $this->assertWidgetMatchesXpath($form->createView(), array(),
'/textarea
[@name="na&me"]
[not(@pattern)]
[.="foo&bar"]
'
    );
}

Is it correct?

fabpot added a commit that referenced this pull request Nov 22, 2011
Commits
-------

78e9b2f [Form] Fixed textarea_widget (W3C standards)

Discussion
----------

[Form] Fixed textarea_widget (W3C standards)

Textarea widget included the "pattern" attribute but is not valid by W3C standards.

(See PR 2666 - New PR because rebase inside the 2.0 branch)

---------------------------------------------------------------------------

by fabpot at 2011/11/18 09:01:41 -0800

@hlecorche: Thanks for your work on this issue. Can you update the unit tests to be sure that this case is covered? If you're not comfortable with this, just tell me and I will do it myself

---------------------------------------------------------------------------

by hlecorche at 2011/11/19 02:51:06 -0800

@fabpot: I did'nt commited because I am not sure. I changed the "tests/Symfony/Tests/Component/Form/AbstractLayoutTest.php" file :

    public function testTextarea()
    {
        $form = $this->factory->createNamed('textarea', 'na&me', 'foo&bar', array(
            'property_path' => 'name',
            'pattern' => 'foo',
        ));

        $this->assertWidgetMatchesXpath($form->createView(), array(),
    '/textarea
    [@name="na&me"]
    [not(@pattern)]
    [.="foo&bar"]
    '
        );
    }

Is it correct?
@fabpot fabpot merged commit 78e9b2f into symfony:2.0 Nov 22, 2011
@fabpot
Copy link
Member

fabpot commented Nov 22, 2011

@hlecorche: perfect. I've added the test here: 38f64a1

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