Review main Merged

40139[FEATURE] Fluid Tag Builder: Allow empty attributes

Sebastian Michaelsen CR +2 V +2 Normal +62 −2 updated 07/22/15, 18:39

Commit message

When using the Fluid Tag Builder to create tags an attribute can only be
set as a key/value pair. It should be possible render attributes with
the "empty attributes syntax".

http://www.w3.org/TR/html-markup/syntax.html#syntax-attributes

Review

  • Code review CR +2
    • Anja Leichsenring +2
    • Markus Klein +1
  • Verified V +2
    • Anja Leichsenring +2
    • Markus Klein +1

Issues 1

Files 5

Review log 28

Show 3 earlier messages
  1. Sebastian Michaelsen uploaded patch set 1 06/09/15, 20:48

  2. Morton Jonuschat commented on patch set 1 06/09/15, 21:04

    This produces invalid markup when XHTML doctypes are being used, full attribute form is required in that case.
  3. Markus Klein commented on patch set 1 06/09/15, 22:02

    Those half-baked HTML5 pseudo attributes are one of the worst things they ever introduced and those optional end-tags being the worst. HTML is for machines and not for humans => stick to good old XHTML standards just my 2 cents
  1. Sebastian Michaelsen uploaded patch set 2 06/10/15, 06:25

  2. Sebastian Michaelsen commented on patch set 2 06/10/15, 06:30

    @Morton: Thanks, I updated the code accordingly @Markus: I see, but if you dislike HTML5 you are still free to choose XHMTL. Besides I think HTML is not just for machines but for developers (crafting and debugging it) as well.
  3. Sebastian Michaelsen commented on patch set 2 06/10/15, 06:39

    Additional explanation to this patch: It not only enables the empty attribute syntax but also you to put arbitrary content inside your tag, which can be desirable. E.g. I'm using Fluid to output a marker based template for EXT:formhandler, which expects certain markers inside tags. Without the change I can not achieve that.
  4. Morton Jonuschat commented on patch set 2 CR +1 V +1 06/10/15, 07:06

    verified by unit tests.
  5. Mathias Brodala commented on patch set 2 CR -1 06/10/15, 07:24

    I'd like to clarify first if NULL is a viable alternative.

    Feature-67372-AllowEmptyAttributeSyntaxInFluidTagBuilder.rst:24

    What if I want data-foo=""? I'd vote for making the value optional instead, thus $this->tag->addAttribute('disabled');

    TagBuilder.php:172

    How about defaulting to NULL instead to allow for skipping the value altogether?

    TagBuilder.php:173

    Skip this if $attributeValue is NULL.

    TagBuilder.php:229

    IMO this check is not necessary.
  6. Markus Sommer commented on patch set 2 CR -1 V -1 07/17/15, 09:06

    HTML5 allows both. Old an new Syntax. We realy need this Patch
  7. Patrick Kollodzik uploaded patch set 3 07/17/15, 19:54

  8. Patrick Kollodzik commented on patch set 3 CR +1 V +1 07/17/15, 20:00

    Tested it with an empty string and only with the attribute. The AbstractTagBasedViewhelper filters out every attribute without a value. We changed this behaviour and added a unit test for this case. If you wish to use attributes like disabled without ="" then there is further work needed, because the template compiling breaks.
  9. Xavier Perseguers voted on patch set 3 CR +1 V +1 07/17/15, 23:09

  10. Markus Klein commented on patch set 3 07/18/15, 08:28

    Feature-67372-AllowEmptyAttributeSyntaxInFluidTagBuilder.rst:17

    needs one more blank line before

    TagBuilderTest.php:119

    where do you define TSFE?
  11. Stefan Neufeind uploaded patch set 4 07/18/15, 08:52

  12. Stefan Neufeind commented on patch set 4 07/18/15, 08:53

    Took care of small comments from Markus. Please revote.
  13. Markus Klein uploaded patch set 5 07/18/15, 09:01

  14. Markus Klein commented on patch set 3 07/18/15, 09:01

    TagBuilderTest.php:119 Reply

    ok, dirty but works
  15. Markus Klein voted on patch set 5 CR +1 V +1 07/18/15, 09:02

  16. Anja Leichsenring voted on patch set 5 CR +2 V +2 07/18/15, 09:06

  17. Anja Leichsenring merged patch set 5 07/18/15, 09:06

  18. Helmut Hummel commented on patch set 6 07/22/15, 16:56

    post -1 with tendency to -2 This patch is broken on many levels
  19. Stefan Neufeind commented on patch set 6 07/22/15, 16:59

    Could you please be a bit more verbose? :-(
  20. Helmut Hummel commented on patch set 6 07/22/15, 17:01

    TagBuilder.php:229

    1. This introduces a hard dependency to a TYPO3 specific global object 2. TSFE->config->doctype is NULL when the default (html5) kicks in, so the check is broken here anyway

    TagBuilder.php:230

    3. This renders e.g. <img alt /> instead of <img alt="" /> Only "Certain attributes may be specified by providing just the attribute name, with no value." (http://www.w3.org/TR/html-markup/syntax.html#syntax-attributes)

    TagBuilderTest.php:127

    these should rather be two test methods
  21. Helmut Hummel commented on patch set 6 07/22/15, 17:03

    I'm not saying that this could be implemented cleanly (which it currently is unfortunately not). But what would we win, besides supporting a code style, while other code style still are valid HTML5
  22. Stefan Neufeind commented on patch set 6 07/22/15, 17:07

    Hmm, valid objections. In that light, I'd suggest to revert it for the moment until after a more lengthy discussion / better ideas to solve it.
  23. Marc Bastian Heinrichs commented on patch set 6 07/22/15, 18:11

    broken code-wise, testcode-wise and functional-wise, so -2 and -2 after merge. I'm also in favour of a revert, than doing a follow up.
  24. Helmut Hummel commented on patch set 6 07/22/15, 18:36

    Reverted This patchset was reverted in change: Idd0af9d3164adc91a7e8ad9e0c554467cce0d233
  25. Helmut Hummel commented on patch set 6 07/22/15, 18:39